validate_args {regmedint} | R Documentation |
Validate arguments to regmedint before passing to other functions
Description
Internal functions (usually) do not validate arguments, thus, we need to make sure informative errors are raised when the arguments are not safe for subsequent computation.
Usage
validate_args(
data,
yvar,
avar,
mvar,
cvar,
emm_ac_mreg,
emm_ac_yreg,
emm_mc_yreg,
eventvar,
a0,
a1,
m_cde,
c_cond,
mreg,
yreg,
interaction,
casecontrol
)
Arguments
data |
Data frame containing the following relevant variables. |
yvar |
A character vector of length 1. Outcome variable name. It should be the time variable for the survival outcome. |
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 |
emm_ac_mreg |
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the mediator model. |
emm_ac_yreg |
A character vector of length > 0. Effect modifiers names. The covariate vector in treatment-covariate product term in the outcome model. |
emm_mc_yreg |
A character vector of length > 0. Effect modifiers names. The covariate vector in mediator-covariate product term in outcome model. |
eventvar |
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. |
a0 |
A numeric vector of length 1. The 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 |
mreg |
A character vector of length 1. Mediator regression type: |
yreg |
A character vector of length 1. Outcome regression type: |
interaction |
A logical vector of length 1. The presence of treatment-mediator interaction in the outcome model. Default to TRUE. |
casecontrol |
A logical vector of length 1. Default to FALSE. Whether data comes from a case-control study. |
Value
No return value, called for side effects.