How to use permute for random effects within adonis2? #690
Replies: 1 comment 1 reply
-
For Q1, you are right in the sense that what you propose to do won't work. In fact you can't test both of your hypotheses with the same design. In one, the species question, you need to permute the whole plots (your mesocosms) while keeping the split-plots (your samples) fixed. In the other you want to restrict permutations so that the split-plots are permuted but only within the whole plots. So you need # permutation design for the split plots (i.e. within blocks permuted at random)
perm_s <- with(meta(phyloseq.object),
how(nperm = 999, blocks = Mesocosm)) for testing perm_w <- with(
meta(phyloseq.object),
how(
nperm = 999,
plots = Plots(strata = Mesocosm, type = "free"),
within = Within(type = "none")
) for a test of I'll think about the other points later. |
Beta Was this translation helpful? Give feedback.
-
Greetings,
I am trying to design a PERMANOVA model that takes into account random factors, but I am not sure how to proceed. I will briefly describe the aim of my study, and then I will describe the data for each research question, before asking my statistical questions.
My study focuses on microbial ecology. I am investigating the impacts of plant species, concentrations of pesticides, and soil amendments (biochar), on the microbial composition in the soil.
My 1st research question concerns the impact of plant species and sampling depth on community composition. To answer this, 9 mesocosms were planted with one of 3 plant species. In each mesocosm, we took two samples: one at shallow depth, one at deep depth. Thus, we have 18 samples, taken from 9 mesocosms, planted with 3 different species, at 2 different sampling depths. Since, from each mesocosm, two samples were taken at different depths, I think a Mesocosm factor should be computed as random effect, in a formula that would look like this:
distance ~ Species + Depth + (1 | Mesocosm)
. Here is the actual code that I have computed to achieve this, by setting the Mesocosm factor as blocks. In this code, I use a phyloseq object, from which I retrieve the otu_table (on which the Hellinger distance is calculated within adonis2), and from which I retrieve the metadata where the variables are stored. Here is the code:I'm not sure if that is the appropriate method. By setting Mesocosm as blocks, am I not restricting permutations to within mesocosms only? And if I do that, how can I evaluate the impact of plant species, since each mesocosm only has one plant species? I should about using the Plots argument, but I am really unsure how to proceed.
My 2nd research question concerns the impact of pesticides concentration and biochar (a soil amendment) on community composition. Unfortunately, the sampling design is not ideal to test this research question, but I must do with what I have, so here goes. I have 6 mesocosms, all planted with the same species (so that is not a factor here). 3 of these mesocosms have biochar added to them. In each mesocosm, we samples two depths, as before. That gives us 12 samples for now. But this time, there are two sampling periods. The first sampling period was before any pesticides application. Then, pesticides were applied to the mesocosms throughout the summer, in the following manner: 3 concentrations of pesticides were applied across the 6 mesocosms; each concentration was applied to one mesocosm with biochar and one mesocosm without biochar. Thus, of the 6 mesocosms, the 3 without biochar each received a different concentration, and the 3 with biochar similarly received a different concentration each. At the end of summer, a second sampling was done.
I know that I cannot test the impact of pesticides by itself, since at no point in time do I have samples with and without pesticides taken on the same day (microbial communities vary too much with time to allow comparisons from early and late summer). However, I still have different concentrations of pesticides taken at the 2nd sampling, and presence/absence of biochar at each sampling period. What I would like to test is whether the presence of biochar can modulate the impact of the concentration of pesticides, and even modulate how the community changes over the season, from before the application of pesticides to after that application.
Since I have samples taken before and after pesticides application, in the same mesocosms, I figured I should treat the Mesocosm and the Pesticides factors as crossed random effects. The formula that I am trying to replicate would look like this (that is actually the formula that I used in a linear mixed model with lmer):
otu_table(phyloseq.object) ~ Concentration * Biochar + Depth + (1 | Mesocosm) + (1 | Pesticides)
. How can I replicate this formula with adonis2, using permutest? I thought of setting the Pesticides factor as Block, and perhaps the Mesocosm factor as Plots, but again, I am really unsure how to proceed.Thank you in advance for your help!
Best regards,
Charbel Hanna
Beta Was this translation helpful? Give feedback.
All reactions