Australian National University · FACULTY OF STATISTICS

BIOL2001 Chap.13 Logistic Regression and the Generalised Linear Model

- one subject, every graph, every model, every mark
8 Chapters5-page Bible
Our own words - no uploaded lecturer files
Updated for this semester
Chapter 13 of 15 · BIOL2001

Logistic Regression and the Generalised Linear Model

Binary responses

Presence or absence, alive or dead: many ecological responses have only two values, and a straight line fitted to them predicts impossible probabilities below 0 and above 1. Logistic regression solves this by modelling the log-odds, which have no limits, as a linear function of the covariates, then transforming back to probability.

The chapter builds the probability, odds and log-odds ladder, explains the S-shaped curve, and reads coefficients as multipliers of the odds; a computed figure shows the curve for frog presence against pond pH.

The GLM family

A worked example computes probabilities, odds and an odds ratio from seedling survival counts.

The chapter then places logistic regression inside the generalised linear model: a link function, a response distribution from the exponential family, fitting by maximum likelihood, and deviance in place of R-squared. It covers the glm() call with the binomial family, Bernoulli versus binomial responses, and why residual plots and QQ plots are of limited use here.

In this chapter

What this chapter covers

  • 01

    Why linear models fail for binary responses

  • 02

    Probability, odds and log-odds

  • 03

    The logit link and back-transformation

  • 04

    The S-shaped logistic curve

  • 05

    Odds ratios from coefficients

  • 06

    Generalised linear models and link functions

  • 07

    Maximum likelihood fitting

  • 08

    Deviance and percentage explained

Worked example · free

Reading a logistic curve at chosen pH values

Q [4 marks]. A logistic model gives logit P(frog present) = −6 + 1.0 × pH. Find the probability of presence at pH 6 and pH 7, and the odds ratio for one unit of pH. The practice weighting is assigned by AskSia and is not an official assessment.
An invented logistic model for the presence of a frog against pond pH, logit(P) = −6 + 1.0 × pH.An invented logistic model for the presence of a frog against pond pH, logit(P) = −6 + 1.0 × pH. The fitted probability is 0.5 at pH 6, where the curve is steepest, and flattens towards 0 and 1 at the extremes; the dots mark the fitted values at pH 4 to 8.pond pHP(frog present)234567891000.250.50.7510.1190.2690.5000.7310.881logit(P) = −6 + 1.0 × pH
An invented logistic model for the presence of a frog against pond pH, logit(P) = −6 + 1.0 × pH. The fitted probability is 0.5 at pH 6, where the curve is steepest, and flattens towards 0 and 1 at the extremes; the dots mark the fitted values at pH 4 to 8.
  • 1At pH 6 the log-odds are −6 + 6 = 0, so P = 1 / (1 + 1) = 0.5.
  • 1At pH 7 the log-odds are 1, so P = e1 / (1 + e1) = 2.718 / 3.718 = 0.731.
  • 1Each unit of pH adds 1.0 to the log-odds, so the odds are multiplied by e1.0 = 2.72.
  • 1Check: odds at pH 6 are 1 and at pH 7 are 0.731 / 0.269 = 2.72, matching the odds ratio.
The probability of presence is 0.5 at pH 6 and 0.731 at pH 7, and each unit of pH multiplies the odds of presence by 2.72. The change in probability is largest around pH 6, where the curve is steepest.
Sia tip — Back-transform the log-odds to a probability before comparing values; a difference of log-odds is not a difference in probability.
Glossary

Key terms

Odds
The probability of success divided by the probability of failure.
Log-Odds
The natural logarithm of the odds, also called the logit, which is unbounded and symmetric around zero.
Logistic Regression
A generalised linear model for a binary response that uses the logit link and a binomial distribution.
Generalised Linear Model
A model linking the expected response to a linear predictor through a link function and an exponential-family distribution.
Maximum Likelihood
The estimation method that chooses the parameters making the observed data most probable.
Deviance
A measure of a generalised linear model's error, where lower values mean a better fit.
FAQ

Logistic Regression and the Generalised Linear Model FAQ

Why not fit a linear regression to presence and absence data?

A straight line fitted to 0s and 1s predicts values below 0 and above 1, which no probability can take, and the normal error assumption makes no sense for a two-valued response. Logistic regression models the log-odds instead, which keeps every fitted probability between 0 and 1.

How do I convert a log-odds value back to a probability?

Exponentiate it to get the odds, then divide the odds by one plus the odds. A log-odds of 0 gives odds of 1 and a probability of 0.5, and a log-odds of 1 gives odds of 2.718 and a probability of 0.731.

What does a logistic regression coefficient mean?

It is the change in the log-odds for a one-unit increase in the covariate. Exponentiated, it multiplies the odds: a coefficient of minus 0.13, as in the lecture's flatfish model, multiplies the odds by 0.88 per unit of salinity, a 12% decrease.

Why can the QQ plot be ignored for a logistic model?

The residuals of a binary response model are never normally distributed, so a QQ plot of them says nothing useful about fit. The residuals against fitted values plot also shows two bands, one for the 0s and one for the 1s, which reflects the data rather than a problem.

Study strategy

Assessment move

Fill in the probability, odds and log-odds ladder by hand for five probabilities until each conversion is one line. Compute an odds ratio from a small two-group table, then confirm that its log matches the coefficient a model with a dummy would give. Fit one logistic model in R and read every line of summary(), including the deviances.

Keep a note of which scale each number in your answer is on, probability, odds or log-odds, because mixing scales within one sentence is the most common way interpretation marks are lost.

Working through Logistic Regression and the Generalised Linear Model in BIOL2001? Sia is AskSia’s AI Statistics tutor — ask any BIOL2001 Logistic Regression and the Generalised Linear Model question and get a clear, step-by-step explanation grounded in how BIOL2001 is taught and assessed. Read this chapter free, then take your hardest questions to Sia.

A+Everything unlocked
Unlocks this Bible + all 46 of your Australian National University subjects - and 1,000+ Bibles across every Australian university.
Sia - your BIOL2001 tutor, unlimited, worked the way the exam marks it
The full 5-page Bible + practice bank with worked solutions
Chrome extension - sync your LMS so Sia knows your deadlines
Bilingual EN / Chinese on every Bible and every Sia answer
$0.99 Trial
30-day money-back · cancel in one tap · how it works