opgam                package:DCluster                R Documentation

_O_p_e_n_s_h_a_w'_s _G_A_M

_D_e_s_c_r_i_p_t_i_o_n:

     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.

_U_s_a_g_e:

     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, ...)

_A_r_g_u_m_e_n_t_s:

    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_.

_D_e_t_a_i_l_s:

     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.

_V_a_l_u_e:

     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.

_R_e_f_e_r_e_n_c_e_s:

     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.

_S_e_e _A_l_s_o:

     DCluster, opgam.iscluster.default

_E_x_a_m_p_l_e_s:

     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="*")

