spscan.test performs the spatial scan test of
Kulldorf (1997) for case/control point data.
spscan.test(x, case = 2, nsim = 499, alpha = 0.1, maxd = NULL,
cl = NULL, longlat = FALSE)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.
x$marks is assumed to be a factor. Automatic
conversion is attempted if it is not.
The number of simulations from which to compute the p-value. A non-negative integer. Default is 499.
The significance level to determine whether a cluster is signficiant. Default is 0.1.
The radius of the largest possible cluster to
consider. Default is NULL, i.e., no limit.
A cluster object created by makeCluster,
or an integer to indicate number of child-processes
(integer values are ignored on Windows) for parallel evaluations.
A logical value indicating whether
Euclidean distance (FALSE) or Great Circle
(WGS84 ellipsoid, FALSE) should be used.
Default is FALSE, i.e., Euclidean distance.
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).
Setting cl to a positive integer MAY speed up
computations on non-Windows computers. However,
parallelization does have overhead cost, and there are
cases where parallelization results in slower
computations.
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)
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