Survival Analysis
Overview
Contains the core survival analysis routines, including definition of Surv objects, Kaplan-Meier and Aalen-Johansen (multi-state) curves, Cox models, and parametric accelerated failure time models.
- Update Surv2 so that a 0/1 or TRUE/FALSE status is not turned into a factor, in agreement with Surv
- Add the clabel attribute to Surv and Surv2 objects, i.e., retain the label that was used for "censoring" when status is a factor. Begin to use that label in printout. Some code used (censor) and some (censored) as a default label for non-factor status, standardize on the first.
- Minor error in survfit: if a subject had data of (0,10+), (10,24) the "censor" at time 10 really isn't a censoring, and 10 should not appear in the time component. But sometimes it did, depending on the path through the code. The curve was always correct, just with extra time points. Add tests/survfit3.R to C test for this.
- Fix subscripting errors in yates() for a coxph model with an NA coefficient, and add a test case. Git pull request 343 found the error but the code change needed more documentation/comments. A similar length error is now fixed in survpenal.fit.
From inst/NEWS.Rd in the release
Install
Health
NOTEcompiled coder-devel-windows-x86_64
Note: information on .o files for x64 is not available File 'd:/Rcompile/CRANpkg/lib/4.7/survival/libs/x64/survival.dll': Found '_exit', possibly from '_exit' (C) Found 'abort', possibly from 'abort' (C), 'runtime' (Fortran) Compiled code should not call entry points which might terminate R nor write to stdout/stderr instead of to the console, nor use Fortran I/O nor system RNGs nor [v]sprintf. The detected symbols are linked into the code but might come from libraries and not actually be called. See 'Writing portable packages' in the 'Writing R Extensions' manual.
- NOTE12 OK, 1 NOTE2026-09-18
- OK13 OK2026-09-17
- NOTE12 OK, 1 NOTE2026-09-16
- ERROR11 OK, 1 NOTE, 1 ERROR2026-09-11
- NOTE12 OK, 1 NOTE2026-08-27
Show 6 earlier changesHide 6 earlier changes
- OK13 OK2026-08-26
- NOTE12 OK, 1 NOTE2026-07-11
- OK13 OK2026-07-04
- NOTE12 OK, 1 NOTE2026-07-03
- OK12 OK2026-04-25
- NOTE11 OK, 3 NOTE2026-03-10
Documentation
- Help pages
- 135 (1 internal)
- Examples that run
- 100%78 run in a plain check
- Exported functions with examples
- 65%
- Documented parameters
- 92%
- Return-value docs
- 90%
- Help pages citing references
- 32%
- The survival package PDF
- Adjusted Survival Curves PDF
- Approximating a Cox Model PDF
- Brier scores and the redistribute-to-the-right algorithm PDF
- Concordance PDF
- Counting process and timeline data sets PDF
- Matrix exponentials PDF
- Model frames and the Survival package PDF
- Multi-state models and competing risks PDF
- Multi-state survival curves PDF
Show 6 moreHide 6 vignettes
Downloads
Repository
- PRs merged (all time)
- 26%
- Median days to close, 50 most recently updated closed issues
- 8
- Median days to close, 50 most recently updated closed PRs
- 6
Stars over time
Forks over time
Issues over time
PRs over time
Commits over time
Commit identities over time
Checks run against github.com/therneau/survival on 2026-10-11.
No development-tooling practices detected in the upstream repository.
Dependencies
Installing survival adds no packages beyond those that come with R.
Show the 48 most downloaded dependentsHide the 48 most downloaded dependents
and 839 more dependents and 309 packages that suggest it on CRAN ↗
Code & Tests
Datasets
People & History
Previously maintained by Thomas Lumley (2.6 to 2.35-5).
Pick two releases to compare their code metrics.
- 3.8-12Latest
- 3.8-112026-08-21 · diff ↗
- 3.8-9
- RR 4.6.0 released · 2026-04-24
- 3.8-6
- RR 4.5.0 released · 2025-04-11
- 3.8-3
- 3.7-02024-06-05 · diff ↗
- 3.6-42024-04-24 · diff ↗
- RR 4.4.0 released · 2024-04-24
- 3.5-8
- 3.5-7
- RR 4.3.0 released · 2023-04-21
- 3.5-52023-03-12 · diff ↗
- 3.5-3
- 3.5-0
Show 130 earlier eventsHide 130 earlier events
- 3.4-0.12023-01-03 · diff ↗
- 3.4-02022-08-09 · diff ↗
- RR 4.2.0 released · 2022-04-22
- 3.3-12022-03-03 · diff ↗
- 3.3-02022-03-01 · diff ↗
- 3.2-132021-08-24 · diff ↗
- 3.2-122021-08-13 · diff ↗
- RR 4.1.0 released · 2021-05-18
- 3.2-112021-04-26 · diff ↗
- 3.2-102021-03-16 · diff ↗
- 3.2-9
- 3.2-7
- 3.2-3
- RR 4.0.0 released · 2020-04-24
- 3.1-122020-04-10 · diff ↗
- 3.1-112020-03-07 · diff ↗
- 3.1-82019-12-03 · diff ↗
- 3.1-72019-11-09 · diff ↗
- 3.1-6
- RR 3.6.0 released · 2019-04-26
- 2.44-1.12019-04-01 · diff ↗
- 2.44-1
- 2.43-32018-11-27 · diff ↗
- 2.43-1
- 2.42-62018-07-13 · diff ↗
- 2.42-42018-07-02 · diff ↗
- 2.42-3.12018-04-24 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 2.42-3
- RR 3.4.0 released · 2017-04-21
- 2.41-32017-04-04 · diff ↗
- 2.41-22017-03-16 · diff ↗
- 2.41-1
- 2.40-1
- 2.39-52016-06-26 · diff ↗
- 2.39-42016-05-11 · diff ↗
- 2.39-32016-05-05 · diff ↗
- RR 3.3.0 released · 2016-05-03
- 2.39-2
- 2.38-32015-07-02 · diff ↗
- 2.38-22015-06-12 · diff ↗
- RR 3.2.0 released · 2015-04-16
- 2.38-12015-02-24 · diff ↗ ·
removed 2 exports
is.na.coxph.penalty, is.na.ratetableadded 2 exports
neardate, tmerge - RR 3.1.0 released · 2014-04-10
- 2.37-72014-01-22 · diff ↗
- 2.37-62014-01-16 · diff ↗ ·
removed 1 export
ttadded 8 exports
agreg.fit, agexact.fit, coxph.wtest, survfit.formula, survfitKM, survfitCI, survpenal.fit, survConcordance.fit - RR 3.0.0 released · 2013-04-03
- 2.37-42013-03-27 · diff ↗
- 2.37-22012-12-08 · diff ↗
- 2.36-142012-04-25 · diff ↗
- 2.36-132012-04-24 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 2.36-122012-02-06 · diff ↗
- RR 2.14.0 released · 2011-10-31
- 2.36-102011-10-01 · diff ↗
- 2.36-92011-04-28 · diff ↗
- 2.36-82011-04-14 · diff ↗
- 2.36-7
- RR 2.13.0 released · 2011-04-13
- 2.36-52011-02-21 · diff ↗
- 2.36-42011-02-18 · diff ↗
- 2.36-3
- 2.36-22010-11-22 · diff ↗
- 2.36-12010-11-03 · diff ↗
- RR 2.12.0 released · 2010-10-15
- RR 2.11.0 released · 2010-04-22
- 2.35-82009-12-21 · diff ↗
- RR 2.10.0 released · 2009-10-26
- 2.35-72009-09-09 · diff ↗
- 2.35-62009-09-07 · diff ↗
- 2.35-52009-08-25 · diff ↗
- RR 2.9.0 released · 2009-04-17
- 2.35-42009-04-01 · diff ↗
- 2.35-32009-03-20 · diff ↗
- 2.35-22009-03-20 · diff ↗ ·
removed 11 exports
as.date, date.ddmmmyy, date.mdy, date.mmddyy, date.mmddyyyy, frailty.gammacon, is.date, is.na.date, mdy.date, survfit.km, survreg.oldadded 6 exports
aareg, psurvreg, qsurvreg, dsurvreg, survConcordance, survregDtest - RR 2.8.0 released · 2008-10-20
- RR 2.7.0 released · 2008-04-22
- 2.34-12008-04-02 · diff ↗
- 2.342007-10-16 · diff ↗
- 2.332007-10-09 · diff ↗
- RR 2.6.0 released · 2007-10-03
- 2.322007-06-18 · diff ↗
- RR 2.5.0 released · 2007-04-24
- 2.312007-01-31 · diff ↗
- 2.302006-11-30 · diff ↗
- RR 2.4.0 released · 2006-10-03
- 2.292006-09-29 · diff ↗
- 2.282006-08-19 · diff ↗
- 2.262006-05-19 · diff ↗
- 2.252006-05-17 · diff ↗
- RR 2.3.0 released · 2006-04-24
- 2.242006-04-15 · diff ↗
- 2.232006-04-07 · diff ↗
- 2.222006-03-17 · diff ↗
- 2.212006-02-08 · diff ↗
- RR 2.2.0 released · 2005-10-06
- 2.20
- 2.19
- 2.182005-06-10 · diff ↗
- RR 2.1.0 released · 2005-04-18
- 2.172005-04-06 · diff ↗
- 2.162004-11-16 · diff ↗
- 2.152004-10-27 · diff ↗
- 2.13-22004-10-04 · diff ↗
- RR 2.0.0 released · 2004-10-04
- 2.13-12004-08-05 · diff ↗
- 2.132004-08-01 · diff ↗
- 2.11-52004-06-02 · diff ↗
- 2.11-4
- RR 1.9.0 released · 2004-04-12
- 2.112003-12-28 · diff ↗ ·
added 46 exports
Surv, as.date, attrassign, basehaz, clogit, cluster, cox.zph, coxph, coxph.control, coxph.detail, date.ddmmmyy, date.mdy, date.mmddyy, date.mmddyyyy, format.Surv, frailty, frailty.gamma, frailty.gammacon, frailty.gaussian, frailty.t, is.Surv, is.date, is.na.Surv, is.na.coxph.penalty, is.na.date, is.na.ratetable, is.ratetable, labels.survreg, match.ratetable, mdy.date and 16 more - 2.9-162003-11-24 · diff ↗
- 2.9-152003-10-21 · diff ↗
- RR 1.8.0 released · 2003-10-08
- 2.9-142003-09-19 · diff ↗
- 2.9-132003-09-05 · diff ↗
- 2.9-122003-09-02 · diff ↗
- 2.9-112003-08-12 · diff ↗
- 2.9-102003-05-25 · diff ↗
- 2.9-72003-04-16 · diff ↗
- RR 1.7.0 released · 2003-04-16
- RR 1.6.0 released · 2002-10-01
- 2.9-62002-07-09 · diff ↗
- 2.9-42002-06-14 · diff ↗
- 2.9-32002-06-02 · diff ↗
- 2.9-22002-05-17 · diff ↗
- RR 1.5.0 released · 2002-04-29
- 2.9-12002-04-28 · diff ↗
- 2.8-22001-12-19 · diff ↗
- 2.62001-06-22
Package metadata
- First published
- 2001-06-22
- Total releases
- 111 / 25 yrs
- License
- LGPL (>= 2) OSI · relicensed from GPL (>= 2) in 2.37-2
- Minimum R
- ≥ 4.1.0
- Bundled data
- 2.3 MB / 17 files
- Download size
- 8.1 MB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("survival")The package provides a citation file that builds its entry when R runs it. Run citation() to see it.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-18, which the citation names so these numbers can be found later. More on citing and the projects behind them.