flex_test: Flexibly-shaped Spatial Scan Test In smerc: Statistical Methods for Regional Counts

 flex_test R Documentation

Flexibly-shaped Spatial Scan Test

Description

flex_test performs the flexibly-shaped scan test of Tango and Takahashi (2005).

Usage

flex_test(
coords,
cases,
pop,
w,
k = 10,
ex = sum(cases)/sum(pop) * pop,
type = "poisson",
nsim = 499,
alpha = 0.1,
longlat = FALSE,
cl = NULL,
lonlat = longlat,
...
)


Arguments

 coords An n \times 2 matrix of centroid coordinates for the regions in the form (x, y) or (longitude, latitude) is using great circle distance. cases The number of cases observed in each region. pop The population size associated with each region. w A binary spatial adjacency matrix for the regions. k An integer indicating the maximum number of regions to inclue in a potential cluster. Default is 10 ex The expected number of cases for each region. The default is calculated under the constant risk hypothesis. type The type of scan statistic to compute. The default is "poisson". The other choice is "binomial". nsim The number of simulations from which to compute the p-value. alpha The significance level to determine whether a cluster is signficant. Default is 0.10. longlat 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. 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). lonlat Deprecated in favor of longlat. ... Not used.

Details

The test is performed using the spatial scan test based on the Poisson test statistic and a fixed number of cases. 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).

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:

Joshua French

References

Tango, T., & Takahashi, K. (2005). A flexibly shaped spatial scan statistic for detecting clusters. International journal of health geographics, 4(1), 11. Kulldorff, M. (1997) A spatial scan statistic. Communications in Statistics – Theory and Methods 26, 1481-1496.

print.smerc_cluster, summary.smerc_cluster, plot.smerc_cluster, scan.stat, scan.test

Examples

data(nydf)
data(nyw)
coords <- with(nydf, cbind(longitude, latitude))
out <- flex_test(
coords = coords, cases = floor(nydf$cases), w = nyw, k = 3, pop = nydf$pop, nsim = 49,
alpha = 0.12, longlat = TRUE
)

data(nypoly)
library(sp)
# plot(nypoly, col = color.clusters(out))


smerc documentation built on Oct. 13, 2022, 9:07 a.m.