-
-
Notifications
You must be signed in to change notification settings - Fork 56
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mediation() "Proportion mediated" estimate should be bound to 0-100 #690
Comments
The proportion is computed as Here are two examples: 1. %mediated is about 200%set.seed(111)
x <- gl(2, 1000)
m <- as.numeric(x == 2) + rnorm(1000)
y <- - 0.5 * as.numeric(x == 2) + m + rnorm(1000)
df <- data.frame(x, m, y)
mm <- lm(m ~ x, df)
my <- lm(y ~ x + m, df)
mediation::mediate(mm, my,
treat = "x", mediator = "m") |>
parameters::model_parameters()
#> Parameter | Estimate | 95% CI | p
#> -----------------------------------------------------------
#> Indirect Effect (ACME) | 1.05 | [ 0.94, 1.15] | < .001
#> Direct Effect (ADE) | -0.55 | [-0.65, -0.45] | < .001
#> Total Effect | 0.50 | [ 0.37, 0.62] | < .001
#> Prop. Mediated | 2.09 | [ 1.75, 2.65] | < .001 2. %mediated is about -110%set.seed(111)
x <- gl(2, 1000)
m <- as.numeric(x == 2) + rnorm(1000)
y <- - as.numeric(x == 2) + 0.5 * m + rnorm(1000)
df <- data.frame(x, m, y)
mm <- lm(m ~ x, df)
my <- lm(y ~ x + m, df)
mediation::mediate(mm, my,
treat = "x", mediator = "m") |>
parameters::model_parameters()
#> Parameter | Estimate | 95% CI | p
#> -----------------------------------------------------------
#> Indirect Effect (ACME) | 0.55 | [ 0.48, 0.61] | < .001
#> Direct Effect (ADE) | -1.05 | [-1.15, -0.95] | < .001
#> Total Effect | -0.50 | [-0.60, -0.40] | < .001
#> Prop. Mediated | -1.10 | [-1.45, -0.84] | < .001
|
Maybe we should show some text that proportion mediated may not be meaningful in the case of suppression when the direct and indirect effect signs are opposite? |
Maybe - but also note that this can happen in the CIs when the level of uncertainty is high for any of the effects (in the example above the point est. for all effects has the same sign, but the CIs of the prop mediated are negative/above 100%). If we do add a note here, we should also add it to the output of |
I guess it depends on what you want to quantify. Perhaps would also make sense, as the proportion of the overall influence that is mediated. |
But that proportion isn't particularly meaningful. The question "How much of the effect of X can be explained by M?" really only makes sense if X and M have effects in the same direction. I'm not a fan of proportion mediated as a metric for mediation analysis—for this and other reasons, it is often much more misleading than informative. When I taught regression analysis, I specially advised my students not to use such a metric and instead to focus on the absolute magnitudes of direct and total effects. |
If the direct and indirect effect cancel out, isn't it sensible to say that 50% of the influence of A on C is direct, 50% indirect but due to their opposite direction the net effect is 0.
There is already a note. I may have missed it before. |
No, because the proportion is with respect to the ATE, not out of "total potential influence" (which would be interesting to see defined causally). |
It's not the most essential aspect of the output but as it is the estimate for proportion mediated can have nonsensical intervals:
The text was updated successfully, but these errors were encountered: