Poisson regression coefficients

Generalized Linear Models in R

Richard Erickson

Instructor

Chapter overview

  • Describing Poisson regressions
  • Plotting Poisson GLMs with ggplot2
  • Describing logistic regression with odds-ratios
  • Plotting binomial GLMs with ggplot2
Generalized Linear Models in R

Fire injury data

Daily fire injuries from Louisville, KY

Generalized Linear Models in R

Linear model coefficients overview

  • Estimate expected daily injury per month
  • Estimate reference intercept
  • Estimate intercept for other months
Generalized Linear Models in R

Linear model equation

  • $ y \sim \beta_0 + \beta_m x_m + \ldots + \epsilon$
  • $\beta_0$: Reference intercept
  • $\beta_m$: Month $m$ effect
  • $y$ injuries per day (e.g., 1, 0, 4)
  • $x$ dummy variable to code for month (0 or 1)
  • $m$ corresponds to month intercept, dummy variable
Generalized Linear Models in R

Linear model results

  • $\beta_0$ is expected (or average) in reference month
  • $\beta_m$ is effect of month $m$ (or difference from reference)
  • e.g., $\beta_0$ + $\beta_m$ = ave. daily injuries for month $m$
  • More complicated models covered in chapter 4
  • Linear models are additive
Generalized Linear Models in R

Poisson model

  • $y \sim \text{Poisson}(\lambda)$
  • Link: $\lambda = e^{(\beta_0 + \beta_m x_m + \epsilon)}$
  • Multiplicative
  • Example results:
    • $\beta_0 \times \beta_1 = \text{ln}(\text{mean daily injuries for month}\ m)$
    • Take exponential to convert to raw units
Generalized Linear Models in R

Difference between Poisson and linear models

  • Poisson model: $e^{\beta_0 \times \beta_m} = \text{expected daily injuries for month}\ m$
  • Linear model: $\beta_0$ + $\beta_m = \text{expected daily injuries for month}\ m$
Generalized Linear Models in R

Extract in R

poisson_out <- glm(y ~ x, family = 'poisson')
coef(poisson_out)
exp(coef(poisson_out))
Generalized Linear Models in R

Tidy solution

library(broom)
poisson_out <- glm(y ~ x, family = 'poisson')
tidy(poisson_out, exponentiate = TRUE)
Generalized Linear Models in R

Statistical inferences

  • Similar as linear model on link-scale
  • Do coefficients differ from zero?
  • On data-scale, different
  • Do coefficients differ from 1?
  • Exponential-scale rather than raw-scale
Generalized Linear Models in R

Let's practice!

Generalized Linear Models in R

Preparing Video For Download...