Add or remove a covariate term from an exposure-response TTE model
Source:R/ertte-scm.R
ertte_term.RdAdd or remove a single covariate term from an existing ertte model, returning a new fitted model object.
Value
An ertte model object. If the term can't be added/removed
(see quiet), the original mod is returned unchanged.
Details
These functions are not typically called directly; they
underpin ertte_scm_forward() and ertte_scm_backward(), used to
add or remove a single term from a time-to-event regression model.
mod is refit using the matching engine constructor based on its
class, so these functions work for both ertte_aft and ertte_coxph
models.
Regardless of whether the model is a parametric AFT model or a Cox
proportional hazard model, the term to be added or removed is
defined by a single one-sided formula. Categorical covariates enter
the model as factor levels, whereas continuous covariates enter as
linear terms by default. However, for a power-function parameterisation
(theta such that T ~ (x /ref)^theta on the AFT time scale, or
h(t|x) ~ h0(t) * (x / ref)^theta on the Cox hazard scale), the
covariate can be wrapped in ertte_power(), e.g. ~ ertte_power(age).