This function is similar to R function multimed from the mediation package.

multimedDS(
  outcome,
  med.main,
  med.alt.transmit,
  treat,
  covariates.transmit,
  data,
  sims = 1000,
  conf.level,
  seed
)

Arguments

outcome

a string character, the name of the outcome variable in 'data'.

med.main

a string character, the name of the mediator of interest. Under the parallel design this is the only mediator variable used in the estimation.

med.alt.transmit

vector of character strings indicating the names of the post-treatment confounders, i.e., the alternative mediators affecting both the main mediator and outcome.

treat

a string character, the name of the treatment variable in 'data'.

covariates.transmit

vector of character strings representing the names of the pre-treatment covariates.

data

a string character, the name of data frame containing all the above variables.

sims

a number of bootstrap samples used for the calculation of confidence intervals.

conf.level

level to be used for confidence intervals.

seed

a number of a seed random number generator. Default value is NULL.

Value

a summary table of the object of class 'multimed'

Details

The function 'multimed' is used for causal mediation analysis when post-treatment mediator-outcome confounders, or alternative mediators causally preceding the mediator of interest, exist in the hypothesized causal mechanisms. It estimates the average causal mediation effects (indirect effects) and the average direct effects under the homogeneous interaction assumption based on a varying-coefficient linear structural equation model. The function also performs sensitivity analysis with respect to the violation of the homogenous interaction assumption. The function can be used for the single experiment design.

Author

Demetris Avraam, for DataSHIELD Development Team