Using bootstrap to calculate the confidence intervals in the scenario of binary outcome and continuous mediator.
Mediate_binaY_contM_bootci(
data,
outcome = "Y",
mediator = "M",
exposure = "X",
covariateY = c("X1", "X2"),
covariateM = c("X1", "X2"),
x0 = 0,
x1 = 1,
cY = c(0, 0),
cM = c(0, 0),
R = 1000
)
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
The number of replications.
The 95