You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
- $\begingroup$ Welcome. Just a thought here. Depending on the structure of your random effects, there may already be some regularization in your mixed model that lasso can’t improve on. $\endgroup$Rick Hass– Rick Hass2025-08-27 16:01:44 +00:00Commented Aug 27 at 16:01
- 3$\begingroup$ "However, I have noticed that the full model is nearly always the best fitting model based on AIC " with 40k observations and only 10 variables, it is not really surprising that any variable selection method based on prediction performance/fit would keep them all in the model, particularly AIC with its lighter complexity penalty. How did you get glmnet to produce a model with nonzero coefs? Using CV to pick the penalty strength, or just manually adjusting it until you got the desired number of variables? $\endgroup$Nathan Wycoff– Nathan Wycoff2025-08-27 17:52:55 +00:00Commented Aug 27 at 17:52
- $\begingroup$ Thank you for your comments, they've given me lots to think about. @NathanWycoff, I used cv to pick the penalty strength for the lasso and then used glmmTMB to produce my glmm model. Is it better to stick with one method then, so choose either the lasso and highlight the potential issues around it being for glm, or switch to something like the MuMIn package and use AIC? $\endgroup$CjC– CjC2025-08-27 19:41:03 +00:00Commented Aug 27 at 19:41
- 1$\begingroup$ @CjC Oh interesting; the CV-based lasso really did pick only some strict subset of parameters? That's surprising to me. Anyhow, you'll have to tell us just a bit more about your goals for us to give you a definite answer. Why do you want to do variable selection? In order to get a simpler model containing fewer terms? If so, this is in tension with the way you are currently performing variable selection, which is instead geared towards maximal predictive accuracy (glmnet+CV) or based on searching for a "true" model (AIC). $\endgroup$Nathan Wycoff– Nathan Wycoff2025-08-27 20:38:05 +00:00Commented Aug 27 at 20:38
- $\begingroup$ @NathanWycoff, thank you again for your comments, I have updated my question above with some further information and code which hopefully explains a bit further my aims of the research. Ultimatley, I want to find the most important variables for site selection and remove any unnecessary variables (especially due to the large dataset). Currently I am just using ggpredict after model fitting but the results may be used in the future to create a predictive map of suitable perch sites in the study area. $\endgroup$CjC– CjC2025-08-28 08:42:34 +00:00Commented Aug 28 at 8:42
Add a comment |
How to Edit
- Correct minor typos or mistakes
- Clarify meaning without changing it
- Add related resources or links
- Always respect the author’s intent
- Don’t use edits to reply to the author
How to Format
- create code fences with backticks ` or tildes ~ ```
like so
``` - add language identifier to highlight code ```python
def function(foo):
print(foo)
``` - put returns between paragraphs
- for linebreak add 2 spaces at end
- _italic_ or **bold**
- indent code by 4 spaces
- backtick escapes
`like _so_` - quote by placing > at start of line
- to make links (use https whenever possible) <https://example.com>[example](https://example.com)<a href="https://example.com">example</a>
- MathJax equations
$\sin^2 \theta$
How to Tag
A tag is a keyword or label that categorizes your question with other, similar questions. Choose one or more (up to 5) tags that will help answerers to find and interpret your question.
- complete the sentence: my question is about...
- use tags that describe things or concepts that are essential, not incidental to your question
- favor using existing popular tags
- read the descriptions that appear below the tag
If your question is primarily about a topic for which you can't find a tag:
- combine multiple words into single-words with hyphens (e.g. machine-learning), up to a maximum of 35 characters
- creating new tags is a privilege; if you can't yet create a tag you need, then post this question without it, then ask the community to create it for you