zhouhj1994 / LinDA

33 stars 3 forks source link

Any tutorial on how to use the mixed effects models by controling random effects like age, gender, BMI? #4

Closed biofuture closed 1 year ago

biofuture commented 1 year ago

Hello,

Thanks for the work. Do you have any tutorial on how to use your package to control the confounding factors like age, gender, BMI while doing this microbial differential abundance/association analysis?

Thanks.

zhouhj1994 commented 1 year ago

Hello, Thanks for the interest. We use similar syntax as for the linear programming. For example, suppose the variable of interest is called treatment, then you can use formula = ' ~ treatment+age+gender+BMI' to adjust confounders. You may look at https://cran.r-project.org/web/packages/MicrobiomeStat/MicrobiomeStat.pdf for detailed instructions of the function "linda" in our "MicrobiomeStat" package. Let me know if the problem persists.

Thanks, Huijuan

On Thu, Jul 21, 2022 at 1:52 PM Xiaotao JIANG (姜小濤) < @.***> wrote:

Hello,

Thanks for the work. Do you have any tutorial on how to use your package to control the confounding factors like age, gender, BMI while doing this microbial differential abundance/association analysis?

Thanks.

— Reply to this email directly, view it on GitHub https://github.com/zhouhj1994/LinDA/issues/4, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALF4E4A2KFRQ6DUIAJQMZQTVVDQRBANCNFSM54GJ6U4Q . You are receiving this because you are subscribed to this thread.Message ID: @.***>

biofuture commented 1 year ago

Thanks, Huijuan,

do you mean this command in the pdf doc?

' ~ treatment+age+gender+BMI'. or. ' ~ treatment+age+gender+BMI' *

Let's say, we want to investigate the differential abundant analysis for treatment and geography by adjusting age, gender and BMI.

I need to use this formula '~treatment+geography+age+gender+BMI', am I correct?

Differential abundance analysis pooling both the left and right throat data Mixed effects model is used

ind <- depth >= 1000 linda.obj <- linda(otu.tab[, ind], meta[ind, ], formula = '~Smoke+Sex+(1|SubjectID)', feature.dat.type = 'count', prev.filter = 0.1, is.winsor = TRUE, outlier.pct = 0.03, p.adj.method = "BH", alpha = 0.1)

zhouhj1994 commented 1 year ago

Yes, the formula should be '~treatment+geography+age+gender+BMI'. In fact, LinDA treats no difference between variables and confounders. You may look at the list named "output” in the return value storing the result of differential abundance analysis for each of those fixed effects. Thanks.

On Mon, Jul 25, 2022 at 2:01 PM Xiaotao JIANG (姜小濤) < @.***> wrote:

Thanks, Huijuan,

do you mean this command in the pdf doc?

' ~ treatment+age+gender+BMI'. or. ' ~ treatment+age+gender+BMI' *

Let's say, we want to investigate the differential abundant analysis for treatment and geography by adjusting age, gender and BMI

I need to use this formula '~treatment+geography+age+gender+BMI', am I correct? Differential abundance analysis pooling both the left and right throat data Mixed effects model is used

ind <- depth >= 1000 linda.obj <- linda(otu.tab[, ind], meta[ind, ], formula = '~Smoke+Sex+(1|SubjectID)', feature.dat.type = 'count', prev.filter = 0.1, is.winsor = TRUE, outlier.pct = 0.03, p.adj.method = "BH", alpha = 0.1)

— Reply to this email directly, view it on GitHub https://github.com/zhouhj1994/LinDA/issues/4#issuecomment-1193615877, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALF4E4HJUI3FEBRDZP64SNLVVYUU3ANCNFSM54GJ6U4Q . You are receiving this because you commented.Message ID: @.***>

biofuture commented 1 year ago

HJ, Thanks for the explanation.

yan1365 commented 1 year ago

Hello,

May I ask except treating all the variables as confounders, it is a way to sperate fixed effect from the random effects. In other words, it is possible to implement the more complex design like two level factorial treatment design, with crossover, something like that.

Thanks

zhouhj1994 commented 1 year ago

The LinDA treats variables in the same way as the "lmer", so the categorical variables are treated as 0-1 dummy variables. (For L-level categorical variable, there are L-1 dummy variables (the remaining one is think of as the reference level), thus we can obtain the effect of each one of the L-1 levels compared to the reference level. The same rule applies to interaction terms (if this is what "crossover" means). Does this explanation answer your question? Thanks.