Day 2 · Companion guide

The log and logit links — how to read coefficients as biology

A dedicated workbook with worked biological examples for the two most-used link functions in ecology. The goal: when a colleague hands you a glm output, you can say what it means in one sentence.

Why this guide exists

Every wildlife graduate eventually fits a model like glm(count ~ x, family=poisson) or glm(survival ~ x, family=binomial) and stares at the coefficient table. The numbers look small. The standard errors look impressive. But what do they mean?

This guide builds intuition through worked examples. Read it once, do the exercises, and then re-read it after the lab. By the end of Day 2 you should be able to look at a coefficient and immediately picture what the effect would look like if you plotted the fitted curve.

Two sentences to leave the day with:
  1. "A log-link coefficient of $\beta$ means a one-unit change in $x$ multiplies the response by $e^\beta$."
  2. "A logit-link coefficient of $\beta$ means a one-unit change in $x$ multiplies the odds by $e^\beta$. The probability change depends on where you start."

The log link, conceptually

When you specify family=poisson(link="log") or family=Gamma(link="log"), you are telling R to fit the model

$\log(\mu_i) = \beta_0 + \beta_1 x_i$

or equivalently

$\mu_i = e^{\beta_0 + \beta_1 x_i} = e^{\beta_0} \cdot e^{\beta_1 x_i}$

That second form is the key. The mean is a product of two pieces: a baseline ($e^{\beta_0}$) and a multiplicative effect that depends on $x$. As $x$ increases by 1, the mean is multiplied by $e^{\beta_1}$.

Why this is the right scale for ecology. Biological rates almost always scale multiplicatively. A 10% increase in some food source produces a percentage change in the population, not a fixed additive change. Doubling a resource doubles a per-capita rate, not adds 5 to it. The log link makes this multiplicative structure linear in the coefficients.

How to read a log-link slope

Internalize this table:

$\beta$ (log scale)$e^\beta$Plain English: per unit increase in $x$…
−1.000.37response falls to 37% (a 63% drop)
−0.690.50response is halved
−0.400.67response falls by ~33%
−0.100.90response falls by ~10%
−0.050.95response falls by ~5%
01.00no effect
+0.051.05response rises by ~5%
+0.101.105response rises by ~10%
+0.201.22response rises by ~22%
+0.401.49response rises by ~50%
+0.692.00response doubles
+1.002.72response increases by a factor of 2.72
+2.007.39response increases ~7.4×
Rule of thumb for small $|\beta|$. When $\beta$ is small (roughly $|\beta| < 0.20$), $e^\beta \approx 1 + \beta$. So you can directly read $\beta$ as "approximately a $100 \cdot \beta$ percent change per unit." For $\beta = 0.07$, that's about a 7% increase.

Multi-unit changes

The multiplicative effect of moving $k$ units of $x$ is $e^{k\beta}$. So if $\beta = 0.05$ per km and you ask about a 10 km increase, the multiplicative effect is $e^{10 \cdot 0.05} = e^{0.5} = 1.65$, a 65% increase.

"Half-life" framing

If your slope is negative, the value of $x$ at which the response is halved (relative to $x = 0$) is

$x_{1/2} = \dfrac{-\ln 2}{\beta} = \dfrac{-0.693}{\beta}$

For $\beta = -0.05$ per km, $x_{1/2} = 13.9$ km. That's an intuitive number to report in a paper.

Eight worked biological examples (log link)

L1

Density of salmonberry along an elevation gradient

Negative binomial regression of stem count per plot on elevation (m). $\hat\beta = -0.0030$ per meter.

Read it

Each meter reduces expected count by 0.3% ($e^{-0.003} = 0.997$). Over a 1000 m climb, the expected count falls to $e^{-3} = 0.05$ — 5% of the lowland count. The half-elevation is $0.693/0.003 = 231$ m.

L2

Whale calls per hour vs. ship traffic

Poisson regression of calls/hour on ship-passes-per-day. $\hat\beta = +0.04$ per ship. Effect of a busy 50-ship day vs. a quiet 0-ship day?

Read it

$e^{0.04 \cdot 50} = e^{2} = 7.39$. Wait — that's a 7.4× increase with ships, which is biologically odd if you expected ships to be disturbing. The sign is positive (more ships, more calls) — probably an indicator that whale density and ship traffic both track an underlying productivity gradient. The math is fine; the model is missing a confounder.

L3

Caterpillar abundance vs. fertilizer treatment

Treatment is binary (control vs. fertilizer). Coefficient for fertilizer = $+0.85$.

Read it

$e^{0.85} = 2.34$. Fertilized plots have 2.3× the expected caterpillar count of control plots. If you'd like to report it as "percent increase," that's a 134% increase — but in ecology, "fold change" (×2.3) is cleaner.

