arsweeny / microbiome-glmm

3 stars 0 forks source link

Help to GLMM model #2

Open OrsonMM opened 2 months ago

OrsonMM commented 2 months ago

Dear Amy Sweeny,

I read your great paper ... Please you can help me to fit a model.

I have this variables:

asv : DADA2 output treat : 3 differents (class1, class2, class3) time : 3 differents time points (1,2,3) sample: Tree replicates per sample in each time and treat

The question is what is the asv community that are affected by Treat, Time or interaction of these Treat:Time

Mods[[1]]<- MCMCglmm(fixed= abundance ~ Time + Treat, 
                     random= ~  sample + asv + Treat:asv + Treat:Time + Time:asv, 
                     prior=Prior3,
                     data=df,
                     verbose=T, pr=T, pl=T, # will save posteriors for random effect levels & model predictions for each iteration 
                     family = "poisson",
                     nitt = 13000*mf,
                     thin = 10*mf,burnin=3000*mf)
Mods[[1]]<- MCMCglmm(fixed= abundance ~ Time + Treat + Treat:Time , 
                     random= ~  sample + asv + asv:Treat + asv:Time, 
                     prior=Prior3,
                     data=df,
                     verbose=T, pr=T, pl=T, # will save posteriors for random effect levels & model predictions for each iteration 
                     family = "poisson",
                     nitt = 13000*mf,
                     thin = 10*mf,burnin=3000*mf)
arsweeny commented 2 months ago

Hi! Yes I'd be happy to help. Can you tell me how the above ran for you? In the top model, if you want the effect of an interaction of time and treatment on asv composition, you will also need to interact that with asv (three-way-interaction). That might be computationally a bit much, but the model below should give you an initial idea of whether there are independent effects first. Feel free to reach out via e-mail if you want to chat more.