Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

help with correct adonis model specification #364

Open
ramiroricardo opened this issue Jun 3, 2020 · 0 comments
Open

help with correct adonis model specification #364

ramiroricardo opened this issue Jun 3, 2020 · 0 comments

Comments

@ramiroricardo
Copy link

ramiroricardo commented Jun 3, 2020

Dear all,

I am analysing a microbiome dataset in which mice were sampled at two time points, before and after a treatment. I want to test if the communities are different before and after treatment.

I would like to use mouse_id as a blocking factor, as the initial state of the microbiomes differs between mice.

I understand that adonis is not designed to deal with random effects, but I was wondering if this could be dealt with by fitting mouse_id as a fixed effect? (as one could do in a linear model)

I get very different results when running the models with and without mouse_id as a fixed effect (here I am using a Bray-Curtis distance matrix).

Model without mouse_id

adonis(ps_recipient_KOWT_bc~as.factor(timepoint),data=sample_df_KOWT)

'nperm' >= set of all permutations: complete enumeration.
Set of permutations < 'minperm'. Generating entire set.

Call:
adonis(formula = ps_recipient_KOWT_bc ~ as.factor(timepoint),      data = sample_df_KOWT) 

Permutation: free
Number of permutations: 719

Terms added sequentially (first to last)

                     Df SumsOfSqs MeanSqs F.Model      R2 Pr(>F)
as.factor(timepoint)  1   0.52713 0.52713  17.916 0.81749    0.1
Residuals             4   0.11769 0.02942         0.18251       
Total                 5   0.64482                 1.00000  

Model with mouse_id fitted as a fixed effect

adonis(ps_recipient_KOWT_bc~as.factor(timepoint)+mouse_id,data=sample_df_KOWT)

'nperm' >= set of all permutations: complete enumeration.
Set of permutations < 'minperm'. Generating entire set.

Call:
adonis(formula = ps_recipient_KOWT_bc ~ as.factor(timepoint) +      mouse_id, data = sample_df_KOWT) 

Permutation: free
Number of permutations: 719

Terms added sequentially (first to last)

                     Df SumsOfSqs MeanSqs F.Model      R2  Pr(>F)  
as.factor(timepoint)  1   0.52713 0.52713 18.9481 0.81749 0.03333 *
mouse_id              2   0.06205 0.03102  1.1152 0.09623 0.63333  
Residuals             2   0.05564 0.02782         0.08629          
Total                 5   0.64482                 1.00000          
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Would the latter model be correct?

I have also thought of using strata=mouse_id, though since I only have two samples per mouse, I think this would lead to a rather low number of permutations.

Kind regards,

Ricardo Ramiro

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant