rstpm2
1.7.1Smooth Survival Models, Including Generalized Survival Models
Overview
R implementation of generalized survival models (GSMs), smooth accelerated failure time (AFT) models and Markov multi-state models. For the GSMs, g(S(t|x))=eta(t,x) for a link function g, survival S at time t with covariates x and a linear predictor eta(t,x). The main assumption is that the time effect(s) are smooth doi:10.1177/0962280216664760. For fully parametric models with natural splines, this re-implements Stata's 'stpm2' function, which are flexible parametric survival models developed by Royston and colleagues. We have extended the parametric models to include any smooth parametric smoothers for time. We have also extended the model to include any smooth penalized smoothers from the 'mgcv' package, using penalized likelihood. These models include left truncation, right censoring, interval censoring, gamma frailties and normal random effects doi:10.1002/sim.7451, and copulas. For the smooth AFTs, S(t|x) = S_0(t*eta(t,x)), where the baseline survival function S_0(t)=exp(-exp(eta_0(t))) is modelled for natural splines for eta_0, and the time-dependent cumulative acceleration factor eta(t,x)=\int_0^t exp(eta_1(u,x)) du for log acceleration factor eta_1(u,x). The Markov multi-state models allow for a range of models with smooth transitions to predict transition probabilities, length of stay, utilities and costs, with differences, ratios and standardisation.
Install
Health
- OK2026-04-2512 OK · 0 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- NOTE2026-04-2212 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
- ERROR2026-04-1811 OK · 2 NOTE · 0 WARNING · 1 ERROR · 0 FAILURE
- NOTE2026-03-1012 OK · 2 NOTE · 0 WARNING · 0 ERROR · 0 FAILURE
Documentation
- Examples that run
- 94%
- Documented parameters
- 90%
- Return-value docs
- 100%
- References docs
- 80%
Downloads
Repository
Repository practices
2 development-tooling and community-health practices detected across 2 families in the upstream repository
Checks run against github.com/mclements/rstpm2 on 2026-07-26.
Dependencies
Code & Tests
Datasets
People & History
28 releases. Pick two to compare their code metrics. R releases are shown for context.
- RR 4.6.0 released · 2026-04-24
- 1.7.1Latest
- 1.7.02025-08-27 · diff ↗
- 1.6.92025-07-25 · diff ↗
- 1.6.72025-05-11 · diff ↗
- RR 4.5.0 released · 2025-04-11
- 1.6.6.12024-12-21 · diff ↗
- 1.6.62024-10-29 · diff ↗
- 1.6.52024-08-20 · diff ↗
- 1.6.42024-08-19 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 1.6.32023-12-05 · diff ↗
- RR 4.3.0 released · 2023-04-21
- 1.6.22023-03-08 · diff ↗
- 1.6.12023-02-28 · diff ↗
- 1.5.92023-01-07 · diff ↗
Show 24 earlier events
- 1.5.82022-10-17 · diff ↗
- 1.5.72022-07-14 · diff ↗
- 1.5.62022-05-10 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 1.5.52022-04-19 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 1.5.22021-03-03 · diff ↗
- RR 4.0.0 released · 2020-04-24
- 1.5.12019-11-06 · diff ↗
- 1.5.02019-10-15 · diff ↗
- RR 3.6.0 released · 2019-04-26
- 1.4.52019-01-17 · diff ↗
- 1.4.42018-11-01 · diff ↗
- 1.4.22018-05-29 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 1.4.12017-09-20 · diff ↗
- 1.4.02017-08-31 · diff ↗
- RR 3.4.0 released · 2017-04-21
- 1.3.42016-10-09 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 1.3.22016-04-13 · diff ↗
- 1.3.12016-02-24 · diff ↗
- 1.2.22015-07-26
- RR 3.2.0 released · 2015-04-16
Package metadata
- First published
- 2015-07-26
- Total releases
- 28 / 11 yrs
- License
- GPL-2 | GPL-3 OSI
- Minimum R
- ≥ 3.0.2
- Bundled data
- 119 KB / 4 files
- Download size
- 1.1 MB
- Installed size
- not tracked yet
- With dependencies
- not tracked yet