Can you use Lasso for variable selection of fixed effects, then run a mixed model using the fixed effects from Lasso? I have a mixed model with many fixed effects, and two random variables (the data is made up of repeat observations of a number of individuals, and has a random intercept and a random slope parameter associated with each individual). The model will be used for prediction. I want to use a regularisation technique to reduce the number of fixed effects as the model is likely overfitted at present.
Would it be valid to run a Lasso analysis on a model which excludes the random effects and use the outcome of this to choose the fixed effects to keep in my mixed model? As in:

*

*Run a number of Lasso regressions on a training set where the tuning parameter (lambda) is varied

*Calculate the RMSE of an (unseen) test set

*Find the value of lambda which gives the best RMSE in the test set

*Find the variables for which the coefficient is set to zero for the value of lambda that produces the best RMSE in the test set

*Exclude these variables from a subsequent mixed model.

I've found that there are lots of papers for different lasso-type things that people do for mixed models, but I'm struggling to find a clear, reliable, reference that explains why you couldn't just do the steps above... My intuition is that this would not be valid because the Lasso wouldn't know about the structure in the model that the random effects capture... is that right? And if so, could you point me to a nice reference that makes this clear? Or, if it is ok, could anyone point me to a nice reference that makes that clear?
I hope this makes sense, and sorry if it's a simple answer!

There doesn't appear to be a consensus on how to perform variable selection on both fixed and random effects. There are technical papers proposing solutions to this problem, like this paper from Fan and Li.
Bondell et al. argue against separating the fixed and random when performing variable selection, as the structure of the random effects will affect which fixed effect variables are selected. I am not an expert at variable selection or mixed models, but Bondell's claims and your intuition seem correct to me. Since this problem doesn't seem to be fully solved, I don't think you'll find the clear resource you want. You will find many technical arguments like those papers or their references.
It is straightforward to produce an example where temporarily ignoring the random effects will not work. Imagine you have a longitudinal study and a random effect for each person. It wouldn't make any sense to omit the random effects because that is how you model within-person correlation.
