logit: Logit and inverse-logit functions

Description Usage Arguments Details Value References See Also Examples

Description

An alias for qlogis as logit, and alias for plogis as inv_logis.

Usage

1
2
3
4
logit(p, location = 0, scale = 1, lower.tail = TRUE, log.p = FALSE)

inv_logit(q, location = 0, scale = 1, lower.tail = TRUE,
  log.p = FALSE)

Arguments

p

vector of probabilities.

location

location and scale parameters.

scale

location and scale parameters.

lower.tail

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

log.p

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

q

vector of quantiles.

Details

If location or scale are omitted, they assume the default values of 0 and 1 respectively.

The Logistic distribution with location = m and scale = s has distribution function

F(x) = 1 / (1 + exp(-(x-m)/s))

and density

f(x) = 1/s exp((x-m)/s) (1 + exp((x-m)/s))^-2.

It is a long-tailed distribution with mean m and variance π^2 /3 s^2.

Value

dlogis gives the density, plogis gives the distribution function, qlogis gives the quantile function, and rlogis generates random deviates.

The length of the result is determined by n for rlogis, and is the maximum of the lengths of the numerical arguments for the other functions.

The numerical arguments other than n are recycled to the length of the result. Only the first elements of the logical arguments are used.

References

Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New S Language. Wadsworth & Brooks/Cole.

Johnson, N. L., Kotz, S. and Balakrishnan, N. (1995) Continuous Univariate Distributions, volume 2, chapter 23. Wiley, New York.

See Also

Distributions for other standard distributions.

Examples

1
2
var(rlogis(4000, 0, scale = 5))  # approximately (+/- 3)
pi^2/3 * 5^2

CGMossa/rbatteries documentation built on Oct. 30, 2019, 5:29 a.m.