Logistic regression is a generalized linear model where the outcome is a two-level categorical variable. The outcome,
\(Y_i\text{,}\) takes the value 1 (in our application, this represents a callback for the resume) with probability
\(p_i\) and the value 0 with probability
\(1 - p_i\text{.}\) Because each observation has a slightly different context, e.g. different education level or a different number of years of experience, the probability
\(p_i\) will differ for each observation. Ultimately, it is this probability that we model in relation to the predictor variables: we will examine which resume characteristics correspond to higher or lower callback rates.
Notation for a logistic regression model.
The outcome variable for a GLM is denoted by
\(Y_i\text{,}\) where the index
\(i\) is used to represent observation
\(i\text{.}\) In the resume application,
\(Y_i\) will be used to represent whether resume
\(i\) received a callback (
\(Y_i=1\)) or not (
\(Y_i=0\)).
The predictor variables are represented as follows:
\(x_{1,i}\) is the value of variable 1 for observation
\(i\text{,}\) \(x_{2,i}\) is the value of variable 2 for observation
\(i\text{,}\) and so on.
The logistic regression model relates the probability a resume would receive a callback (\(p_i\)) to the predictors \(x_{1,i}\text{,}\) \(x_{2,i}\text{,}\) β¦, \(x_{k,i}\) through a framework much like that of multiple regression:
\begin{equation}
\text{transformation}(p_{i}) = \beta_0 + \beta_1x_{1,i} + \beta_2 x_{2,i} + \cdots + \beta_k x_{k,i}\tag{9.5.1}
\end{equation}
We want to choose a transformation in the equation that makes practical and mathematical sense. For example, we want a transformation that makes the range of possibilities on the left hand side of the equation equal to the range of possibilities for the right hand side; if there was no transformation for this equation, the left hand side could only take values between 0 and 1, but the right hand side could take values outside of this range. A common transformation for \(p_i\) is the logit transformation, which may be written as
\begin{equation*}
\text{logit}(p_i) = \log_{e}\left( \frac{p_i}{1-p_i} \right)
\end{equation*}
The logit transformation is shown in
FigureΒ 9.5.3. Below, we rewrite the equation relating
\(Y_i\) to its predictors using the logit transformation of
\(p_i\text{:}\)
\begin{equation*}
\log_{e}\left( \frac{p_i}{1-p_i} \right) = \beta_0 + \beta_1 x_{1,i} + \beta_2 x_{2,i} + \cdots + \beta_k x_{k,i}
\end{equation*}
In our resume example, there are 8 predictor variables, so \(k = 8\text{.}\) While the precise choice of a logit function isnβt intuitive, it is based on theory that underpins generalized linear models, which is beyond the scope of this book. Fortunately, once we fit a model using software, it will start to feel like weβre back in the multiple regression context, even if the interpretation of the coefficients is more complex.
To convert from values on the logistic regression scale (e.g.
\(-2.4998\) and
\(-1.6330\) in
ExampleΒ 9.5.4), use the following formula, which is the result of solving for
\(p_i\) in the regression model:
\begin{equation*}
p_i = \frac{e^{\beta_0 + \beta_1 x_{1,i}+\cdots+\beta_k x_{k,i}}}{1 + e^{\beta_0 + \beta_1 x_{1,i}+\cdots+\beta_k x_{k,i}}}
\end{equation*}
As with most applied data problems, we substitute the point estimates for the parameters (the
\(\beta_i\)) so that we can make use of this formula. In
ExampleΒ 9.5.4, the probabilities were calculated as
\begin{align*}
\amp\frac{e^{-2.4998}}{1 + e^{-2.4998}} = 0.076 \amp\amp \frac{e^{-2.4998 + 0.8668}}{1 + e^{-2.4998 + 0.8668}} = 0.163
\end{align*}
While knowing whether a resume listed honors provides some signal when predicting whether or not the employer would call, we would like to account for many different variables at once to understand how each of the different resume characteristics affected the chance of a callback.