Learn R Programming

eha (version 2.4-6)

Loglogistic: The Loglogistic Distribution

Description

Density, distribution function, quantile function, hazard function, cumulative hazard function, and random generation for the Loglogistic distribution with parameters shape and scale.

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)
hllogis(x, shape = 1, scale = 1, prop = 1, log = FALSE)
Hllogis(x, shape = 1, scale = 1, prop = 1, log.p = FALSE)
rllogis(n, shape = 1, scale = 1)

Arguments

x, q

vector of quantiles.

p

vector of probabilities.

n

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

shape, scale

shape and scale parameters, both defaulting to 1.

prop

A 'proportional hazards' parameter, for now only available for hllogis and Hllogis. See Details.

log, log.p

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

lower.tail

logical; if TRUE (default), probabilities are \(P[X \le x]\), otherwise, \(P[X > x]\).

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.

Invalid arguments will result in return value NaN, with a warning.

Details

The Loglogistic distribution with shape parameter \(a\) and scale parameter \(\sigma\) has density given by $$f(x) = (a/\sigma) {(x/\sigma)}^{a-1} / (1 + {(x/\sigma)}^{a})^2$$ for \(x \ge 0\). The cumulative distribution function is \(F(x) = 1 - 1 / (1 + {(x/\sigma)}^a)\) on \(x \ge 0\).

From eha version 2.3-0, the loglogistic distribution is extended to a three-parameter family of distributions. The third parameter, 'prop', is a 'proportional hazards' parameter, simply multiplying the hazard function by its value. For now only implemented in the hazard and cumulative hazards functions, but it will be introduced fully soon. Probably as a class of distributions with a new name.

See also phreg.

See Also

phreg, aftreg.