Skip to content
Prev 429 / 7420 Next

Spatial ANCOVA in R

Dear Camilo,

I hope I interpret correctly what you want.
In AN(C)OVA you are primary interested to see, whether a variable 
significantly contributes to the explanation of the observed variance, 
right? Spatial models by and large try to "do away with" spatial 
autocorrelation (SAC), so that coefficient estimates are unbiased by 
SAC. Hence, an applying the anova-function to, say, a spatial 
eigenvector mapping GLM (function ME in spdep) will give you the 
explained deviance for each effect, including the spatial eigenvectors.

ANCOVA and regression models are fundamentally identical, only they 
focus on different aspects of the results (deviance explaind vs. 
coefficient estimates). Spatial models are similar to mixed effect 
models (and sometimes ARE mixed effect models), so I can see no reason 
why not to treat them in the same way as any other 
regression/ANOVA-model: run a GLM, use anova(., test="Chisq") on the 
model, done.

Not all spatial methods may offer a generic anova-function, but the 
majority does (gls in nlme does, glmmPQL can be (wrongly!) forced to 
respond by using anova.lme(.), while spautolm and spsarlm provide no 
anova-function). In these cases, you have to have to resort to model 
comparison, i.e. comparing a spatial model with and without the effect 
of interest (obeying marginality and nestedness of models). The 
difference in deviance explained can be attributed to the effect of the 
omitted variable.

HTH,

Carsten

P.S.: Let me advertise some own work here, if I may (open access pdf on 
the journal's or my homepage):
Dormann, C. F., J. M. McPherson, M. B. Ara?jo, R. Bivand, J. Bolliger, 
G. Carl, R. Davis, A. Hirzel, W. Jetz, W. D. Kissling, I. K?hn, R. 
Ohlem?ller, P. R. Peres-Neto, B. Reineking, B. Schr?der, F. M. Schurr, 
and R. Wilson. 2007. Methods to account for spatial autocorrelation in 
the analysis of species distributional data: a review. Ecography 30:609-628.
With R-code for all methods in the appendix, of course.
Camilo Mora wrote: