11.11 Packages & Functions: plm
AER
andplm
packageplm()
: Estimate linear models for panel data usinglm()
on transformed dataindex =
: Specify the index variables (unit’s id and e.g. time)model =
: one of"pooling"
,"within"
,"between"
,"random"
,"fd"
, or"ht"
"pooling"
= pooled OLS"within"
= fixed effects"fd"
= first-differences"random"
= random effects (?)"between"
= between (?)
- See Croissant and Millo (2008) for an overview of the package.
- Important, sometimes there are conflicts between packages (e.g.,
plm
anddplyr
)- e.g., between
dplyr::lag
andstats::lag
- It might be necessary to specify which functions
plm
should rely on by using theconflicted
packageslibrary(conflicted), conflict_prefer("filter", "stats"), conflict_prefer("lag", "stats")
- e.g., between
References
Croissant, Yves, and Giovanni Millo. 2008. “Panel Data Econometrics in R: The Plm Package.” Journal of Statistical Software, Articles 27 (2): 1–43.