rflexscan | R Documentation |
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.
rflexscan( 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, secondary = NULL, clustertype = "HOT" )
x |
A vector of X-coordinates. |
y |
A vector of Y-coordinates. |
lat |
(DEPRECATED) A vector of latitude. |
lon |
(DEPRECATED) A vector of longitude. |
name |
A vector of names of each area. |
observed |
A vector with the observed number of disease cases. |
expected |
A vector with the expected number of disease cases under the null hypothesis. This is used on "Poisson" model. |
population |
A vector with the background population at risk in each area. This is used on "Binomial" model. |
nb |
A neighbors list or an adjacency matrix. |
clustersize |
The number of maximum spatial cluster size to scan, i.e., the maximum number of regions included in the detected cluster |
radius |
Radius of Earth to calculate a distance between two sets of latitude and
longitude. It is approximately 6370 km in Japan. This parameter is used when
|
stattype |
Statistic type to be used (case-insensitive).
|
scanmethod |
Scanning method to be used (case-insensitive).
|
ralpha |
Threshold parameter of the middle p-value 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).
|
comments |
Comments for the analysis which will be written in summary. |
verbose |
Print progress messages. |
secondary |
The number of secondary clusters to be enumerated. If |
clustertype |
Type of cluster to be scanned.
|
Centroid coordinates for each region should be specified EITHER by Cartesian
coordinates using arguments x
and y
or by latitudes and
longitudes using arguments lat
and lon
.
Note that lat
and lon
are DEPRECATED due to accuracy issues.
This feature is implemented to maintain compatibility with FleXScan software.
We recommend to transform latitude and longitude onto the Cartesian
coordinate system beforehand (using spTransform
function in sp package,
for example) and use the x
and y
parameters that are projected
coordinates.
An rflexscan
object which contains analysis results and specified
parameters.
Otani T. and Takahashi K. (2021). Flexible scan statistics for detecting spatial disease clusters: The rflexscan R package, Journal of Statistical Software 99:13.
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.
summary.rflexscan, plot.rflexscan, choropleth
# 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 <- rflexscan(x = nc.sids$x, y = nc.sids$y, observed = nc.sids$SID74, expected = expected, name = rownames(nc.sids), clustersize = 10, nb = ncCR85.nb) # print rflexscan object print(fls) # print properties of the most likely cluster print(fls$cluster[[1]]) # print summary to the terminal summary(fls) # plot graph plot(fls, col = palette()) labs <- 1:length(fls$cluster) legend("bottomleft", legend = labs, col = palette(), lty = 1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.