lhe17 / nebula

GNU General Public License v2.0
29 stars 6 forks source link

Multiple Random Effects #43

Open westonelison opened 8 months ago

westonelison commented 8 months ago

Hi lhe17,

Great tool! Is there a way to include multiple random effects in the model? For instance, when doing a mega analysis of multiple datasets or when having a pooled design where we want to account for pool and donor in the model.

Thank you!

lhe17 commented 8 months ago

Hi Weston,

Thank you for your question.

The tool can include only one random effect term. Nevertheless, if you pool samples from multiple studies, you can just add study IDs to the design matrix as covariates if the number of studies is not big (e.g., <10).

Best regards, Liang

On Thu, Feb 29, 2024 at 2:19 PM Weston Elison @.***> wrote:

Hi lhe17,

Great tool! Is there a way to include multiple random effects in the model? For instance, when doing a mega analysis of multiple datasets or when having a pooled design where we want to account for pool and donor in the model.

Thank you!

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

AdelynTsai commented 5 months ago

Hi, to follow up on the question about having multiple random effects (besides donor ID) in the model. Should the design matrix be coded as something like this: model.matrix(~X1+X2+(1|X3), data=sample_data$pred)? X3 will be a random covariate like a study ID. Thanks!

lhe17 commented 5 months ago

Hi AT16,

No. NEBULA does not support multiple-level random effects. If the number of studies is not large, you could treat study as a fixed-effects variable using model.matrix(~X1+X2+X3, data=sample_data$pred)

Best regards, Liang

On Thu, May 30, 2024 at 9:34 PM AT16 @.***> wrote:

Hi, to follow up on the question about having multiple random effects (besides donor ID) in the model. Should the design matrix be coded as something like this: model.matrix(~X1+X2+(1|X3), data=sample_data$pred)? X3 will be a random covariate like a study ID. Thanks!

— Reply to this email directly, view it on GitHub https://github.com/lhe17/nebula/issues/43#issuecomment-2141087233, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGDISURMPVN4X6R7FCGJNUDZE7HQVAVCNFSM6AAAAABEAQLREWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBRGA4DOMRTGM . You are receiving this because you commented.Message ID: @.***>