I have conducted a basic mediation analysis using mediation::mediate. My treatment variable (X) is a binary variable with two groups. My mediator and outcome variables are continuous. I also have a random effect to account for repeated measures.
fm2 <- lme4::lmer(mediator ~ treatment + (1|subjectID), data = df)
fm2 <- lme4::lmer(outcome ~ treatment + mediator + (1|subjectID), data = df)
results <- mediation::mediate(fm2, fm3, treat = "treatment", mediator = "mediator")
summary(results)
The results seem to be what I would expect, but I notice that the ACME, ADE and proportion mediated are repeated and identical for both the control and treated group, and the 'average' is therefore just that same number.
Since the treatment variable only has two groups, are the values for each group just showing the effect of treated vs. control and control vs. treated? In which case identical values make sense and are fine? Or is there something I have missed?
All other examples I have seen online either have different values for control and treated groups, OR the summary output simply shows one line for each of ACME, ADE and prop. mediated, such as the image below.
I have tried various things, e.g. including 'control.value = "Control", treat.value = "Treatment", with no luck.
I have also tried to generate a reproducible example below, if needed, and the summary looks the same (the mediation effects are not significant, but my query is only regarding the format of the output).
outcome <- rnorm(98, mean = 10, sd = 2)
mediator <- rnorm(98, mean = 8, sd = 2)
treatment <- rep(c("Control", "Treated"), times = 49)
subjectID <- rep(1:49, times = 2)
df <- data.frame(treatment, mediator, outcome, subjectID)
fm2 <- lme4::lmer(mediator~treatment + (1|subjectID), data = df)
fm3 <- lme4::lmer(outcome~treatment + mediator + (1|subjectID), data = df)
results <- mediation::mediate(fm2, fm3, treat = "treatment", mediator = "mediator")
summary(results)
I'm just curious if I can safely interpret the output, or if the duplication means I may have missed something.
Thank you in advance! Appreciate the help.