1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
//! **Survival / time-to-event** diagnostics — a framework apart from the
//! regression models elsewhere in the crate, because the response is a
//! (possibly right-censored) time and the likelihood is built around risk sets
//! rather than residual variance.
//!
//! * [`CoxFit`] — the **Cox proportional-hazards** model
//! `h(t) = h₀(t)·exp(xᵀβ)`, fit by maximizing the partial likelihood (Efron or
//! [`Breslow`](Ties::Breslow) ties). Gives log hazard ratios with Wald
//! `z`-statistics, the Breslow baseline cumulative hazard, and Harrell's
//! concordance index.
//! * [`KaplanMeier`] — the non-parametric **product-limit** survivor-function
//! estimator with Greenwood standard errors and median survival.
//! * Residuals — [`martingale_residuals`], [`deviance_residuals`] (outlier
//! detection) and [`schoenfeld_residuals`] (the proportional-hazards
//! assumption check).
//!
//! # Data convention
//!
//! Each observation is a `(time, event)` pair — `time > 0` and `event` is `1.0`
//! for an observed event or `0.0` for right-censoring — plus a covariate row.
//! The Cox design **must not** include an intercept column: the baseline hazard
//! absorbs it, and a constant column is rejected.
//!
//! # Anchors
//!
//! At the MLE the Cox score vanishes, so martingale residuals and each
//! covariate's Schoenfeld residuals sum to zero; the concordance index lies in
//! `[0, 1]`; and the Kaplan–Meier steps reproduce the product-limit values by
//! hand (see `tests/survival.rs`).
pub use ;
pub use ;
pub use ;
pub use ;