BS1125 / CMAverse

A suite of functions for reproducible causal mediation analyses
https://bs1125.github.io/CMAverse/
50 stars 12 forks source link

If estimate="imputation" is specified in cmest, should binary outcome not be rare? #43

Open Apprentice2 opened 1 year ago

Apprentice2 commented 1 year ago

I would like to perform a mediation analysis with a binary value of y, where y=1 is data for 2000 subjects and y=0 is data for 8000 subjects.

If I specify estimate="paramfunc" in the CMAverse cmest function, a warning message "When estimation is 'paramfunc' and yreg is 'logistic' or 'coxph', the outcome must be rare; ignore this warning if the outcome is rare" is displayed. Does this message mean that my data is not suitable for this condition because there is 20% y=1?

On the other hand, if I specify estimation = "imputation" and inference = "bootstrap", the above plan does not appear. Am I correct in assuming that under these conditions it is safe to apply my data where y=1 is not rare?

BS1125 commented 1 year ago

Yes, correct.

Apprentice2 commented 1 year ago

Thank you very much for your response, I thought that when regression-based-approach is applied to a binary outcome in mediation analysis, the outcome must be rare. If possible, I would appreciate it if you could provide me with papers that show that it is possible to estimate the effect for a binary outcome even if the outcome is not rare by specifying estimate="investment".

BS1125 commented 1 year ago

Hi, the imputation-based estimation is general, and the outcome is not required to be rare.

The parametric estimation requires rare outcomes to use yreg="logistic" because odds ratio approximates risk ratio only when the outcome is rare. To use the parametric estimation with binary outcomes that are not rare, set yreg="loglinear", i.e., a glm model with the log link is fitted for the outcome. Reference: https://psycnet.apa.org/fulltext/2013-03476-001.pdf

Apprentice2 commented 11 months ago

Sorry for the late reply Thank you for your response. I understand very well.

Apprentice2 commented 11 months ago

I am looking for "Imputation-based estimation does not require that binary outcome be rare." I am looking for literature showing that this is the case. If you know of any, I would appreciate it if you could point me to them.