Package: rstpm2 1.7.1
rstpm2: Smooth Survival Models, Including Generalized Survival Models
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.
Authors:
rstpm2_1.7.1.tar.gz
rstpm2_1.7.1.tar.gz(r-4.7-arm64)rstpm2_1.7.1.tar.gz(r-4.7-x86_64)rstpm2_1.7.1.tar.gz(r-4.6-arm64)rstpm2_1.7.1.tar.gz(r-4.6-x86_64)
rstpm2_1.7.1.tgz(r-4.6-emscripten)
manual.pdf |manual.html✨
card.svg |card.png
rstpm2/json (API)
NEWS
| # Install 'rstpm2' in R: |
| install.packages('rstpm2', repos = c('https://cran.r-universe.dev', 'https://cloud.r-project.org')) |
Bug tracker:https://github.com/mclements/rstpm2/issues
- brcancer - German breast cancer data from Stata.
- colon - Colon cancer.
- legendre.quadrature.rule.200 - Legendre quadrature rule for n=200.
- popmort - Background mortality rates for the colon dataset.
Last updated from:a9a6f23612. Checks:6 OK. Indexed: no.
| Target | Result | Time | Files | Syslog |
|---|---|---|---|---|
| linux-devel-arm64 | OK | 275 | ||
| linux-devel-x86_64 | OK | 268 | ||
| source / vignettes | OK | 461 | ||
| linux-release-arm64 | OK | 266 | ||
| linux-release-x86_64 | OK | 296 | ||
| wasm-release | OK | 180 |
Exports:addModelaftaftModelAICAICcanovabhazardBICcoefcoef<-confintconfint.predictnlcox.tvceformformulagsmgsm_designhazFunhrModelincrVarlinesmarkov_msmmarkov_sdensxnsxDplotpredictpredictnlpredictnl.defaultpstpm2qAICcratio_markov_msmresidualssimulatesmoothpwcsplineFunstandardisestpm2summaryupdatevcovvoptimisevoptimizevunirootzeroModel
Dependencies:bbmlebdsmatrixfastGHQuadlatticelsodaMASSMatrixmgcvmvtnormnlmenumDerivRcppRcppArmadillosurvival
\texttt{rstpm2}: a simple guide
Rendered fromSimpleGuide.Rnwusingutils::Sweaveon Jun 11 2026.Last update: 2019-10-15
Started: 2019-10-15
Introduction to the predictnl function
Rendered frompredictnl.Rnwusingutils::Sweaveon Jun 11 2026.Last update: 2018-05-29
Started: 2018-05-29
Introduction to the rstpm2 Package
Rendered fromIntroduction.Rnwusingutils::Sweaveon Jun 11 2026.Last update: 2025-08-27
Started: 2015-07-26
Predictions for Markov multi-state models
Rendered frommultistate.Rnwusingutils::Sweaveon Jun 11 2026.Last update: 2025-07-25
Started: 2019-10-15
