CRAN Task View: Survival Analysis
| Maintainer: | Arthur Allignol and Aurélien Latouche |
| Contact: | arthur.allignol at fdm.uni-freiburg.de |
| Version: | 2008-06-04 |
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.
This is a preliminary task view, and we have likely missed some important
information. Please email the task view maintener with any feedback.
Standard Survival Analysis
-
Basic Methods:
The recommended package
survival
provides
the necessary tools for estimating the distribution (survival probability) of time
to the event and cumulative hazards for various censoring
and truncation schemes.
muhaz
allows estimation
of the hazard function. Packages
eha
and
Design
provide additional tools for dealing with time to event data,
like facilities to obtain risk sets or number of events.
surv2sample
yields tests for comparing two survival
distributions.
TSHRC
provides a two-stage procedure
for comparing hazard rates. That is useful when hazard functions
cross. Package
emplik
can performs empirical likelihood
for means, quantiles and hazards from possibly censored and/or truncated
data. Package
dblcens
computes the NPMLE estimator of CDF for
doubly censored data, along with the CDF of the two censoring distributions.
Package
coin
provides conditional inference (aka permutation tests)
for a general indepence hypothesis for arbitrary scales including
censored variables. Notably the
surv_test
function for testing the equality of survival distributions in two or more independent groups.
-
Cox Model:
survival
permits to fit the well-known
Cox proportional hazards model for right-, left-, interval-censored
and counting process data. It can also be used with time-dependent
covariates. Goodness-of-fit tests are also implemented.
The
cph
function of the
Design
package
fits the Cox model for interval time-dependent covariates and time-dependent
strata.
CPE
can use either a
coxph
or
cph
object to evaluate the discriminatory power and the predictive accuracy of the model.
The
coxphf
function from
coxphf
package performs a Cox regression
with Firth's penalized likelihood. This
method has been shown to provide a solution in case of monotone likelihood.
coxrobust
fits efficiently and robustly Cox models, but in its
basic form, that is without time-dependent covariates.
intcox
fits a Cox model for interval censored data by the iterative
convex minorant algorithm. The
NestedCohort
package permits to
display the Kaplan-Meier estimates of the survival probability
and to fit a Cox proportional hazards model for nested cohorts.
survival
and
proptest
provides methods
to test for the proportional hazards assumption.
The path following algorithms for GLMs and Cox proportional hazards models have
been implemented in the
glmpath
package.
This strategy provided much smoother feature selection mechanism than the forward stepwise process.
-
Other Regression Models:
The
survival
package proposes as a complement of
the Cox model the
survreg
function, which fits linear
models for the mean of survival or its logarithm with various
parametric error distributions. Package
eha
implements
maximum likelihood estimation of proportional hazards models.
It reduces to a Cox model when there are no ties in the data.
This package also proposes the Weibull regression model. As for
the
Design
package, it contains an implementation of the
Buckley-James regression model. The
emplik
package also has
a function to compute the Buckley-James model, but without
intercept term.
rankreg
computes rank regression
estimator for the accelerated failure time model and tests the coefficients against
a given value.
emplik
performs the same test through
empirical likelihood estimation. A conditional quantile regression
model for censored data can be fitted using
crq
from the
quantreg
package. (An older implementation of one of the fitting algorithms is
available also available in package
crq.)
lss
implements a recent inference procedure based
on the least-squares principle for the accelerated failure time model.
The generalized additive models for location, scale and shape (GAMLSS) can also
be fitted for censored data, and are implemented in the
gamlss.cens
package. The
mixPHM
fits multiple mixtures of various parametric
hazard models using an EM algorithm.
smoothSurv
allows the fit
of a regression model with possible left-, right- and interval-censoring
and the error distribution expressed as a mixture of G-splines.
The
pseudo
package computes pseudo observations for
regressing survival function based on the restricted mean and
the Kaplan-Meier estimator.
The
tpr
package fits regression models for temporal
process responses with time-varying coefficients
The
timereg
package, not available on CRAN (see links below), contains
implementations of various models to deal with time-varying effects, like
the Aalen additive risk model, the semi-parametric additive risk model
by McKeague and Sasieni, the Cox-Aalen model by Scheike and Zhang,
the proportional excess hazards model by Martinussen and Scheike,
the Cox model with partly time-varying effects by Martinussen,
Scheike and Skovgaard, the two-stage estimation method for
the Clayton-Oakes-Glidden model and the semiparametric proportional odds model.
Can also do flexible regression modelling for competing risks data based on the IPCW direct binomial regression approach (Scheike, Zhang, Gerds, 2008).
Multistate Models
-
General Multistate Models:
The
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 correspondance
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.
The
mvna
package provides convenient functions for estimating
and plotting the cumulative transition hazards in any multistate model,
possibly subject to right-censoring and left-truncation.
changeLOS
permits to estimate and plot the transition probabilties
for any multistate model. It also estimates the change of length of hospital
stay.
The
msm
package contains functions for fitting general continuous-time
Markov and hidden Markov multistate models to longitudinal data. Transition rates
and output processes can be modelled in terms of covariates.
-
Recurrent Events:
coxph
from the
survival
can be used to
analyze recurrent event data.
The
cph
function of the
Design
package fits the Anderson-Gill
model for recurrent events, model which can also be fitted with the
frailtypack
package. The
survrec
package proposes
implementations of several models for recurrent events data, such as
the Pena-Strawderman-Hollander, Wang-Chang estimators, and MLE estimation
under a Gamma Frailty model. The Pena-Hollander model can be fitted using
the
gcmrec
package.
-
Competing Risks:
surv2sample
provides estimation of the cumulative incidence
functions for several causes of failure. The package also performs comparison
in two samples. The package
cmprsk
also estimates the cumulative
incidence functions, but they can be compared in more than two samples.
The package also implements the Fine and Gray model for regressing the
subdistribution hazards. Package
pseudo
computes pseudo observations
for modelling competing risks based on the cumulative incidence functions.
Relative Survival
relsurv
implements various regression models
used in relative survival, such as the additive model for
relative survival with a binomial or a Poisson error, or the
Andersen at al. multiplicative regression model, which is an
extension of the Cox model for relative survival. It can also
fit the Cox proportional hazards model in transformed times. The
package also includes display facilities and miscellaneous others.
Multivariate Survival
We mean by multivariate survival 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 or use frailty models.
-
Joint Modelling
Package
Icens
provides various implemention
of methods to find the NPMLE for censored and truncated
multivariate survival data. Note that some of these
techniques can be used for standard survival.
The package
MLEcens
permits to compute the nonparametric
maximum likelihood estimator for bivariate distributions when the
failure times cannot be directly observed.
-
Frailties:
The
CompetingRiskFrailty
package fits a Cox model
for each cause-specific hazards of competing risks data
with random effects and possible smooth varying coefficients.
frailypack
fits a shared gamma frailty model using
a penalized likelihood on the hazard function for left-truncated
and censored data, with a maximum of two strata.
Joint models for survival data can be fitted using the
JM
package. It can fit a Weibull accelerated failure time model, an additive log cumulative hazard model or a time-dependent
proportional hazards model.
kinship
implements
a mixed-effects Cox model.
Bayesian Models
bayesSurv
package proposes an implementation
of several accelerated failure time models with random effects.
Parameter estimation is made using MCMC methods.
The package
DPpackage
includes a generic function
to fit a mixture of Dirichlet process in an accelerated failure
time model for interval censored data.
A proportional hazards model using a Bayesian approach is implemented
in package
survBayes. Right- and interval-censored data
and a lognormal or gamma frailty term can be fitted.
Boosting techniques
The
mboost
package includes a random forest
and a generic gradient boosting algorithm for the construction
of prognostic and diagnostic models for right-censored data.
CoxBoost
provides routines for fitting Cox proportional
hazards models by likelihood based boosting.
An extension of Random Forest techniques to right-censored data
can be found in
randomSurvivalForest.
Other
KMsurv
includes the data sets and functions which
illustrates Klein and Moeschberger (1997),
Survival Analysis, Techniques for Censored and Truncated Data
, Springer-Verlag.
The package
boot
contains the function
bootcens, which
performs various resampling plans for censored data.
survivalROC
computes time-dependent ROC curve from censored
data using Kaplan-Meier or nearest neighbor estimation method.
The
TwoWaySurv
package fits an additive hazard model
for data where, besides the follow-time, a non-periodic calendar
time is also taken into account.
The package
party
provides various recursive
partitioning algorithms that are also applicable to censored
responses (conditional inference trees/forests, model-based recursive
partitioning).
CRAN packages:
Related links: