Skip to content

v0.5.0

Latest

Choose a tag to compare

@rich-iannone rich-iannone released this 29 Jul 18:57

Greenwood v0.5.0 adds first-class support for time-varying covariates. The new split_episodes() utility handles the data-wrangling step that has historically been a barrier to TVC analysis: it takes a subject-level baseline table and a long-format visits table and merges them into the counting-process (interval-per-row) format that Surv.counting() and CoxPH already accept.

New Features

  • Time-varying covariate support via split_episodes() — Converts repeated-measurement data into counting-process (episode-split) format. Accepts a baseline table (one row per subject with follow-up time, event indicator, and time-fixed covariates) and a visits table (one row per subject/visit with time-varying covariate values), and produces a (tstart, tstop, event, …) dataset ready to pass directly to Surv.counting() and CoxPH.fit(). Supports last-observation-carried-forward (LOCF) via carry_forward=True and returns output in Pandas, Polars, or PyArrow depending on the format= argument. (#21)