Does PERMANOVA analysis (specifically adonis2 in the vegan package) allow for nested terms?

378 views Asked by At

I am trying to run a PERMANOVA analysis on the bray-cutis dissimilarities between my samples, but I need to nest sample days within time of day. I read that the "strata" function in adonis2 constricts the permutations, but I can't get this code to run and I am unsure if this is equivalent to nested terms.

Here is some variations in adonis2 that I tried:

  1. adonis2 (bc_long ~ Height + Timeofday2/Day_groups + Day_groups + HeightTimeofday2/Day_groups + HeightDay_groups, data=meta_long, permutations = 2000, na.action = na.omit) ##This does not include strata, and I just included nested terms. The code runs, but I don't trust the results I get back since I am unsure if adonis2 reads the nested syntax I used.

  2. adonis2 (bc_long ~ Height + Timeofday2, strata = Day_groups, data=long_diel2, permutations = 2000) ##This code does not run, and here is the error I get: Error in qr.fitted(qrhs, G) : 'qr' and 'y' must have the same number of rows

1

There are 1 answers

0
Eduardo Moreira On

My ability to help is restricted because I do not know the structure of your data, nor the nature of your variables.

That being said, the first option, using the "Timeofday2/Day_groups" is the correct way to indicate to "adonis2" that "Day_groups" is nested within "Timeofday2".

I hope that will help you.