BIOL2001 Chap.13 Logistic Regression and the Generalised Linear Model
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.
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
- 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.
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.
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.
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.
STAT1008 Quantitative Research Methods · BIOL1030 Diversity of Life · STAT7038 Regression Modelling