kosukeimai / mediation

R package mediation
58 stars 29 forks source link

Does medsens function support the sensitivity analysis of causal mediation analysis with multilevel data? #60

Open minhengw opened 1 year ago

minhengw commented 1 year ago

Hi, does medsens function support the sensitivity analysis of causal mediation analysis with multilevel data? Thank you so much!


Due to the essence of multilevel data, I use lmer function to obtain med.fit and out.fit. Then, use these two outputs as inputs of the mediate function to get med.out. Finally, I try to use medsens function to perform the sensitivity analysis.

However, I get the error message below:

Error in medsens(med.out, rho.by = 0.1, effect.type = "indirect", sims = 100) : mediate object fitted with non-supported model combinations

thx!

tingleyd commented 1 year ago

No.

On Tue, Aug 15, 2023 at 4:42 AM minhengw @.***> wrote:

Hi, does medsens function support the sensitivity analysis of causal mediation analysis with multilevel data? Thank you so much!

Due to the essence of multilevel data, I use lmer function to obtain med.fit and out.fit. Then, use these two outputs as inputs of the mediate function to get med.out. Finally, I try to use medsens function to perform the sensitivity analysis.

However, I get the error message below:

Error in medsens(med.out, rho.by = 0.1, effect.type = "indirect", sims = 100) : mediate object fitted with non-supported model combinations

thx!

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

-- Dustin Tingley Professor of Government Deputy Vice Provost for Advances in Learning Harvard University scholar.harvard.edu/dtingley vpal.harvard.edu Forthcoming book: https://www.uncertainfuturesbook.com/

Check out link.harvard.edu

minhengw commented 1 year ago

thanks!