I ran a spatial lag regression model in R using spdep. Due to cross-validation of my results and data-size, I ran the same model in GeoDa but the resulting indices didn't match.
My data(slot):head(sdat2@data, 3) lsoa n_brg n_vln rt_vl rt_br id RPC1 RPC2 RPC30 E01004076 148 107 7.653791 238.70968 3979 -0.4750426 -1.0710260 1.43460291 E01004077 58 50 26.153080 90.90909 3980 -0.8414698 -1.0566305 -1.17067022 E01004078 49 51 20.308042 70.00000 3981 -0.6691681 -0.7677197 -0.8471715 RPC4 RPC50 1.133597 1.60975621 1.164454 -0.69135542 1.203011 0.5165002
My question is similar to this one here so I've tried what Roger Bivand suggested originally:
My data(slot):head(sdat2@data, 3) lsoa n_brg n_vln rt_vl rt_br id RPC1 RPC2 RPC30 E01004076 148 107 7.653791 238.70968 3979 -0.4750426 -1.0710260 1.43460291 E01004077 58 50 26.153080 90.90909 3980 -0.8414698 -1.0566305 -1.17067022 E01004078 49 51 20.308042 70.00000 3981 -0.6691681 -0.7677197 -0.8471715 RPC4 RPC50 1.133597 1.60975621 1.164454 -0.69135542 1.203011 0.5165002
My question is similar to this one here so I've tried what Roger Bivand suggested originally:
- I got my spatial weights as a k-NN distance matrix in GeoDa and made it symmetric with make.sym.nb().
- I use this same weight-file for my regression in GeoDa and R and there are no NAs
- Moran's I on my DV is identical in GeoDa and R: rho = 0.5194...
- When I run a spatial error model, the results are nearly identical: