Checking a GLM with simulated residuals
Today let's understand why a Poisson GLM's residual plot can look alarming even when the model is exactly right, and how to build a residual that means the same thing no matter which family fit the data.
A city runs 30 bike-share stations. Each station gets its own typical number of daily rentals, anywhere from under 100 to over 300, and each one filed some number of maintenance tickets over the last 30 days.
Here are 8 of the 30 stations.
Across all 30 stations, tickets filed range from 0 to 17, average 2.97, and 6 stations report none at all. A straight line has no business fitting counts shaped like that, so a Poisson GLM fits these counts instead.
But once that model is fit, can you read its residual plot the same way you would read one from an ordinary linear regression? The answer turns out to be no, and knowing exactly why changes what you should actually watch for in that plot.
Why an ordinary residual plot looks alarming for a GLM
In linear regression, a healthy residual plot is a flat, even band around zero. A funnel, where the spread grows as the fitted value rises, means trouble: the model's errors are not constant, and its standard errors are wrong.
Flip through the three shapes below to recall that habit.
Now fit the Poisson GLM to the 30 stations and look at its own residuals the same way.
The rentals coefficient, exponentiated and scaled to 50 rentals, says each extra 50 daily rentals multiplies the expected ticket rate by 2.26. That is the ordinary way to read a Poisson GLM's coefficient: as a rate ratio.
Now look at its response residuals, observed tickets minus fitted tickets, split by how low or high the fitted value is.
The spread among the 15 lowest-fitted stations is 0.50. Among the 15 highest-fitted stations it is 1.82, more than three times as wide. That is a real funnel, and the model that produced it is exactly correct.