Learn R Programming

smacpod (version 1.2.3)

spscan.test: Spatial Scan Test

Description

spscan.test performs the spatial scan test of Kulldorf (1997).

Usage

spscan.test(x, case = 2, nsim = 499, len = 50, nreport = nsim + 1,
  maxr = NULL)

Arguments

x
A ppp object from the spatstat package with marks for the case and control groups.
case
The position of the name of the "case" group in levels(x$marks). The default is 2.
nsim
The number of simulations from which to compute p-value.
len
The length of the vector of radii from which to perform the test.
nreport
The frequency with which to report simulation progress. The default is nsim+ 1, meaning no progress will be displayed.
maxr
The max distance of the vector of radii from which to perform the test.

Value

  • Returns a list with the following components:
  • pvalueThe p-value of the spatial scan test.
  • mlcThe location of the most likely cluster.
  • rThe radius of the window of the most likely cluster.

Details

The test is performed using the random labeling hypothesis. The windows are circular and extend from the observed data locations. The minimum window radius is the minimum distance between cases. The default upper bound is half the maximum interevent distance.

References

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley. Kulldorff, M. (1997) A spatial scan statistic. Communications in Statistics -- Theory and Methods 26, 1481-1496.

Examples

Run this code
data(grave)
out = spscan.test(grave)
plot(grave)
# draw location of most likely cluster
# uses function from plotrix package
library(plotrix)
draw.circle(out$mlc[1], out$mlc[2], out$r)

Run the code above in your browser using DataLab