View source: R/stat.poisson.adj.R
stat.poisson.adj | R Documentation |
Efficiently compute a vector of Poisson test statistics.
This function does no sanity checking. We encourage you
to compare the results against
scan.stat
for correctness.
stat_poisson_adj
is a C++ version implementation
of the code and should be faster.
stat_binomial_adj
is a C++ version implementation
of stat.binom
.
stat.poisson.adj(
yin,
ty,
logein,
logeout,
a = 0,
pen = 1,
min.cases = 2,
return.max = FALSE
)
stat_poisson_adj(
yin,
ty,
logein,
logeout,
a = 0,
pen = 1,
min.cases = 2,
return.max = FALSE
)
stat_binom_adj(
yin,
ty,
popin,
popout,
logpopin,
logpopout,
tpop,
min.cases = 2,
return.max = FALSE
)
yin |
The total number of cases in the zone. |
ty |
The total number of cases in the study area. |
logein |
The |
logeout |
The |
a |
A tuning parameter for the adjusted log-likelihood ratio. See details. |
pen |
The eccentricity penalty for each candidate zone. |
min.cases |
The minimum number of cases required for a cluster. The default is 2. |
return.max |
A logical value. Default is |
popin |
The total population in the zone. |
popout |
The population outside the zone. This
should be |
logpopin |
The |
logpopout |
The |
tpop |
The total population in the study area. |
A numeric vector.
data(nydf)
coords <- with(nydf, cbind(longitude, latitude))
enn <- elliptic.nn(coords, nydf$pop, ubpop = 0.015)
cases <- floor(nydf$cases)
ty <- sum(cases)
ex <- ty / sum(nydf$pop) * nydf$pop
yin <- nn.cumsum(enn$nn, cases)
ein <- nn.cumsum(enn$nn, ex)
logein <- log(ein)
logeout <- log(ty - ein)
pen <- elliptic.penalty(a = 0.5, enn$shape_all)
stat.poisson.adj(yin, ty, logein, logeout,
a = 0.5, pen = pen, return.max = TRUE
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.