Skip to content

how to set the parameter of strata in adonis2 #600

Answered by gavinsimpson
Ivy-ops asked this question in Q&A
Discussion options

You must be logged in to vote

You don't need to specify anything for strata — just don't even mention it:

h1 <- with(your_data, how(nperm = 999, blocks = subject))
adonis2(distance ~ treatment, data = your_data, permutations = h1)

However I would suggest you do this via rda() because there is no easy way to exclude the between subject variation:

h1 <- with(your_data, how(nperm = 999, blocks = subject))
ord <- rda(response_df ~ treatment + Condition(subject), data = your_data)
anova(ord, permutations = h1)

would stop any between subject variation getting counted in the treatment effect.

As for your second design, you need to look at where the thing you want to test varies. Clearly it doesn't vary at the within-subject

Replies: 4 comments 8 replies

Comment options

You must be logged in to vote
6 replies
@Ivy-ops
Comment options

@gavinsimpson
Comment options

@Ivy-ops
Comment options

@gavinsimpson
Comment options

Answer selected by Ivy-ops
@jarioksa
Comment options

@Ivy-ops
Comment options

Comment options

You must be logged in to vote
1 reply
@Ivy-ops
Comment options

Comment options

You must be logged in to vote
1 reply
@gavinsimpson
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #599 on October 03, 2023 09:32.