I have to fit some data to a glm, family=poisson(link="log").

The response variables are X1, X2, X3 and X4.

I need an algorithm to fit the best possible model (by lowest AIC). All terms must be included plus the 64 possible combinations of interaction terms.

I'm currently using glmulti package, but that sometimes omits the terms X1, X2, X3 or X4, which must be included in my model.

Is there a way of forcing the glmulti package to always include these terms? ... Alternatively is there a way of constructing a loop that goes through the 64 possible models exhaustively and compares AIC?


1 Answer 1


I would be very hesitant to use anything that "automatically" generates the best model for you. First, you can theoretically make a linear regression with 100 predictors, but it won't really predict much of anything given the amount of explained variance will likely not be much improved by the inclusion of so many predictors. Second, the interpretability of such a model can't be incredibly high. If you have 60+ interaction terms as you say, how do you explain these interactions? I can't imagine that is going to be be easy.

Third, and I must highlight this specifically, you need a strong theoretical basis for your model. Of course you can build whatever data-driven model you want, but what if your model doesn't match the vast research on the subject? What if it does match the research but you have no way of conveying it's meaning? Its important to have a both a strong theoretical and data-driven approach anytime you approach anything like a GLM.


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.