You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm running some multilevel mediation analysis using brms and trying to use the mediation function from bayestestR to see the effect table. However, every time I run it gives me an error message. I think it's due to the fact the mediation function does not support more than one mediators?I have two mediators in the model:
f1 <- bf(outcome ~ lag_outcome + mediator_a + mediator_b + treatment_1 + treatment_2+control_vars + (1|group), family = "bernoulli")
How can I utilise the mediation function in this situation? I really like the output of the mediation function which mimics the easy-to-read output from the mediation package.
Thanks for your help.
The text was updated successfully, but these errors were encountered:
Hi,
I'm running some multilevel mediation analysis using brms and trying to use the mediation function from bayestestR to see the effect table. However, every time I run it gives me an error message. I think it's due to the fact the mediation function does not support more than one mediators?I have two mediators in the model:
f1 <- bf(outcome ~ lag_outcome + mediator_a + mediator_b + treatment_1 + treatment_2+control_vars + (1|group), family = "bernoulli")
f2 <- bf(mediator_a ~ lag_outcome + treatment_1 + treatment_2+control_vars + (1|group), family = "gaussian")
f3 <- bf(mediator_2 ~ lag_outcome + treatment_1 + treatment_2+control_vars + (1|group), family = "gaussian")
med_mod <- brm(f1 +
f2+
f3,
set_rescor(FALSE),
seed=1234,
data=df,
iter=5000,
warmup=2500,
control = list(adapt_delta = 0.99, max_treedepth=12),
chains = 2, cores = 2,
backend = "cmdstanr", threads = threading(2),
prior= c(set_prior("normal(0,10)", class = "b")))
How can I utilise the mediation function in this situation? I really like the output of the mediation function which mimics the easy-to-read output from the mediation package.
Thanks for your help.
The text was updated successfully, but these errors were encountered: