[R-sig-Geo] Error in lag.listw(listw2, u) : Variable contains non-finite values - panel spatial model using splm

m@rcomeiiom m@iii@g oii iibero@it m@rcomeiiom m@iii@g oii iibero@it
Mon Jun 10 17:45:46 CEST 2019


Dear community,

I am working on a panel spatial model in R using the package splm. In particular I am trying to estimate the following model

spatpan<-spml(y ~ x, data = data_p, index = NULL, listw = W30, na.action = na.fail, lag = TRUE, spatial.error = "b", model = "within", effect = "twoways",zero.policy=TRUE)

but I get the following error and warnings:

Error in lag.listw(listw2, u) : Variable contains non-finite values
In addition: Warning messages:
1: In lag.listw(listw, u) : NAs in lagged values
2: In lag.listw(listw, u) : NAs in lagged values
3: In lag.listw(listw2, u) : NAs in lagged values
4: In lag.listw(listw2, u) : NAs in lagged values


Similarly, if I model the spatial correlation only for the error term,

spatpan<-spml(y ~ x, data = data_p, index = NULL, listw = W30, na.action = na.fail, lag = FALSE, spatial.error = "b", model = "within", effect = "twoways",zero.policy=TRUE)

I get the following warnings

1: In lag.listw(listw, u) : NAs in lagged values

...

3: In lag.listw(listw, TT) : NAs in lagged values

...

35: In optimize(sarpanelerror, interval = interval, maximum = TRUE, ... :
NA/Inf replaced by maximum positive value

...


In this case however the model turns out to be estimated, despite the standard errors are everywhere NAs and the spatial rho coefficient equal to 1 with weird t stats and p-values. 

An identical problem to mine was already signalled in this mailing list, unfortunately without receiving any suggestion : http://r-sig-geo.2731867.n2.nabble.com/problems-using-spml-with-a-listw-where-not-everybody-has-a-neighbour-td7587857.html.

I guess that the issue could be due to the n by n spatial weighting matrix W30, which contains some neighbourless observations. However this feature should be taken into account by the zero.policy option. Moreover the same framework perfectly works in the cross-sectional case, by using the function sacsarlm from the package spdep.

Please, does anybody know what is causing this and how can I solve this issue? Any help would be really appreciated.

Kind Regards,

Marco Mello

 
	[[alternative HTML version deleted]]



More information about the R-sig-Geo mailing list