Learn R Programming

scanstatistics (version 1.1.1)

scan_pb_perm_cpp: Calculate the space-time permutation scan statistic.

Description

Calculate the space-time permutation scan statistic (Kulldorff 2005) and Monte Carloo replicates.

Usage

scan_pb_perm_cpp(
  counts,
  baselines,
  zones,
  zone_lengths,
  store_everything,
  num_mcsim
)

Value

A list with elements observed and simulated, each being a data frame with columns:

zone

The top-scoring zone (spatial component of MLC).

duration

The corresponding duration (time-length of MLC).

score

The value of the loglihood ratio statistic (the scan statistic).

relrisk_in

The estimated relative risk inside.

relrisk_in

The estimated relative risk outside.

Arguments

counts

An integer matrix (most recent timepoint in first row).

baselines

A matrix with positive entries (most recent timepoint in first row).

zones

An integer vector (all zones concatenated; locations indexed from 0 and up)

zone_lengths

An integer vector.

store_everything

A boolean.

num_mcsim

An integer.