Type: | Package |
Title: | Flexible Scan Statistics |
Version: | 0.2.2 |
Author: | Zhicheng Du, Yuantao Hao |
Maintainer: | Zhicheng Du <dgdzc@hotmail.com> |
Depends: | R (≥ 2.10) |
Description: | An easy way to conduct flexible scan. Monte-Carlo method is used to test the spatial clusters given the cases, population, and shapefile. A table with formal style and a map with clusters are included in the result report. The method can be referenced at: Toshiro Tango and Kunihiko Takahashi (2005) <doi:10.1186/1476-072X-4-11>. |
License: | GPL-3 |
Imports: | smerc, sp, spdep, methods, graphics, spatialreg |
Encoding: | UTF-8 |
LazyData: | true |
NeedsCompilation: | no |
Packaged: | 2022-01-06 07:16:39 UTC; dgdzc |
Repository: | CRAN |
Date/Publication: | 2022-01-06 07:40:02 UTC |
Flexible Scan Statistics
Description
An easy way to conduct flexible scan. Monte-Carlo method is used to test the spatial clusters given the cases, population, and shapefile. A table with formal style and a map with clusters are included in the result report. The method can be referenced at: Toshiro Tango and Kunihiko Takahashi (2005) <doi:10.1186/1476-072X-4-11>.
Usage
flexscan(map,case,pop,nsim,k,alpha,isplot,col)
Arguments
map |
spatial object, typically a shapefile read in using 'rgdal::readOGR' |
case |
numeric, a vector of number of cases for each region of 'map'; it is noteworthy that the order of regions in 'case' is corresponding to that in 'map' |
pop |
numeric, a vector of number of population for each region of 'map'; it is noteworthy that the order of regions in 'pop' is corresponding to that in 'map' |
nsim |
numeric, the number of simulations for Monte Carlo test; the default is 999 |
k |
numeric, the maximum number of regions allowed for clusters; the default is 10 |
alpha |
numeric, the significance level of flexible scan test; the default is 0.05 |
isplot |
logical, wether to plot the results; the default is 0.05 |
col |
color vector, two colors for most likely cluster and secondary cluster; the default is c("red","blue") |
Value
data.frame |
a data.frame containing 8 variables as follows: |
Cluster Type |
most likely cluster or secondary cluster |
Region ID |
region id for each cluster; it is noteworthy that the 'ID' is the order of regions in 'map' |
Observed Cases |
observed cases for each cluster |
Expected Cases |
expected cases for each cluster |
SR |
standardized ratio of observed to expected cases |
RR |
relative risk for each cluster |
LLR |
loglikelihood ratio for each cluster |
P Value |
p value of likelihood ratio test for each cluster |
Note
Please feel free to contact us, if you have any advice and find any bug!
Reference:
Tango, T. & Takahashi, K. A Flexibly Shaped Spatial Scan Statistic for Detecting Clusters. INT J HEALTH GEOGR. 4, 11 (2005).
Updates:
Version 0.2.0: Fix the bugs according to the dependent package of "smerc" version 1.1
Version 0.2.2: Fix the bugs according to the dependent package of "spdep"
Author(s)
Zhicheng Du<dgdzc@hotmail.com>, Yuantao Hao<haoyt@mail.sysu.edu.cn>
Examples
data(map)
data(sample)
# simple example for checks; turn the warnings back on using 'options(warn=0)'
options(warn=-1)
flexscan(map,case=sample$case,pop=sample$pop,k=3,isplot=FALSE,nsim=10)
## Not run:
flexscan(map,case=sample$case,pop=sample$pop)
## End(Not run)
Shapefile
Description
There 123 tiles in the map.
Usage
map
Sample Data
Description
There are two variables in the 'sample' including 'case' and 'pop'.
Usage
sample