rstpm21.6.6.1 package

Smooth Survival Models, Including Generalized Survival Models

aft-class

Class "stpm2" ~~~

aft

Parametric accelerated failure time model with smooth time functions

bhazard

Placemarker function for a baseline hazard function.

coef

Generic method to update the coef in an object.

cox.tvc

Test for a time-varying effect in the coxph model

eform

S3 method for to provide exponentiated coefficents with confidence int...

grad

gradient function (internal function)

gsm_design

Extract design information from an stpm2/gsm object and newdata for us...

gsm.control

Defaults for the gsm call

gsm

Parametric and penalised generalised survival models

incrVar

Utility that returns a function to increment a variable in a data-fram...

lines

S3 methods for lines

markov_msm

Predictions for continuous time, nonhomogeneous Markov multi-state mod...

markov_sde

Predictions for continuous time, nonhomogeneous Markov multi-state mod...

nsx

Generate a Basis Matrix for Natural Cubic Splines (with eXtensions)

nsxD

Generate a Basis Matrix for the first derivative of Natural Cubic Spli...

numDeltaMethod

Calculate numerical delta method for non-linear predictions.

plot-methods

plots for an stpm2 fit

predict-methods

Predicted values for an stpm2 or pstpm2 fit

predict.nsx

Evaluate a Spline Basis

predictnl-methods

~~ Methods for Function predictnl ~~

predictnl

Estimation of standard errors using the numerical delta method.

pstpm2-class

Class "pstpm2"

residuals-methods

Residual values for an stpm2 or pstpm2 fit

rstpm2-internal

Internal functions for the rstpm2 package.

simulate-methods

Simulate values from an stpm2 or pstpm2 fit

smoothpwc

Utility to use a smooth function in markov_msm based on piece-wise con...

stpm2-class

Class "stpm2" ~~~

tvcCoxph-class

Class "tvcCoxph"

update-methods

Methods for Function update

voptimize

Vectorised One Dimensional Optimization

vuniroot

Vectorised One Dimensional Root (Zero) Finding

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.

  • Maintainer: Mark Clements
  • License: GPL-2 | GPL-3
  • Last published: 2024-12-21