I know this has been asked, and I've looked at at least 10 threads on this topic, but I still can't understand it. I'm using the plm package to estimate a random effects model on some panel data. I have a model that I have specified, but when I insert an additional variable that does not contain any NA's, I get the following error message.
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
0 (non-NA) cases
I have pared it down as much as possible to the following:
plm(dependent ~ varA + varB + varC + varD, data=mydata,
model="random", index=c("Name", "Month"), na.action=na.exclude)
Without varA
the model works fine. In place of VarA
, I can insert other variables that I have at my disposal, and some will work while others will not.
My data can be obtained here.
I have tried using na.omit(mydata)
, which works sometimes but not reliably.
Any insight would be appreciated.