Similar questions have been posed earlier, but I have failed to correctly understand how to apply this to my exmperimental design.
Experimental design:
- 9 blocks with an unbalanced number och plots in each block.
- 35 plots with 3 samples per year and plot.
- Each plot were randomly assigned a Treatment, with the condition that all treatments must be represented in each block.
- Blocks were divided into two groups A and B. Group A sampled 2017 and 2018. Group B sampled in 2018 and 2019. Treatment was applied inbetween the sampling occassions. i.e. Before treatment for group A was sampled in 2017, then the treatments were applied and then after treatment sampled in 2018.
I want to do a PERMANOVA to examine if the beetle communities differ before and after treatment as well as between treatments. Since it is abundance data on the beetle community I have choosen to use Bray-curtis.
I want to use the adonis or the adonis2 functions in the Vegan-package. (I am open to suggestions though, but this question regards these two functions).
As I understand it the adonis-function uses a sequential sums of squares(similar to an ANOVA type 1). However, I would like to do an marginal-effects test using adonis2 but I can not seem to understand how to stipulate how to restrict the permutations.
This is what I've got so far, it runs, and gives me resonable results, but I am unsure whether I have restricted the permutations correctly.
perm <- how(nperm = 999, blocks = env$Block, plots = Plots(env$Plot), Within(type = "free"))
adonis2(
m_com_total ~ env$Treatment * env$Impact + env$Year,
method = "bray",
permutations = perm,
by = "margin"
)
I am also unsure if I should write the restriction as:
..., plots = Plots(strata = env$Plot), Within(type = "free"))
Instead of
..., plots = Plots(env$Plot), Within(type = "free"))
This yields slightly different results.
I would greatly appreciate any helpful tips and suggestions. I have read the vignette for permutations in the permute package. Since I still have questions I apparently did not understand this particular part.
Oh yeah, if it helps I have been told to specify the restrictions/design-structure in adonis as follows:
adonis(
m_com_total ~ env$Treatment * env$Year + env$Impact ,
strata = env$Block:env$Plot:env$Trap,
method = "bray",
perm = 999
)