L4

Bobcat detections vs. canopy cover and road density

Poisson model with two predictors. Canopy slope $+0.025$ per percent (so 0–100); road density $-0.40$ per (roads/km²).

Read it

A 50-percentage-point canopy increase multiplies expected detections by $e^{0.025 \cdot 50} = e^{1.25} = 3.49$. Adding 1 road/km² multiplies by $e^{-0.40} = 0.67$ (a 33% drop). At a typical urban-fringe site with 3 roads/km², detections are cut to $0.67^3 = 0.30$ of their roadless baseline.

L5

Mortality risk vs. age

Hazard model (a log-link Poisson approximation) for annual mortality. $\hat\beta = +0.08$ per year of age.

Read it

Annual mortality rate rises 8% per year. The mortality doubling time is $0.693/0.08 = 8.7$ years. This is the same as a Gompertz-style demographic model, written GLM-style.

L6

Time-to-detection on cameras (lognormal regression)

$\log(\text{time}) = \beta_0 + \beta_1 \cdot \text{prey availability}$. $\hat\beta_1 = -0.30$ per standardized prey index.

Read it

Each SD of prey availability cuts expected time-to-detection by $1 - e^{-0.30} = 26\%$. Two SDs cut it by $1 - e^{-0.60} = 45\%$ — a $\times 1.82$ rise in the detection rate, not a doubling. Halving the time takes $\ln 2 / 0.30 = 2.31$ SDs of prey. The trap here is arithmetic instinct: effects that add on the log scale multiply on the response scale, so doubling the predictor change does not double the effect.

L7

Multiplicative interaction with a categorical variable

Model: glm(catch ~ temp * gear, family=poisson). Main temp = $-0.05$; gear (trawl vs gillnet ref) = $+0.20$; temp:gearTrawl = $+0.08$.

Read it

For gillnets: temp slope is $-0.05$ → 5% drop per degree.

For trawls: temp slope is $-0.05 + 0.08 = +0.03$ → 3% rise per degree.

Baseline shift for trawls: $e^{0.20} = 1.22$, so at temperature 0 the trawl catches 22% more.

This is two completely different stories on the same axis. The interaction term is doing real biological work.

L8

Offset (effort correction) in a count model

Model: glm(detections ~ habitat + offset(log(hours)), family=poisson). The offset says "the response is rate per hour, not total count." How do you interpret the habitat coefficient?

Read it

Including an offset of $\log(\text{hours})$ is equivalent to modeling the per-hour rate. The habitat coefficient then represents a per-effort multiplicative effect — not confounded with sampling intensity. If habitat coefficient is $+0.5$, the per-hour detection rate is $e^{0.5} = 1.65 \times$ as large in that habitat. Offsets are the single most under-used trick in applied ecology. Use them whenever effort varies across observations.

Try it yourself — log-link exercises

Try 1

Translate

You fit a Poisson regression of mosquito counts on temperature. The temperature coefficient is $+0.12$ per °C. In one sentence, what does a 5° warming do to expected mosquito counts?

Answer

$e^{0.12 \cdot 5} = e^{0.6} = 1.82$. Five degrees of warming multiplies expected mosquito counts by 1.82 (an 82% increase).

Try 2

Back-engineer a coefficient

You observe that doubling stream productivity (kJ/m²/yr) is associated with a 50% increase in juvenile salmon density. If productivity enters the model as $\log_2(\text{productivity})$, what log-link slope should you expect?

Answer

$e^\beta = 1.50 \Rightarrow \beta = \ln(1.5) = 0.405$. So you should expect a coefficient near 0.41 on the $\log_2$(productivity) predictor.

Try 3

Confidence interval back-transformation

A Poisson coefficient is $\hat\beta = 0.40$ with 95% CI $(0.18, 0.62)$ on the log scale. Translate the point estimate and CI to the multiplicative scale.

Answer

$e^{0.40} = 1.49$, with CI $(e^{0.18}, e^{0.62}) = (1.20, 1.86)$. So a one-unit change in $x$ multiplies expected counts by 1.49, with a CI of 1.20× to 1.86×. Never average the endpoints in log space and then exponentiate the average — exponentiate each endpoint and report the asymmetric CI.

The logit link, conceptually

When you specify family=binomial(link="logit") you are fitting

$\log\!\left(\dfrac{p_i}{1 - p_i}\right) = \beta_0 + \beta_1 x_i$

The thing inside the log is the odds — the ratio of the probability of success to the probability of failure. So

$\text{odds}_i = e^{\beta_0 + \beta_1 x_i} \quad\text{and}\quad p_i = \dfrac{e^{\beta_0 + \beta_1 x_i}}{1 + e^{\beta_0 + \beta_1 x_i}}$

As $x$ increases by 1, the odds are multiplied by $e^{\beta_1}$. This is the same multiplicative-effect logic as the log link, just applied to odds instead of means.

The hard part for biologists. "Odds" feels foreign. Biologists want to talk about probabilities. The conversion isn't linear, and the same coefficient corresponds to a different probability change depending on the baseline probability. This guide is going to teach you to navigate that.

Probability ↔ Odds ↔ Log-odds — translation table

Probability $p$Odds $p/(1-p)$Log-odds $\eta = \mathrm{logit}(p)$
0.010.0101−4.60
0.050.0526−2.94
0.100.111−2.20
0.250.333−1.10
0.501.0000
0.753.000+1.10
0.909.000+2.20
0.9519.000+2.94
0.9999.000+4.60

R helpers:

plogis(eta) # log-odds → probability
qlogis(p) # probability → log-odds
exp(beta) # coefficient → odds ratio
The "divide by 4" trick. For probabilities near 0.5, a logit-link coefficient $\beta$ corresponds to roughly a $\beta/4$ change in probability per unit $x$. So a coefficient of $+1$ moves $p$ by about 25 percentage points at the inflection. The trick fails near 0 or 1 (where the logistic curve flattens).

Eight worked biological examples (logit link)

B1

Marten site occupancy vs. canopy cover

glm(occupied ~ canopy, family=binomial). Intercept $-2$, canopy slope $+0.04$ per percent (canopy on 0–100 scale).

Read it

At canopy = 0: log-odds = −2 → odds = 0.135 → $p = 0.12$. At canopy = 50: log-odds = 0 → $p = 0.5$. At canopy = 100: log-odds = +2 → $p = 0.88$.

Each percentage-point canopy multiplies odds by $e^{0.04} = 1.041$ (a 4.1% odds increase). A 25-point jump multiplies odds by $e^{1} = 2.72$, almost tripling odds.

B2

Survival of tagged smolts vs. river temperature

$\hat\beta_{\text{temp}} = -0.30$ per °C. Translate.

Read it

$e^{-0.30} = 0.74$. Each degree of warming reduces the odds of survival by 26%. Compounded over a 5° warming, odds are multiplied by $0.74^5 = 0.22$ — a 78% drop in odds.

If the baseline $p$ was 0.80 (odds 4), the new odds is $4 \cdot 0.22 = 0.88$, $p = 0.47$. The probability drops 33 percentage points.

B3

Nest success vs. female age

$\hat\beta_{\text{age}} = +0.15$ per year. Probability at age 5 is 0.5. Estimate $p$ at age 10.

Read it

At age 5, log-odds = 0. At age 10, log-odds = $0 + 5 \cdot 0.15 = 0.75$. Odds = $e^{0.75} = 2.12$. $p = 2.12/3.12 = 0.68$.

So a 5-year increase moves $p$ from 0.5 to 0.68 — an 18 percentage-point increase. (The /4 rule: $0.15 \cdot 5 / 4 \approx 0.19$, close.)

B4

Trap response: dichotomous predictor

A factor predictor "previously trapped" has coefficient $-1.5$.

Read it

$e^{-1.5} = 0.22$. Animals previously trapped have 78% lower odds of being re-captured this period — a strong trap-shy effect. If naive animals are caught at $p = 0.4$ (odds 0.67), trap-experienced are at odds $0.67 \cdot 0.22 = 0.15$, $p = 0.13$. This is exactly the kind of behaviour you'd model with a "trap response" parameter in mark-recapture.

B5

Threshold thinking on the logit scale

You fit a logistic regression of presence on a continuous predictor and find $\hat\beta_0 = -3$, $\hat\beta_1 = +0.06$. At what value of $x$ does the predicted probability cross 0.5?

Read it

$p = 0.5$ when log-odds $= 0$. So $-3 + 0.06 x = 0 \Rightarrow x = 50$. This is the inflection point of the fitted curve — biologists often want this as a "threshold" for habitat suitability.

B6

Marginal effect — the most useful number for talking to managers

For the marten model from B1 with canopy slope $+0.04$, what is the marginal effect of canopy on probability at canopy = 50 (where $p = 0.5$)?

Read it

Marginal effect at $p$: $\dfrac{\partial p}{\partial x} = \beta \cdot p(1-p) = 0.04 \cdot 0.5 \cdot 0.5 = 0.01$ per percentage point of canopy. So at the inflection, each percentage point of canopy raises occupancy probability by 1 percentage point. At canopy = 100 (where $p = 0.88$): marginal effect is $0.04 \cdot 0.88 \cdot 0.12 = 0.0042$ per percentage point — much smaller because the curve is flattening.

