precog.test | R Documentation |
precog.test
is an implementation of the
Prefiltered Component-based Greedy Scan Method.
precog.test(
coords,
cases,
pop,
w,
ex = sum(cases)/sum(pop) * pop,
nsim = 499,
tol_prob = 0.9,
alpha = 0.1,
ubpop = 0.5,
longlat = FALSE,
cl = NULL,
ysim = NULL
)
coords |
An |
cases |
The number of cases observed in each region. |
pop |
The population size associated with each region. |
w |
A binary spatial adjacency matrix for the regions. |
ex |
The expected number of cases for each region. The default is calculated under the constant risk hypothesis. |
nsim |
The number of simulations from which to compute the p-value. |
tol_prob |
A single numeric value between 0 and 1 that describes the quantile of the tolerance envelopes used to prefilter regions from the candidate zones. |
alpha |
The significance level to determine whether a cluster is signficant. Default is 0.10. |
ubpop |
The upperbound of the proportion of the total population to consider for a cluster. |
longlat |
The default is |
cl |
A cluster object created by |
ysim |
A matrix of size |
Returns a smerc_cluster
object.
Joshua French and Mohammad Meysami
print.smerc_cluster
,
summary.smerc_cluster
,
plot.smerc_cluster
,
data(nydf)
data(nyw)
out <- precog.test(coords = nydf[,c("x", "y")],
cases = floor(nydf$cases),
pop = nydf$pop, w = nyw, nsim = 19,
alpha = 0.2)
# better plotting
if (require("sf", quietly = TRUE)) {
data(nysf)
plot(st_geometry(nysf), col = color.clusters(out))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.