Pairs a univariable [cox_single()] Cox proportional hazards fit with the matching Kaplan-Meier stratified survival curve for the same predictor, so both are produced from a single call without refitting the Cox model twice.
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. Factor (or coercible) predictors are used directly as Kaplan-Meier strata; numeric predictors are binned into quartiles for the Kaplan-Meier strata (matching [plot_cox_survival()]'s convention), while the Cox side treats them as continuous.- conf_level
Numeric confidence level (default: 0.95).
Value
An object of class cbe_km containing:
cox: Thecbe_coxobject from [cox_single()].km_fit: Thesurvival::survfitobject for the Kaplan-Meier curve.km_tidy:broom::tidy()table ofkm_fit.direction:"increases"or"decreases", pulled from the Cox hazard ratio direction.summary: One-row-per-stratum tidy summary combining Cox hazard ratios and Kaplan-Meier median survival.feature: Feature name string.var_label: Human-readable variable label.
