# Get started

Greenwood turns time-to-event data into estimates, tests, models, and figures. It is built on [Narwhals](https://narwhals-dev.github.io/narwhals/) for backend-agnostic compute, validated against R's `survival` package, and visualized with [plotnine](https://plotnine.org/).


# The pipeline

Every analysis starts from a [Surv](../reference/Surv.md#greenwood.Surv) response and flows through a shared kernel:

1.  **[Surv](../reference/Surv.md#greenwood.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.

- **Foundations**: [Survival data and the Surv object](survival-data.md) explains censoring and how to represent it, and [Data sources and formats](data-sources.md) covers loading data from any backend.
- **Description and comparison**: [Kaplan-Meier](kaplan-meier.md), [Comparing groups](comparing-groups.md), and [Visualizing survival](visualization.md).
- **Regression**: [Cox regression](cox-regression.md), [Cox model diagnostics](cox-diagnostics.md), and [Parametric models](parametric-models.md).
- **Multiple event types**: [Competing risks](competing-risks.md) and [Multi-state models](multi-state.md).
- **Evaluation**: [Prediction performance](prediction-performance.md).


# Next steps

- New to the library? Start with [Installation](installation.md), then the [Quick start](quick-start.md) for a fast tour.
- New to survival analysis? Begin with [Survival data and the Surv object](survival-data.md).
