Im running a panel regression (randon effects) and i have several regressor candidates.
X.panel3.form = as.formula(c("value ~ ",paste(X.panel3.cols,collapse="+")))
> X.panel3.form
value ~ SMB + HML + MOM + IBX + EQWO + TERMBZ + BZCDS5Y + COEN +
COMP + COMI + COAG + DOL + VIX + SPX + TERMUS
Then I run a simple panel regression model
fit.plm = plm(X.panel3.form,data=panel,index = c("variable","Date"), model="random")
This would be the full model, but i would like to automatically select models with fewer regressors. similar to a Stepwise procedure.
in facts stepwise with and optimization by AIC would be the best reference in mind, something simple to keep only the more relevant regressors.
the point is that Step()
function does not work for panel data in R (I believe its because theres no maximum likelyhood estimation for panel models)
so when running the Step()
, StepAIC()
(from Mass package)
i got the error:
Error in UseMethod("extractAIC") :
no applicable method for 'extractAIC' applied to an object of class "c('plm', 'panelmodel')"
so my question is: What would be an anternative for automatic model selection in R and a possible simple implementation for panel datasets when using the plm package?