Three link functions, and why the choice rarely matters

Today let's understand the three most common link functions used to fit a binomial model, and why picking one over another rarely changes the story your data tells.

Say you are testing circuit boards for reliability. You take 20 boards and expose them to an overvoltage of 10 volts above their rated spec, for a fixed test window, and you count how many fail inside that window. Then you repeat the test at 12, 14, 16 and 18 volts above spec, 20 boards each time.

Here is what you saw. At 10 volts, 2 of the 20 boards failed. At 12 volts, 6 failed. At 14 volts, 12 failed. At 16 volts, 17 failed. And at 18 volts, 19 out of 20 failed. As a failure rate, that is 0.10, 0.30, 0.60, 0.85 and 0.95.

Plot that failure rate against voltage and here is what you get.

That rising shape is what you get whenever a quantity is squeezed between 0 and 1: slow near the bottom, steep through the middle, slow again near the top. More than one function traces a curve shaped roughly like that one, and three of them, called logit, probit and cloglog, are what this page compares side by side.

What a link function is for

A GLM fits a straight line: b0 + b1 times x. But a straight line has no limit on either end. Push voltage far enough up or down and b0 + b1 * voltage will shoot past 1 or below 0, and no failure rate can ever be a number like that.

A link function fixes this. It is a function, call it g, that takes a probability, which only ever lives between 0 and 1, and stretches it out onto the whole real line, from minus infinity to plus infinity. You fit your straight line to g(p) instead of to p itself. Then, to get a probability back out, you apply the inverse of g to the fitted line.

Three different functions do that stretching job for a binomial model: logit, probit and complementary log-log, which everyone shortens to cloglog.

The logit of p is log(p / (1 - p)), the log of the odds that the event happens. If p is 0.10, the odds of failing are 0.10 / 0.90, about 0.111 to 1, and the log of that odds is the logit.

The probit of p is qnorm(p). The function qnorm() answers a specific question: at what point on the standard normal curve does exactly p of the area sit to the left of it? qnorm(0.10) asks where the standard normal curve has 10% of its area below it, and the answer is a negative number, since 10% of the curve sits in its left tail.

The cloglog of p is log(-log(1 - p)).

Compute each of the three links for the five failure rates from the cover, and watch how differently they treat the very same five numbers.

RInteractive R
# Convert the five observed failure rates to their logit, probit and cloglog values p <- c(0.10, 0.30, 0.60, 0.85, 0.95) voltage <- c(10, 12, 14, 16, 18) logit_p <- log(p / (1 - p)) probit_p <- qnorm(p) cloglog_p <- log(-log(1 - p)) data.frame(voltage, p, logit = round(logit_p, 4), probit = round(probit_p, 4), cloglog = round(cloglog_p, 4)) #> voltage p logit probit cloglog #> 1 10 0.10 -2.1972 -1.2816 -2.2504 #> 2 12 0.30 -0.8473 -0.5244 -1.0309 #> 3 14 0.60 0.4055 0.2533 -0.0874 #> 4 16 0.85 1.7346 1.0364 0.6403 #> 5 18 0.95 2.9444 1.6449 1.0972

  

Look at the row for voltage 10, where p = 0.10. The logit is -2.1972, the probit is -1.2816 and the cloglog is -2.2504. Three different numbers, computed from the exact same probability. Each link stretches that 0.10 out onto the real line in its own way, and that difference in scale is going to matter a lot once you start reading coefficients off a fitted model.