1. Poisson regression coefficients
Hello again and welcome back. In the previous chapter, you learned about the logit and probit link functions.
2. Chapter overview
In this chapter, you will learn about using Poisson link functions to describe model results.
Next, you will learn how to plot Poisson GLMs with geom_smooth() in ggplot2.
Then, you will revisit the logistic results and see how using odds-ratios can help you to better describe logistic regression results.
Last, you will learn about plotting binomial GLMs with geom_smooth() in ggplot2.
3. Fire injury data
To understand the outputs from a Poisson regression, we will revisit the results from the daily fire injury data.
But first, let's look at a linear model of the data.
We will look at a linear model because it is more intuitive to understand.
4. Linear model coefficients overview
When using a linear model with the daily fire injury dataset, we can estimate the effect of each month compared to the reference month.
The model estimates the expected number of daily injuries per month.
The model contains a reference intercept that corresponds to a month we compare everything else with.
The model also contains an intercept for each other month that corresponds with how that month differs from the reference month.
5. Linear model equation
Algebraically, we can write this out as y is predicted by the reference intercept beta-naught plus an intercept beta-sub-m intercept for every other month.
This also includes month id variable x and error epsilon.
y is the observed number of injuries per day,
x-sub-m is a dummy variable for month m with 1 being month m and 0 corresponding to not month m.
6. Linear model results
When looking at the results of the model, beta-naught is the average number of daily injuries for the reference month.
beta-m is the difference in average number of daily injuries for month m compared to the reference month.
For example, beta-naught plus beta-sub-m is the average daily injuries for month m.
We will cover more complicated models in chapter 4, which covers multiple regression.
The key points from this example are that the linear model coefficents have same units and are additive.
7. Poisson model
Now, let's revisit the example from the previous slide.
Our variables x and y are the same.
However, we now have a link function to "link" our data to the probability distribution.
The default link is an exponential function.
This causes the model to no longer be additive.
Instead the model is multiplicative.
Additionally, we take the exponential to convert from the link scale.
Hence, if we multiply beta-not by beta-m and then take the exponential, we get the expected daily injuries.
8. Difference between Poisson and linear models
Now that you've seen how to interpret the coefficients from both a Poisson and linear model, let's look at both coefficients again.
Notice how the Poisson model is multiplicative and the linear model additive.
9. Extract in R
Using base R, you can extract coefficients using the coef() function.
Then, you can take the exponential to convert to the scale of the raw data.
10. Tidy solution
More simply, the Tidyverse offers a single function that extracts and exponentiates the results in one line using the broom library.
Specifically, the tidy() function offers an exponentiate option when extracting coefficients.
11. Statistical inferences
On the link-scale, statistical inferences with the Poisson GLM are similar to a linear model.
Do the coefficients differ from zero based upon confidence intervals or p-values?
However, after transforming the coefficients back to the raw, datascale things are different.
Now, we ask are the Poisson coefficients different from 1?
This is because of the exponential transformation.
12. Let's practice!
Now, let's look at the coefficients from the fire injury data!