R:splm封装中具有两个空间权重的空间durbin模型估计

时间:2019-09-24 16:12:27

标签: r spatial spml

以下(Asgharian等,2013)来估计以下等式; enter image description here

我已经在下面编写了代码

ERV1 = read.delim("wm1_ex_vol_SDM2_NEW.txt", row.names = 1) #spatial weight 1
ERV1 = as.matrix(ERV1, zero.policy=TRUE); ERV1 <- mat2listw(ERV1)

ERV2 = read.delim("wm2_ex_vol_SDM2_NEW.txt", row.names = 1) #spatial weight 2
ERV2 = as.matrix(ERV2, zero.policy=TRUE); ERV2 <- mat2listw(ERV2)

spa.sak = read.csv("SPATIAL_xyz.csv",header=TRUE,sep=",");spa.sakp= spa.sak[,-c(1)]
     is.pbalanced(spa.sakp)
      #spatial lags are derived below: ERV1 and ERV2 are spatial weights, and slag computes the spatial lags for each weights.
           slervcredTx1 <- slag(spa.sakp$credT, listw=ERV1) 
            slervchecxTx1 <- slag(spa.sakp$chexT, listw=ERV1);  
             slervuninfTx1 <- slag(spa.sakp$uninfT, listw=ERV1)
               slervgdpTx1 <- slag(spa.sakp$gdpT, listw=ERV1); 
                slervchintTx1 <- slag(spa.sakp$chintT, listw=ERV1)
                  sllagervx2 = slag(lagret, listw=ERV2) 
                   slervcredTx2 <- slag(spa.sakp$credT, listw=ERV2) 
                      slervchecxTx2 <- slag(spa.sakp$chexT, listw=ERV2);  
                        slervuninfTx2 <- slag(spa.sakp$uninfT, listw=ERV2)
                          slervgdpTx2 <- slag(spa.sakp$gdpT, listw=ERV2); 
                           slervchintTx2 <- slag(spa.sakp$chintT, listw=ERV2)
        #formula: Those with spa.sakp are the indepedent variables and with (sl..) are spatia lags
            fmerv2s = (spa.sakp$indexT ~
                         spa.sakp$credT+    spa.sakp$chexT +spa.sakp$uninfT +spa.sakp$gdpT + spa.sakp$chintT
                                  +slervcredTx1  +slervchecxTx1 +slervuninfTx1 +slervgdpTx1 +slervchintTx1
                                       +slervcredTx2+slervchecxTx2 +slervuninfTx2 +slervgdpTx2 +slervchintTx2)

        #Computation                                                                                        
            ERVM2s<- spml(formula = fmerv2s, data = spa.sakp, index = c('id','months'),listw = ERV1, listw2=ERV2 , model = "within", lag = TRUE, effect = "time", spatial.error = "none") 

我期望像

Spatial autoregressive coefficient:
        Estimate Std. Error t-value  Pr(>|t|)    
rho1 -0.137605   0.033528 -4.1042 4.057e-05 ***
rho2 -0.129102   0.039558 -4.1142 4.057e-05 ***
......

但是我得到的是

Spatial autoregressive coefficient:
            Estimate Std. Error t-value  Pr(>|t|)    
    rho1 -0.137605   0.033528 -4.1042 4.057e-05 ***
    ...

问题可能出在公式ERV1内寻址ERV2ERVM2 <- spml(.....) 有什么帮助吗?

0 个答案:

没有答案