13.1 Logistic regression with a single predictor
Logistic function maps (0,1) to (−∞,∞):
logit(x)=log(x1−x)
Also known as ‘log odds’, this can be used to map probabilities to the whole real line.
The inverse is logit−1 or ‘sigmoid’ function:
logit−1=ex1+ex This maps the real line to probabilities.
In R
we can use the logistic distribution:
This mapping allows us to expand our linear regression into models with two outcomes yi∈{0,1}
Pr(yi=1)=logit−1(Xiβ)
- Note that all the uncertainty comes for the probabilistic prediction of the binary outcome.