Glossary
Terms used throughout the Greenwood documentation, listed alphabetically. Where a term has a direct counterpart in Greenwood’s API, the relevant class or function is noted.
- Accelerated failure time (AFT)
- A parametric regression model for survival data that represents the log of the event time as a linear function of covariates. Covariates “accelerate” or “decelerate” time to the event rather than scaling the hazard. The coefficient e^\beta is an acceleration factor. Greenwood provides AFT with Weibull, exponential, log-normal, and log-logistic distributions via AFT, including an optional threshold (location) parameter fit by ordinary maximum likelihood or maximum product of spacings.
- Aalen-Johansen estimator
-
A non-parametric estimator of the cumulative incidence function (CIF) in a competing-risks setting. It generalizes Kaplan-Meier to multiple event types by accumulating cause-specific hazard increments weighted by the overall survival probability. The sum of CIFs across all causes plus the censoring probability equals 1 at every time point. Available via AalenJohansen.
The estimator is sometimes called the Kalbfleisch-Prentice estimator after Kalbfleisch and Prentice (1980), who derived the same product-limit CIF formula from first principles. Both names refer to an identical computation: \hat{F}_j(t) = \sum_{s \le t} \hat{S}(s^-)\,
d_j(s)/n(s), where \hat{S} is the overall Kaplan-Meier survival treating any event type as an event. Software such as SAS
PROC LIFETESTuses the Kalbfleisch-Prentice label for what Greenwood exposes as AalenJohansen. - Aalen additive hazards model
-
An alternative to Cox regression that models the hazard itself as a linear combination of time-varying covariate effects: h(t \mid x) = \beta_0(t) + \sum_{j=1}^{p} \beta_j(t)\,x_j. Unlike the Cox model, which assumes proportional hazards (constant log-hazard ratios), the Aalen model lets each covariate’s effect vary freely over time. Estimation proceeds by ordinary least squares at each event time, producing cumulative coefficient functions \hat{B}(t) that can be plotted to visualize how effects evolve. The trade-off is higher variance (especially in the tail where risk sets are small) and no single summary coefficient per covariate. Available via
AalenAdditive. - At-risk / risk set
- The set of subjects who are still under observation and have not yet experienced an event or been censored just before a given time t. The size of the risk set, n(t), is the denominator in most survival estimators. See also event table.
- Bagging (bootstrap aggregation)
- An ensemble technique that trains each base learner on a bootstrap resample of the data (rows sampled with replacement) and averages their predictions. Averaging many decorrelated learners reduces variance without adding bias. It is the mechanism behind Greenwood’s random survival forest: each tree sees a different bootstrap sample, and the rows left out of a tree’s sample form its out-of-bag set.
- Baseline hazard
- The hazard function h_0(t) for a subject whose covariates are all zero (or at their reference level) in a Cox model. It is left unspecified by the Cox partial likelihood and estimated non-parametrically from the data. In Greenwood, CoxPH.baseline_hazard() returns the Breslow estimator of the cumulative baseline hazard.
- Breslow estimator
-
“Breslow” refers to two related but distinct quantities in Cox regression, both introduced by Norman Breslow.
The first is the cumulative baseline hazard estimator: a non-parametric step function that estimates H_0(t) from a fitted Cox model. At each event time t_i it increments by d_i / \sum_{j \in R(t_i)} \exp(x_j^\top \hat\beta), where d_i is the number of events and the denominator is the sum of risk scores over the risk set. The baseline survival S_0(t) = \exp(-H_0(t)) follows directly. This estimator underlies CoxPH.baseline_hazard() in Greenwood regardless of which tie method is used.
The second is the Breslow tie approximation for the Cox partial likelihood: when multiple subjects share the same event time, the partial likelihood treats the risk set as unchanged across all tied events (i.e., the denominator is computed once using the full risk set). This is computationally simple but can be noticeably biased when the fraction of tied event times is large. The Efron approximation is more accurate in those situations and is preferred in practice (see tied event times for a comparison). In Greenwood,
ties="breslow"selects the Breslow approximation andties="efron"(the default) selects the Efron approximation. - Brier score
- A proper scoring rule that measures the mean squared difference between predicted survival probabilities and observed binary outcomes at a single time horizon. In the censored setting, observations are reweighted by the inverse probability of censoring (IPCW) to account for unobserved event times. Lower is better, and a naive constant-survival model gives an upper benchmark. Available via brier_score().
- BCa bootstrap (bias-corrected and accelerated bootstrap)
-
A bootstrap confidence interval method that applies two corrections to the percentile bootstrap to account for bias and skewness in the bootstrap distribution. The bias-correction factor \hat{z}_0 shifts the percentile selection based on the fraction of bootstrap replicates that fall below the observed statistic. The acceleration \hat{a} adjusts for how quickly the standard error changes with the parameter value, estimated via jackknife. BCa intervals achieve better coverage than the percentile bootstrap (raw empirical quantiles) or the normal bootstrap (bootstrap standard error with a normal approximation) when the estimator’s sampling distribution is skewed or asymmetric. In Greenwood, bootstrap() supports
method="bca"(default),method="percentile", andmethod="normal". - B-spline basis
-
A flexible basis function set for smooth curve fitting, defined by piecewise polynomials joined at knot locations with continuity constraints up to a chosen order. Unlike a restricted cubic spline, a B-spline is not constrained to be linear beyond the boundary knots, which makes it well suited to a diagnostic role where extrapolation is not required. In Greenwood, CoxPH.smooth_hr() uses a B-spline basis (built with
scipy.interpolate.BSpline) to fit a flexible, non-linear log-hazard-ratio curve for one covariate, in contrast to the restricted cubic spline basis that RoystonParmar uses to model the baseline log cumulative hazard. Thedf=argument controls the number of basis functions and therefore how wiggly the fitted curve can be. - Buckley-James estimator
-
A rank-based, semiparametric alternative to accelerated failure time regression that fits \log(T) = X\beta + \varepsilon without assuming a distribution for \varepsilon (Buckley & James, 1979). It alternates two steps until \beta stabilizes: censored log-times are imputed by their conditional mean under the Kaplan-Meier estimate of the current residual distribution (the same self-consistent redistribution principle behind Kaplan-Meier itself), then \beta is refit by ordinary least squares on the imputed values. With no censoring, every residual is exact and the algorithm converges in one step to plain least squares. Largely superseded in practice by the maximum-likelihood AFT, which is more efficient under a correct distributional assumption and has closed-form standard errors; Buckley-James has none, so standard errors are available in Greenwood only via bootstrap resampling (
n_boot=). Available via BuckleyJames. - C-statistic
- See concordance index.
- Calibration
- A measure of how closely a model’s predicted survival probabilities match observed outcomes. Subjects are binned by their predicted survival probability at a fixed time horizon, and the mean prediction in each bin is compared against the Kaplan-Meier estimate for that bin’s subjects. A well-calibrated model has points near the diagonal on a predicted-vs-observed plot. Good discrimination (high concordance index) does not guarantee good calibration: a model can rank subjects correctly but still overestimate or underestimate absolute probabilities. Available via calibration().
- Complementary log-log (cloglog) transform
-
The transformation g(S) = \log(-\log(S(t))) applied to survival probabilities. On a plot of \log(-\log(S(t))) vs \log(t), data from a Weibull distribution fall on a straight line with slope equal to the Weibull shape parameter. This is the basis of the Weibull plot, where departures from linearity indicate the Weibull assumption does not hold. For stratified data, parallel lines on the cloglog scale indicate the proportional hazards assumption holds between groups. In Greenwood,
plot_weibull()uses this transform by default (dist="weibull"). - Cause-specific hazard
- The instantaneous rate at which subjects experience a specific cause of failure, conditioning on not having experienced any cause yet: h_k(t) = \lim_{\delta \to 0} P(t \le T < t + \delta,\, \text{cause} = k \mid T \ge t) / \delta. When competing events are present, a subject who experiences a competing cause is removed from the risk set and their time is treated as censored for the cause of interest. This produces unbiased hazard estimates but does not correspond directly to the cumulative probability of each cause: summing one-minus-Kaplan-Meier estimates across causes overestimates the total probability of failure. Contrast with the subdistribution hazard underlying the Fine-Gray model, which preserves a direct link to the cumulative incidence function by keeping competing-event subjects in the risk set.
- Censoring
- The situation in which the exact event time is not observed for a subject. Censoring is the defining feature of survival data. Standard regression methods that ignore it are biased. Greenwood supports four censoring types: right censoring, left censoring, interval censoring, and the counting-process form for left truncation and time-varying covariates.
- Censoring distribution
-
The probability of remaining uncensored up to time t: \hat{G}(t) = P(\text{not censored
by time } t), estimated by applying the Kaplan-Meier estimator to the censoring process (where censoring is treated as the “event” and true events are treated as censoring). The censoring distribution is the foundation of all IPCW methods: the IPC weight for subject i is w_i = 1 / \hat{G}(t_i^-), which reweights observed subjects to represent the full population. Subjects at times with heavy censoring receive larger weights, correcting for information lost to censoring. Available via
CensoringDistribution. - Complete-case analysis
-
The default missing-data strategy in Greenwood’s regression models: any row with a missing value in the response, a covariate, or an auxiliary column such as
strata=,cluster=, orfrailty_cluster=is dropped before fitting, and the remaining complete rows are analyzed as if they were the whole sample. This mirrors the behavior of R’s modeling functions. Complete-case analysis is simple and unbiased when values are missing completely at random, but it discards information and can bias estimates when missingness depends on the outcome or on unobserved covariates. CoxPH.fit(), AFT.fit(), and related methods all apply complete-case analysis silently. Inspect your data for missingness patterns before fitting if this is a concern. - Concordance index (C-statistic, Harrell’s C)
- A measure of a model’s ability to rank subjects by their event times. It is the proportion of all comparable pairs of subjects (one who had an event before the other) for which the model assigns a higher risk score to the subject who had the event first. A value of 0.5 corresponds to random ranking, whereas 1.0 is perfect discrimination. Available via concordance_index(). An IPCW variant (concordance_index_ipcw()) corrects for censoring bias and is more robust when censoring is heavy or differs across risk groups.
- Competing risks
- A study setting in which subjects can experience one of several mutually exclusive events. Experiencing one event precludes the others from occurring. Standard Kaplan-Meier applied to a single cause in the presence of competing risks overestimates the cause-specific probability. The correct quantity is the cumulative incidence function, estimated by AalenJohansen and used as the basis for FineGray regression.
- Conditional survival
-
The probability of surviving beyond time t given that a subject has already survived to a landmark time c: P(T > t \mid T > c) = S(t) / S(c) for t > c. Conditional survival is useful in landmark analyses, where subjects are only evaluated if they are event-free at a fixed point after study entry. In Greenwood,
CoxPH.predict(type="survival", conditional_after=c)computes conditional survival curves. - Counting-process form
-
A representation of survival data as a set of intervals (s_i, t_i] with an event indicator at t_i. It is the natural way to encode left truncation (late entry: s_i >
0) and time-varying covariates (a subject contributes multiple rows with s_i = end of previous interval). Built with
Surv.counting(start, stop, event). - Covariate
-
A measured characteristic of a subject (also called a predictor, feature, or independent variable) used to explain or predict variation in survival outcomes. In a regression model such as CoxPH or AFT, each covariate has an associated coefficient \beta_j whose exponentiated value e^{\beta_j} is the hazard ratio (or acceleration factor in AFT) for a one-unit increase in that variable. Covariates are passed as the
Xargument tomodel.fit(y, X). Covariates are distinct from strata. A covariate enters the model parametrically: its effect is summarized by a single estimated coefficient that applies uniformly across all subjects, and the model assumes that effect is constant over time (the proportional hazards assumption). A stratification variable, by contrast, is handled non-parametrically: a completely separate baseline hazard is estimated for each stratum, allowing the hazard shape to differ freely between groups. The practical consequence is that stratification absorbs a variable’s effect rather than quantifying it (you get no coefficient or hazard ratio for a stratification variable). Use stratification when a variable’s time-varying effect violates proportional hazards and you do not need to estimate its magnitude. Use a covariate when you want an interpretable effect estimate. See also stratification. - Cox proportional hazards model
- A semi-parametric regression model that expresses the hazard as h(t \mid x) = h_0(t) \exp(\beta^\top x), where h_0(t) is an unspecified baseline hazard and \exp(\beta_j) is the hazard ratio for covariate j. Coefficients are estimated by maximizing the partial likelihood, which eliminates h_0(t). Available via CoxPH. See also proportional hazards assumption.
- Cox-Snell residuals
-
Residuals defined as the estimated cumulative hazard at each subject’s observed time: r_i^{CS} = -\log \hat{S}(t_i), where \hat{S}(t_i) is the model’s fitted survival probability for subject i. If the model is correctly specified, Cox-Snell residuals follow a unit-exponential distribution for uncensored observations, so a plot of their Nelson-Aalen cumulative hazard against a 45-degree line is a visual goodness-of-fit check. They are also the building block for martingale residuals: M_i = \delta_i - r_i^{CS}. In the accelerated failure time model, the Cox-Snell residual is computed from the standardized residual z_i = (\log t_i - \mathbf{x}_i^\top\hat\gamma) / \hat\sigma via the fitted distribution’s survival function. Available from AFT via
residuals(type="cox_snell"). - CoxNet
- A penalized Cox proportional hazards model that adds an elastic-net penalty (\alpha \|\beta\|_1 + (1-\alpha)\|\beta\|_2^2) to the partial likelihood. Setting \alpha = 1 gives lasso (automatic variable selection through coefficient shrinkage to zero). Using \alpha = 0 gives ridge (shrinks all coefficients without dropping them). Useful when the number of covariates is large relative to the number of events. Available via CoxNet.
- Cross-validation (k-fold)
- A resampling procedure for estimating model performance or selecting hyperparameters. The data are partitioned into k roughly equal-sized folds while the model is trained on k - 1 folds and evaluated on the held-out fold, rotating through all k folds so every observation is used for evaluation exactly once. The k evaluation scores are then averaged to give a single performance estimate. In survival analysis, stratified k-fold splits preserve the event rate across folds so that no fold is dominated by censored observations. In Greenwood, cv_coxnet() uses k-fold cross-validation to select the optimal penalizer for CoxNet by maximising concordance or minimising the integrated Brier score. The general-purpose cross_validate() evaluates any survival model with user-specified scoring functions and fold counts.
- Cumulative hazard function
- The integral of the hazard function over time: H(t) = \int_0^t h(u)\,du. It is related to the survival function by S(t) = \exp(-H(t)). The Nelson-Aalen estimator targets H(t) directly, while the Kaplan-Meier estimator targets S(t).
- Cumulative incidence function (CIF)
- The probability of experiencing a specific cause of failure by time t, accounting for competing causes: F_k(t) = P(T \le t,\, \text{cause} = k). Unlike the naive one-minus-Kaplan-Meier approach, the CIF is not biased by competing events. Estimated non-parametrically by AalenJohansen and modeled by FineGray.
- Delta method
-
A general technique for approximating the variance of a function of an estimated quantity. If \hat\theta is an estimator with variance V and g is a differentiable transformation, the delta method gives \text{Var}(g(\hat\theta)) \approx [g'(\hat\theta)]^2 V. In survival analysis it is used to derive confidence intervals for quantities such as exponentiated Cox coefficients (hazard ratios), cumulative incidence functions, and survival probabilities at specific time points. The multivariate form, \text{Var}(g(\hat\theta)) \approx \nabla g(\hat\theta)^\top V\, \nabla g(\hat\theta), handles vector-valued parameters. Greenwood applies the delta method throughout
_metrics.pyand_competing.pyto propagate uncertainty from model parameters to derived quantities. - Deviance residuals
-
Signed square roots of the subject-level contribution to the log-likelihood ratio statistic, obtained by transforming the martingale residuals M_i as D_i = \text{sign}(M_i)\sqrt{-2[M_i + \delta_i \log(\delta_i - M_i)]}, where \delta_i is the event indicator. Deviance residuals are more symmetric around zero than martingale residuals, making them easier to use for identifying outliers: large positive values correspond to subjects who experienced the event much sooner than the model predicted, and large negative values to subjects who lived much longer than expected. In the accelerated failure time model, deviance residuals use a likelihood-ratio formula: the signed square root of twice the difference between the log-density at the saturated value and at the fitted standardized residual. Available from CoxPH and AFT via
residuals(type="deviance"). - dfbeta residuals
-
Approximate influence statistics that measure how much each subject’s data changes each estimated coefficient. The dfbeta for subject i and coefficient j is the difference between \hat{\beta}_j fitted on the full data and \hat{\beta}_j fitted with subject i removed, approximated without refitting the model. In the Cox model, dfbeta residuals are derived from the score (gradient) residuals and the observed information matrix. They are useful for identifying subjects who have disproportionate influence on a specific coefficient. Available from CoxPH and AFT via
residuals(type="dfbeta"). - dfbetas residuals
-
The standardized form of dfbeta residuals, obtained by dividing each dfbeta value by the corresponding coefficient’s model-based standard error. Because dfbeta is on the raw coefficient scale, comparing its magnitude across covariates with different units or variances is not meaningful. Dividing by the standard error puts every covariate’s influence values on a common, unit-free scale, making it possible to rank observations by influence across the whole coefficient vector at once. Available from CoxPH and AFT via
residuals(type="dfbetas"). - Endpoint
-
The specific outcome a study is designed to measure, defined in advance as the criterion for declaring that an event has occurred. A study may have a single primary endpoint (e.g., all-cause death) or multiple endpoints (e.g., recurrence and death analyzed separately or as competing events). Choosing the endpoint determines which column or combination of columns in the data encodes the event indicator and which time column to use. In multi-endpoint datasets such as
colon(recurrence vs. death, stored in separate rows viaetype) andmgus2(progression vs. death, stored in separate column pairs), each endpoint must be extracted and analyzed independently before passing to Surv. - Event
- The outcome of interest in a survival study: death, disease progression, machine failure, customer churn, or any other well-defined, non-repeating endpoint. An observation for which the event occurred within the follow-up period is called an event observation. One for which it did not (or could not be confirmed) is censored.
- Event table
- A tabulation that, at each distinct event time, records the number of subjects at risk (n_\text{risk}), the number of events (n_\text{event}), and the number of censorings (n_\text{censor}). It is the common foundation for Kaplan-Meier, the log-rank test, and Cox regression. Available via event_table().
- Episode splitting
- The data-transformation step that converts a dataset with one row per subject and time-varying covariate measurements into the counting-process form required by Cox regression. Each subject’s follow-up is divided into a series of intervals delimited by the times at which any covariate changes value, producing one row per interval with constant covariate values and the event indicator set to 1 only on the final row if the subject had an event. When multiple covariates change at different times, the split points are the union of all change times for that subject. In Greenwood, split_episodes() automates episode splitting from a long-format measurement table to a ready-to-fit counting-process dataset.
- ECOG performance status
-
A five-point ordinal scale (0 through 4) developed by the Eastern Cooperative Oncology Group to grade how much a disease limits a patient’s daily activity, ranging from 0 (fully active) to 4 (completely disabled). It is one of the most common covariates in oncology survival studies because it is a strong, simply measured predictor of prognosis. The bundled
lungdataset records it in theph.ecogcolumn (with a small number of missing values), and it is genuinely ordinal, unlike a nominal classification such as histological cell type, which makes it a natural choice for the trend test as well as an ordinary covariate in CoxPH or AFT. - Effective degrees of freedom
- A measure of model complexity for a penalized regression model, used in place of the raw covariate count when computing information criteria. For a pure lasso fit the effective degrees of freedom equals the number of non-zero coefficients, since each surviving coefficient is estimated essentially unpenalized. For ridge or elastic-net fits, where every coefficient is shrunk continuously rather than set to zero, it is instead the trace of the ridge hat matrix, a fractional value between 0 and the number of covariates that reflects how much shrinkage has been applied. Available from CoxNet via effective_df().
- Efron approximation
-
A method for handling tied event times in the Cox partial likelihood. When multiple subjects have the same event time, the exact partial likelihood requires summing over all possible orderings, which is computationally infeasible for large ties. The Efron approximation averages the risk-set contributions over the tied events, producing a correction that is close to the exact result and substantially more accurate than the simpler Breslow approximation when ties are frequent. It is the default in R’s
coxph()and in Greenwood’s CoxPH (ties="efron"). - Elastic-net penalty
-
A regularization penalty that blends lasso (L1) and ridge (L2) penalties: \lambda[\alpha \|\beta\|_1 + (1 - \alpha)\|\beta\|_2^2], where \lambda is the overall regularization strength (the penalizer) and \alpha (the
l1_ratio) is the mixing parameter. Setting \alpha = 1 gives pure lasso while \alpha = 0 gives pure ridge. Values strictly between 0 and 1 blend both penalties: lasso’s sparsity (some coefficients are driven exactly to zero) is combined with ridge’s stability when predictors are correlated. The elastic-net is the penalty used by Greenwood’s CoxNet, withl1_ratio=1.0(lasso) as the default. - Ensemble mortality
-
The scalar risk score produced by Greenwood’s tree ensembles, defined (following Ishwaran et al.) as the sum of a subject’s predicted cumulative hazard over the training event times. Larger values mean higher risk, so it can be passed straight to concordance_index(). It is what
predict(type="risk")returns for SurvivalTree, RandomSurvivalForest, and ExtraSurvivalTrees. - Extremely randomized survival trees (extra trees)
-
A variant of the random survival forest that, in addition to sampling covariates at each split, draws the split threshold at random rather than optimizing it. The extra randomness further decorrelates the trees, often lowering variance and speeding up fitting at the cost of a little bias. Available via ExtraSurvivalTrees, which grows trees on the full sample by default (set
bootstrap=Truefor out-of-bag scoring). - Fine-Gray model
- A regression model for competing-risks data based on the subdistribution hazard of a specific cause. It models how covariates affect the cumulative incidence function directly, rather than the cause-specific hazard. Implemented in Greenwood as FineGray, which accepts a multi-state Surv response and a target cause.
- FISTA (Fast Iterative Shrinkage-Thresholding Algorithm)
-
A proximal gradient optimization algorithm used to minimize composite objectives of the form f(\beta) + g(\beta), where f is a smooth, differentiable loss (such as the negative Cox partial likelihood) and g is a convex but non-smooth penalty (such as the lasso L1 term). FISTA extends basic proximal gradient descent with a Nesterov-style momentum correction that accelerates convergence from O(1/k) to O(1/k^2) in the objective value, where k is the iteration count. In Greenwood, FISTA is the solver underlying CoxNet and
max_iter=andtol=control the iteration limit and convergence tolerance for each inner fit during cross-validation and the final model. - Fleming-Harrington test
-
A family of weighted log-rank tests parameterized by (\rho, \gamma) that apply time-varying weights W(t) = \hat{S}(t^-)^\rho (1 - \hat{S}(t^-))^\gamma to each event time. Setting \rho = 0, \gamma = 0 gives the standard log-rank test whereas \rho = 1, \gamma = 0 gives the Peto-Peto test, which emphasizes early differences. Available via logrank_test() with
rho=andgamma=arguments. - Follow-up
-
The period of observation during which a subject is monitored for the occurrence of the event. Follow-up begins at study entry (or, in a counting-process analysis, at the subject’s delayed entry time) and ends either at the event or at censoring (whichever comes first). The follow-up time is what is recorded in the
timecolumn of a survival dataset. The total follow-up of a study is often summarized as the median or total person-time across all subjects. Loss to follow-up (subjects who withdraw or become unreachable before the study ends) is the most common source of right censoring. - Forest plot
- A graphical display of point estimates and confidence intervals (typically hazard ratios from a Cox model) for multiple subgroups or covariates arranged in rows. Each row shows a symbol for the estimate and a horizontal line for the interval, making it easy to compare effect sizes and their uncertainty at a glance. In Greenwood, plot_forest() produces an interactive forest plot from a fitted CoxPH model.
- Formula interface
-
A string-based alternative to passing a covariate DataFrame directly, in which the right-hand side of a model is written as a Wilkinson-style formula, for example
"age + sex"or"age * sex"(main effects plus their interaction). Parsed by the optional formulaic dependency, the formula interface expands categorical columns into indicator variables automatically, supportsC(column)to force a numeric-looking column to be treated as categorical, and supportsC(column, contr.treatment(base=...))to control the reference category. Available on CoxPH.fit() and AFT.fit() via thedata=argument together with a formula string in place of the covariate frame. - Gradient boosting (survival)
-
An ensemble method that builds an additive model by fitting each new, shallow regression tree to the negative gradient of a loss under the current model, then adding a shrunken version of it. Greenwood’s GradientBoostingSurvivalAnalysis uses the negative Cox partial-likelihood as the loss, so each tree is fit to the martingale residuals. A Breslow baseline then turns the additive log-risk score into survival curves. The
learning_ratecontrols shrinkage andn_estimatorsthe number of trees. - Gray’s test
- A non-parametric hypothesis test for equality of cumulative incidence functions across two or more groups in a competing-risks setting. It is the competing-risks analogue of the log-rank test, but rather than comparing cause-specific hazards it directly tests whether the CIFs of the target cause differ between groups, accounting for the effect of competing events. The test statistic is a weighted sum of differences between observed and expected CIF increments, and Fleming-Harrington (\rho, \gamma) weights are supported. Gray’s test is the appropriate choice when the research question is “does the treatment affect the cumulative probability of this event?” rather than “does the treatment affect the rate at which the event occurs?” Available via grays_test() in Greenwood.
- Greenwood’s formula
-
The standard variance estimator for the Kaplan-Meier survival curve: \widehat{\text{Var}}(\hat{S}(t)) = \hat{S}(t)^2 \sum_{t_i \le t} \frac{d_i}{n_i(n_i - d_i)}, where d_i and n_i are the events and risk-set size at time t_i. Confidence intervals are derived from this variance on a transformed scale (
log,log-log, orplain). Greenwood uses this formula by default in KaplanMeier. - Hazard function (hazard rate)
- The instantaneous rate of an event at time t, given survival to that time: h(t) = \lim_{\delta \to 0} P(t \le T < t + \delta \mid T \ge t) / \delta. It is not a probability but a rate (events per unit time). The hazard is related to the survival function by S(t) = \exp\!\left(-\int_0^t h(u)\,du\right).
- Hazard ratio
- The ratio of the hazard functions of two groups or covariate levels, typically assumed constant over time under the proportional hazards assumption. In a Cox model, e^{\beta_j} is the hazard ratio associated with a one-unit increase in covariate j. Values greater than 1 indicate higher hazard (shorter survival) for the group with the higher covariate value.
- Illness-death model
- A three-state multi-state model with transitions from a healthy (initial) state to either an illness state or to death directly, and from illness to death. It is the canonical example in the multi-state literature and underlies many clinical analyses of disease progression: a patient may die without ever becoming ill (healthy → dead) or may first become ill and then die (healthy → ill → dead). The illness-death model generalizes both simple survival analysis (if the illness state is ignored) and competing risks (if illness is treated as an absorbing event). With all three transitions specified it models both the occurrence and the downstream effect of the intermediate event on mortality. In Greenwood, the illness-death model is a special case of the MultiState framework.
- Immortal time bias
-
A systematic bias in observational survival studies that arises when a period of follow-up during which a subject could not have experienced the outcome is incorrectly attributed to a treatment or exposure group. The “immortal” time — when subjects are, by construction, event-free — inflates apparent survival in that group. A common example is classifying a subject as “treated” from study entry even though treatment did not start until weeks later: the pre-treatment follow-up is credited to the treated group, making treatment appear beneficial even if it has no effect. The bias is corrected by using the counting-process form and entering subjects into the exposed risk set only from their actual exposure time, which Greenwood supports via
Surv.counting(start, stop, event). - Influence diagnostics
-
A suite of per-subject statistics that jointly assess how much each observation affects the model fit, how well it is predicted, and how unusual its covariate pattern is. The three primary components are: leverage (how extreme the covariate pattern is), deviance residuals (how poorly the observation is predicted), and likelihood displacement (the overall impact on the log-likelihood if the observation is removed). Together they distinguish two failure modes: an observation with high leverage but a small residual is influential yet well-fitted. One with a large residual but low leverage is poorly predicted but not especially influential. In Greenwood,
CoxPH.influence()returns a table combining all three diagnostics for each subject. - Information criteria (AIC, BIC)
-
Two related summaries that rank candidate models by trading off fit against complexity, both computed from the model’s log-likelihood \ell and its number of parameters k (or effective degrees of freedom for penalized models). The Akaike information criterion is \text{AIC} = -2\ell + 2k. The Bayesian information criterion instead penalizes complexity by the sample size, \text{BIC} = -2\ell + k \log(n), where n is typically the number of events. Because the BIC penalty grows with \log(n), it favors simpler models more strongly than AIC once the sample is reasonably large. Lower values are better for both. Greenwood reports AIC and BIC via glance() for CoxPH, AFT, RoystonParmar, and PiecewiseExponential, and uses them to automatically select knot counts (
PiecewiseExponential(knot_strategy="aic"/"bic")) and to rank distributional families (compare_distributions()). - Integrated Brier score (IBS)
- The Brier score averaged over a range of evaluation times, providing a single summary of overall predictive accuracy across the follow-up period. Available via integrated_brier_score().
- Interval censoring
-
A censoring mechanism in which the event is known only to have occurred within a time interval [\ell_i, u_i], rather than at an exact time. Built with
Surv.interval(lower, upper). Usenumpy.infas the upper bound to represent right censoring within this form. Estimated non-parametrically by Turnbull’s algorithm. - IPC-weighted ridge regression
-
A linear survival model that corrects for censoring bias via IPCW reweighting rather than the Cox partial likelihood. The model fits a weighted ridge regression on the observed (uncensored) log-times, where each subject’s weight is 1 / \hat{G}(t_i^-) from the censoring distribution. This eliminates censoring bias from the least-squares objective without assuming proportional hazards. IPC-weighted regression is useful as a fast, assumption-light baseline for comparing against more structured models. Available via
IPCRidge. - IPCW (inverse probability of censoring weighting)
- A technique for correcting for informative censoring in prediction metrics. Observations that are censored before the evaluation time are upweighted by the inverse of their probability of remaining uncensored, estimated by a censoring Kaplan-Meier curve (see censoring distribution). Brier scores, time-dependent AUC, and concordance index in Greenwood use IPCW by default.
- Kaplan-Meier estimator (product-limit estimator)
- The standard non-parametric estimator of the survival function. It is a step function that drops at each event time by the conditional probability of the event at that time: \hat{S}(t) = \prod_{t_i \le t} \left(1 - \frac{d_i}{n_i}\right). Confidence intervals use Greenwood’s formula. Available via KaplanMeier.
- Karnofsky performance score
-
An eleven-point ordinal scale, scored in increments of 10 from 0 (dead) to 100 (normal, no symptoms), that grades a patient’s ability to carry out daily activities. It predates and serves a similar purpose to the ECOG performance status, and the two are often reported side by side in oncology datasets. The bundled
lungdataset records both a physician-rated score (ph.karno) and a patient self-rated score (pat.karno), andveteranrecords a singlekarnocolumn. Comparing physician- and patient-rated scores for the same subject can itself be informative about how reporting perspective affects prognosis. - Landmark analysis
-
An analysis strategy in which subjects are only included, or only evaluated, from a fixed point in follow-up (the landmark time) onward, restricted to those known to be event-free at that time. Landmarking is a common device for avoiding immortal time bias when a variable of interest (such as response to an early treatment) is not known until partway through follow-up: rather than assigning that status from study entry, the analysis is deferred to the landmark time so that every included subject has had an equal chance to reach it. See conditional survival for the corresponding quantity, P(T > t \mid T > c), which Greenwood computes via
CoxPH.predict(conditional_after=c). - Left censoring
-
A censoring mechanism in which the event is known to have occurred before the observation time (the event time is at most t_i, not at least t_i). Less common than right censoring. Built with
Surv.left(time, event). - Lasso (L1 penalty)
-
A regularization method that adds a penalty proportional to the sum of absolute coefficient values, \lambda \|\beta\|_1, to the model’s log-likelihood or loss function. As the penalty strength \lambda increases, lasso shrinks coefficients toward zero and sets some exactly to zero, performing automatic variable selection. This is in contrast to ridge (L2) regularization, which shrinks all coefficients but rarely zeroes them out. In the survival context, lasso is especially useful when the number of covariates is large relative to the number of events. In Greenwood, lasso is obtained from CoxNet by setting
alpha=1. Intermediate values ofalphablend lasso and ridge in an elastic-net penalty. - Left truncation (late entry)
-
A form of selection bias in which a subject is only observed because they survived long enough to enter the study. The subject only joins the risk set at their entry time s_i > 0. If their event had occurred before s_i, they would not be in the data at all. Handled via the counting-process form
Surv.counting(start, stop, event). - Leverage
-
A scalar summary of how extreme a subject’s covariate pattern is relative to the rest of the risk set, measured as the diagonal of the Cox model’s approximate hat matrix: h_i = \mathbf{L}_i^\top \hat{V}\, \mathbf{L}_i, where \mathbf{L}_i is the subject’s summed score residual contribution and \hat{V} is the estimated covariance matrix of \hat\beta. High leverage indicates that a subject occupies a sparse region of covariate space and therefore has the potential to pull coefficient estimates toward its own observed outcome. Leverage is one component of the influence diagnostics table returned by
CoxPH.influence(). See also likelihood displacement and dfbeta residuals. - Likelihood displacement
-
A scalar influence measure for each subject, quantifying how much the log-likelihood changes when that subject is removed. In the Cox model it is computed as the quadratic form \text{LD}_i = \hat\beta_{\Delta i}^\top I\, \hat\beta_{\Delta i}, where \hat\beta_{\Delta i} is the approximate change in \hat\beta when subject i is deleted (the dfbeta vector) and I is the observed information matrix. Likelihood displacement combines both the leverage and residual components into a single scalar: a subject with high leverage and a large residual will have large likelihood displacement. It is included in the influence diagnostics table returned by
CoxPH.influence(). - Lin-Wei sandwich estimator
-
A robust variance estimator for the Cox model, also known as the sandwich or “robust” variance. It replaces the model-based (inverse information) variance with \hat{V} = I^{-1} M I^{-1}, where I is the observed information matrix and M is the outer product of score residuals summed across subjects (the “meat” of the sandwich). The Lin-Wei estimator is consistent even when the Cox model is misspecified, and it generalizes to clustered data by summing score residuals within clusters before forming M. Activated in Greenwood via
CoxPH.fit(..., robust=True)or by supplyingcluster=. - Logit transform (survival)
-
The transformation g(S) = \log((1 - S(t)) / S(t)) applied to survival probabilities, which is the log-odds of the failure probability F(t) = 1 - S(t). On a plot of \log((1 - S(t)) / S(t)) vs \log(t), data from a log-logistic distribution fall on a straight line. Used in the Weibull plot with
dist="loglogistic". - Location-scale parameterization
- The canonical form in which accelerated failure time models are expressed internally: \log T = \mu + \sigma\,\varepsilon, where \mu is the location (the linear predictor \mathbf{x}^\top\boldsymbol\gamma plus an intercept), \sigma is the scale parameter, and \varepsilon is a standardized error whose distribution determines the event-time family. The Weibull AFT corresponds to an extreme-value (Gumbel) \varepsilon, log-normal to a standard normal \varepsilon, and log-logistic to a standard logistic \varepsilon. This parameterization unifies all AFT families into a single linear-model structure on the log-time scale and is the form used by Greenwood’s AFT internally regardless of which distribution is selected.
- Log-rank test
- A non-parametric test for equality of survival curves across two or more groups. It sums the (observed − expected) event counts at each event time, where expected counts are computed under the null hypothesis of equal hazard rates. The log-rank test is most powerful when hazards are proportional over time. Use Fleming-Harrington weights for alternatives. Available via logrank_test().
- Martingale residuals
-
Per-subject residuals from a fitted Cox model equal to the difference between the observed event indicator and the model’s expected cumulative number of events: M_i = \delta_i - \hat{H}_0(t_i)\exp(\mathbf{x}_i^\top\hat\beta), where \delta_i
\in \{0,1\} is the event indicator and \hat{H}_0(t_i) is the estimated baseline cumulative hazard at the subject’s exit time. Martingale residuals have expected value zero when the model is correct. They are the primary tool for checking whether continuous covariates enter the model on the right scale: plotting M_i against a candidate covariate reveals nonlinear effects as a curved lowess smooth. Their main drawback is asymmetry: bounded above by 1 but unbounded below, so large negative values are expected for long-surviving censored subjects. Deviance residuals symmetrize them. Available from CoxPH and AFT via
residuals(type="martingale"). - Maximum product of spacings (MPS)
-
An alternative to maximum likelihood for fitting a parametric distribution (Cheng & Amin, 1983), used by
AFT(method="mps"). Each exact observation’s density contribution is replaced by the gap between consecutive order statistics on the CDF scale (in the location-scale parameterization’s standardized \varepsilon), and right-censored observations keep the ordinary log-survival contribution (Cheng & Stephens, 1989). Because a CDF gap is bounded in [0, 1], this objective cannot diverge to infinity the way a raw density can, which matters specifically for a threshold parameter: the ordinary likelihood can be unbounded as the threshold approaches the smallest observed time (for some distributions), while MPS stays well-behaved there. Asymptotically equivalent to maximum likelihood under regularity conditions, so standard errors are still obtained from the numeric Hessian of the objective actually optimized. - MaxCombo test
- A hypothesis test for comparing survival curves that evaluates multiple Fleming-Harrington weight functions simultaneously and takes the largest absolute Z-statistic as the test statistic. This makes it robust to unknown treatment-effect timing: when the effect is immediate, the standard log-rank weight dominates; when the effect is delayed, the late-emphasis weight dominates. The MaxCombo adapts automatically, making it well suited to immunotherapy and oncology trials where delayed effects are expected but not guaranteed. The p-value is computed from the joint multivariate normal distribution of the weighted Z-statistics. Available via maxcombo_test().
- Mixture cure model
-
A survival model for populations in which a fraction of subjects will never experience the event (the “cured” or “long-term survivor” subgroup). The population survival is decomposed as S_{\text{pop}}(t \mid x, z) = 1 - \pi(x) + \pi(x)\,S_u(t \mid z), where \pi(x) is the cure probability modeled by logistic regression (the incidence component) and S_u(t \mid z) is the survival function for susceptible subjects modeled by Cox proportional hazards (the latency component). The EM algorithm alternates between estimating each subject’s posterior probability of being cured and updating the incidence and latency parameters. The model is identified when the Kaplan-Meier curve levels off to a non-zero plateau, suggesting a cured fraction. Available via
MixtureCure. - Model-based standard error
-
The default standard error reported for a Cox model’s coefficients, computed from the inverse of the observed information matrix (the negative Hessian of the partial log-likelihood) rather than from the Lin-Wei sandwich estimator. It is correct when the model is properly specified and observations are independent, but it understates uncertainty when the model is misspecified or when observations are correlated (repeated measures, clustered data). Also called the naive standard error. In Greenwood, it remains available as
naive_std_error_(andnaive_vcov_) on a fitted CoxPH model even after refitting withrobust=True, so the two can be compared directly. - Multi-state model
- A model in which subjects can occupy one of several states and transition between them over time. Competing risks is a special case (one transient state, multiple absorbing states). More general structures (for example, a “healthy -> sick -> dead” illness-death model) are represented with Surv.multistate and fitted with MultiState.
- Nelson-Aalen estimator
- A non-parametric estimator of the cumulative hazard function: \hat{H}(t) = \sum_{t_i \le t} \frac{d_i}{n_i}. A survival estimate can be recovered as \hat{S}(t) = \exp(-\hat{H}(t)), though Kaplan-Meier is usually preferred for direct survival estimation. Available via NelsonAalen.
- Non-parametric model
- A model that makes no assumptions about the shape of the underlying survival or hazard function. Instead of fitting a fixed parametric family, it lets the data determine the function’s form at each observed event time, producing a step function. Non-parametric estimators are highly flexible and robust to distributional misspecification, but they cannot extrapolate beyond the last observed event time and have no compact summary (such as a scale or shape parameter). The Kaplan-Meier and Nelson-Aalen estimators and the Aalen-Johansen cumulative incidence function are all non-parametric. Contrast with parametric model and semi-parametric model.
- Occupancy probability
-
In a multi-state model, the probability that a subject is in a specific state at time t: \pi_k(t) = P(\text{state at time }t = k). Occupancy probabilities sum to 1 across all states at every time point and are the primary quantities of interest in most multi-state analyses. They differ from transition probabilities in the transition matrix: the entry p_{jk}(s, t) conditions on being in state j at s, whereas \pi_k(t) marginalizes over the initial-state distribution. In the two-state alive/dead model, \pi_\text{alive}(t) reduces to the Kaplan-Meier survival estimate. Computed by MultiState in Greenwood via
state_occupancy(). - One-standard-error (1-SE) rule
-
A model-selection heuristic for choosing a regularization strength from a cross-validated grid, used as an alternative to simply picking the value with the best mean score. After identifying the penalizer with the best mean cross-validation score (highest concordance or lowest Brier score) and its standard error across folds, the 1-SE rule selects the most heavily regularized (sparsest) penalizer whose mean score is still within one standard error of the best. Because model performance is often statistically indistinguishable across a range of penalizer values, this trades a negligible amount of predictive accuracy for a simpler, more interpretable, and less overfit-prone model. In Greenwood, cv_coxnet() reports both choices:
best_penalizer_(the best mean score) andpenalizer_1se_(the 1-SE choice). - Out-of-bag (OOB) estimate
-
An estimate of predictive performance computed from bagging without a separate validation set: each subject is scored using only the trees whose bootstrap sample excluded it. Greenwood’s RandomSurvivalForest (and ExtraSurvivalTrees with
bootstrap=True) reports out-of-bag concordance viaoob_score=True, and uses the same held-out mechanism for permutation variable importance. - Pairwise log-rank test
- An extension of the log-rank test that performs all pairwise group comparisons when there are more than two groups, with an optional multiplicity correction (e.g., Holm). Avoids inflating the type I error rate that would result from running separate two-group tests. Available via pairwise_logrank_test().
- Pairwise RMST test
- An extension of the restricted mean survival time comparison that performs all pairwise group contrasts, with optional multiplicity correction. Available via pairwise_rmst_test().
- Parametric model
- A model that assumes the survival or hazard function follows a specific distributional family (such as Weibull, exponential, log-normal, or log-logistic) characterized by a fixed number of parameters. Parametric models are more statistically efficient than non-parametric alternatives when the distributional assumption holds, and they allow smooth hazard estimation, extrapolation beyond the observed follow-up window, and closed-form expressions for quantities such as the mean survival time. The trade-off is that a poorly chosen distribution can lead to bias. The AFT and Royston-Parmar models in Greenwood are parametric (or, for Royston-Parmar, flexibly parametric). Contrast with non-parametric model and semi-parametric model.
- Partial likelihood
- The likelihood function used to estimate Cox model coefficients. It conditions on the observed event times and considers only the identity of the subject who had the event relative to those still at risk, thereby eliminating the unspecified baseline hazard from the estimation.
- Penalizer
-
The regularization strength parameter \lambda that scales the penalty added to a model’s log-likelihood. A larger penalizer shrinks coefficients more aggressively toward zero, increasing bias but reducing variance and guarding against overfitting. A penalizer of zero recovers the unpenalized model. In Greenwood’s CoxNet the penalizer is the primary tuning parameter, and cv_coxnet() selects it automatically via cross-validation over a log-spaced grid spanning from a data-derived maximum (\lambda_{\max}, below which at least one coefficient becomes non-zero) down to
eps * lambda_max. See also elastic-net penalty, lasso, and ridge. - Permutation variable importance
- A model-agnostic measure of a covariate’s contribution, obtained by randomly permuting its values and recording the resulting drop in predictive performance. A larger drop means a more important covariate. Greenwood’s forests compute it on the out-of-bag samples (the increase in 1 - \text{concordance}) via variable_importance(), which is also what tidy() returns for a fitted forest.
- Peto-Peto test
-
A weighted log-rank test that emphasizes early survival differences by assigning weight W(t) = \hat{S}(t^-) at each event time, where \hat{S} is the pooled Kaplan-Meier estimate. It is the special case (\rho = 1, \gamma = 0) of the Fleming-Harrington family. The Peto-Peto test is more powerful than the standard log-rank test when the treatment effect is concentrated early in follow-up and diminishes over time, but less powerful when differences emerge late. Because the two tests can give very different p-values when hazard ratios cross, it is important to visualize survival curves before choosing a weighting scheme. Available via
logrank_test(rho=1, gamma=0)in Greenwood. - Piecewise exponential model (PEM)
- A parametric survival model that assumes a constant (exponential) hazard within each of a set of pre-specified time intervals while allowing the hazard level to differ freely across intervals. Covariate effects enter as proportional hazard multipliers shared across all intervals. The key computational insight is that a PEM is algebraically equivalent to a Poisson generalized linear model fitted on interval-expanded data with a log-exposure offset, making standard GLM software directly applicable. The PEM occupies the middle ground between the fully non-parametric Cox proportional hazards model (no assumption on the baseline hazard shape) and rigid fully parametric models: it provides a piecewise-constant baseline hazard that can be plotted and extrapolated. Available via PiecewiseExponential in Greenwood. Interval boundaries can be selected automatically by AIC or BIC.
- Power analysis (survival trials)
- The statistical planning step that determines how many events, subjects, or how much follow-up a trial needs to detect a specified treatment effect with a given probability (power). In the survival context, the Schoenfeld power formula links power directly to the total number of observed events rather than the sample size alone, so trial planning separates into two steps: first determine the required event count from the target hazard ratio, significance level, and desired power; then determine the sample size needed to observe that many events given expected censoring and accrual. Greenwood provides logrank_n_events() (required events), logrank_power() (power for a given design), and logrank_sample_size() (required sample size accounting for censoring).
- Probit transform (survival)
-
The transformation g(S) = \Phi^{-1}(1 - S(t)) applied to survival probabilities, where \Phi^{-1} is the standard normal quantile function. On a plot of \Phi^{-1}(1 - S(t)) vs \log(t), data from a log-normal distribution fall on a straight line. Used in the Weibull plot with
dist="lognormal". - Proportional hazards assumption
-
The assumption in the Cox model that the hazard ratio between any two subjects is constant over time (that is, the hazard functions are parallel on a log scale). It can be tested formally with the Schoenfeld residual correlation test, available via
CoxPH.zph()which returns a ZPHResult. - Proportional odds model
-
An alternative to proportional hazards in which the odds ratio of failure by time t, \big[(1 - S(t \mid x)) / S(t \mid x)\big], rather than the hazard ratio, is assumed constant over time. Useful when survival curves for two groups converge (or diverge) over time instead of staying a fixed multiple apart, which violates proportional hazards but can still be proportional on the odds scale. In Greenwood, available as
RoystonParmar(scale="odds"): the restricted cubic spline is placed on the log odds of failure instead of the log cumulative hazard, andexp(coef)is an odds ratio rather than a hazard ratio. Withdf=1(no internal knots), the proportional-odds Royston-Parmar model is exactly a log-logistic accelerated failure time model, the same identityscale="hazard"has with the Weibull model. - Random survival forest (RSF)
-
A bagging ensemble of survival trees, each grown on a bootstrap sample and considering a random subset of covariates at every split, following Ishwaran et al. (2008). Predictions average the per-tree cumulative-hazard functions, giving a flexible, low-variance non-parametric model that captures non-linearities and interactions without a proportional-hazards assumption. Available via RandomSurvivalForest, with an optional Numba-accelerated split search (
engine="numba"). - Restricted cubic spline
-
A piecewise cubic polynomial that is constrained to be linear beyond the outermost knots (the boundary knots), reducing sensitivity to sparse data at the extremes of the range. Between the interior knots, it is a standard cubic spline: smooth (continuous up to the second derivative) and flexible. Internal knots are typically placed at quantiles of the event-time distribution, and the number of knots controls the smoothness–flexibility trade-off. Restricted cubic splines are the basis expansion used by the Royston-Parmar model to represent its transformed baseline survival function (log cumulative hazard or log odds of failure, depending on
scale=) as a smooth function of \log(t): with k internal knots, k - 1 spline basis terms enter the linear predictor. The number of knots is controlled by thedf=argument to RoystonParmar in Greenwood (dfequals the number of spline terms, one more than the number of internal knots). - Reference category
-
The baseline level of a categorical covariate against which all other levels are compared once the covariate is expanded into indicator (dummy) variables. A categorical column with k levels contributes k - 1 indicator terms to the model. The omitted level is the reference, and each reported coefficient is the log hazard ratio (or log acceleration factor) for its level relative to that reference. Greenwood’s formula interface picks the first level alphabetically as the reference by default (a different reference is chosen with
C(column, contr.treatment(base="level"))). Encoding an unordered categorical column as raw integers instead of indicator variables is a common mistake, since it forces the model to treat the codes as a single continuous, linearly increasing effect. - Restricted mean survival time (RMST)
- The expected event-free survival time up to a pre-specified time horizon \tau: \text{RMST}(\tau) = \int_0^\tau S(t)\,dt. It is the area under the survival curve to \tau and has a direct clinical interpretation as “average time alive and event-free up to \tau.” Available via KaplanMeier.rmst(), and tested between groups with rmst_test().
- Response (
y) -
The outcome variable passed to a survival model, consisting of event times paired with their censoring or event-type status. In Greenwood, the response is always a Surv object. It is conventionally named
yin model-fitting code, carrying over the standard statistical notation for the dependent variable: in ordinary regression y = X\beta + \varepsilon,yis the vector of outcomes andXis the covariate matrix. Survival analysis adopts the same convention even though the response is a composite (time and status) rather than a single scalar. Throughout the documentation and examples you will see the patterny = gw.Surv.right(time, event)followed bymodel.fit(y, X), deliberately mirroring the y, X split familiar from regression. - Response residuals
-
Per-subject residuals that measure the difference between observed and fitted values on the original time scale: r_i = t_i - \hat{t}_i, where \hat{t}_i = \exp(\mathbf{x}_i^\top\hat\gamma) is the predicted event time from the accelerated failure time model. A positive residual indicates the subject survived longer than the model predicted. Response residuals are analogous to ordinary regression residuals and are useful for a quick visual check of model fit, but they are not symmetric and their variance is not constant, so they are typically supplemented by deviance residuals or Cox-Snell residuals for formal diagnostics. Available from AFT via
residuals(type="response"). - Ridge (L2 penalty)
-
A regularization method that adds a penalty proportional to the sum of squared coefficient values, \lambda \|\beta\|_2^2, to the model’s log-likelihood or loss function. Ridge shrinks all coefficients toward zero as the penalty strength \lambda increases, but unlike lasso it rarely sets any coefficient exactly to zero. This makes ridge well suited to situations where many covariates each contribute a small signal: all of them are retained in the model but their estimates are stabilized. In Greenwood, ridge is obtained from CoxNet by setting
alpha=0. Intermediate values ofalphablend ridge and lasso in an elastic-net penalty. - Right censoring
-
The most common censoring mechanism. An observation is right-censored if the event had not yet occurred by the time the subject left the study or the study ended. All that is known is that the true event time exceeds the observed time t_i. Built with
Surv.right(time, event). - ROC curve (receiver operating characteristic curve)
- A graphical summary of a binary classifier’s discrimination across all possible decision thresholds. For each threshold on the predicted risk score, it plots the true positive rate (sensitivity) against the false positive rate (1 − specificity), tracing a curve from (0, 0) to (1, 1). The area under the ROC curve (AUC) summarizes discrimination in a single threshold-free number: 0.5 corresponds to random ranking and 1.0 to perfect discrimination. In survival analysis, a time-specific ROC curve is constructed at each evaluation horizon t^* by defining cases as subjects who had the event before t^* and controls as subjects still at risk after t^*. Observations censored before t^* are reweighted by IPCW. The resulting time-dependent AUC is available via time_dependent_auc() in Greenwood.
- Royston-Parmar model
-
A flexible parametric survival model that uses restricted cubic splines to represent a transformed baseline survival function, allowing smooth, data-driven shapes rather than the rigid forms imposed by exponential or Weibull models. It bridges the gap between fully parametric models and the non-parametric Cox approach: parameters are fully estimated so extrapolation and smooth hazard curves are possible. Two scales are available via
scale=: the log cumulative hazard (scale="hazard", proportional hazards, the default) or the log odds of failure (scale="odds", proportional odds model). Available via RoystonParmar. - Schoenfeld power formula
-
A result due to Schoenfeld (1981) that links the power of the log-rank test to the total number of observed events rather than to the sample size or follow-up duration separately. Under a proportional-hazards alternative with hazard ratio \Delta, the number of events required to achieve power 1 - \beta at two-sided significance level \alpha is approximately d \approx (z_{\alpha/2} + z_\beta)^2 / (\log \Delta)^2, where z_p is the p-th standard normal quantile. Because the formula depends only on d and \Delta, trial planning separates into two steps: first determine the required event count, then determine the sample size needed to observe that many events given expected censoring and accrual rates. Greenwood’s
power_logrank()andsamplesize_logrank()implement these calculations. - Schoenfeld residuals
- Residuals from a fitted Cox model used to assess the proportional hazards assumption. At each event time, the Schoenfeld residual for a covariate is the observed covariate value of the subject who had the event minus the risk-set weighted mean. A significant correlation between Schoenfeld residuals and time indicates non-proportional hazards. Scaled Schoenfeld residuals (divided by the risk-set covariance at each event time) are the basis of the Grambsch-Therneau test, which regresses them on time to produce a formal chi-squared test per covariate. Computed by CoxPH.cox_zph(), returned as a ZPHResult.
- Score residuals
-
Per-subject, per-covariate residuals from a fitted Cox model representing each subject’s contribution to the score (gradient) of the partial log-likelihood evaluated at \hat\beta. For subject i and covariate j, the score residual is L_{ij} = \int_0^\infty [x_{ij}(t) - \bar{x}_j(t)]\,dM_i(t), where \bar{x}_j(t) is the risk-set weighted mean of covariate j at time t and dM_i is the martingale residual increment. The matrix of score residuals is the “meat” of the Lin-Wei sandwich estimator: when subjects are clustered, score residuals are summed within clusters before forming the sandwich. dfbeta residuals are linear functions of score residuals obtained by pre-multiplying by the inverse information matrix. In the accelerated failure time model, score residuals are the per-subject contributions to the gradient of the log-likelihood with respect to the regression coefficients. Available from CoxPH and AFT via
residuals(type="score"). - Semi-parametric model
- A model that combines a non-parametric component with a parametric one. The Cox proportional hazards model is the canonical example: the baseline hazard h_0(t) is left completely unspecified (non-parametric), while covariate effects are estimated through a finite-dimensional parameter vector \beta (parametric). This separation is what makes the partial likelihood possible: \beta can be estimated without ever specifying h_0(t). Semi-parametric models are more flexible than fully parametric models while retaining interpretable covariate effects, at the cost of not being able to compute quantities (such as mean survival time) that require integrating the full hazard function.
- Shared frailty
-
A Cox model extension that adds a cluster-level random effect to the hazard to account for unmeasured heterogeneity shared by subjects in the same group (hospital, family, recurrent-event unit). Two distributions are available. Gamma frailty multiplies the hazard by a cluster-specific random effect z \sim \text{Gamma}(1/\theta, 1/\theta), so h(t \mid x, z) = z\, h_0(t) \exp(\beta^\top x). Its variance \theta is estimated with an EM algorithm, alternating between profiling out (\beta, z) at the current \theta and updating \theta from the posterior expectation of the random effects. Log-normal frailty instead adds an additive random effect on the log-hazard scale, h(t \mid x, u) = h_0(t) \exp(\beta^\top x + u) with u \sim \mathcal{N}(0, \sigma^2), jointly optimized with (\beta, u) by penalized partial likelihood and \sigma^2 updated by REML. Larger \theta or \sigma^2 indicates stronger between-cluster heterogeneity, and a likelihood-ratio test of the null
theta = 0(orsigma2 = 0) is available via frailty_test(). In Greenwood, both are fit withCoxPH(frailty="gamma"/"lognormal", frailty_cluster=...), which currently requires right-censored data andties="breslow". Contrast with the Lin-Wei sandwich estimator, which corrects standard errors for cluster correlation without changing the model itself. - Soft-thresholding
- The proximal operator of the L1 norm, defined as \mathcal{S}_\lambda(v_j) = \text{sign}(v_j)\max(|v_j| - \lambda,\, 0). It shrinks each element of a vector toward zero by \lambda and sets elements with |v_j| \le \lambda exactly to zero, which is why it is the core computational step for fitting lasso-penalized models. After each gradient update on the smooth loss (e.g., the negative Cox partial likelihood), every coefficient is passed through the soft-threshold operator to enforce the L1 penalty. In FISTA, soft-thresholding is applied after each momentum-corrected gradient step. For the elastic-net penalty, the threshold is \lambda\alpha (the lasso component) and the result is divided by 1 + \lambda(1-\alpha) to apply the simultaneous ridge shrinkage. Used internally by CoxNet.
- Strata
-
See stratification. In Greenwood’s API, the
by=argument to CoxPH.fit(), KaplanMeier.fit(), NelsonAalen.fit(), and related methods identifies the column or array whose distinct values define the strata. - Stratification
-
A technique in which separate baseline hazards are estimated for each level of a stratification variable, while covariate effects (log-hazard-ratio coefficients) remain shared across strata. It is a flexible way to relax the proportional hazards assumption for a known confounder without estimating its coefficient. Specified via the
by=argument to CoxPH.fit(). - Subdistribution hazard
- The hazard function underlying the Fine-Gray model, defined over the entire follow-up time for a specific cause. Subjects who experience a competing event remain in the “at risk” set with a weight of zero rather than being removed, which means the subdistribution hazard has a direct relationship to the cumulative incidence function.
- Survival function
- The probability that the event has not yet occurred by time t: S(t) = P(T > t). It is a non-increasing function starting at S(0) = 1 and approaching 0 as t \to \infty. Estimated non-parametrically by Kaplan-Meier or derived from the Nelson-Aalen cumulative hazard as \exp(-\hat{H}(t)).
- Survival tree
- A decision tree for time-to-event data that recursively splits subjects into groups whose survival differs as much as possible, choosing each split to maximize the two-sample log-rank statistic between the child groups. Each leaf stores a Kaplan-Meier survival curve and a Nelson-Aalen cumulative hazard from its subjects. A single tree is interpretable but high-variance (it is the base learner of the random survival forest). Available via SurvivalTree.
- Surv object
- The response type in Greenwood that bundles event times with their status codes and validates them eagerly. Every estimator and model in Greenwood consumes a Surv object. Built with Surv.right(), Surv.counting(), Surv.left(), Surv.interval(), or Surv.multistate() depending on the censoring and event structure of the data.
- Threshold parameter (location parameter)
-
A three-parameter extension of a 2-parameter accelerated failure time distribution: T =
\gamma + T', where \gamma \ge 0 is a guaranteed minimum survival time and T' follows the ordinary location-scale parameterization. Useful when a failure process has a genuine floor, a burn-in period in reliability engineering, or an incubation time before an event becomes possible. Not to be confused with the Location-scale parameterization’s own location \mu, which shifts log-time rather than time itself and carries no such floor. Enabled via
AFT(threshold=True); not supported fordist="gengamma". Best fit withmethod="mps"(maximum product of spacings) rather than ordinary maximum likelihood, which can drive \gamma toward the smallest observed time. - Time-dependent AUC
- The area under the ROC curve at a specific time horizon, measuring a model’s ability to distinguish subjects who had the event before that time from those who did not. IPCW weighting is applied to handle censoring. Available via time_dependent_auc() and integrated_auc().
- Time-varying covariates
- Covariates whose values change during a subject’s follow-up period. They are handled by splitting each subject into multiple rows in the counting-process form, where each row covers the interval during which a particular covariate value applies.
- Tied event times (ties)
-
The situation in which two or more subjects experience an event at the same recorded time. Ties are common when time is measured in coarse units (whole days, months) or when a registry records all events within a batch. They create an ambiguity in the Cox partial likelihood, which is derived under the assumption that event times are strictly ordered. Two approximations are widely used: the Breslow method treats tied events as if they occurred in an arbitrary sequence, which is fast but biased when the tie fraction is large. The Efron method averages over the possible orderings of the tied events, which is more accurate and is the default in both R’s
coxphand Greenwood’s CoxPH. The tie-handling method is set via theties=argument to CoxPH. - Trend test
- A non-parametric test for a monotone (ordered) trend in survival across three or more groups with a natural ordering, such as disease stages, dose levels, or age bands. It is more powerful than the omnibus log-rank test when the alternative is a trend rather than an arbitrary difference. Supports Fleming-Harrington weights and stratification. Available via trend_test().
- Transition matrix
-
In a multi-state model, the matrix P(s, t) whose (j, k) entry is the probability of moving from state j to state k between times s and t: p_{jk}(s, t) = P(X(t) = k \mid X(s) = j). The Aalen-Johansen estimator generalizes Kaplan-Meier to multi-state processes by computing a product integral \hat{P}(s, t) = \prod_{u \in (s,\,t]} [I + d\hat{A}(u)], where d\hat{A}(u) is the matrix of estimated cause-specific hazard increments at event time u. Row sums of the transition matrix equal 1, and the (0, 0) entry of the two-state model recovers the Kaplan-Meier survival estimate. Occupancy probabilities are derived from the transition matrix by weighting rows by the initial-state distribution. Accessible from MultiState via
transition_matrix()in Greenwood. - Truncation
- A form of selection in which a subject’s inclusion in the study depends on their event time. Left truncation (late entry) is the most common form: subjects who experienced the event before they could enter the study are not observed at all, biasing estimates if not accounted for. The counting-process form corrects for left truncation by having subjects enter the risk set only at their entry time.
- Turnbull’s algorithm (NPMLE for interval-censored data)
- The nonparametric maximum likelihood estimator (NPMLE) of the survival function under interval censoring (Turnbull, 1976), computed by an EM self-consistency algorithm. Unlike Kaplan-Meier, the estimator’s support is not identified everywhere: the data determine a set of maximal intersection intervals (via the Gentleman & Geyer 1994 construction), and only the total probability mass on each one is identified, not where within it the mass truly sits. Where an interval degenerates to a single point, survival is known exactly there; elsewhere it is reported as an explicit ambiguity bracket rather than an interpolated guess. Reduces exactly to the Kaplan-Meier estimator when there is no genuine interval ambiguity (only exact events and right censoring). Available via Turnbull.
- Weibull plot
-
A diagnostic visualization that plots Kaplan-Meier survival estimates on transformed axes where a specified parametric distribution appears as a straight line. The classic Weibull plot uses the complementary log-log transform: \log(-\log(S(t))) on the y-axis and \log(t) on the x-axis. Points that fall on a line confirm the distributional assumption. For stratified Kaplan-Meier fits, parallel lines indicate the proportional hazards assumption holds between groups. The same idea generalizes to other distributions: the probit transform (\Phi^{-1}(1 - S(t)) vs \log(t)) linearizes log-normal data, and the logit transform (\log((1 - S(t)) / S(t)) vs \log(t)) linearizes log-logistic data. An optional parametric overlay from a fitted AFT model draws the theoretical line through the empirical points to visualize goodness-of-fit. Available via
plot_weibull(). - Weibull distribution
- A two-parameter family of probability distributions widely used in parametric survival analysis. Its hazard function is h(t) = \lambda \kappa t^{\kappa - 1}, where \lambda > 0 is the scale and \kappa > 0 is the shape. When \kappa = 1 it reduces to the exponential distribution (constant hazard). \kappa > 1 gives an increasing hazard over time whereas \kappa < 1 a decreasing one. The Weibull is the only distribution that satisfies both the accelerated failure time and the proportional hazards parameterizations, making it the default distribution in many AFT implementations including Greenwood’s AFT.
- Z-score standardization
- Rescaling a covariate to have mean 0 and standard deviation 1 by subtracting its mean and dividing by its standard deviation, also called feature standardization. In a Cox model, covariates on wildly different scales (a 0/1 indicator alongside a covariate in the tens of thousands) can make the Newton-Raphson solver’s Hessian ill-conditioned, slowing convergence and inflating standard errors. Greenwood’s CoxPH.fit() warns when the ratio of the largest to smallest covariate standard deviation exceeds 100. Standardizing before fitting resolves this at the cost of changing what each coefficient means: it becomes the log hazard ratio per one-standard-deviation increase in the covariate rather than per one raw unit. CoxNet standardizes covariates internally by default and reports coefficients back on the original scale, so this step is not needed there.