ds.regmedint.Rd
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
)
a string character, the name of the data frame containing the relevant variables.
a character vector of length 1. Outcome variable name. It should be the time variable for survival outcomes.
a character vector of length 1. Treatment variable name.
a character vector of length 1. Mediator variable name.
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.
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.
a numeric vector of length 1. Reference level of treatment variable that is considered "untreated" or "unexposed".
a numeric vector of length 1.
a numeric vector of length 1. Mediator level at which controlled direct effect is evaluated at.
a numeric vector of the same length as cvar. Covariate vector at which conditional effects are evaluated at.
a character vector of length 1. Mediator regression type: "linear" or "logistic".
a character vector of length 1. Outcome regression type: "linear", "logistic", "loglinear", "poisson", "negbin", "survCox", "survAFT_exp", or "survAFT_weibull".
a logical vector of length 1. Default to TRUE. Whether to include a mediator-treatment interaction term in the outcome regression model.
a logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.
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.
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.
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
.
a summary table of the object of class 'multimed'.
The function ds.regmedint
is used for regression-based causal mediation
analysis as described in Valeri & VanderWeele 2013 and Valeri & VanderWeele 2015.