spscan.test performs the spatial scan test of Kulldorf (1997).
spscan.test(x, case = 2, nsim = 499, alpha = 0.1, nreport = nsim + 1,
maxd = NULL, parallel = TRUE)A ppp object from the spatstat package with marks for the case and control groups.
The position of the name of the "case" group in levels(x$marks). The default is 2.
The number of simulations from which to compute p-value.
The significance level to determine whether a cluster is signficiant.
The frequency with which to report simulation progress. The default is nsim+ 1, meaning no progress will be displayed.
The radius of the largest possible cluster to consider.
A logical indicating whether the test should be parallelized using the parallel:mclapply function. Default is TRUE.
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 centroid of the significant clusters.
The radius of the window of the clusters.
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.
Proportion of cases 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 test is performed using the random labeling hypothesis. The windows are circular and extend from the observed data locations. 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).
Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley. Kulldorff M., Nagarwalla N. (1995) Spatial disease clusters: Detection and Inference. Statistics in Medicine 14, 799-810. Kulldorff, M. (1997) A spatial scan statistic. Communications in Statistics -- Theory and Methods 26, 1481-1496.
# NOT RUN {
data(grave)
out = spscan.test(grave, parallel = FALSE)
plot(out, chars = c(1, 20), main = "most likely cluster")
# get warning if no significant cluster
out2 = spscan.test(grave, alpha = 0.01)
# }
Run the code above in your browser using DataLab