When I try to fit the following random effect on a panel data:
df<-read.csv("http://josejesus.info/Depen/panel.csv")
library(plm)
panel<-pdata.frame(df,c("state","year"))
plm(v3~v4+v5+v6+v7+v8+v9+v10+v11+v12,data=panel,effect="twoways",model="random")
I get the following error:
Error in if (sigma2$time < 0) warning("the estimated variance of the time effect is negative") : missing value where TRUE/FALSE needed.
But if I suppress the last variable v12
I get a result but with a warning about the negative time variance.
Can someone help me to understand what is going on?