# greenwood > Modern survival analysis for Python: Narwhals-native, R-validated, beautifully visualized. ## Docs ### API Reference #### The response > The Surv object, the spine of every analysis. - [Surv](https://rich-iannone.github.io/greenwood/reference/Surv.html): A validated time-to-event response for survival analysis - [CensoringType](https://rich-iannone.github.io/greenwood/reference/CensoringType.html): The censoring flavor of a `Surv` response #### Non-parametric estimators > Kaplan-Meier survival and Nelson-Aalen cumulative hazard. - [KaplanMeier](https://rich-iannone.github.io/greenwood/reference/KaplanMeier.html): Kaplan-Meier product-limit estimator of the survival function - [NelsonAalen](https://rich-iannone.github.io/greenwood/reference/NelsonAalen.html): Nelson-Aalen estimator of the cumulative hazard #### Regression > Cox proportional hazards and parametric AFT models. - [CoxPH](https://rich-iannone.github.io/greenwood/reference/CoxPH.html): Cox proportional hazards model - [CoxNet](https://rich-iannone.github.io/greenwood/reference/CoxNet.html): Elastic-net penalized Cox proportional hazards model - [ZPHResult](https://rich-iannone.github.io/greenwood/reference/ZPHResult.html): Proportional-hazards test results (Grambsch-Therneau) - [AFT](https://rich-iannone.github.io/greenwood/reference/AFT.html): Parametric accelerated failure time model - [RoystonParmar](https://rich-iannone.github.io/greenwood/reference/RoystonParmar.html): Royston-Parmar flexible parametric survival model (proportional hazards scale) #### Competing risks & multi-state > Cumulative incidence, the Fine-Gray model, and multi-state transition probabilities. - [AalenJohansen](https://rich-iannone.github.io/greenwood/reference/AalenJohansen.html): Aalen-Johansen estimator of cumulative incidence functions for competing risks - [FineGray](https://rich-iannone.github.io/greenwood/reference/FineGray.html): Fine-Gray subdistribution hazard model for a competing-risks endpoint - [MultiState](https://rich-iannone.github.io/greenwood/reference/MultiState.html): Aalen-Johansen estimator of multi-state transition and occupancy probabilities #### Group comparisons > The log-rank test, trend tests for ordered groups, the G-rho (Fleming-Harrington) family, and restricted mean survival time (RMST) comparisons. - [logrank_test](https://rich-iannone.github.io/greenwood/reference/logrank_test.html): Compare survival across groups using the weighted log-rank (G-rho) test - [trend_test](https://rich-iannone.github.io/greenwood/reference/trend_test.html): Test for linear trend across ordered groups using the log-rank test family - [pairwise_logrank_test](https://rich-iannone.github.io/greenwood/reference/pairwise_logrank_test.html): Pairwise log-rank tests for all group pairs with multiple-comparison correction - [TestResult](https://rich-iannone.github.io/greenwood/reference/TestResult.html): The outcome of a log-rank group comparison test - [rmst_test](https://rich-iannone.github.io/greenwood/reference/rmst_test.html): Test for equality of RMST across two or more groups - [rmst_diff](https://rich-iannone.github.io/greenwood/reference/rmst_diff.html): Compute RMST difference between two groups with confidence interval - [pairwise_rmst_test](https://rich-iannone.github.io/greenwood/reference/pairwise_rmst_test.html): Pairwise RMST tests for all group pairs with multiple-comparison correction - [RMSTResult](https://rich-iannone.github.io/greenwood/reference/RMSTResult.html): Results of an RMST comparison test or difference calculation - [logrank_n_events](https://rich-iannone.github.io/greenwood/reference/logrank_n_events.html): Number of events needed for the log-rank test to reach a target power - [logrank_power](https://rich-iannone.github.io/greenwood/reference/logrank_power.html): Power of the log-rank test given the number of observed events - [logrank_sample_size](https://rich-iannone.github.io/greenwood/reference/logrank_sample_size.html): Total sample size needed for the log-rank test to reach a target power #### Prediction performance > Concordance and the IPCW Brier score. - [concordance_index](https://rich-iannone.github.io/greenwood/reference/concordance_index.html): Harrell's concordance index: discrimination of risk scores against observed survival - [brier_score](https://rich-iannone.github.io/greenwood/reference/brier_score.html): IPCW (Graf) Brier score of predicted survival probabilities at specified times - [integrated_brier_score](https://rich-iannone.github.io/greenwood/reference/integrated_brier_score.html): Integrated (time-averaged) Brier score across multiple time points - [cross_validate](https://rich-iannone.github.io/greenwood/reference/cross_validate.html): Evaluate a survival model's out-of-sample performance using k-fold cross-validation #### Visualization > plotnine survival curves and aligned numbers-at-risk tables. - [plot_survival](https://rich-iannone.github.io/greenwood/reference/plot_survival.html): Plot Kaplan-Meier survival curve(s) with Altair - [risk_table](https://rich-iannone.github.io/greenwood/reference/risk_table.html): Return the numbers-at-risk table as a standalone Altair chart #### Core kernel > The risk-set / event-table tabulation shared by KM, log-rank, and Cox. - [EventTable](https://rich-iannone.github.io/greenwood/reference/EventTable.html): Per-time risk-set tabulation (optionally within strata) - [event_table](https://rich-iannone.github.io/greenwood/reference/event_table.html): Tabulate the event history: risk sets and events at each observed time