Skip to contents

summary.mm is used to display the results of the mediation analyzes done with multimediate.

Usage

## S3 method for class 'mm'
summary(object, opt = "navg", logit = "all", ...)

Arguments

object

element of the class mm.

opt

a character string indicating the details of the analysis "navg" for the average causal effects for t=0,1 and "avg" for the average causal effects.

logit

a character string indicating, when the outcome is binary, the scale of the average causal effects. "effects" for average causal effects, " OR" average causal effects on OR scale, "logOR" average causal effects on logOR scale and "all" for all scale.

...

additional arguments affecting the summary produced

Value

table summarizing the causal analysis

Examples

# Load example data
data(data2)
data2$Treatment <- as.factor(data2$Treatment)
data2$C1 <- as.factor(data2$C1)
data2$C2 <- as.factor(data2$C2)
data2$C3 <- as.factor(data2$C3)
data2$M1 <- as.numeric(data2$M1)
data2$M2 <- as.numeric(data2$M2)
data2$M3 <- as.numeric(data2$M3)
data2$Outcome <- as.factor(data2$Outcome)

# Fit mediator models
M1reg <- lm(M1 ~ Treatment + C1, data = data2)
M2reg <- lm(M2 ~ Treatment + C2, data = data2)
M3reg <- lm(M3 ~ Treatment + C3, data = data2)

# Fit outcome model (binary outcome)
Yreg <- glm(Outcome ~ Treatment + M1 + M2 + M3 + C1 + C2 + C3, 
               data = data2, family = binomial("logit"))

# Perform multiple mediation analysis
med.analysis <- multimediate(
  lmodel.m = list(M1reg, M2reg, M3reg),
  correlated = TRUE,
  model.y = Yreg,
  treat = "Treatment",
  treat.value = 1,
  control.value = 0,
  J = 100,
  conf.level = 0.95
)

# Different summary options
summary(med.analysis, opt = "avg", logit = "effects")
summary(med.analysis, opt = "avg", logit = "OR")
summary(med.analysis, opt = "avg", logit = "all")