# Spatial regression

I have a question regarding performing spatial regression on data which residuals are spatially correlated.

1. If the residuals are spatially autocorrelated due to the presence of trend, how should I account for the existence of spatial autocorrelation?

2. And what about if there is no trend, but rather spatial autocorrelation in random variation (in residuals left after detrending)?

3. And what about if there are both trend and spatially autocorrelated random variation in my data?

4. Can I in both cases apply this formula to account for spatial autocorrelation no matter if it is the result of trend or random variation correlation:

``````y^*=y-ρ∑(w_ij*y_j)
x^*=x-ρ∑_(w_ij*x_j)
``````

Thanks.

• In the formulas, what is rho? What is the relationship between the weights "w_ij" and the regression? What happened to the i subscripts on the left hand sides? – whuber Jul 2 '12 at 18:42
• Whuber, thank you for taking your time to read my question. Rho is the strength of correlation, and W_ij are weights applied to the values of y and x variables (depicting the influence of neighbouring values of variables at a certain location). This modified x and y variables (x* and y*) that are actually accounted for spatial autocorrelation will be then used in linear regression equation. I am not sure what values for weights to choose in case i have autocorrelation due to 1) or 2) or in case autocorrelation is due to both trend and correlation in random variation. – Beka Jul 3 '12 at 2:09

2. Use geostatistical methods based on an underlying spatial stochastic process, such as a spatial generalized linear model as described in Diggle and Ribeiro Jr., Model-based Geostatistics (Springer 2007) and implemented in the `geoR` and `geoRglm` packages for `R`.