[R-sig-Geo] Impact measures in spatial panels when regressors are endogenous. I need some help by a reproducible example.
André M. Marques
@ndremm@rque@ @end|ng |rom y@hoo@com@br
Mon Mar 2 18:02:58 CET 2020
Dear all,
I am working on a research project that uses spatial panel econometric models.
At this moment I am facing some difficulties because I guess there are some issues with the function impacts() in spatialreg package and also with impacts.splm() of the splm package.
I already have used these codes previously.
But at this time I have endogenous regressors in Cliff-Ord spatial panel model.
The major issue I have found is to calculate the impacts when I have one endogenous variable (~pcap) and two exogenous instruments (~hwy+water) in a SARAR spatial panel model.
Below I present a simple reproducible example: library(plm)
library(splm)
library(spdep)data("Produc",package='plm') # Panel data.
head(Produc)data("usaww", package="splm")
head(usaww) usalw <- mat2listw(usaww,style='W') # mat2listw() X nb2listw()
summary(usalw)fm <- log(gsp) ~ log(pcap) + log(pc) + log(emp) + unemp GM_sarar.w2sls <- spgm(formula=fm,data=Produc,listw=usalw,lag=TRUE,
model="random",spatial.error=TRUE,
endog = ~pcap,instruments= ~hwy+water,
lag.instruments = TRUE,method="w2sls")
summary(GM_sarar.w2sls) data(usaww)
lwstates <- mat2listw(usaww, style ="W")
sparse.W <- listw2dgCMatrix(lwstates)
time <- length(unique(Produc$year))
s.lwstates <- kronecker(Diagonal(time), sparse.W)
set.seed(12345)
trMatc <- spatialreg:::trW(s.lwstates, type="mult")
imp <- impacts(GM_sarar.w2sls, tr = trMatc, R = 200)
summary(imp, zstats=TRUE, short=T)
class(GM_sarar.ec2sls)
[1] "splm" Could someone please try to solve this issue by a reproducible example?
Best regards,
André M. Marques
Federal University of Paraiba
Department of Economics
Graduate Program of Economics
[[alternative HTML version deleted]]
More information about the R-sig-Geo
mailing list