Last updated on 2020-11-27 by Arthur Allignol, Aurelien Latouche
Survival analysis, also called event history analysis in social science, or reliability analysis in engineering, deals with time until occurrence of an event of interest. However, this failure time may not be observed within the relevant time period, producing so-called censored observations.
This task view aims at presenting the useful R packages for the analysis of time to event data.
Please let the maintainers know if something is inaccurate or missing. The Task View is also on github. Feel free to open an issue or submit a pull request.
Estimation of the Survival Distribution
survfit
function from the survival package
computes the Kaplan-Meier estimator for truncated and/or censored data.
rms (replacement of the Design package)
proposes a modified version of the survfit
function.
The prodlim package implements a fast algorithm and some features
not included in survival.
Various confidence intervals and confidence bands for the Kaplan-Meier estimator
are implemented in the km.ci package.
plot.Surv
of package eha plots
the Kaplan-Meier estimator.
The NADA package includes a function to compute the Kaplan-Meier
estimator for left-censored data.
svykm
in survey provides a weighted
Kaplan-Meier estimator.
The kaplan-meier
function
in spatstat computes the Kaplan-Meier estimator from
histogram data. The MAMSE package permits to compute a
weighted Kaplan-Meier estimate. The KM
function in
package rhosp plots the survival function using a
variant of the Kaplan-Meier estimator in a hospitalisation risk
context. The survPresmooth package computes
presmoothed estimates of the main quantities used for
right-censored data, i.e., survival, hazard and density functions.
The bpcp package provides several functions for computing confidence
intervals of the survival distribution (e.g., beta product
confidence procedure). The lbiassurv package offers
various length-bias corrections to survival curve
estimation.
The landest package allows landmark
estimation and testing of survival
probabilities. The jackknifeKME package computes the
original and modified jackknife estimates of Kaplan-Meier
estimators. The condSURV package provides
methods for estimating the conditional survival function for
ordered multivariate failure time data. The gte package
implements the generalised Turnbull estimator proposed by Dehghan
and Duchesne for estimating the conditional survival function with
interval-censored data.
icfit
function in package interval
computes the NPMLE for interval-censored data.
The DTDA package implements several algorithms
permitting to analyse possibly doubly truncated survival
data.
Hazard Estimation
epi.insthaz
function from epiR computes
the instantaneous hazard from the Kaplan-Meier estimator.
Testing
survdiff
function in survival
compares survival curves using the Fleming-Harrington G-rho family of test.
NADA implements this class of tests for left-censored
data.
SurvTest
in the coin package implements
the logrank test reformulated as a linear rank test.
Regression Modelling
coxph
function in
the survival package fits the Cox model.
cph
in the rms package and
the eha package propose some extensions to the
coxph
function. The package coxphf
implements the Firth's penalised maximum likelihood bias reduction
method for the Cox model. An implementation of weighted
estimation in Cox regression can be found in coxphw.
The coxrobust package proposes a robust implementation
of the Cox model.
timecox
in package timereg fits Cox models
with possibly time-varying effects. The mfp package
permits to fit Cox models with multiple fractional
polynomial. A Cox model model can be fitted to
data from complex survey design using the svycoxph
function in survey. The multipleNCC package
fits Cox models using a weighted partial likelihood for nested
case-control studies. The MIICD package implements
Pan's (2000) multiple imputation approach to Cox models for
interval censored data. The ICsurv package fits Cox
models for interval-censored data through an EM algorithm.
The dynsurv package fits time-varying coefficient
models for interval censored and right censored survival data
using a Bayesian Cox model, a spline based Cox model or a
transformation model. The OrdFacReg package implements the Cox
model using an active set algorithm for dummy variables of ordered
factors. The survivalMPL package fits Cox models using
maximum penalised likelihood and provide a non parametric smooth
estimate of the baseline hazard function. A Cox model with
piecewise constant hazards can be fitted using the pch
package. The icenReg package implements several models
for interval-censored data, e.g., Cox, proportional odds, and
accelerated failure time models. A Cox type Self-Exciting
Intensity model can be fitted to right-censored data using
the coxsei package. The SurvLong contains
methods for estimation of proportional hazards models with
intermittently observed longitudinal
covariates. The plac package provides routines to fit
the Cox model with left-truncated data using augmented information
from the marginal of the truncation times.
cox.zph
function in survival.
The CPE package calculates concordance probability
estimate for the Cox model, as does the coxphCPE
function in clinfun. The coxphQuantile
in
the latter package draws a quantile curve of the survival
distribution as a function of covariates. The multcomp
package computes simultaneous tests and confidence intervals for
the Cox model and other parametric survival
models. The lsmeans package permits to obtain
least-squares means (and contrasts thereof) from linear models. In
particular, it provides support for
the coxph
, survreg
and coxme
functions. The multtest
package on Bioconductor proposes a resampling based multiple
hypothesis testing that can be applied to the Cox model. Testing
coefficients of Cox regression models using a Wald test with a
sandwich estimator of variance can be done using
the saws package. The rankhazard package
permits to plot visualisation of the relative importance of
covariates in a proportional hazards
model. The smoothHR package provides hazard ratio
curves that allows for nonlinear relationship between predictor
and survival. The paf package permits to compute the
unadjusted/adjusted attributable fraction function from a Cox
proportional hazards model. The PHeval package proposes
tools to check the proportional hazards assumption using a
standardised score process. The ELYP package implements
empirical likelihood analysis for the Cox Model and Yang-Prentice
(2005) Model.
survreg
(from survival) fits a parametric
proportional hazards model. The eha
and mixPHM packages implement a proportional hazards
model with a parametric baseline hazard. The pphsm
in rms translates an AFT model to a proportional
hazards form. The polspline package includes
the hare
function that fits a hazard regression
model, using splines to model the baseline hazard. Hazards can be,
but not necessarily, proportional. The flexsurv package
implements the model of Royston and Parmar (2002). The model uses
natural cubic splines for the baseline survival function, and
proportional hazards, proportional odds or probit functions for
regression. The SurvRegCensCov package allows
estimation of a Weibull Regression for a right-censored endpoint,
one interval-censored covariate, and an arbitrary number of
non-censored covariates.
survreg
function in package survival can
fit an accelerated failure time model. A modified version of
survreg
is implemented in the rms package
(psm
function). It permits to use some of the
rms functionalities. The eha package also
proposes an implementation of the AFT model (function
aftreg
). The NADA package
proposes the front end of the survreg
function for
left-censored data. The
simexaft package implements the
Simulation-Extrapolation algorithm for the AFT model, that can be
used when covariates are subject to measurement error. A robust
version of the accelerated failure time model can be found in
RobustAFT. The coarseDataTools package fits
AFT models for interval censored data. An alternative weighting scheme for parameter estimation in
the AFT model is proposed in the imputeYn package. The
AdapEnetClass package implements elastic net
regularisation for the AFT model.
aareg
and aalen
,
respectively. timereg also proposes an implementation
of the Cox-Aalen model (that can also be used to perform the Lin,
Wei and Ying (1994) goodness-of-fit for Cox regression models) and
the partly parametric additive risk model of McKeague and
Sasieni. A version of the Cox-Aalen model for interval censored
data is available in the coxinterval
package. The uniah package fits shape-restricted
additive hazards models. The addhazard package contains
tools to fit additive hazards model to random sampling, two-phase
sampling and two-phase sampling with auxiliary information.
bj
function in rms and
BJnoint
in emplik compute the
Buckley-James model, though the latter does it without
an intercept term.
survreg
can fit other types of models depending on the chosen
distribution, e.g., a tobit model. The AER
package provides the tobit
function, which is a
wrapper of survreg
to fit the tobit model. An
implementation of the tobit model for cross-sectional data and
panel data can be found in the censReg package.
The timereg package provides implementation of the
proportional odds model and of the proportional excess hazards
model. The invGauss package fits the inverse Gaussian
distribution to survival data. The model is based on describing
time to event as the barrier hitting time of a Wiener process,
where drift towards the barrier has been randomized with a
Gaussian distribution. The pseudo package computes the
pseudo-observation for modelling the survival function based on
the Kaplan-Meier estimator and the restricted
mean. The fastpseudo package dose the same for the
restricted mean survival time. flexsurv fits
parametric time-to-event models, in which any parametric
distribution can be used to model the survival probability, and
where one of the parameters is a linear function of covariates.
The Icens
function in package Epi provides
a multiplicative relative risk and an additive excess risk model
for interval-censored data. The VGAM package can fit
vector generalised linear and additive models for censored data.
The gamlss.cens package implements the generalised
additive model for location, scale and shape that can be fitted to
censored data. The locfit.censor
function
in locfit produces local regression estimates.
The crq
function included in the quantreg
package implements a conditional quantile regression model for
censored data. The JM package fits shared parameter
models for the joint modelling of a longitudinal response and
event times. The temporal process regression model is implemented
in the tpr package. Aster models, which combine
aspects of generalized linear models and Cox models, are
implemented in the aster and aster2
packages.
The BGPhazard package implements Markov
beta and gamma processes for modelling the hazard ratio for
discrete failure time data. The surv2sampleComp
packages proposes some model-free contrast comparison measures
such as difference/ratio of cumulative hazards, quantiles and
restricted mean. The rstpm2 package provides link-based
survival models that extend the Royston-Parmar models, a family of
flexible parametric models. The TransModel package
implements a unified estimation procedure for the analysis of
censored data using linear transformation
models. The ICGOR fits the generalized odds rate hazards
model to interval-censored data while GORCure
generalized odds rate mixture cure model to interval-censored
data. The thregI package permits to fit a threshold
regression model for interval-censored data based on the
first-hitting-time of a boundary by the sample path of a Wiener
diffusion process. The miCoPTCM package fits
semiparametric promotion time cure models with possibly
mis-measured covariates. The smcure package permits to fit
semiparametric proportional hazards and accelerated failure time
mixture cure models. The dynamichazard package allows
to estimate various hazard models where the coefficients follow a
state equation. The estimation is then carried out with a
combination of an Extended Kalman Filter or Unscented Kalman
filter combined with an EM algorithm. The case-base sampling
approach for fitting flexible hazard regression models to survival
data with single event type or multiple competing causes via
logistic and multinomial regression can be found in
package casebase.
coxph
function from package survival can be fitted for any
transition of a multistate model. It can also be used for
comparing two transition hazards, using correspondence between
multistate models and time-dependent covariates. Besides, all the
regression methods presented above can be used for multistate
models as long as they allow for left-truncation.survfit
) and prodlim can also be used
to estimate the cumulative incidence function.
The NPMLEcmprsk
package implements the semi-parametric mixture model for competing
risks data. The MIICD package implements Pan's (2000)
multiple imputation approach to the Fine and Gray model for
interval censored data. The CFC package permits to
perform Bayesian, and non-Bayesian, cause-specific competing risks
analysis for parametric and non-parametric survival
functions. The gcerisk package provides some methods
for competing risks data. Estimation, testing and regression
modeling of subdistribution functions in the competing risks
setting using quantile regressions can be had
in cmprskQR. The intccr package permits to
fit the Fine and Gray model as well other models that belong to
the class of semiparametric generalized odds rate transformation
models to interval-censored competing risks data.
coxph
from the
survival package can be used to analyse recurrent event
data. The cph
function of the rms package
fits the Anderson-Gill model for recurrent events.
The condGEE
package implements the conditional GEE for recurrent event gap
times. The reda
package provides function to fit gamma frailty model with either a
piecewise constant or a spline as the baseline rate function for
recurrent event data, as well as some miscellaneous functions for
recurrent event data.
rs.surv
computes a relative
survival curve. rs.add
fits an additive model and rsmul
fits the Cox model of Andersen et al. for relative survival, while rstrans
fits a Cox model in transformed time.
coxph
and survreg
functions in package
survival. A mixed-effects Cox model is implemented in
the coxme package. The two.stage
function
in the timereg package fits the Clayton-Oakes-Glidden
model. The parfm package fits fully parametric frailty
models via maximisation of the marginal likelihood.
The lmec package fits a
linear mixed-effects model for left-censored data. The tlmec
package implements a linear mixed effects model for censored data
with Student-t or normal distributions. The parfm
package implements parametric frailty models by maximum marginal
likelihood. The PenCoxFrail package provides a
regularisation approach for Cox frailty models through
penalisation. The mexhaz enables modelling of the
excess hazard regression model with time-dependent and/or
non-linear effect(s) and a random effect defined at the cluster
level. The frailtyEM package contains
functions for fitting shared frailty models with a semi-parametric
baseline hazard with the Expectation-Maximization
algorithm. Supported data formats include clustered failures with
left truncation and recurrent events in gap-time or Andersen-Gill
format
Multivariate survival refers to the analysis of unit, e.g., the survival of twins or a family. To analyse such data, we can estimate the joint distribution of the survival times
NMixMCMC
in mixAK performs an MCMC estimation
of normal mixtures for censored data.
MCMCtobit
in MCMCpack.
weibullregpost
function in LearnBayes computes
the log posterior density for a Weibull proportional-odds regression model.
Multivariate survival refers to the analysis of unit, e.g., the survival of twins or a family. To analyse such data, we can estimate the joint distribution of the survival times
NMixMCMC
in mixAK performs an MCMC estimation
of normal mixtures for censored data.
MCMCtobit
in MCMCpack.
weibullregpost
function in LearnBayes computes
the log posterior density for a Weibull proportional-odds regression model.
This section tries to list some specialised plot functions that might be useful in the context of event history analysis.
plot.Hist
function in prodlim permits
to draw the states and transitions that characterize a multistate
model.
ggsurvplot
for drawing survival curves with
the 'number at risk' table. Other functions are also available for
visual examinations of cox model assumptions.
censboot
function that
implements several types of bootstrap techniques for right-censored data.
5 years ago by Hasinur Rahaman Khan
A Class of Adaptive Elastic Net Methods for Censored Data
8 years ago by Anders Gorst-Rasmussen
Regularization for semiparametric additive hazards regression
2 years ago by Hengrui Cai
Average Positive Predictive Values (AP) for Binary Outcomes and Censored Event Times
5 years ago by Fernando Colchero
Age-Specific Survival Analysis from Incomplete Capture-Recapture/Recovery Data
4 years ago by Andrew Chapple
Hierarchical Bayesian Model for a Hazard Function
11 days ago by Emilio Akira Morones Ishikawa
Markov Beta and Gamma Processes for Modeling Hazard Rates
7 months ago by Sahir Bhatnagar
Fitting Flexible Smooth-in-Time Hazards and Risk Functions via Logistic and Multinomial Regression
3 years ago by Venkatraman E. Seshan
Clinical Trial Design and Data Analysis Functions
a year ago by Stephan Dlugosz
Analysis of Competing Risks Using Quantile Regressions
12 days ago by Torsten Hothorn
Conditional Inference Procedures in a Permutation Test Framework
7 months ago by Takeshi Emura
Univariate Feature Selection and Compound Covariate for Predicting Survival
7 years ago by David Clement
Parameter estimation in conditional GEE for recurrent event gap times
4 years ago by Marta Sestelo
Estimation of the Conditional Survival Function for Ordered Multivariate Failure Time Data
3 years ago by Eric S. Kawaguchi
Quantile Comparison for Two-Sample Right-Censored Survival Data
3 years ago by Arthur Allignol
The Conditional Probability Function of a Competing Event
9 years ago by Emil A. Cornea
Power Calculation for Weighted Log-Rank Tests in Cure Rate Models
8 years ago by Aurelien Latouche
Competing risks regression for Stratified and Clustered data
6 years ago by Ravi Varadhan
Stepwise Covariate Selection for the Fine & Gray Competing Risks Regression Model
6 years ago by Hein Putter
Companion Package to "Dynamic Prediction in Clinical Survival Analysis"
2 years ago by William H. Barton
Empirical Likelihood Ratio Test for Two Samples with Censored Data
a year ago by Torsten Hothorn
Exact Distributions for Rank and Permutation Tests
2 years ago by Yun-Hee Choi
Family Age-at-Onset Data Simulation and Penetrance Estimation
4 months ago by Ramon Oller
Tests for Right and Interval-Censored Survival Data Based on the Fleming-Harrington Class
2 months ago by Aurelie Siberchicot
Help to Fit of a Parametric Distribution to Non-Censored or Censored Data
2 years ago by Christopher Jackson
Flexible Parametric Survival and Multi-State Models
3 years ago by Mikis Stasinopoulos
Fitting an Interval Response Variable Using `gamlss.family' Distributions
16 days ago by Trevor Hastie
Lasso and Elastic-Net Regularized Generalized Linear Models
3 years ago by Mee Young Park
L1 Regularization Path for Generalized Linear Models and Cox Proportional Hazards Model
8 years ago by Anne-Laure Boulesteix
Testing the additional predictive value of high-dimensional data
6 years ago by Qiang Zhao
Generalized Logrank Tests for Interval-censored Failure Time Data
4 months ago by Clifford Anderson-Bergman
Regression Models for Interval Censored Data
7 years ago by Lianming Wang
A package for semiparametric regression analysis of interval-censored data
4 years ago by Francesca Mangili
Imprecise Dirichlet Process for Survival Analysis
5 years ago by Hasinur Rahaman Khan
Imputing the Last Largest Censored Observation(s) Under Weighted Least Squares
4 months ago by Michael P. Fay
Weighted Logrank Tests and NPMLE for Interval Censored Data
7 years ago by Hakon K. Gjessing
Threshold regression that fits the (randomized drift) inverse Gaussian distribution to survival data.
8 years ago by S. Kovalchik
Tools for subgroup analyses with multiple trial data using aggregate statistics
5 years ago by Hasinur Rahaman Khan
Jackknife Estimates of Kaplan-Meier Estimators or Integrals
a year ago by Dimitris Rizopoulos
Joint Modeling of Longitudinal and Time-to-Event Data under a Bayesian Approach
a year ago by Pete Philipson
Joint Modelling of Repeated Measurements and Time-to-Event Data
2 months ago by Takeshi Emura
Joint Frailty-Copula Models for Tumour Progression and Death in Meta-Analysis
5 years ago by Sehee Kim
Semiparametric Joint Models for Longitudinal and Counting Processes
8 years ago by Vahid Partovi Nia
Length-biased correction to survival curve estimation.
a year ago by Dominic Schuhmacher
Maximum Likelihood Estimation of a log-Concave Density Based on Censored Data
2 years ago by Daniela M Witten
Lassoed Principal Components for Testing Significance of Features
4 years ago by Jean-Francois Plante
Calculation of Minimum Averaged Mean Squared Error (MAMSE) Weights
2 months ago by Aurelie Bertrand
Promotion Time Cure Model with Mis-Measured Covariates
8 months ago by ArnoŔt KomÔrek
Multivariate Normal Mixture Models and Mixtures of Generalized Linear Mixed Models Including Model Based Clustering
8 years ago by Marloes Maathuis
Computation of the MLE for bivariate (interval) censored data
a year ago by Christopher Jackson
Multi-State Markov and Hidden Markov Models in Continuous Time
4 years ago by Francesco Grossetti
Building Augmented Data to Run Multi-State Models with 'msm' Package
a month ago by Hein Putter
Data Preparation, Estimation and Prediction in Multi-State Models
2 months ago by Torsten Hothorn
Simultaneous Inference in General Parametric Models
a year ago by Nathalie C. Stoer
Weighted Cox-Regression for Nested Case-Control Data
3 years ago by Arthur Allignol
Nelson-Aalen Estimator of the Cumulative Hazard in Multistate Models
2 years ago by Chung-Hsing Chen
Type-Specific Failure Rate and Hazard Rate on Competing Risks Data
6 years ago by Kaspar Rufibach
Least Squares, Logistic, and Cox-Regression with Ordered Predictors
7 years ago by Soo-Heang Eo
Outlier Detection using quantile regression for Censored Data
a year ago by Paolo Frumento
Piecewise Constant Hazards Models for Censored and Truncated Data
2 months ago by Thomas A. Gerds
Prediction Error Curves for Risk Prediction Models in Survival Analysis
6 years ago by Holger Reulen
Estimating Regularized Multi-state Models Using L1 Penalties
6 years ago by Marie-Pierre Sylvestre
Permutational Algorithm to Simulate Survival Data
2 years ago by Cecile Chauvel
Evaluation of the Proportional Hazards Assumption with a Standardized Score Process
a year ago by Joonas Miettinen
Functions for Epidemiological Analysis using Population Data
19 days ago by Weiliang Qiu
Power and Sample Size Calculation for Survival Analysis of Epidemiological Studies
a year ago by Silvia Liverani
Dirichlet Process Bayesian Clustering, Profile Regression
a year ago by Thomas A. Gerds
Product-Limit Estimation for Censored Event History Analysis
4 years ago by Kyu Ha Lee
Penalized Parametric and Semiparametric Bayesian Survival Models with Shrinkage and Grouping Priors
a year ago by Udaya B. Kogalur
Fast Unified Random Forests for Survival, Regression, and Classification (RF-SRC)
2 years ago by Christophe Dutang
Side Effect Risks in Hospital : Simulation and Estimation
2 months ago by Thomas Alexander Gerds
Risk Regression Models and Prediction Scores for Survival Analysis with Competing Risks
8 years ago by Paramita Saha-Chaudhuri<U+000a>
Riskset ROC curve estimation from censored survival data
a year ago by A. Randriamiharisoa
Truncated Maximum Likelihood Fit and Robust Accelerated Failure Time Regression for Gaussian and Log-Weibull Case
a year ago by Mark Clements
Smooth Survival Models, Including Generalized Survival Models
a year ago by Michael P. Fay
Small-Sample Adjustments for Wald Tests Using Sandwich Estimators
2 years ago by Kyu Ha Lee
Hierarchical Models for Parametric and Semi-Parametric Analyses of Semi-Competing Risks Data
5 years ago by Nusrat Rabbee
Simulated Survival and Hazard Analysis for Time-Dependent Exposure
5 years ago by Andrew G Chapple
'Simulates Univariate and Semi-Competing Risks Data Given Covariates and Piecewise Exponential Baseline Hazards'
4 years ago by Thomas Alexander Gerds
Estimation of Smooth Hazard Models for Interval-Censored Data with Applications to Survival and Illness-Death Models
2 years ago by Anthony Davison
Practicals for Use with Davison (2003) Statistical Models
8 months ago by Adrian Baddeley
Spatial Point Pattern Analysis, Model-Fitting, Simulation, Tests
9 months ago by Benjamin M. Taylor
Bayesian Spatial Survival Analysis with Parametric Proportional Hazards Models
2 days ago by Haiming Zhou
Bayesian Modeling and Analysis of Spatially Correlated Survival Data
4 years ago by Miki Horiguchi
Sample Size Calculation using Restricted Mean Survival Time
4 years ago by Miki Horiguchi
Inference for Model-Free Between-Group Parameters for Censored Survival Data
8 years ago by Sergej Potapov
Estimators of prediction accuracy for time-to-event data.
8 years ago by Hajime Uno
C-statistics for risk prediction models with censored survival data
8 years ago by Hugo Varet
Relative survival, AER and SMR based on French death rates
8 years ago by Hajime Uno
IDI and NRI for comparing competing risk prediction models with censored survival data
3 years ago by Maurizio Manuguerra
Penalised Maximum Likelihood for Survival Analysis Models
8 years ago by Paramita Saha-Chaudhuri<U+000a>
Time-dependent ROC curve estimation from censored survival data
5 years ago by Haleh Yasrebi
Survival Prediction by Joint Analysis of Microarray Gene Expression Data
a year ago by Shannon T. Holloway
Analysis of Proportional Hazards Model with Sparse Longitudinal Covariates
3 years ago by Ignacio Lopez de Ullibarri
Presmoothed Estimation in Survival Analysis
5 years ago by Stanislas Hubeaux
Weibull Regression for a Right-Censored Endpoint with Interval-Censored Covariate
5 years ago by Alexander Sibley
Power Calculations for SNP Studies with Censored Outcomes
4 years ago by Cassio de Campos
Survival Analysis using a Transform-Both-Sides Model
3 years ago by Man-Hua Chen
Threshold Regression for Interval-Censored Data with a Cure Rate Option
a year ago by Paul Blanche
Time-Dependent ROC Curve and AUC for Censored Survival Data
3 years ago by Vanesa Balboa-Barreiro
Estimation of Transition Probabilities for the Illness-Death Model
a year ago by Artur Araujo
Estimation of Transition Probabilities in Multistate Models
3 months ago by Gilbert Ritschard
Trajectory Miner: a Toolbox for Exploring and Rendering Sequences
3 years ago by David J. Sharrow
Fitting Routines for the Vitality Family of Mortality Models