A dataframe with the data, as described in DCluster manual
page.
thegrid
A two-columns matrix containing
the points of the grid to be used. If it is null, a rectangular grid of step
step is built.
radius
The radius of the circles used in the computations.
step
The step of the grid.
alpha
Significance level of the tests performed.
iscluster
Function used to decide whether the current circle
is a possible cluster or not. It must have the same arguments
and return the same object than gam.iscluster.default
.
set.idxorder
Whether an index for the ordering by distance
to the center of the current ball is calculated or not.
point
Point where the curent ball is centred.
rr
rr=radius*radius .
...
Aditional arguments to be passed to iscluster.
Details
The Geographical Analysis Machine was developed by Openshaw
et al. to perform geographical studies of the relationship between
different types of cancer and their proximity to nuclear plants.
In this method, a grid of a fixed step is built along the study region, and
small balls of a given radius are created at each point of the grid. Local
observed and expected number of cases and population are calculated and a
function is used to assess whether the current ball is a cluster or not. For
more information about this function see opgam.iscluster.default, which
is the default function used.
If the obverved number of cases excess a critical value, which is calculated
by a function passed as an argument, then that circle is marked as a possible
cluster. At the end, all possible clusters are drawn on a map. Clusters may be
easily identified then.
Notice that we have follow a pretty flexible approach, since user-implemented
functions can be used to detect clusters, such as those related to
ovedispersion (Pearson's Chi square statistic, Potthoff-Whittinghill's
statistic) or autocorrelation (Moran's I statistic and Geary's c statistic),
or a bootstrap procedure, although it is not recommended because it can
be VERY slow.
Value
A dataframe with five columns:
x
Easting coordinate of the center of the cluster.
y
Northing coordinate of the center of the cluster.
statistic
Value of the statistic computed.
cluster
Is it a cluster (according to the criteria used)? It should
be always TRUE.
pvalue
Significance of the cluster.
References
Openshaw, S. and Charlton, M. and Wymer, C. and Craft, A. W. (1987). A mark I geographical analysis machine for the automated analysis of point data sets. International Journal of Geographical Information Systems 1, 335-358.
Waller, Lance A. and Turnbull, Bruce W. and Clarck, Larry C. and Nasca, Philip (1994). Spatial Pattern Analyses to Detect Rare Disease Clusters. In 'Case Studies in Biometry'. Chapter 1, 3-23.
See Also
DCluster, opgam.iscluster.default
Examples
library(spdep)
data(nc.sids)
sids<-data.frame(Observed=nc.sids$SID74)
sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y)
#GAM using the centroids of the areas in data
sidsgam<-opgam(data=sids, radius=30, step=10, alpha=.002)
#Plot centroids
plot(sids$x, sids$y, xlab="Easting", ylab="Northing")
#Plot points marked as clusters
points(sidsgam$x, sidsgam$y, col="red", pch="*")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(DCluster)
Loading required package: boot
Loading required package: spdep
Loading required package: sp
Loading required package: Matrix
Loading required package: MASS
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/DCluster/opgam.Rd_%03d_medium.png", width=480, height=480)
> ### Name: opgam
> ### Title: Openshaw's GAM
> ### Aliases: opgam opgam.intern
> ### Keywords: spatial
>
> ### ** Examples
>
> library(spdep)
>
> data(nc.sids)
>
> sids<-data.frame(Observed=nc.sids$SID74)
> sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
> sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y)
>
>
> #GAM using the centroids of the areas in data
> sidsgam<-opgam(data=sids, radius=30, step=10, alpha=.002)
>
> #Plot centroids
> plot(sids$x, sids$y, xlab="Easting", ylab="Northing")
> #Plot points marked as clusters
> points(sidsgam$x, sidsgam$y, col="red", pch="*")
>
>
>
>
>
>
> dev.off()
null device
1
>