Fits a univariable Cox proportional hazards model, validates the proportional hazards assumption, formats coefficients with explicit reference levels, generates plain-language clinical interpretations, and gathers model fit metrics.
Arguments
- data
A data frame containing survival data and the candidate feature.
- outcome
Character string naming the Surv object or outcome column in
data(e.g.,"outcome"or"Surv(survival_time, status)").- feature
Character string naming the candidate predictor column in
data.- conf_level
Numeric confidence level (default: 0.95).
- ...
Additional arguments passed to
survival::coxph(e.g.,weights,ties).
Value
An object of class cbe_cox containing:
model: The fittedsurvival::coxphobject.zph: Thesurvival::cox.zphproportional hazards test object.zph_table: Formatted assumption test table.zph_violated: Logical indicating whether the assumption was violated (p < 0.05).zph_text: Automated sentence summarizing the assumption test.table: Clean coefficient table with explicit reference level rows for factors.interpretation: Plain-language automated interpretation of the hazard ratio(s).glance: One-row data frame of model goodness-of-fit metrics.feature: Feature name string.var_label: Human-readable variable label.is_numeric: Logical flag indicating whether predictor is continuous/numeric.
