seq_scan_sim
efficiently performs scan.test
on a
simulated data set. The function is meant to be used internally by the
optimal_ubpop
function in the smerc package.
seq_scan_sim(
nsim = 1,
nn,
ty,
ex,
type = "poisson",
ein = NULL,
eout = NULL,
tpop = NULL,
popin = NULL,
popout = NULL,
cl = NULL,
simdist = "multinomial",
pop = NULL,
min.cases = 0,
ldup = NULL,
lseq_zones
)
A list with the maximum statistic for each population upperbound for
each simulated data set. Each element will have a vector of maximums for
each simulated data set corresponding to the sequence of ubpop values. The
list will have nsim
elements.
A positive integer indicating the number of simulations to perform.
A list of nearest neighbors produced by nnpop
.
The total number of cases in the study area.
The expected number of cases for each region. The default is calculated under the constant risk hypothesis.
The type of scan statistic to compute. The
default is "poisson"
. The other choice
is "binomial"
.
The expected number of cases in the zone. Conventionally, this is the estimated overall disease risk across the study area, multiplied by the total population size of the zone.
The expected number of cases outside the
zone. This should be ty - ein
and is computed
automatically if not provided.
The total population in the study area.
The total population in the zone.
The population outside the zone. This
should be tpop - popin
and is computed
automatically if not provided.
A cluster object created by makeCluster
,
or an integer to indicate number of child-processes
(integer values are ignored on Windows) for parallel evaluations
(see Details on performance).
It can also be "future"
to use a future backend (see Details),
NULL
(default) refers to sequential evaluation.
Character string indicating the simulation
distribution. The default is "multinomial"
, which
conditions on the total number of cases observed. The
other options are "poisson"
and "binomial"
The population size associated with each region.
The minimum number of cases required for a cluster. The default is 2.
A logical vector indicating positions of duplicated zones. Not intended for user use.
A list of logical vectors specifying the sequence of relevant zones based on ubpop constraints