Logistic Regression: Modelling Binary Outcomes

Logistic regression is used when the response variable YY is binary (e.g., success/failure, pass/fail) rather than continuous, so an ordinary straight-line model can predict impossible values below 0 or above 1, especially when extrapolating, and does not enforce the probability bounds.


Instead of modelling the probability directly as a linear function of the predictors, logistic regression models the log-odds (the logit) as linear.

The Model

For a single predictor xx:


ln⁡(p1−p)=β0+β1x\ln\left(\frac{p}{1-p}\right) = \beta_0 + \beta_1 x


Solving for pp gives the S-shaped logistic (sigmoid) curve:


p=11+e−(β0+β1x)p = \frac{1}{1+e^{-(\beta_0+\beta_1 x)}}


The coefficient β1\beta_1 is the change in the log-odds for a one-unit increase in xx. Exponentiating it, eβ1e^{\beta_1}, gives the odds ratio, the multiplicative change in the odds of success per unit increase in xx.

Worked Example

Suppose a model for passing a certification exam based on hours studied xx is ln⁡(p/(1−p))=−4+0.8x\ln(p/(1-p)) = -4 + 0.8x. At x=5x=5: the log-odds equal 00, so p=0.5p=0.5, the point where a predicted pass and fail are equally likely. At x=8x=8: the log-odds equal 2.42.4, so p=1/(1+e−2.4)≈0.92p = 1/(1+e^{-2.4}) \approx 0.92, a much higher predicted probability.

The fitted logistic model \ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x = 5 hours studied.

The fitted logistic model ln⁡(p/(1−p))=−4+0.8x\ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x=5x = 5 hours studied.

Predicted Probability of Passing vs Hours Studied

Predicted Probability of Passing vs Hours Studied



A campus health study wants to predict whether a patient will develop a particular illness (coded as 1 = yes, 0 = no) using age and BMI as predictors. Which method is most appropriate for modelling this outcome?

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

The figure shows a fitted logistic regression model ln⁡(p1−p)=−4+0.8x\ln\left(\dfrac{p}{1-p}\right) = -4 + 0.8x, where xx is hours studied and pp is the probability of passing. Which statement correctly interprets the coefficient 0.80.8?

The fitted logistic model \ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x = 5 hours studied.

The fitted logistic model ln⁡(p/(1−p))=−4+0.8x\ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x=5x = 5 hours studied.

Predicted Probability of Passing vs Hours Studied

Predicted Probability of Passing vs Hours Studied

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

Using the same fitted logistic regression model illustrated in the graph, ln⁡(p1−p)=−4+0.8x\ln\left(\dfrac{p}{1-p}\right) = -4 + 0.8x, what is the predicted probability that a student who studies x=7.5x = 7.5 hours passes the exam? Give your answer to two decimal places.

Give your answer in probability.

The fitted logistic model \ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x = 5 hours studied.

The fitted logistic model ln⁡(p/(1−p))=−4+0.8x\ln(p/(1-p)) = -4 + 0.8x produces an S-shaped probability curve. The dashed lines mark the point where the predicted probability equals 0.50, which occurs at x=5x = 5 hours studied.

Predicted Probability of Passing vs Hours Studied

Predicted Probability of Passing vs Hours Studied

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors