0

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?

José
  • 921
  • 14
  • 21
  • 1
    Did you check these answers: http://stats.stackexchange.com/questions/186400/negative-variance-random-effects-model , http://stackoverflow.com/questions/31050744/random-effects-estimation-error-with-plm-package-due-to-negative-variance, http://stats.stackexchange.com/questions/176827/error-in-plm-random-effects-swamy-arora-swar-estimator-with-lagged-dependent/181444#181444 ? – Felix Dec 09 '16 at 10:47
  • @felix, I had seen the second one but the first one was more helpful in my case. Thanks. – José Dec 09 '16 at 13:08
  • Should be fixed in the current development version of plm. – Helix123 Mar 01 '17 at 12:55

0 Answers0