This function is similar to R function regmedint from the regmedint package.

ds.regmedint(
  data = NULL,
  yvar = NULL,
  avar = NULL,
  mvar = NULL,
  cvar = NULL,
  eventvar = NULL,
  a0 = NULL,
  a1 = 1,
  m_cde = 1,
  c_cond = NULL,
  mreg = NULL,
  yreg = NULL,
  interaction = TRUE,
  casecontrol = FALSE,
  na_omit = FALSE,
  exponentiate = FALSE,
  datasources = NULL
)

Arguments

data

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

yvar

a character vector of length 1. Outcome variable name. It should be the time variable for survival outcomes.

avar

a character vector of length 1. Treatment variable name.

mvar

a character vector of length 1. Mediator variable name.

cvar

a character vector of length > 0. Covariate names. Use NULL if there is no covariate. However, this is a highly suspicious situation. Even if avar is randomized, mvar is not. Thus, there should usually be some confounder(s) to account for the common cause structure (confounding) between mvar and yvar.

eventvar

a character vector of length 1. Only required for survival outcome regression models. Note that the coding is 1 for event and 0 for censoring, following the R survival package convention.

a0

a numeric vector of length 1. Reference level of treatment variable that is considered "untreated" or "unexposed".

a1

a numeric vector of length 1.

m_cde

a numeric vector of length 1. Mediator level at which controlled direct effect is evaluated at.

c_cond

a numeric vector of the same length as cvar. Covariate vector at which conditional effects are evaluated at.

mreg

a character vector of length 1. Mediator regression type: "linear" or "logistic".

yreg

a character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".

interaction

a logical vector of length 1. Default to TRUE. Whether to include a mediator-treatment interaction term in the outcome regression model.

casecontrol

a logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.

na_omit

a logical vector of length 1. Default to FALSE. Whether to use na.omit() function in stats package to remove NAs in columns of interest before fitting the models.

exponentiate

a logical vector of length 1. Default to FALSE. Whether to exponentiate the estimates to measure the odds ratio incase of a logistic regression model.

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.

Value

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

Details

The function ds.regmedint is used for regression-based causal mediation analysis as described in Valeri & VanderWeele 2013 and Valeri & VanderWeele 2015.

Author

Demetris Avraam, for DataSHIELD Development Team