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 am performing a mediation analysis with mixed models in the presence of a (potential) treatment * mediator interaction. I would like to test if this interaction is significant. Is there anything wrong with using the same logic in this code to preform this test? My model.m and model.y that I provide to the mediate function are both lmer objects, and test.TMint says that it is not implemented for these models quite yet.
So my question is, is there anything theoretically wrong with this:
mod.m <- lmer(M ~ X + (1|id), data = data)
mod.y <- lmer(Y ~ M * X + (1|id), data = data)
mediation/R/medtests.R
Lines 78 to 84 in a9a5c7b
Hello,
I am performing a mediation analysis with mixed models in the presence of a (potential) treatment * mediator interaction. I would like to test if this interaction is significant. Is there anything wrong with using the same logic in this code to preform this test? My model.m and model.y that I provide to the mediate function are both lmer objects, and test.TMint says that it is not implemented for these models quite yet.
So my question is, is there anything theoretically wrong with this:
mod.m <- lmer(M ~ X + (1|id), data = data)
mod.y <- lmer(Y ~ M * X + (1|id), data = data)
med.results <- mediate(mod.m, mod.y, mediator = "M", treat = "X" )
acme_diff = med.results$d1.sims - med.results$d0.sims
quantile(acme_diff, probs = c(0.025, 0.975))
The text was updated successfully, but these errors were encountered: