
Cox model with time-varying COEFFICIENTS
Source:R/survival_extra_native.R
morie_cox_time_varying.RdSplits follow-up at event-time quantiles and fits a separate coefficient in each interval, with a likelihood-ratio test against the constant-coefficient fit.
Value
list with beta (intervals x p), se, z,
p_value, cutpoints, events_per_interval,
constant_beta, lr_vs_constant, p_vs_constant.
Details
This is the time-varying COEFFICIENT, not the time-varying covariate
– the covariate is fixed and its effect is allowed to change. It is
the direct fix when morie_cox_schoenfeld_residuals shows
proportional hazards failing.
Late intervals routinely hold very few events, and a hazard ratio
estimated from three of them is not informative however clean it
looks. Read events_per_interval first.