Survival Distributions in R
Survival Distributions in R
Survival Distributions in R
Survival Distributions in R
Overview
General Survival Distributions
Exponential Distribution
Weibull Distribution
Gamma Distribution
Lognormal Distribution
Gompertz Distribution
Log-logistic Distribution
Generalized Gamma Distribution
Overview
This page summarizes common parametric distributions in R, based on the R functions shown in the table below.
Weibull
dweibull pweibull flexsurv::hweibull flexsurv::Hweibull rweibull
(AFT)
Generalized
gamma
flexsurv::dgengamma flexsurv::pgengamma flexsurv::hgengamma flexsurv::Hgengamma flexsurv::rgengamma
(Prentice
1975)
Exponential Distribution
Notation: λ > 0 (rate)
Density: f (t) = λe
−λt
Survival: S(t) = e
−λt
Hazard: h(t) = λ
Mean: 1/λ
Median: ln(2)/λ
https://devinincerti.com/code/survival-distributions.html 1/3
7/11/2019 Survival Distributions in R
Weibull Distribution
Notation: κ > 0 (shape), η > 0 (scale), Γ(x) = gamma function (https://en.wikipedia.org/wiki/Gamma_function)
κ−1
Density: f (t)
κ
κ t −(x/η)
= ( ) e
η η
Survival: S(t)
κ
−(t/η)
= e
κ−1
Hazard: h(t)
κ t
= ( )
η η
Notes: The exponential distribution is a special case of the Weibull with κ = 1 and λ = 1/η
Gamma Distribution
x
Notation: a > 0 (shape), b > 0 (rate), γ(k, x) = ∫
0
z
k−1
e
−z
dz is the lower incomplete gamma function
(https://en.wikipedia.org/wiki/Incomplete_gamma_function)
a
Density: f (t)
b a−1 −bt
= t e
Γ(a)
γ(a,bt)
Survival: S(t) = 1 −
Γ(a)
Mean: a/b
Notes: When a = 1 , the gamma distribution simpli es to the exponential distribution with rate parameter b.
Lognormal Distribution
Notation: μ ∈ (−∞, ∞) (mean), σ > 0 (standard deviation), Φ(t) is the CDF of the standard normal distribution
(https://en.wikipedia.org/wiki/Normal_distribution#Cumulative_distribution_function)
2
(ln t−μ)
−
Density: f (t)
1
2
= e 2σ
tσ√2π
ln t−μ
Survival: 1 − Φ ( σ
)
Mean: e
2
μ+σ /2
Median: e μ
Gompertz Distribution
Notation: a ∈ (−∞, ∞) (shape), b > 0 (rate)
Density: f (t) = be
at
exp[−
b
a
(e
at
− 1)]
Survival: S(t)
b at
= exp[− (e − 1)]
a
Hazard: h(t) = be
at
a
(e
at
− 1)
Median: 1
ln[−(1/a) ln(1/2) + 1]
b
Notes: When a = 0 the Gompertz distribution is equivalent to the exponential with constant hazard and rate b.
Log-logistic Distribution
https://devinincerti.com/code/survival-distributions.html 2/3
7/11/2019 Survival Distributions in R
1
Survival: S(t) =
κ
(1 + (t/η) )
κ−1
(κ/η)(t/η)
Hazard: h(t) =
κ
(1 + (t/η) )
Median: η
η(π/κ)
Mean: If κ > 1 , ; else unde ned
sin(π/κ)
−2
−2 Q
|Q|(Q )
Density: f (t) = exp[Q
−2
(Qw − e
Qw
)]
−2
σtΓ(Q )
−2
γ(Q ,u)
1 − if Q ≠ 0
Survival: S(t) = { Γ(Q
−2
)
1 − Φ(w) if Q = 0
Notes: Simpli es to lognormal when Q = 0 , Weibull when Q = 1 , exponential when Q = σ = 1 , and gamma when Q = σ
https://devinincerti.com/code/survival-distributions.html 3/3