Learn R Programming

rflexscan (version 0.1)

flexscan: Detect spatial disease clusters using the flexible/circular scan statistic

Description

This function analyzes spatial count data using the flexible spatial scan statistic developed by Tango and Takahashi (2005) or Kulldorff's circular spatial scan statistic (1997), and detect spatial disease clusters.

Usage

flexscan(x, y, lat, lon, name, observed, expected, population, nb,
  clustersize = 15, radius = 6370, stattype = "ORIGINAL",
  scanmethod = "FLEXIBLE", ralpha = 0.2, simcount = 999,
  rantype = "MULTINOMIAL", comments = "", verbose = FALSE)

Arguments

x

An array of X-coordinates.

y

An array of Y-coordinates.

lat

An array of latitude.

lon

An array of longitude.

name

The name of each area.

observed

An array of observed number of diseases.

expected

An array of expected number of diseases under the null hypothesis. This is used on "Poisson" model.

population

An array of background population at risk in each area. This is used on "Binomial" model.

nb

A neighbours list or an adjacency matrix.

clustersize

The number of maximum spatial cluster size to scan.

radius

Radius of Earth to calculate a distance between two sets of latitude and longitude. It is approximately 6370 km in Japan.

stattype

Statistic type to be used (case-insensitive).

"ORIGINAL"

the likelihood ratio statistic by Kulldorff and Nagarwalla (1995)

"RESTRICTED"

the restricted likelihood ratio statistic by Tango (2008), with a preset parameter ralpha for restriction

scanmethod

Scanning method to be used (case-insensitive).

"FLEXIBLE"

flexible scan statistic by Tango and Takahashi (2005)

"CIRCULAR"

circular scan statistic by Kulldorff (1997)

ralpha

Parameter for the restricted likelihood ratio statistic.

simcount

The number of Monte Carlo replications to calculate a p-value for statistical test.

rantype

The type of random number for Monte Carlo simulation (case-insensitive).

"MULTINOMIAL"

Total number of cases in whole area is fixed. It can be chosen in either Poisson or Binomial model.

"POISSON"

Total number of cases is not fixed. It can be chosen in Poisson model.

comments

Comments for the analysis which will be written in summary.

verbose

Print progress messages.

Value

An rflexscan object which contains analysis results and specified parameters.

References

Tango T. and Takahashi K. (2005). A flexibly shaped spatial scan statistic for detecting clusters, International Journal of Health Geographics 4:11.

Kulldorff M. and 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.

Tango T. (2008). A spatial scan statistic with a restricted likelihood ratio. Japanese Journal of Biometrics 29(2):75-95.

See Also

summary.rflexscan, plot.rflexscan, choropleth

Examples

Run this code
# NOT RUN {
# load sample data (North Carolina SIDS data)
library(spdep)
data("nc.sids")

# calculate the expected numbers of cases
expected <- nc.sids$BIR74 * sum(nc.sids$SID74) / sum(nc.sids$BIR74)

# run FleXScan
fls <- flexscan(x = nc.sids$x, y = nc.sids$y,
                observed = nc.sids$SID74,
                expected = expected,
                name = rownames(nc.sids),
                clustersize = 10,
                nb = ncCR85.nb)

# Print summary to the terminal
summary(fls)

# Plot graph
plot(fls)
labs <- 1:length(fls$cluster)
legend("topright", legend = labs, col = palette()[labs], lty = 1)

# }

Run the code above in your browser using DataLab