[R] plm random effect: the estimated variance of the individual effect is negative
David Winsemius
dwinsemius at comcast.net
Thu Jan 3 22:23:07 CET 2013
On Jan 3, 2013, at 8:19 AM, matteo ognibene wrote:
>
> Hi,R 2.15.2 plm() function on Windows 7
> I have a problem with the variance estimation in a random effect model
> I used this formula to get my result, and it works:reg <- deltaF ~
> L1.deltaF + L2.deltaF + deltaCDS + L1.deltaCDS + L2.deltaCDS +
> L3.deltaCDS + deltaUS_Yields + deltaZ + L1.deltaZ + L2.deltaZfixed
> <- plm(reg, data=Mody_R, na.action = na.exclude,
> index=c("country_id", "datestata"), model="random")
> but when i split my dataframe into several groups it gives me this
> error:"Error in swar(object, data, effect) : the estimated
> variance of the individual effect is negative"
> The code i used to split the dataframe is:SplitMody <- split(Mody_R,
> Mody_R$period)SplitFixed <- lapply(SplitMody, function(Mody_R)
> plm(reg, data=Mody_R, na.action = na.exclude, index=c("country_id",
> "datestata"), model="random"))
> I want to point the all the code works perfectly in a within model,
> and I tried using all the random.method for the variance
> estimation.In addition I used the same model in Stata and it
> works... (the results are identical for a within model in R and Stata)
> I'll be really gratefull if someone can help me.
> Thanks,Matteo
> [[alternative HTML version deleted]]
Head up; matteo: This is pretty much unreadable (due to the failure to
follow the recommended posting procedure.)
--
David Winsemius, MD
Alameda, CA, USA
More information about the R-help
mailing list