fast.test
performs the fast subset scan test of
Neill (2012).
fast.test(
coords,
cases,
pop,
ex = sum(cases)/sum(pop) * pop,
nsim = 499,
alpha = 0.1,
ubpop = 0.5,
longlat = FALSE,
cl = NULL,
type = "poisson"
)
Returns a list of length two of class scan. The first element (clusters) is a list containing the significant, non-ovlappering clusters, and has the the following components:
The location ids of regions in a significant cluster.
The total population in the cluser window.
The observed number of cases in the cluster window.
The expected number of cases in the cluster window.
Standarized mortaility ratio (observed/expected) in the cluster window.
Relative risk in the cluster window.
The loglikelihood ratio for the cluster window (i.e., the log of the test statistic).
The pvalue of the test statistic associated with the cluster window.
The second element of the list is the centroid coordinates. This is needed for plotting purposes.
An \(n \times 2\) matrix of centroid coordinates for the regions in the form (x, y) or (longitude, latitude) is using great circle distance.
The number of cases observed in each region.
The population size associated with each region.
The expected number of cases for each region. The default is calculated under the constant risk hypothesis.
The number of simulations from which to compute the p-value.
The significance level to determine whether a cluster is signficant. Default is 0.10.
The upperbound of the proportion of the total population to consider for a cluster.
The default is FALSE
, which
specifies that Euclidean distance should be used. If
longlat
is TRUE
, then the great circle
distance is used to calculate the intercentroid
distance.
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.
The type of scan statistic to compute. The
default is "poisson"
. The other choice
is "binomial"
.
Joshua French
The test is performed using the spatial scan test based on the Poisson test statistic and a fixed number of cases. The windows are based on the Upper Level Sets proposed by Patil and Taillie (2004). The clusters returned are non-overlapping, ordered from most significant to least significant. The first cluster is the most likely to be a cluster. If no significant clusters are found, then the most likely cluster is returned (along with a warning).
Neill, D. B. (2012), Fast subset scan for spatial pattern detection. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 74: 337-360. <doi:10.1111/j.1467-9868.2011.01014.x>
print.smerc_cluster
,
summary.smerc_cluster
,
plot.smerc_cluster
,
scan.stat
, scan.test
data(nydf)
coords <- with(nydf, cbind(longitude, latitude))
out <- fast.test(
coords = coords, cases = floor(nydf$cases),
pop = nydf$pop,
alpha = 0.05, longlat = TRUE,
nsim = 49, ubpop = 0.5
)
Run the code above in your browser using DataLab