R spml and plm: why is there an intercept in spatial fixed effects?

383 views Asked by At

I am comparing a spatial panel autoregressive model with a panel regression without spatial terms. For both models I estimate individual fixed effects. I was surprised that the spml package outputs the fixed effects with an intercept term. This is not the case when doing a "normal" fixed effects panel regression.

I have never seen that intercepts are reported with the fixed effects. Is there a reason why spml is doing this? Does the interpretation of the fixed effects change when compared to the fixed effects to the plm package?

Here is an example of what I mean:

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

There are 0 answers