Get started

Greenwood turns time-to-event data into estimates, tests, models, and figures. It is built on Narwhals for backend-agnostic compute, validated against R’s survival package, and visualized with plotnine.

The pipeline

Every analysis starts from a Surv response and flows through a shared kernel:

  1. Surv response: captures the outcome and its censoring (right, left, interval, or the counting-process form with left truncation), plus optional weights and multi-state endpoints. It is validated eagerly, so downstream code can trust it.
  2. Risk-set / event-table kernel: at each unique event time, how many are at risk, how many had events, how many were censored. This single tabulation underlies Kaplan-Meier, the log-rank test, and Cox.
  3. Estimators and models: Kaplan-Meier and Nelson-Aalen, group tests, Cox regression, parametric models, competing risks, and multi-state models.
  4. Outputs: tidy frames, plotnine figures, and publication tables through Great Tables and Great Summaries.

Every statistic in Greenwood is validated to tolerance against R’s survival package, so results match the reference implementation the field already trusts.

How this guide is organized

The guide builds up from data to models. If you are new to survival analysis, read it in order; if you know what you need, jump straight to the relevant page.

Next steps