1
$\begingroup$

I have a set of 14 variables and I want to construct GLMM's. I want to include at first each variable and then add all the others, one at the time.

This will require a lot of combinations of variables, resulting in many models, and I was wondering if there is a method/R- package that would allow me to select the best models automatically, without having to construct each model "manually"?

$\endgroup$

2 Answers 2

1
$\begingroup$

Most (if not all) statistical textbooks highly recommend to avoid automatic model selection (there are numerous reasons explained in those books). Instead I recommend you to follow the steps described in the excellent book from Zuur et al. (2009) Mixed Effects Models and Extensions in Ecology with R.

I won't go into much detail but you'll see that it is recommended to start with the full model (including all explanatory variables and likely significant interactions that you should select) and to remove non-significant explanatory variable or interaction one at the time using for example the drop1 function in R.

$\endgroup$
3
  • $\begingroup$ Stepwise addition of terms is only one form of feature selection, which in turn is only one form of automatic model selection. Stepwise deletion, which you have recommended, is another. Other techniques include regularization, the AIC, and fully Bayesian model selection. I have yet to see a textbook with a blanket recommendation against all automatic forms of model selection. $\endgroup$ Commented Jun 28, 2016 at 20:16
  • $\begingroup$ @Kodiologist My understanding is that automatic selection would be like stepAIC function from MASS package which takes all explanatory variables and "spits" the final results. This is different (in my opinion) to a procedure were the user build a complete model (after removing correlated variables) and remove non-significant terms one at the time based on a selection criteria such as AIC using drop1, which isn't an automatic model selection since the user is performing all the steps. The procedure I discussed is in Zuur's book, which is well-known in my marine biology field. $\endgroup$ Commented Jun 29, 2016 at 14:18
  • $\begingroup$ If you're using a precisely specified decision rule, the process is effectively automatic, whatever the experience is like for the programmer. Model-selection strategies which are not automatic are those that involve some kind of human judgment call. $\endgroup$ Commented Jun 29, 2016 at 15:36
1
$\begingroup$

Rather than trying to add or delete terms based on some noisy criterion such as statistical significance (see, e.g., https://en.wikipedia.org/wiki/Stepwise_regression#Criticism), you will likely be better served by including all 14 variables, which is, after all, not a very large number unless you have a very small sample. If you're worried that most features won't be informative and so this saturated model will readily overfit, try ridge regression or the lasso.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.