Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Categorical levels of L matrix in fourth corner model #118

Closed
joshgsmith opened this issue Nov 9, 2023 · 1 comment
Closed

Categorical levels of L matrix in fourth corner model #118

joshgsmith opened this issue Nov 9, 2023 · 1 comment

Comments

@joshgsmith
Copy link

joshgsmith commented Nov 9, 2023

Hi team, I am cross-posting a question on StackOverflow related to the application of a fourth corner model in mvabund using categorical levels in the R matrix. Typically, the R matrix includes continuous environmental variables recorded at a site or observation, but is it appropriate to substitute R with categorical levels that describe the environment? I am specifically interested in the relationship between environmental periods (R; before, during, after) and their interaction with species traits (Q) on the relative abundance of taxa (L) in my multivariate community. The model runs when using categorical levels in R, and the results seem correct, but I am not sure what is going on under the hood in traitglm() and whether this is an appropriate use of the function.

Cheers!

@dwarton
Copy link
Owner

dwarton commented Nov 9, 2023

yes categorical variables are fine, how they are interpreted depends how they are estimated. The default, method="manyglm", will create dummy variables in the standard way (e.g. before-after, during-after), but method="glm1path" or similar will create a dummy variable for each level (before, during AND after) and will let the LASSO weave its magic to work out which to include.

If planning to text for a env*trait interaction I would recommend using latent variables to do this, there are known issues with the default anova.traitglm, but I haven't coded traitglm to do this as yet...

@dwarton dwarton closed this as completed Nov 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants