[R-sig-Geo] Moran test on residuals of a logistic regression
Roger Bivand
Roger.Bivand at nhh.no
Tue Sep 19 21:08:24 CEST 2006
On Tue, 19 Sep 2006, guis at teledetection.fr wrote:
> Hi
>
> I have a logistic regression model, and I would like to see if the
> residuals of this model are spatially autocorrelated. I saw that the
> lm.morantest function could be used to test for autocorrelation in
> residuals from a linear model (lm). Does a similar function exist for
> residuals of a logistic regression models? (one of the arguments of the
> lm.morantest is an lm object: x.lm)
No, it doesn't.
> I thought of extracting the residuals of my model (with the residuals
> function) and then applying a moran.test, but I read that this wasn't
> correct as there was no correction for the fact that these were residuals
> (I didn't understand why).
The classic reference is Cliff and Ord (1981) p. 200, section 8.2.4, who
point out that sample model residuals are correlated anyway, because they
are estimated using the fitted regression coefficients. An alternative
they also mention but discard is to test n-k independent BLUS residuals,
chosen by dropping k spatial units. They also state that "random
permutations are not the appropriate reference set for testing the
residuals". So lm.morantest() or its Saddlepoint approximation equivalent
are the only game in town for Moran's I of regression residuals. Of course
I can be computed, but the basis for inference will most likely be
unsound.
> Is there a way to specify that the moran.test is
> applied to residuals, making it possible to use this function in my case?
> I have a last question : if I extract residuals of the logistic models,
> what type of residuals should I choose : deviance, pearson, working,
> response, partial...?
(All responsibility waived!!)
If you replace the test:
if(class(model) != "lm")
in lm.morantest()
with:
if(!inherits(model, "lm"))
lm.morantest() will "work" for some definition of work on glm objects
using deviance residuals. Until somebody tests this properly, I would
certainly not advise using the output for anything other than electron
recycling.
Hope this helps,
Roger
> I would be grateful for any help
> Thanks
>
> Helene Guis
> PhD student CIRAD - University of Franche-Comté, France.
> guis at teledetection.fr
>
> --------------------------------------------------------------------
> mail2web - Check your email from the web at
> http://mail2web.com/ .
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>
--
Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Helleveien 30, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 95 43
e-mail: Roger.Bivand at nhh.no
More information about the R-sig-Geo
mailing list