# Linear Regression and Spatial-Autocorrelation

I want to predict Tree Heights in a certain area using some variables obtained through remote sensing. Like approximate Biomass, etc. I want to first use a linear regression (I know it's not the best idea but it is a must step for my project). I wanted to know how badly can spatial autocorrelation affect it and what is the easiest way to correct this if it is even possible. I'm doing everything in R by the way.

• If you do see spatial autocorrelation in the residuals you can include the observations at nearby locations ("spatial lags") as predictors in the model as Sameer suggests. Another option for handling spatial autocorrelation is to model the spatial trend by including a semi-parametrically estimated function of the spatial coordinates using, for example, a generalized additive model. See this related question for more info. Sep 12, 2012 at 2:26

Moran's I is a diagnostic statistic that can be used to detect spatial autocorrelation in the residuals of a regression, given that you have a weight matrix $\mathbf{w}$, with entries $w_{ij}$ representing distances between observation (residuals) $X_i$ and $X_j$. You can think of it as a spatially-weighted measure of correlation. Significance of the statistic can be calculated analytically or perhaps with non-parametric re-sampling methods (e.g. jackknife). Another method for doing something similar is the Lagrange multiplier test.
• (+1) The author of spdep also has a nice textbook about spatial data analysis in R here. I own this book and have found it very useful. Sep 12, 2012 at 2:22