[R] Extract model matrix from plm

yves croissant yves.croissant at univ-reunion.fr
Fri May 14 06:40:03 CEST 2010


There is actually a model.matrix method for plm objects. Unfortunately,
it is not currently exported and therefore can't be used by the end user
of plm. I'll fix that in the next update. However, you won't find in
this matrix the dummies because demeaned values are used. If you really
want the matrix that includes the individual dummies, you'd better use
lm with factor(id) somewhere in the formula, where id is the individual
index. 


Le mardi 11 mai 2010 à 09:30 -0400, Abiel X Reinhart a écrit :
> Is there a way to recover the model matrix that is being used by the plm package? For example, if you run a panel regression with fixed effects, the model matrix would contain the generated dummy variables for the groups.
> 
> Thanks.
> 
> Abiel Reinhart
> 
> 
> 
> This communication is for informational purposes only. I...{{dropped:30}}
> 
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>



More information about the R-help mailing list