mediateDS: Causal Mediation Analysis

View source: R/mediateDS.R

mediateDSR Documentation

Causal Mediation Analysis

Description

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

Usage

mediateDS(
  model.m,
  model.y,
  treat,
  mediator,
  boot,
  conf.level,
  robustSE,
  sims,
  seed,
  newobj
)

Arguments

model.m

a string character, the name of a fitted model object for mediator.

model.y

a string character, the name of a fitted model object for outcome.

treat

a character string indicating the name of the treatment variable used in the models. The treatment can be either binary (integer or a two-valued factor) or continuous (numeric).

mediator

a character string indicating the name of the mediator variable used in the models.

boot

a logical value. if 'FALSE' a quasi-Bayesian approximation is used for confidence intervals; if 'TRUE' nonparametric bootstrap will be used. Default is 'FALSE'.

conf.level

the level of the returned two-sided confidence intervals.

robustSE

a logical value. If 'TRUE', heteroskedasticity-consistent standard errors will be used in quasi-Bayesian simulations. Ignored if 'boot' is 'TRUE' or neither 'model.m' nor 'model.y' has a method for vcovHC in the sandwich package. Default is 'FALSE'.

sims

a number of Monte Carlo draws for nonparametric bootstrap or quasi-Bayesian approximation.

seed

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

newobj

a character string that provides the name for the output object that is stored on the data servers. Default med.out.

Details

The function 'mediate' is used to estimate various quantities for causal mediation analysis, including average causal mediation effects (indirect effect), average direct effects, proportions mediated, and total effect.

Value

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

Author(s)

Demetris Avraam, for DataSHIELD Development Team


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