R spml和plm:为什么在空间固定效果上会有截距?

时间:2019-04-05 21:07:28

标签: r spatial plm spml

我正在将空间面板自回归模型与没有空间项的面板回归进行比较。对于这两种模型,我都估计了单独的固定效应。令spml包输出带有截距项的固定效果,我感到很惊讶。在进行“正常”固定效果面板回归时,情况并非如此。

我从未见过报道过截击具有固定效果。 spml这样做有原因吗?与plm包中的固定效果相比,固定效果的解释会改变吗?

这是我的意思的示例:

library(splm)
library(plm)

df <- data.frame(y = c(10,20,30,40,15,17,25,37), x = c(10,5,20,10,12,7,18,11))
df$time <- rep(c(1,2), each = 4)
df$ind <- rep(1:4, 2)
df <- df[,c("ind","time", "y", "x")]
df

# matrix for spatial estimation - Spatial Panel Autoregressive Model
W <- matrix( c( 0,0,1,1,
                0,0,1,1,
                1,1,0,5,
                0,1,10,0), nrow = 4)
W <- sweep(W, 1, rowSums(W), "/")
listw <- mat2listw(W, style = "W")

# spatial estimation
res_spatial <- spml(y ~ x, data = df, listw = listw, effect = "individual",
                    model="within", spatial.error="none", lag = T)

# panel estimation without spatial lags
res <- plm(y ~ x, data = cbind(df),  effect = "individual", model="within")

# FIXED EFFECTS WITHOUT INTERCEPT
summary(fixef(res))

# FIXED EFFECTS WITH INTERCEPT -> WHY??
effects.splm(res_spatial)

0 个答案:

没有答案