The main question I have is how to create a permutation design for the following sampling design:
Data was collected under a shrub and directly nearby, outside the shrub influence. We called this ‘pair’ (df$pair);
Three different shrub species were chosen, and we expect that the response will vary for each shrub. For example, shrub 1 will increase the response variable while shrub 2 will not change and shrub 3 will decrease. I am not sure if I should include the shrub species as a ‘block’ in the perm design or not.
The hypothesis is being tested through a multivariate glm using mvabund package. The model is:
model <- manyglm(response ~ shrub*pair, family = negative.binomial, data = df)
Data for permutations is similar to this:
df <- data.frame(
pair = rep(1:30, each = 2),
condition = rep(c("under", "outside"), times = 10),
shrub = rep(c("shrub1", "shurb2", "shrub3"), each = 20)
)
So far I came up with this solution, but I am not sure this is correct to test our hypothesis.
perm.ctrl <- how(
within=Within(type="free"),
plots = Plots(strata = df$pair, type = "free"),
blocks = df$shrub,
nperm = 9999)
I understand that with this design the permutations are occurring always within each shrub type (and outside) and the paired structure is being preserved. Can someone guide me through this?
Thanks in advance.