View source: R/Cox_estimation_helpers.R
| build_cox_formula | R Documentation |
Constructs a Cox model formula from variable names, optionally adjusted for additional covariates.
build_cox_formula(
outcome.name,
event.name,
treat.name,
adjust_covariates = NULL
)
outcome.name |
Character. Name of outcome variable. |
event.name |
Character. Name of event indicator variable. |
treat.name |
Character. Name of treatment variable. |
adjust_covariates |
This option is implemented but has not been
tested against the manuscript analyses or the simulation studies of
León and Anderson (2026a, 2026b), which use the unadjusted
treatment-only fits.
Character vector or |
An R formula object for Cox regression. When adjust_covariates
is supplied, the treatment term is always placed first on the
right-hand side.
build_cox_formula("time_months", "event", "treat")
build_cox_formula("time_months", "event", "treat",
adjust_covariates = c("strata(site)", "age"))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.