ME                   package:spdep                   R Documentation

_M_o_r_a_n _e_i_g_e_n_v_e_c_t_o_r _G_L_M _f_i_l_t_e_r_i_n_g

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

     The Moran eigenvector filtering function is intended to remove
     spatial autocorrelation from the residuals of generalised linear
     models. It uses brute force eigenvector selection to reach a
     subset of such vectors to be added to the RHS of the GLM model to
     reduce residual autocorrelation to below the specified alpha
     value.

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

     ME(formula, data, family = gaussian, weights, offset, listw,
      alpha=0.05, nsim=99, verbose=TRUE, stdev=FALSE)

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

 formula: a symbolic description of the model to be fit

    data: an optional data frame containing the variables in the model

  family: a description of the error distribution and link function to
          be used in the model

 weights: an optional vector of weights to be used in the fitting
          process

  offset: this can be used to specify an a priori known component to be
          included in the linear predictor during fitting

   listw: a 'listw' object created for example by 'nb2listw'

   alpha: used as a stopping rule to choose all eigenvectors up to and
          including the one with a p-value exceeding alpha

    nsim: number of permutations for permutation bootstrap for finding
          p-values

 verbose: if TRUE report eigenvectors selected

   stdev: if TRUE, p-value calculated from bootstrap permutation
          standard deviate using 'pnorm' with alternative="greater", if
          FALSE the Hope-type p-value

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

     The eigenvectors for inclusion are chosen by calculating the
     empirical Moran's I values for the initial model plus each of the
     doubly centred symmetric spatial weights matrix eigenvectors in
     turn. Then the first eigenvector is chosen as that with the lowest
     Moran's I value. The procedure is repeated until the lowest
     remaining Moran's I value has a permutation-based probability
     value above alpha. The probability value is either Hope-type or
     based on using the mean and standard deviation of the permutations
     to calculate ZI based on the stdev argument.

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

     An object of class 'ME_res': 

selection: a matrix summarising the selection of eigenvectors for
          inclusion, with columns:

          _E_i_g_e_n_v_e_c_t_o_r number of selected eigenvector

          _Z_I permutation-based standardized deviate of Moran's I if
               stdev=TRUE

          _p_r(_Z_I) probability value: if stdev=TRUE of the
               permutation-based standardized deviate, if FALSE the
               Hope-type probability value, in both cases on-sided

          The first row is the value at the start of the search 

 vectors: a matrix of the selected eigenvectors in order of selection

_A_u_t_h_o_r(_s):

     Roger Bivand and Pedro Peres-Neto

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

     Dray S, Legendre P and Peres-Neto PR (2005) Spatial modeling: a
     comprehensive framework for principle coordinate analysis of
     neigbbor matrices (PCNM), Ecological Modelling; Griffith DA and
     Peres-Neto PR (2006) Spatial modeling in ecology: the flexibility
     of eigenfunction spatial analyses.

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

     'SpatialFiltering', 'glm'

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

     ## Not run: 
     example(columbus)
     lmbase <- lm(CRIME ~ INC + HOVAL, data=columbus)
     lagcol <- SpatialFiltering(CRIME ~ 1, ~ INC + HOVAL, data=columbus,
      nb=col.gal.nb, style="W", alpha=0.1, verbose=TRUE)
     lagcol
     lmlag <- lm(CRIME ~ INC + HOVAL + fitted(lagcol), data=columbus)
     anova(lmlag)
     anova(lmbase, lmlag)
     set.seed(123)
     lagcol1 <- ME(CRIME ~ INC + HOVAL, data=columbus, family="gaussian",
      listw=nb2listw(col.gal.nb), alpha=0.1, verbose=TRUE)
     lagcol1
     lmlag1 <- lm(CRIME ~ INC + HOVAL + fitted(lagcol1), data=columbus)
     anova(lmlag1)
     anova(lmbase, lmlag1)
     set.seed(123)
     lagcol2 <- ME(CRIME ~ INC + HOVAL, data=columbus, family="gaussian",
      listw=nb2listw(col.gal.nb), alpha=0.1, stdev=TRUE, verbose=TRUE)
     lagcol2
     lmlag2 <- lm(CRIME ~ INC + HOVAL + fitted(lagcol2), data=columbus)
     anova(lmlag2)
     anova(lmbase, lmlag2)
     example(nc.sids)
     glmbase <- glm(SID74 ~ 1, data=nc.sids, offset=log(BIR74),
      family="poisson")
     set.seed(123)
     MEpois1 <- ME(SID74 ~ 1, data=nc.sids, offset=log(BIR74),
      family="poisson", listw=nb2listw(ncCR85_nb), alpha=0.2, verbose=TRUE)
     MEpois1
     glmME <- glm(SID74 ~ 1 + fitted(MEpois1), data=nc.sids, offset=log(BIR74),
      family="poisson")
     anova(glmME, test="Chisq")
     anova(glmbase, glmME, test="Chisq")
     data(hopkins)
     hopkins_part <- hopkins[21:36,36:21]
     hopkins_part[which(hopkins_part > 0, arr.ind=TRUE)] <- 1
     hopkins.rook.nb <- cell2nb(16, 16, type="rook")
     glmbase <- glm(c(hopkins_part) ~ 1, family="binomial")
     set.seed(123)
     MEbinom1 <- ME(c(hopkins_part) ~ 1, family="binomial",
      listw=nb2listw(hopkins.rook.nb), alpha=0.2, verbose=TRUE)
     glmME <- glm(c(hopkins_part) ~ 1 + fitted(MEbinom1), family="binomial")
     anova(glmME, test="Chisq")
     anova(glmbase, glmME, test="Chisq")
     ## End(Not run)

