opgam {DCluster} | R Documentation |
Scan an area with Openshaw's Geographical Analysis Machine to look for clusters.
opgam is the main function, while gam.intern is called from there.
opgam(data, thegrid=NULL, radius=Inf, step=NULL, alpha, iscluster=opgam.iscluster.default, set.idxorder=TRUE, ...) opgam.intern(point, data, rr, set.idxorder, iscluster, alpha, ...)
data |
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. |
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. |
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.
DCluster, opgam.iscluster.default
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="*")