testing interactions in a permanova when you have non-independent data
Hi there, I am a M.Sc. student without training in PERMANOVA with only some basic knowledge in multivariate analysis (much more in univariate analyses). I am currently working on a project with 2 other people but nobody is really familiar with the PERMANOVA. If someone could help us with the following questions that would be nice. Please check out the question.html document where I simulate a dataframe similar to our original data. Here a short description what we have and want to test: We have the log abundances of 130 bacterial genus levels for 96 subjects determined from stool samples collected at 2 timepoints pre/post treatment. Subjects come from two distinct environments (treatment_A) and also had different feeding types (treatment_B) We hypothesized that there is no difference in overall community composition at timepoint 1 (pre) but that there is a difference at timepoint 2 (post) between the treatment_A groups. The difference between the treatment_A groups at timepoint 2 is only present for 2 of the 4 treatment_B groups. Thus, we want to test whether we can reject the following H0s: H0 (1): There is a difference in community composition at timepoint 1 between treatment_A groups. H0 (2): There is no difference at timepoint 2 (in overall community composition). H0 (3): Whether there is an effect at timepoint 2 is independet treatment_B such that the effect occurs similarly in all treatment_B groups. Specific questions: How do we make sure that we do not violate the assumptions of independent observations when we test the effect of treatment A in the PERMANOVA framework? How to specify our model correctly to test all our effects? How to proceed if the interaction time:treatment_A or time:treatment_A:treatment_B is significant? What are posthoc procedures that could be done? Is it possible to include a continuous predictor as covariate. E.g. if you wanted to statistically "control" for the variation explained by this predictor? Thank you for any help! Henrik P.S.: Feel free to edit the .Rmd file if you prefer answering in this way!