# Is it ok to just look at the p-values to perform variable selection in a GLMM?

I'm doing a GLMM Poisson regression with a random intercept and 7 fixed covariates in the full model. For variable selection in a GLM with only fixed effects I would normally use something like the stepAIC function in R to investigate possible interaction effects. However, such procedure does not seem to exist for a GLMM? Instead, I'd simply fit the model using something like hlgm in R and look at the p-values, then I'd omit the ones that are not significant from the model. Is such approach appropriate in variable selection in a GLMM based on a certain selection criterion (let's say AIC for example)?

• Automatic variable selection is [almost?] never a good thing to do. To understand that better, it may help to read my answer here: Algorithms for automatic model selection. Beyond that, asking for R functions / code / packages, etc. is off topic here. If you have an on topic statistical question, please edit to clarify. – gung - Reinstate Monica May 16 '18 at 16:38
• I suppose this is on topic now, so I'll reopen. That said, the answer is basically, no, you shouldn't do that (see my last comment). Why do you want to do variable selection in the first place? – gung - Reinstate Monica May 16 '18 at 17:19
• Consider looking into the R package glmmlasso where the variable selection approach for generalized linear mixed models is implemented through L1-penalized estimation. – usεr11852 May 16 '18 at 19:20

Likely no.

To reiterate the reasons why you can't do this in a linear model:

1. The p-values in other coefficients will change when another variable is added or removed from a model. (this is addressed by proper stepwise regression).
2. The p-value is not a valid measure of predictive accuracy in models. (this is not addressed by proper stepwise regression).
3. Stepwise models are not smart enough to know what order variables should be entered/retreated from the model. For instance, if two variables $x_1$ and $x_2$ are numerically identical, the choice of first entry for one versus the other is completely arbitrary and determined by pragmatic reasons only. The differences in interpretation and meaning can be staggering. Consider, for instance, two highly collinear variables that have a world of difference in interpretation for the few cases where they differ: number of pregnancies and number of children, hours spent watching any TV programming and hours spent watching educational TV programming, et cetera.

The further complications of mixed models:

1. There are many types of p-values you could consider for mixed models. The legitimate ones obtained from bootstrapping or profile likelihood are usually too computationally expensive to calculate at each iteration.

2. A mixed model is more likely to omit between-cluster confounders even though they explain a large portion of intracluster variance: the random effect is never considered or treated like an effect.

Given the general lack of enthusiasm by the statistical community for stepwise modeling, you should just abandon the idea outright. Instead, select, by hand, the variables that matter as far as a causal model for the outcome.

• I do not understand how p- values can serve as a basis for variable -selection? – Subhash C. Davar May 18 '18 at 12:50