is there a gllvm way to do the equivalent of mvabund::anova.manyglm()? #109
-
Hi again, I'm curious if there is a gllvm way to test for a covariate effect on difference in composition, equivalent to mvabund::anova.manyglm() and producing a p-value? I've been trying to use mvabund for this, but there are some limitations in study design. thanks, |
Beta Was this translation helpful? Give feedback.
Replies: 10 comments 8 replies
-
Not equivalent, no. There is gllvm::anova, but it is not very helpful to compare models where the number of parameters is drastically different. Mvabund relies on re-sampling, and that is just something that is not really doable with gllvm. Primarily for computational reasons, but also due to the sensitivity to starting values of the algorithm. You might want to have a look at summary(model) as an alternative, which produces wald-statistics per species and predictor with accompanying p-values. |
Beta Was this translation helpful? Give feedback.
-
thanks for that. Do you mean something like the following? (based on your example)
and by not including an interaction term in the formula, I get a main effect p-value. How should I think about this?
|
Beta Was this translation helpful? Give feedback.
-
General information on the wald test can be found here: https://en.wikipedia.org/wiki/Wald_test. But in short; you can use the p-value to assess if there is evidence for a certain effect (in example that is the amount of bare soil) on the response variable. |
Beta Was this translation helpful? Give feedback.
-
Hi @BertvanderVeen. In the above example, why does defining the trait matrix TR result in a different model when the formula specified is the same? |
Beta Was this translation helpful? Give feedback.
-
Trait models in gllvm work quite differently from models without traits. Even when the traits are not specified in the model formula, by specifying the trait matrix in the model the "trait-route" is taken. The trait model with species-specific predictor effects is IIRC unidentifiable, so when taking the "trait-route" the effect needs to be over the whole community, while without traits it it can be species-specific. |
Beta Was this translation helpful? Give feedback.
-
I can populate the field with a dummy matrix to get this, but is there a syntax to retrieve the whole community effect without defining a TR trait matrix? |
Beta Was this translation helpful? Give feedback.
-
Not that I know of, but perhaps @JenniNiku. |
Beta Was this translation helpful? Give feedback.
-
@hjftan-nm I had a quick think about this. Here is an example to do what you ask:
|
Beta Was this translation helpful? Give feedback.
-
we've done some simulation work looking at this and despite a bunch of potential issues (theoretically and computationally) the anova function on gllvm tends to do OK, if you don't have too many response variables (less than 100, say). Well, we didn't actually test gllvm, we were using glmmTMB and the rr cov structure, but this should behave similarly. As Bert mentioned you should worry about convergence and whether the model fits you are using are good ones, log-likelihood can jump around a little sometimes. anova.gllvm requires at least two models to be specified, so you have to worry about this for each of your models, so for each it would be a good idea to do multiple runs and keep the ones with biggest logL (or better still, use a decent null model fit to provide starting values for the alternative, although this can require some thought to get right). And as the warnings in the output say these are approximate |
Beta Was this translation helpful? Give feedback.
-
Ah, gotcha--I was wondering if there were any peculiarities regarding |
Beta Was this translation helpful? Give feedback.
Not equivalent, no. There is gllvm::anova, but it is not very helpful to compare models where the number of parameters is drastically different. Mvabund relies on re-sampling, and that is just something that is not really doable with gllvm.
Primarily for computational reasons, but also due to the sensitivity to starting values of the algorithm. You might want to have a look at summary(model) as an alternative, which produces wald-statistics per species and predictor with accompanying p-values.