[R-sig-Geo] Error object 'can.sim2' not found in spatianl panel data - splm with spdep

Patrick Meyfroidt patrick.meyfroidt at uclouvain.be
Mon Oct 8 12:20:35 CEST 2012


Dear list,

I have spatial panel data (regions over years), that I subsetted to make
sure that the panel is balanced.

Using spdep, I calculated weights using nearest neighbors on these
regions, with the following code:

--
RUSCRS <- CRS("+proj=lcc +lat_1=15 +lat_2=65 +lat_0=30 +lon_0=95 +x_0=0
+y_0=0 +units=m +datum=WGS84")
rus <- readShapeSpatial([filename], IDvar = "index", proj4string = RUSCRS)
coords <- coordinates(rus)
ruskn5 <- knearneigh(coords, k=5, longlat = NULL)
ruskn5.nb <- knn2nb(ruskn5, row.names=rus$index, sym = FALSE)
wrus.knb5 <- nb2listw(ruskn5.nb, glist=NULL, style="W", zero.policy=NULL)
--

Everything looks fine, i.e. I can print out the results at each step, and
each unit apparently has indeed 5 neighbors with 0.2 weight for each.

Then I use splm package to perform a spatial panel regression, using the
code:

--
fm <- rnabd ~ rlex + pbpl
spml(formula = fm, data = rusp9508.subsvars, index ="index", listw =
wrus.knb5, model = "within", lag = TRUE, spatial.error = "b")
--

But I end up with the following error message:

"Error in get("can.sim2", envir = env) : object 'can.sim2' not found"


Can someone explain what is this "can.sim2" object and possible reasons
for the error message?

Thank you very much for any input,

Patrick Meyfroidt
Université catholique de Louvain - Belgium



More information about the R-sig-Geo mailing list