This answer is based on the adonis
function in the vegan
package for R. Nesting can enter a permanova in two ways: your model and your permutation structure (the strata
parameter).
In your model formula, nesting is simply interaction as specified in R with the forward slash or colon (A/B/C
or A:B:C
); you are specifying that the effect of C
should differ based on the value of B
and A
. This is like a fixed effect. Also note that forward slash differs from colon in that it includes terms for all layers in the nesting hierarchy: A+A:B+A:B:C
.
With strata=A:B
, you limit your permutations to be between only those samples with the same levels of A
and B
. This implicitly treats data from each A:B
interaction level as coming from the separate distributions/having disparate error structure. It is therefore somewhat similar to a random effect.
Depending on what your question is, you might include your nesting in either place or in both (see link in this answer).