Mediation analysis function for binary outcome and continuous mediator
mediate_binaY_contM(
data,
outcome = "Y",
mediator = "M",
exposure = "X",
covariateY = c("X1", "X2", "X3", "X4", "X5", "X6", "X7", "X8"),
covariateM = c("X1", "X2", "X3", "X4", "X5", "X6", "X7"),
x0 = 0,
x1 = 1,
cY = c(0, 0),
cM = c(0, 0)
)
A dataset.
The outcome variable.
The mediator variable.
The exposure variable.
A vector of confounders in the outcome regression.
A vector of confounders in the mediator regression.
The baseline exposure level.
The new exposure level.
conditional levels of covariateY
conditional levels of covariateM
A list containing NIE, NDE and MP point and interval estimates.