B7

Sex × habitat interaction (Titanic-like)

Model: glm(survived ~ sex * class, family=binomial). Main sex (Male) = $-2.5$; main class3 = $-1.2$; sex:class3 = $+0.6$.

Read it

Female 1st-class log-odds = intercept. Male 1st-class log-odds = intercept $- 2.5$.

Female 3rd-class log-odds = intercept $- 1.2$. Male 3rd-class log-odds = intercept $- 2.5 - 1.2 + 0.6 = $ intercept $- 3.1$.

So being male is a $-2.5$ log-odds effect in 1st class but only $-2.5 + 0.6 = -1.9$ in 3rd. The sex disadvantage is smaller in 3rd class — likely because everyone's survival is so low in 3rd class that there's less room for sex differentiation.

B8

Sampling fallacy — base rates again

You fit glm(infected ~ habitat, family=binomial) on a sample where infected animals were oversampled (case-control design). Which coefficients can you still interpret?

Read it

Slopes ($\hat\beta_1, \hat\beta_2, \dots$) are correctly estimated under case-control sampling. The intercept is biased by the sampling design and should not be interpreted as the population-level baseline probability. This is a feature of the logistic likelihood (a famous result from Prentice & Pyke, 1979). It's why epidemiologists love logistic regression for case-control studies.

Try it yourself — logit-link exercises

Try L1

Convert

If a logistic coefficient is $+0.69$, what does a 1-unit change in $x$ do to the odds?

Answer

$e^{0.69} = 2.00$. The odds double.

Try L2

Probability from log-odds

Compute $p$ when the log-odds is $-1$. When it's $+2$. When it's $+5$. Use plogis() if needed.

Answer

plogis(c(-1, 2, 5)) = 0.27, 0.88, 0.993.

Try L3

Find the threshold

A logistic model has intercept $-0.5$ and slope $0.03$ on a covariate. At what covariate value does $p = 0.75$?

Answer

$p = 0.75 \Rightarrow \mathrm{logit}(p) = \log(3) = 1.099$. Solve $-0.5 + 0.03 x = 1.099 \Rightarrow x = 53.3$.

Try L4

Marginal probability change

At $p = 0.20$, what is the marginal effect on probability of a 1-unit change in $x$, given a logit coefficient $\beta = +0.5$?

Answer

$\beta \cdot p \cdot (1-p) = 0.5 \cdot 0.2 \cdot 0.8 = 0.08$. About an 8 percentage-point increase per unit $x$ at this baseline.

Effect sizes on every scale, side by side

LinkWhat's linear$\beta$ is…BacktransformPlain English of a small $\beta$
identityresponseadditive change in meannone"+1 unit x adds $\beta$ to the response"
loglog(response)multiplicative change in mean$e^\beta$"+1 unit x changes response by ~$100 \beta\%$"
logitlog-oddsmultiplicative change in odds$e^\beta$ for OR; $\beta \cdot p(1-p)$ for marginal $p$"+1 unit x changes odds by ~$100 \beta\%$; probability change depends on baseline"
probitprobit(p)SDs of a latent Normal$\Phi$"+1 unit x changes the latent score by $\beta$ SDs"
cloglogcomplementary log-logmultiplicative hazard$e^\beta$survival/hazard interpretation

Top 5 interpretation mistakes (and how to avoid them)

1. Reporting raw coefficients to non-statisticians. "The treatment effect was 0.85" tells nobody anything. Always exponentiate (log/logit) and back-transform.
2. Averaging CI endpoints in transformed space. Don't compute $(\beta_{\text{lo}} + \beta_{\text{hi}})/2$, then exponentiate. Exponentiate each endpoint and report the asymmetric CI on the new scale. Logged data have logged CIs; back-transforming gives correct multiplicative CIs.
3. Confusing odds ratio with risk ratio. For small $p$, OR $\approx$ RR. For $p$ near 0.5, they diverge dramatically. If your baseline probability is 0.4 and OR = 2, the risk ratio is only $\approx 1.43$. Be careful when explaining "twice as likely."
4. Ignoring the baseline category in a factor predictor. A coefficient like "sexMale: $-0.4$" makes sense only relative to whatever the reference is (here, sexFemale). Always state the reference in plain text.
5. Forgetting the scale of $x$. A "small" coefficient on an unscaled predictor (like temperature in Kelvin) might be enormous biologically; a "large" coefficient on a predictor measured in nanometers might be tiny. Always think about a meaningful unit (1 SD? 1 standard increment? 1 degree?) before interpreting magnitude.
← Back to main lab