[R-sig-Geo] Estimate Spatial Autoregressive model using weighted least squares
Renan Serenini Bernardes
ren@n_@eren|n| @end|ng |rom hotm@||@com
Thu Sep 8 01:00:51 CEST 2022
I have a regression estimated via OLS and WLS and would like to test for spatial effects (estimate SAR) in both models, but I didn't find how to use WLS in SAR model. The package spatialreg offers the option to include weights just for the Spatial Error Model (function errorsarlm). By reading the manual I thought the function spautolm with the argument SAR should do it, but the results seem to be exactly the same of SEM.
Replication:
library(spatialreg)
data(oldcol, package="spdep")
listw <- spdep::nb2listw(COL.nb, style="W")
COL.OLD$POP <- rnorm(49, 1000, 400)
model1 <- errorsarlm(CRIME ~ INC + HOVAL, data=COL.OLD,
weights=POP,listw=listw)
model2 <- spautolm(CRIME ~ INC + HOVAL, data=COL.OLD,family = "SAR",
weights=POP,listw=listw)
summary(model1)
summary(model2)
How can I estimate the SAR model?
Respectfully,
Renan
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list