Using GLMs or GLMMs for diversity metrics?
Alana, FYI, in case you?re interested, it is possible to use distance-based linear models to do a repeated-measures analysis of community change. I have described one approach in a paper in Ecosphere Brewer, J.S. Ecosphere 14:e4387. https://doi.org/10.1002/ecs2.4387 The data analysis section of that paper describes how I used PERMANOVA, combined with distance-based redundancy analysis, to analyze and interpret change in species composition in response to experimental treatments. All analyses of compositional change were done using the vegan package and the adonis2 and capscale functions for PERMANOVA and dbRDA, respectively. The distance matrices used were Bray-Curtis. It is possible to do both within-subjects and between-subjects analyses (the latter are a bit more involved and require analyzing responses of centroids to the treatments, which have to be calculated using principal coordinates analysis). In a nutshell, the within-subjects analysis (which I think is what you?re interesting in) uses PERMANOVA to test the effects of year and its interactions with the treatments, while also including a term in the model to account for the between-subjects variation, so as to remove its df and variation from the residual error term. Distance-based redundancy analysis (using the capscale function) provides sample and species scores to help in interpretation of the PERMANOVA results. Good luck with the analysis. Steve
On Oct 11, 2024, at 5:25 PM, Barton, Alana Charlotte via R-sig-ecology <r-sig-ecology at r-project.org> wrote:
[EXTERNAL] Hello, I would appreciate some help in a question regarding statistical analysis. I'm looking at species count data where sampling was carried out over multiple years in repeated sites. So each year was sampled at six different sites for example. The years were categorized into a temperature group with two factors:warm or cold. However, I'm only interested in exploring community differences between temp. groups and across years. I used the vegan package in R for calculating diversity metrics(abundance, richness, diversity index, evenness) and want to statistically check differences among metrics from factors of group and year. I have been using the manyglm-mvabund package with negative binomial distribution, but there is the issue that mvabund doesn't fit non-integer data well, and I'm worried its incorrectly computing diversity and evenness stats. Additionally, I'm wondering if the repeated sites should be added as a fixed effect to mitigate this? Or if it's even considered a random effect actually and a mixed model is more appropriate, using glmmTMB instead in this case? I'm not terribly familiar with using mixed models in R so any help is appreciated. Thank you for your help _______________________________________________ R-sig-ecology mailing list R-sig-ecology at r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-ecology Stephen Brewer He/him/his jbrewer at olemiss.edu Professor Office - 412 Shoemaker Hall Lab - 409 Shoemaker Hall Department of Biology PO Box 1848 University of Mississippi University, Mississippi 38677-1848 Brewer web page - https://jstephenbrewer.wordpress.com FAX - 662-915-5144 Phone - 662-202-5877