ds.multimed: Estimation and Sensitivity Analysis for Multiple Causal...

View source: R/ds.multimed.R

ds.multimedR Documentation

Estimation and Sensitivity Analysis for Multiple Causal Mechanisms

Description

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

Usage

ds.multimed(
  outcome = NULL,
  med.main = NULL,
  med.alt = NULL,
  treat = NULL,
  covariates = NULL,
  data = NULL,
  sims = 1000,
  conf.level = 0.95,
  seed = NULL,
  datasources = NULL
)

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

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

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.

datasources

a list of DSConnection-class objects obtained after login. If the datasources argument is not specified the default set of connections will be used: see datashield.connections_default.

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.

Value

a summary table of the object of class 'multimed'.

Author(s)

Demetris Avraam, for DataSHIELD Development Team


datashield/dsMediationClient documentation built on June 15, 2022, 12:19 p.m.