Learn Data & AI Skills | 50% off

Last chance! 50% off unlimited learning

Sale ends in


flexsurv (version 2.3.2)

Llogis: The log-logistic distribution

Description

Density, distribution function, hazards, quantile function and random generation for the log-logistic distribution.

Usage

dllogis(x, shape = 1, scale = 1, log = FALSE)

pllogis(q, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)

qllogis(p, shape = 1, scale = 1, lower.tail = TRUE, log.p = FALSE)

rllogis(n, shape = 1, scale = 1)

hllogis(x, shape = 1, scale = 1, log = FALSE)

Hllogis(x, shape = 1, scale = 1, log = FALSE)

Value

dllogis gives the density, pllogis gives the distribution function, qllogis gives the quantile function, hllogis gives the hazard function, Hllogis gives the cumulative hazard function, and rllogis generates random deviates.

Arguments

x, q

vector of quantiles.

shape, scale

vector of shape and scale parameters.

log, log.p

logical; if TRUE, probabilities p are given as log(p).

lower.tail

logical; if TRUE (default), probabilities are P(Xx), otherwise, P(X>x).

p

vector of probabilities.

n

number of observations. If length(n) > 1, the length is taken to be the number required.

Author

Christopher Jackson <chris.jackson@mrc-bsu.cam.ac.uk>

Details

The log-logistic distribution with shape parameter a>0 and scale parameter b>0 has probability density function

f(x|a,b)=(a/b)(x/b)a1/(1+(x/b)a)2

and hazard

h(x|a,b)=(a/b)(x/b)a1/(1+(x/b)a)

for x>0. The hazard is decreasing for shape a1, and unimodal for a>1.

The probability distribution function is F(x|a,b)=11/(1+(x/b)a)

If a>1, the mean is bc/sin(c), and if a>2 the variance is b2(2c/sin(2c)c2/sin(c)2), where c=π/a, otherwise these are undefined.

References

Stata Press (2007) Stata release 10 manual: Survival analysis and epidemiological tables.

See Also