Standalone helper for choosing the reference (baseline) level of a factor before
passing it to [cox_single()] or [cox_multi()]. Wraps [stats::relevel()],
defaulting to the first level (matching the reference-row convention already used
by cox_single()/cox_multi()), and attaches a
"cbe_reference_level" attribute recording the chosen level.
Arguments
- x
A factor, or a vector coercible to one via
as.factor().- ref_level
Character string naming the level to use as reference. Defaults to the first level of
x(its current or natural ordering).
Details
cox_single() and cox_multi() are not rewired to require this
helper; it is an optional convenience for callers who want to choose the reference
level explicitly before fitting.
