空间回归滞后的标准误差

问题描述 投票:2回答:1

我正在使用空间滞后和durbin回归模型,我想估计影响的标准误差。关于如何做到这一点的任何想法?

Reproducible example below using a durbin model

# data  
  data(oldcol) 

# neighbours lists
  lw <- nb2listw(COL.nb, style="W")

# regression
  fit_durb <- lagsarlm(CRIME ~ INC + HOVAL, data=COL.OLD, type="Durbin",
                       listw=lw, method="eigen", 
                       zero.policy=T, na.action="na.omit")
# power traces
  W <- as(lw, "CsparseMatrix")
  trMC <- trW(W, type="MC", listw = lw)

# Impacts
  imp <- summary(impacts(fit_durb, tr=trMC, R=1000), zstats=TRUE, short=TRUE)
r spatial spdep spatial-regression
1个回答
1
投票

您应该能够使用存储在imp对象中的MC样本来获取标准错误,例如:

test1<-lapply(imp$sres, function(x){apply(x, 2, mean)})
test2<-lapply(imp$sres, function(x){apply(x, 2, sd)}
test1$direct/test2$direct

给出与imp返回的相同的z值

© www.soinside.com 2019 - 2024. All rights reserved.