[R-sig-Geo] Linking lm residuls to specific polygon in shape files

David Martell martell at smokey.forestry.utoronto.ca
Mon Aug 14 20:26:19 CEST 2006

I am using the lm.morantest procedure in spdep to test for spatial
autocorrelation in my lm residuals.

I am not sure where this procedure gets the residuals.

I have prepared a GIS coverage that has a .shp file.  I ran the lm model,
produced the residuals, then put them them in the GIS coverage.

When I run lm in my R program, it produces an lm object that also contains
the residuals.

Does lm.morantest get the residuals from the .shp file or the lm object.

If it gets them from the latter, how does it determine which residual is
assigned to which polygon in the .shp file.


Dave Martell


David L. Martell, Professor
Faculty of Forestry, University of Toronto
33 Willcocks Street, Toronto, Ontario, Canada, M5S 3B3

E-mail:  martell at smokey.forestry.utoronto.ca
URL:     http://www.firelab.utoronto.ca
Phone:   (416) 978-6960
Fax:     (416) 978-3834
Map:     ES on campus map at http://oracle.osm.utoronto.ca/map/

More information about the R-sig-Geo mailing list