The logit and expit functions are commonly used to move between the probability scale [0, 1] and the whole real number line, especially when working with supervised learning models with binary outcomes. These functions are very easy to define, here is an implementation in R:
logit <- function(p) {
log(p / (1 - p))
}
expit <- function(x) {
exp(x) / (1 + exp(x))
}
When working in this space, it’s helpful to have some approximations to move between the logit and probability scales. (As an analogy, it is helpful to know that for a normal distribution, the interval standard deviations around the mean covers about 95% of the distribution, while
standard deviations covers about 99%.)
Here are some rough approximations to help you estimate probabilities from logit scores and vice versa:
| Logit | Probability |
|---|---|
| -7 | 0.001 |
| -5 | 0.01 |
| -3 | 0.05 |
| -2 | 0.1 |
| -1 | 0.25 |
| 0 | 0.5 |
| 1 | 0.75 |
| 2 | 0.9 |
| 3 | 0.95 |
| 5 | 0.99 |
| 7 | 0.999 |