Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

spscan.test

Spatial Scan Test


Description

spscan.test performs the spatial scan test of Kulldorf (1997) for case/control point data.

Usage

spscan.test(
  x,
  case = 2,
  nsim = 499,
  alpha = 0.1,
  maxd = NULL,
  cl = NULL,
  longlat = FALSE
)

Arguments

x

A ppp object 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. x$marks is assumed to be a factor. Automatic conversion is attempted if it is not.

nsim

The number of simulations from which to compute the p-value. A non-negative integer. Default is 499.

alpha

The significance level to determine whether a cluster is signficiant. Default is 0.1.

maxd

The radius of the largest possible cluster to consider. Default is NULL, i.e., no limit.

cl

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).

longlat

A logical value indicating whether Euclidean distance (FALSE) or Great Circle (WGS84 ellipsoid, FALSE) should be used. Default is FALSE, i.e., Euclidean distance.

Details

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.

Value

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:

coords

The centroid of the significant clusters.

r

The radius of the window of the clusters.

pop

The total population in the cluser window.

cases

The observed number of cases in the cluster window.

expected

The expected number of cases in the cluster window.

smr

Standarized mortaility ratio (observed/expected) in the cluster window.

rr

Relative risk in the cluster window.

propcases

Proportion of cases in the cluster window.

loglikrat

The loglikelihood ratio for the cluster window (i.e., the log of the test statistic).

pvalue

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.

Author(s)

Joshua French

References

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.

Waller, L.A. and Gotway, C.A. (2005). Applied Spatial Statistics for Public Health Data. Hoboken, NJ: Wiley.

Examples

data(grave)
out = spscan.test(grave, nsim = 99)
plot(out, chars = c(1, 20), main = "most likely cluster")
# get warning if no significant cluster
out2 = spscan.test(grave, alpha = 0.001, nsim = 99)

smacpod

Statistical Methods for the Analysis of Case-Control Point Data

v2.1.1
GPL (>= 2)
Authors
Joshua French [aut, cre] (<https://orcid.org/0000-0002-9708-3353>)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.