Survival Distributions in R

Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

7/11/2019 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.

Parametric survival distributions in R

Distribution Density CDF Hazard Cumulative hazard Random sample


Exponential dexp pexp flexsurv::hexp flexsurv::Hexp rexp

Weibull
dweibull pweibull flexsurv::hweibull flexsurv::Hweibull rweibull
(AFT)

Gamma dgamma pgamma flexsurv::hgamma flexsurv::Hgamma rgamma

Lognormal dlnorm plnorm flexsurv::hlnorm flexsurv::Hlnorm rlnorm

Gompertz flexsurv::dgompertz flexsurv::pgompertz flexsurv::hgompertz flexsurv::Hgompertz flexsurv::rgompertz

Log-logistic flexsurv::dllogis flexsurv::pllogis flexsurv::hllogis flexsurv::Hllogis flexsurv::rllogis

Generalized
gamma
flexsurv::dgengamma flexsurv::pgengamma flexsurv::hgengamma flexsurv::Hgengamma flexsurv::rgengamma
(Prentice
1975)

General Survival Distributions


Survival function: S(t) = P r(T > t) = exp(−H (t))

Hazard function: h(t) = f (t)/S(t)

Cumulative hazard function: H (t) = ∫ h(z)dz = −logS(t)


0

Exponential Distribution
Notation: λ > 0 (rate)

Density: f (t) = λe
−λt

Survival: S(t) = e
−λt

Hazard: h(t) = λ

Cumulative hazard: h(t) = λ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
= ( )
η η

Cumulative hazard: H (t)


t
= ( )
η

Mean: ηΓ(1 + 1/κ)

Median: η(ln(2)) 1/κ

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

Cumulative Hazard: H (t) =


b

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

Notation: κ > 0 (shape), η > 0 (scale)


κ−1
(κ/η)(t/η)
Density: f (t) =
2
κ
(1 + (t/η) )

1
Survival: S(t) =
κ
(1 + (t/η) )

κ−1
(κ/η)(t/η)
Hazard: h(t) =
κ
(1 + (t/η) )

Median: η

η(π/κ)
Mean: If κ > 1 , ; else unde ned
sin(π/κ)

Generalized Gamma Distribution


Notation: μ ∈ (−∞, ∞) (location parameter), σ > 0 (scale parameter), Q ∈ (−∞, ∞) (shape parameter), w = (log(t) − μ)/σ , and
−2 Qw
u = Q e

−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

You might also like