R/02_regmedint_class_constructor.R
new_regmedint.Rd
This is not a user function and meant to be executed within the regmedint function after validatingthe arguments.
new_regmedint(
data,
yvar,
avar,
mvar,
cvar,
emm_ac_mreg,
emm_ac_yreg,
emm_mc_yreg,
eventvar,
a0,
a1,
m_cde,
c_cond,
yreg,
mreg,
interaction,
casecontrol
)
Data frame containing the following relevant variables.
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome.
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 are usually some confounder(s) to account for the common cause structure (confounding) between mvar
and yvar
.
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model.
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model.
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model.
An 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. The 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 levels at which natural direct and indirect effects are evaluated at.
A character vector of length 1. Outcome regression type: "linear"
, "logistic"
, "loglinear"
, "poisson"
, "negbin"
, "survCox"
, "survAFT_exp"
, or "survAFT_weibull"
.
A character vector of length 1. Mediator regression type: "linear"
or "logistic"
.
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE.
A logical vector of length 1. Default to FALSE. Whether data comes from a case-control study.
A regmedint object.