Learn R Programming

abn (version 1.3)

expit: Expit, Logit and odds

Description

Compute the expit and logit of a numerical vector. Transform odds to probability.

Usage

expit(x)
logit(x)
odds(x)

Arguments

x

vector of real values.

Value

A real vector corresponding to the expit, the logit or the odds of the input real values.

Details

logit computes the logit function: $$logit(p) = \log\frac{p}{1-p}$$ expit computes the expit function: $$expit(x) = \frac{e^x}{1+e^x}$$ odds transform an odd into a probability. $$odds(x) = \frac{x}{1-x}$$ Those functions become numerically unstable if evaluated at the edge or the definition range.