Package: rstpm2 1.5.9

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:Mark Clements [aut, cre], Xing-Rong Liu [aut], Benjamin Christoffersen [aut], Paul Lambert [ctb], Lasse Hjort Jakobsen [ctb], Alessandro Gasparini [ctb], Gordon Smyth [cph], Patrick Alken [cph], Simon Wood [cph], Rhys Ulerich [cph]

rstpm2_1.5.9.tar.gz
rstpm2_1.5.9.zip(r-4.5)rstpm2_1.5.9.zip(r-4.4)rstpm2_1.5.9.zip(r-4.3)
rstpm2_1.5.9.tgz(r-4.4-x86_64)rstpm2_1.5.9.tgz(r-4.4-arm64)rstpm2_1.5.9.tgz(r-4.3-x86_64)rstpm2_1.5.9.tgz(r-4.3-arm64)
rstpm2_1.5.9.tar.gz(r-4.5-noble)rstpm2_1.5.9.tar.gz(r-4.4-noble)
rstpm2_1.5.9.tgz(r-4.4-emscripten)rstpm2_1.5.9.tgz(r-4.3-emscripten)
rstpm2.pdf |rstpm2.html
rstpm2/json (API)
NEWS

# Install 'rstpm2' in R:
install.packages('rstpm2', repos = c('https://mclements.r-universe.dev', 'https://cloud.r-project.org'))

Peer review:

Bug tracker:https://github.com/mclements/rstpm2/issues

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
Datasets:

On CRAN:

44 exports 28 stars 5.17 score 15 dependencies 44 dependents 4 mentions 125 scripts 6.8k downloads

Last updated 2 years agofrom:79b05487a1. Checks:OK: 1 WARNING: 8. Indexed: yes.

TargetResultDate
Doc / VignettesOKSep 07 2024
R-4.5-win-x86_64WARNINGSep 07 2024
R-4.5-linux-x86_64WARNINGSep 07 2024
R-4.4-win-x86_64WARNINGSep 07 2024
R-4.4-mac-x86_64WARNINGSep 07 2024
R-4.4-mac-aarch64WARNINGSep 07 2024
R-4.3-win-x86_64WARNINGSep 07 2024
R-4.3-mac-x86_64WARNINGSep 07 2024
R-4.3-mac-aarch64WARNINGSep 07 2024

Exports:addModelaftaft_mixtureaftModelAICAICcanovabhazardBICcoefcoef<-confintconfint.predictnlcox.tvceformformulagsmgsm_designhazFunhrModelincrVarlinesmarkov_msmmarkov_sdensxnsxDplotpredictpredictnlpredictnl.defaultpstpm2qAICcratio_markov_msmresidualssimulatesmoothpwcsplineFunstandardisestpm2summaryupdatevcovvunirootzeroModel

Dependencies:bbmlebdsmatrixBHdeSolvefastGHQuadlatticeMASSMatrixmgcvmvtnormnlmenumDerivRcppRcppArmadillosurvival

Introduction to the predictnl function

Rendered frompredictnl.Rnwusingutils::Sweaveon Sep 07 2024.

Last update: 2018-05-29
Started: 2018-05-29

Introduction to the rstpm2 Package

Rendered fromIntroduction.Rnwusingutils::Sweaveon Sep 07 2024.

Last update: 2019-11-04
Started: 2013-05-31

Predictions for Markov multi-state models

Rendered frommultistate.Rnwusingutils::Sweaveon Sep 07 2024.

Last update: 2019-10-15
Started: 2019-05-08

Readme and manuals

Help Manual

Help pageTopics
Flexible parametric survival models.Rstpm2-package Rstpm2
Parametric accelerated failure time model with smooth time functionsaft
Class "stpm2" ~~~aft-class plot,aft,missing-method predict,aft-method predictnl,aft-method
Placemarker function for a baseline hazard function.bhazard
German breast cancer data from Stata.brcancer
Generic method to update the coef in an object.coef<-
Colon cancer.colon
Test for a time-varying effect in the 'coxph' modelcox.tvc
S3 method for to provide exponentiated coefficents with confidence intervals.eform eform.default eform.stpm2
gradient function (internal function)grad
Parametric and penalised generalised survival modelsgsm pstpm2 stpm2
Extract design information from an stpm2/gsm object and newdata for use in C++gsm_design
Defaults for the gsm callgsm.control
Utility that returns a function to increment a variable in a data-frame.incrVar
Legendre quadrature rule for n=200.legendre.quadrature.rule.200
S3 methods for lineslines.pstpm2 lines.stpm2
Predictions for continuous time, nonhomogeneous Markov multi-state models using parametric and penalised survival models.addModel aftModel as.data.frame.markov_msm as.data.frame.markov_msm_diff as.data.frame.markov_msm_ratio collapse_markov_msm diff diff.markov_msm hazFun hrModel markov_msm plot.markov_msm ratio_markov_msm rbind.markov_msm splineFun standardise standardise.markov_msm subset.markov_msm transform.markov_msm vcov.markov_msm zeroModel
Predictions for continuous time, nonhomogeneous Markov multi-state models using Aalen's additive hazards models.as.data.frame.markov_sde markov_sde plot.markov_sde standardise.markov_sde
Generate a Basis Matrix for Natural Cubic Splines (with eXtensions)nsx
Generate a Basis Matrix for the first derivative of Natural Cubic Splines (with eXtensions)nsxD
Calculate numerical delta method for non-linear predictions.numDeltaMethod
plots for an stpm2 fitplot,pstpm2-method plot,stpm2-method plot-methods
Background mortality rates for the colon dataset.popmort
Predicted values for an stpm2 or pstpm2 fitpredict,pstpm2-method predict,stpm2-method predict-methods
Evaluate a Spline Basispredict.nsx
Estimation of standard errors using the numerical delta method.confint.predictnl predict.formula predictnl predictnl.default predictnl.lm print.predictnl
~~ Methods for Function predictnl ~~predictnl,mle2-method predictnl-methods
Class "pstpm2"AIC,pstpm2-method AICc,pstpm2-method anova,pstpm2-method BIC,pstpm2-method eform,pstpm2-method lines,pstpm2-method plot,pstpm2,missing-method predictnl,pstpm2-method pstpm2-class qAICc,pstpm2-method summary,pstpm2-method
Residual values for an stpm2 or pstpm2 fitresiduals,pstpm2-method residuals,stpm2-method residuals-methods
Internal functions for the rstpm2 package.lhs lhs<- rhs rhs<-
Simulate values from an stpm2 or pstpm2 fitsimulate,pstpm2-method simulate,stpm2-method simulate-methods
Utility to use a smooth function in markov_msm based on piece-wise constant valuessmoothpwc
Class "stpm2" ~~~eform,stpm2-method lines,stpm2-method plot,stpm2,missing-method predictnl,stpm2-method stpm2-class summary,stpm2-method
Class '"tvcCoxph"'plot,tvcCoxph,missing-method tvcCoxph-class
Methods for Function updateupdate,stpm2-method update-methods
Vectorised One Dimensional Root (Zero) Findingvuniroot