I've trying to preform a PERMANOVA using adonis2 on a dissimilarity matrix. My code looks like this.
adonis2(formula = bray_curtis_dist ~ treatment, data = metadata,
permutations = 999)
For the metadata, if I change around the order of my samples (say I order by treatment rather than by ID), the results change drastically. Does adonis2 not match sample names?
This is my results if the metadata is arranged first by ID and then second by Supplement Type. It seems like the SumOfSqs are not the same between the two, and the pvaules are very different. Why does this happen? I get these same values every time I load up a metadata file arranged by either ID or treatment. These files are exactly the same, minus the order of samples.
Thanks!
Permutation test for adonis under reduced model
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Permutation: free
Number of permutations: 255
adonis2(formula = bray_curtis_dist ~ Supplement_Type + Sequence +
Supplement_Type:Sequence, data = metadata)
Df SumOfSqs R2 F Pr(>F)
Supplement_Type 1 0.05667 0.01934 0.2781 0.7325
Sequence 1 0.37653 0.12854 1.8482 0.7656
Supplement_Type:Sequence 1 0.05133 0.01752 0.2519 0.8125
Residual 12 2.44477 0.83459
Total 15 2.92930 1.00000
####
Permutation test for adonis under reduced model
Terms added sequentially (first to last)
Permutation: free
Number of permutations: 255
adonis2(formula = bray_curtis_dist ~ Supplement_Type + Sequence +
Supplement_Type:Sequence, data = metadata)
Df SumOfSqs R2 F Pr(>F)
Supplement_Type 1 0.15567 0.05314 0.7539 0.3365
Sequence 1 0.27412 0.09358 1.3276 0.7344
Supplement_Type:Sequence 1 0.02166 0.00739 0.1049 1.0000
Residual 12 2.47785 0.84588
Total 15 2.92930 1.00000
adonis2()
but I suspect that this might be related to the problem with Type I ANOVA, with terms added sequentially when data aren't balanced. $\endgroup$