0% found this document useful (0 votes)
90 views51 pages

4glm3 Ha Online

Poisson regression for counts ● Poisson regression for counts ● Comonents of GLM for Counts ● The Poisson loglinear model ● Interpretation of β ● Interpretation of β β is interpreted as the percentage change in the expected count (μ) for a 1 unit increase in x. Specifically, a 1 unit increase in x results in approximately a 100*β% increase in the expected count μ. β can also be interpreted as the factor by which μ is multiplied for a 1 unit increase in x. (continued) ● Example: Number of Deaths Due to AIDs ● Data: Number of Deaths Due to AIDs × Month ●

Uploaded by

saaabiill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
90 views51 pages

4glm3 Ha Online

Poisson regression for counts ● Poisson regression for counts ● Comonents of GLM for Counts ● The Poisson loglinear model ● Interpretation of β ● Interpretation of β β is interpreted as the percentage change in the expected count (μ) for a 1 unit increase in x. Specifically, a 1 unit increase in x results in approximately a 100*β% increase in the expected count μ. β can also be interpreted as the factor by which μ is multiplied for a 1 unit increase in x. (continued) ● Example: Number of Deaths Due to AIDs ● Data: Number of Deaths Due to AIDs × Month ●

Uploaded by

saaabiill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Poisson Regression

or
Regression of Counts (& Rates)

Carolyn J. Anderson
Department of Educational Psychology

University of Illinois at Urbana-Champaign

Generalized Linear Models Slide 1 of 51


Outline

■ GLMs for count data.


Overivew ◆ Poisson regression for counts.
● Outline
● GLMs for count data
◆ Poisson regression for rates.
● More Examples. . .
■ Inference and model checking.
Poisson regression for counts
◆ Wald, Likelihood ratio, & Score test.
Poisson regression for rates
◆ Checking Poisson regression.
◆ Residuals.
◆ Confidence intervals for fitted values (means).
◆ Overdispersion.

■ Fitting GLMS (a little technical).


◆ Newton-Raphson algorithm/Fisher scoring.
◆ Statistic inference & the Likelihood function.
◆ “Deviance”.

■ Summary

Generalized Linear Models Slide 2 of 51


GLMs for count data
Situation: response/outcome variable Y is a count.
Generalized linear models for counts have as it’s random
Overivew
● Outline component Poisson Distribution.
● GLMs for count data
● More Examples. . .
Examples:
Poisson regression for counts
■ Number of cargo ships damaged by waves (classic example
Poisson regression for rates
given by McCullagh & Nelder, 1989).
■ Number of deaths due to AIDs in Australia per quarter (3
month periods) from January 1983 – June 1986.
■ Number of violent incidents exhibited over a 6 month period
by patients who had been treated in the ER of a psychiatric
hospital (Gardner, Mulvey, & Shaw, 1995).
■ Daily homicide counts in California (Grogger, 1990).

■ Foundings of day care centers in Toronto (Baum & Oliver,


1992).
■ Political party switching among members of the US House of
Representatives (King, 1988).

Generalized Linear Models Slide 3 of 51


More Examples. . .
■ Number of presidential appointments to the Supreme Court
(King, 1987).
Overivew ■ Number of children in a classroom that a child lists as being
● Outline
● GLMs for count data their friend (unlimited nomination procedure, sociometric
● More Examples. . .
data).
Poisson regression for counts
■ Number of hard disk failures at uiuc during a year.
Poisson regression for rates

■ Number of deaths due to SARs (Yu, Chan & Fung, 2006).


■ Number of arrests resulting from 911 calls.
■ Number of orders of protection issued.
In some of these examples, we should consider “exposure” to
the event. i.e., “t”.
e.g., hard disk failures: In this case, “exposure” could be the
number of hours of operation. Rather than model the number
of failures (i.e., counts), we would want to measure and model
the failure “rate”
Y /t = rate

Generalized Linear Models Slide 4 of 51


Poisson regression for counts

Overivew
Response Variable is a count
Poisson regression for counts
● Poisson regression for counts
● Comonents of GLM for
Explanatory Variable(s):
Counts
● The Poisson loglinear model
● Interpretation of β
■ If they are categorical (i.e., you have a contingency table with
● Interpretation of β
(continued)
counts in the cells), convention is to call them “Loglinear
● Example: Number of Deaths
Due to AIDs
models”.
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
■ If they are numerical/continuous, convention is to call them
(linear link)
● Back to Data but Plot
“Poisson Regression”
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear First, Y = count and then Y /t rate data.
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 5 of 51
● Observed and Fitted Counts
Comonents of GLM for Counts
■ Random component: Poisson distribution and model the
expected value of Y , denoted by E(Y ) = µ.
Overivew ■ Systematic component: For now, just 1 explanatory variable
Poisson regression for counts x (later, we’ll go over an example with more than 1).
● Poisson regression for counts
● Comonents of GLM for
Counts
■ Link: We could use
● The Poisson loglinear model ◆ Identity link, which gives us µ = α + βx
● Interpretation of β
● Interpretation of β
(continued)
Problem: a linear model can yield µ < 0, while the
● Example: Number of Deaths
Due to AIDs
possible values for µ ≥ 0.
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data ◆ Log link (much more common) log(µ).
● A Look at the Bad Model
(linear link) which is the “natural parameter” of Poisson distribution,
● Back to Data but Plot
log(yi ) by Month and the log link is the “canonical link” for GLMs with
● Poisson Log-Linear Model for
Deaths Poisson distribution.
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
The Poisson regression model for counts (with a log link) is
● Transform explanatory
variable
● Poisson Regression with log(µ) = α + βx
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
This is often referred to as “Poisson loglinear model”.
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 6 of 51
● Observed and Fitted Counts
The Poisson loglinear model

Overivew

Poisson regression for counts


● Poisson regression for counts
log(µ) = α + βx
● Comonents of GLM for
Counts
● The Poisson loglinear model
Since the log of the expected value of Y is a linear function of
● Interpretation of β
● Interpretation of β
explanatory variable(s), and the expected value of Y is a
(continued)
● Example: Number of Deaths
multiplicative function of x:
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month µ = exp(α + βx)
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link) = eα eβx
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for What does this mean for µ?
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
How do we interpret β?
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 7 of 51
● Observed and Fitted Counts
Interpretation of β
log(µ) = α + βx

Overivew
Consider 2 values of x (x1 & x2 ) such that the difference
Poisson regression for counts
between them equals 1. For example, x1 = 10 and x2 = 11:
● Poisson regression for counts
● Comonents of GLM for
Counts x2 = x1 + 1
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β The expected value of µ when x = 10 is
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
µ1 = eα eβx1 = eα eβ(10)
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model The expected value of µ when x = x2 = 11 is
(linear link)
● Back to Data but Plot
log(yi ) by Month µ2 = eα eβx2
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count) = eα eβ(x1 +1)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
= eα eβx1 eβ
= eα eβ(10) eβ
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
A change in x has a multiplicative effect on the mean of Y .
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 8 of 51
● Observed and Fitted Counts
Interpretation of β (continued)
When we look at a 1 unit increase in the explanatory variable
(i.e., x2 − x1 = 1), we have

µ1 = eα eβx1 µ2 = eα eβx1 eβ
Overivew
and
Poisson regression for counts
● Poisson regression for counts
● Comonents of GLM for ■ If β = 0, then e0 = 1 and
Counts
● The Poisson loglinear model ◆ µ1 = eα .
● Interpretation of β
● Interpretation of β
◆ µ2 = eα .
◆ µ = E(Y ) is not related to x.
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
■ If β > 0, then eβ > 1 and
◆ µ1 = eα eβx1
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month ◆ µ2 = eα eβx2 = eα eβx1 eβ = µ1 eβ
◆ µ2 is eβ times larger than µ1 .
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
■ If β < 0, then 0 ≤ eβ < 1
● Transform explanatory
variable
◆ µ1 = eα eβx1 .
● Poisson Regression with
Transformed x ◆ µ2 = eα eβx2 = eα eβx1 eβ = µ1 eβ .
● How Large is Large in a
Statistical Sense? ◆ µ2 is eβ times smaller than µ1 .
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 9 of 51
● Observed and Fitted Counts
Example: Number of Deaths Due to AIDs
Whyte, et al 1987 (Dobson, 1990) reported the number of
deaths due to AIDS in Australia per 3 month period from
Overivew
January 1983 – June 1986.
Poisson regression for counts
● Poisson regression for counts
● Comonents of GLM for
Counts yi = number of deaths xi yi xi yi
● The Poisson loglinear model
● Interpretation of β xi = time point (quarter)
● Interpretation of β 1 0 8 18
(continued)
● Example: Number of Deaths
Due to AIDs 2 1 9 23
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
3 2 10 31
● A Look at the Bad Model
(linear link) 4 3 11 20
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for 5 1 12 25
Deaths
● Figure of Fitted log(count)
from Log-linear
6 4 13 37
● Figure of Fitted log(count)
from Log-linear 7 9 14 45
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 10 of 51
● Observed and Fitted Counts
Data: Number of Deaths Due to AIDs × Month

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 11 of 51
● Observed and Fitted Counts
A Linear Model for AIDs Data
Let’s try a linear model:
µi = α + βxi
Overivew

Poisson regression for counts


The estimated parameters from GLM with a Poisson
● Poisson regression for counts
● Comonents of GLM for
distribution and the identity link:
Counts
● The Poisson loglinear model µ̂i = −6.7355 + 2.4287xi
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
In SAS OUTPUT, there’s strange things such as
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
■ Standard errors for estimated parameters equal to 0.
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
■ Some 0’s in the OBSTATS.
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
From SAS LOG file. . .
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
WARNING: The specified model did not converge.
from Log-linear
● Transform explanatory
ERROR: The mean parameter is either invalid or at a limit of its
variable
● Poisson Regression with range for some observations.
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
What’s wrong?. . .
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 12 of 51
● Observed and Fitted Counts
A Look at the Bad Model (linear link)

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 13 of 51
● Observed and Fitted Counts
Back to Data but Plot log(yi ) by Month

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
(line is linear regression line)
Generalized
● ComparisonLinear Models
in Log-Scale Slide 14 of 51
● Observed and Fitted Counts
Poisson Log-Linear Model for Deaths
Figure suggests a log link might work better:
log(µ̂i ) = .3396 + .2565xi
Overivew

Poisson regression for counts µ̂i when Link is µ̂i when Link is
● Poisson regression for counts
● Comonents of GLM for
Counts
xi yi Log Identity xi yi Log Identity
● The Poisson loglinear model
● Interpretation of β 1 0 1.82 −4.21 8 18 10.93 12.69
● Interpretation of β
(continued)
● Example: Number of Deaths
2 1 2.35 −1.88 9 23 14.13 15.12
Due to AIDs
● Data: Number of Deaths Due 3 2 3.03 0.55 10 31 18.26 17.55
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model 4 3 3.92 2.98 11 20 23.60 19.98
(linear link)
● Back to Data but Plot
log(yi ) by Month 5 1 5.06 5.41 12 25 30.51 22.41
● Poisson Log-Linear Model for
Deaths 6 4 6.56 7.84 13 37 39.43 24.84
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count) 7 9 8.46 10.27 14 45 50.96 27.27
from Log-linear
● Transform explanatory
variable
. . . and it looks like it fits much better.
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 15 of 51
● Observed and Fitted Counts
Figure of Fitted log(count) from Log-linear

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 16 of 51
● Observed and Fitted Counts
Figure of Fitted log(count) from Log-linear

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted Pattern in residuals.
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 17 of 51
● Observed and Fitted Counts
Transform explanatory variable
The number of deaths with low & high values of xi are “over-fit”
and number with middle xi ’s are under-fit.
Overivew Transform xi −→ x∗i = log(xi )
Poisson regression for counts
● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 18 of 51
● Observed and Fitted Counts
Poisson Regression with Transformed x
The estimated GLM with model
■ Random: Y follows Poisson distribution.
Overivew
■ Systematic: α + β log(xi ) = α + βx∗i
Poisson regression for counts
● Poisson regression for counts ■ Link: Log −→ log(µ).
● Comonents of GLM for
Counts
● The Poisson loglinear model As a log-linear model
● Interpretation of β
● Interpretation of β
(continued) log(µ̂i ) = −1.9442 + 2.1748x∗i
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
or equivalently, as a multiplicative model
(linear link)
● Back to Data but Plot
−1.9442 2.1748x∗
log(yi ) by Month µ̂i = e e i
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
Interpretation: For a 1 unit increase in log(month), the
● Transform explanatory
variable
estimated count increases by a factor of e2.1748 = 8.80
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Is this “large”?
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 19 of 51
● Observed and Fitted Counts
How Large is Large in a Statistical Sense?

Overivew
SAS/GENMOD provides asymptotic standard errors (ASE, i.e.,
Poisson regression for counts
● Poisson regression for counts
large sample) for the parameter estimates.
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β The ASE for β̂ equals .2151, and
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
β̂ ± 2(.2151) −→ (1.745, 2.605)
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data which suggests that this is large in a statistical sense.
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 20 of 51
● Observed and Fitted Counts
Observed and Fitted Log(Counts)

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 21 of 51
● Observed and Fitted Counts
Observed and Fitted Counts

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 22 of 51
● Observed and Fitted Counts
Comparison of Fitted Counts
log(xi ) xi xi
xi yi Log Log Identity
Overivew 1 0 .14 1.82 −4.21
Poisson regression for counts
● Poisson regression for counts 2 1 .65 2.35 −1.88
● Comonents of GLM for
Counts
● The Poisson loglinear model
3 2 1.56 3.03 0.55
● Interpretation of β
● Interpretation of β 4 3 2.92 3.92 2.98
(continued)
● Example: Number of Deaths
Due to AIDs
5 1 4.74 5.06 5.41
● Data: Number of Deaths Due
to AIDs × Month 6 4 7.05 6.56 7.84
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link) 7 9 9.86 8.46 10.27
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
8 18 13.17 10.93 12.69
Deaths
● Figure of Fitted log(count)
from Log-linear
9 23 17.02 14.13 15.12
● Figure of Fitted log(count)
from Log-linear 10 31 21.40 18.26 17.55
● Transform explanatory
variable
● Poisson Regression with 11 20 26.33 23.60 19.98
Transformed x
● How Large is Large in a
Statistical Sense?
12 25 31.82 30.51 22.41
● Observed and Fitted
Log(Counts) 13 37 37.87 39.43 24.84
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale
14 45 44.49 50.96 27.27 Slide 23 of 51
● Observed and Fitted Counts
Comparison in Log-Scale

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 24 of 51
● Observed and Fitted Counts
Observed and Fitted Counts

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 25 of 51
● Observed and Fitted Counts
More Interpretation of Poisson Regression
■ The marginal effect of xi (month period) on µi (expected
number of deaths due to AIDS).
Overivew
For a 1 unit increase in log(month), the estimated count
Poisson regression for counts
increases by a factor of e2.1748 = 8.80.
● Poisson regression for counts
● Comonents of GLM for ■ Computed fitted values and compared them to the observed.
Counts
● The Poisson loglinear model (table and plots of this).
● Interpretation of β
● Interpretation of β ■ Additional one: We can look at the predicted probability of
(continued)
● Example: Number of Deaths number of deaths given value on xi . (This is not too useful
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
here, but would be of use in a predictive setting).
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
Counts follow a Poisson distribution, so
e−µi µyi
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for P (Yi = y) =
Deaths
● Figure of Fitted log(count)
y!
from Log-linear
● Figure of Fitted log(count)
from Log-linear
According to our estimated model, probabilities that the
● Transform explanatory
variable
number of deaths equals yi for particular value(s) of xi is
● Poisson Regression with ∗
Transformed x −e(−1.9442+2.1748xi ) (−1.9442+2.1748x∗
i)
y
● How Large is Large in a e e
Statistical Sense? P (Yi = y) =
● Observed and Fitted
Log(Counts)
y!
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 26 of 51
● Observed and Fitted Counts
Probabilities of Number of Deaths

−e(−1.9442+2.1748xi ) (−1.9442+2.1748x∗
i)
y
e e
P (Yi = y) =
y!
Overivew

Poisson regression for counts or since we already have µ̂i computed, we can use
● Poisson regression for counts

e−µ̂i µ̂yi
● Comonents of GLM for
Counts
● The Poisson loglinear model P (Yi = y) =
● Interpretation of β y!
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
For example, consider quarter = 3 (and log(3) = 1.09861), we
● Data: Number of Deaths Due
to AIDs × Month
have
● A Linear Model for AIDs Data
● A Look at the Bad Model
µ̂(quarter = 3) = 1.5606
(linear link)
● Back to Data but Plot

P (Y3 = 0) = e−1.5606 (1.5606)0 /0! = .210


log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
P (Y3 = 1) = e−1.5606 (1.5606)1 /1! = .328
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
P (Y3 = 2) = e−1.5606 (1.5606)2 /2! = .128
variable
● Poisson Regression with ..
Transformed x
● How Large is Large in a
.
Statistical Sense?
● Observed and Fitted P (Y3 = 10) = e−1.5606 (1.5606)10 /10! = .000000253
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 27 of 51
● Observed and Fitted Counts
Example 2: Crab Data
Agresti (1996)’s horseshoe crab data.
■ Response variable is the number of satellites a female

Overivew
horseshoe crab has (i.e., how many males are attached to
Poisson regression for counts
her).
● Poisson regression for counts
● Comonents of GLM for ■ Explanatory variable is the width of the female’s back.
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 28 of 51
● Observed and Fitted Counts
A Smoother Look
The data were collpased into 8 groups by their width (i.e.,
≤ 23.25, 23.25–24.25, 24.25–25.25. . . , > 29.25).
Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 29 of 51
● Observed and Fitted Counts
Estimated Poisson Regression for Crabs
log(µ̂i ) = −3.3048 + .1640xi

Overivew ■ The estimated ASE of β̂ = .164 equals .020, which is small


Poisson regression for counts relative to β̂.
● Poisson regression for counts
● Comonents of GLM for
Counts
■ Since β̂ > 0, the wider the female crab, the greater the
● The Poisson loglinear model
● Interpretation of β
expected number of satellites. Note: exp(.1640) = 1.18.
● Interpretation of β
(continued) ■ There is an outlier (with respect to the explanatory variable).
● Example: Number of Deaths
Due to AIDs ◆ Question: how much does this outlier effect the fit of the
● Data: Number of Deaths Due
to AIDs × Month model?
● A Linear Model for AIDs Data
● A Look at the Bad Model ◆ Answer: Remove it and re-estimate the model.
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
log(µ̂i ) = −3.4610 + .1700xi
Deaths
● Figure of Fitted log(count)
from Log-linear and ASE of β̂ = .1700 equals .0216.
● Figure of Fitted log(count)
from Log-linear ◆ So in this case, it doesn’t have much effect. . .
● Transform explanatory
variable The same basic result holds (i.e., positive effect of width
● Poisson Regression with
Transformed x
● How Large is Large in a
on number of satellites, β̂ is “significant” and similar in
Statistical Sense?
● Observed and Fitted
value).
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 30 of 51
● Observed and Fitted Counts
Poisson Regression with Identity Link
■ From the figure of collapsed data, it looks like either a linear
or a log link might work.
Overivew ■ The estimated model with the linear link :
Poisson regression for counts
● Poisson regression for counts µ̂i = −11.53 + .55xi
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
■ Since the effect on the number of expected satellites of
● Example: Number of Deaths
Due to AIDs female width (µi ) is linear and β̂ = .55 > 0, as width
● Data: Number of Deaths Due
to AIDs × Month increases by 1 cm, the expected count increases by .55.
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
■ Question: Is the Poisson regression model with the linear or
● Back to Data but Plot
log(yi ) by Month
the logit link better for these data?
● Poisson Log-Linear Model for
Deaths
■ Answer: Quick look but more formal later when we discuss
● Figure of Fitted log(count)
from Log-linear model assessment (or read further in the text).
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 31 of 51
● Observed and Fitted Counts
Log versus Identity Link for Crabs

Overivew

Poisson regression for counts


● Poisson regression for counts
● Comonents of GLM for
Counts
● The Poisson loglinear model
● Interpretation of β
● Interpretation of β
(continued)
● Example: Number of Deaths
Due to AIDs
● Data: Number of Deaths Due
to AIDs × Month
● A Linear Model for AIDs Data
● A Look at the Bad Model
(linear link)
● Back to Data but Plot
log(yi ) by Month
● Poisson Log-Linear Model for
Deaths
● Figure of Fitted log(count)
from Log-linear
● Figure of Fitted log(count)
from Log-linear
● Transform explanatory
variable
● Poisson Regression with
Transformed x
● How Large is Large in a
Statistical Sense?
● Observed and Fitted
Log(Counts)
● Observed and Fitted Counts
● Comparison of Fitted Counts
Generalized
● ComparisonLinear Models
in Log-Scale Slide 32 of 51
● Observed and Fitted Counts
Poisson regression for rates

Events occur over time (or space), and the length of time (or
amount of space) can vary from observation to observation.
Overivew
Our model should take this into account.
Poisson regression for counts

Poisson regression for rates Example: Gardner, Mulvey, & Shaw (1995), Psychological
● Poisson regression for rates
● The Data Bulletin, 118, 392–404.
● Poisson Regression for Rates
of Events
● As a Multiplicative Model Y = Number of violent incidents exhibited over a 6 month
● Gardner, Mulvey, & Shaw
(1995) period by patients who had been treated in the ER of a
● Estimated Parameters
● SAS/PROC GENMOD psychiatric hospital.
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age During the 6 months period of the study, the individuals were
● Model 1: Age and City both
Nominal primarily residing in the community. The number of violent acts
● Parameter Estimates from
Model 1 depends on the opportunity to commit them; that is, the
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
number of days out of the 6 month period in which a patient is
Values
● Model 3: City Nominal & Age
in the community (as opposed to being locked up in a jail or
Quadratic
● Model 3: Observed and Fitted
hospital).
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 33 of 51


The Data

Overivew
put histogram here.
Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 34 of 51


Poisson Regression for Rates of Events
Y = count (e.g., number violent acts).
t = index of the time or space (e.g., days in the community).
Overivew
The sample rate of occurrence is Y /t.
Poisson regression for counts
The expected value of the rate is
Poisson regression for rates
● Poisson regression for rates
1
● The Data
● Poisson Regression for Rates E(Y /t) = E(Y ) = µ/t
of Events t
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995) The Poisson loglinear regression model for the expected rate
● Estimated Parameters
● SAS/PROC GENMOD
of the occurrence of events is
● Example 2: Lung Cancer
● Plot of the Rate by Age log(µ/t) = α + βx
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
log(µ) − log(t) = α + βx
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
log(µ) = α + βx + log(t)
Numerical
● Model 2: Observed and Fitted
Values The term “− log(t)” is an adjustment term and each individual
● Model 3: City Nominal & Age
Quadratic may have a different value of t.
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
The term − log(t) is referred to as an “offset”.
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 35 of 51


As a Multiplicative Model

Overivew
The Poisson loglinear regression model with a log link for rate
Poisson regression for counts
data is
Poisson regression for rates
● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
log(µ/t) = α + βx
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
µ/t = eα eβx
µ = teα eβx
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age The expected value of counts depends on both t and x, both of
● Model 1: Age and City both
Nominal which are observations (i.e., neither is a parameter of the
● Parameter Estimates from
Model 1 model).
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 36 of 51


Gardner, Mulvey, & Shaw (1995)
■ Response variable is rate of violent incidents, which equals
the number of violent incident divided by the number of days
Overivew
an individual resided in the community. (ȳ = 3.0 with s = 7.3
Poisson regression for counts
and t̄ = 154 with s = 42 days).
Poisson regression for rates ■ Explanatory variables:
● Poisson regression for rates
● The Data
◆ Age (x̄1 = 28.6 years and s1 = 11.1)
● Poisson Regression for Rates
of Events ◆ Sum of 2 ER clinicans ratings of concern on a 0 – 5 scale,
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw so x2 ranges from 0 to 10. (x̄2 = 2.9 with s2 = 3.1).
(1995)
● Estimated Parameters
◆ History of previous violent acts, where
● SAS/PROC GENMOD
● Example 2: Lung Cancer x3 = 0 means no previous acts
● Plot of the Rate by Age
● Plot of the log(Rate) by Age = 1 previous act either 3 days before or
● Model 1: Age and City both
Nominal
● Parameter Estimates from more than 3 days before
Model 1
● Model 2: City Nominal & Age
Numerical
= 2 previous acts both 3 days before and
● Model 2: Observed and Fitted
Values more than 3 days before
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
r(concern, history)= .55
● Model 4: Simpler city & Age
Quadratic
r(age,history)= −.11
● Model 4: Fitted and Observed
● Next Steps
r(age,concern)= −.07

Generalized Linear Models Slide 37 of 51


Estimated Parameters
Coefficient Value ASE value/ASE
Intercept -3.410 .0690 -49.29
Overivew

Poisson regression for counts


Age -.045 .0023 -19.69
Poisson regression for rates Concern .083 .0075 11.20
● Poisson regression for rates
● The Data
● Poisson Regression for Rates History .420 .0380 11.26
of Events
● As a Multiplicative Model put histogram of fitted and observed
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
Note: Poisson regression models for rate data are related to models
● SAS/PROC GENMOD
● Example 2: Lung Cancer
for “survival times”.
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 38 of 51


SAS/PROC GENMOD
DATA violent;
INPUT age history concern days count;
Ldays = LOG(days);
Overivew

Poisson regression for counts To fit model for rate data with “days” as t:
Poisson regression for rates
● Poisson regression for rates
PROC GENMOD DATA=violent;
● The Data
● Poisson Regression for Rates
MODEL count = age history concern
of Events
● As a Multiplicative Model
/ LINK=log DIST=poisson OFFSET=Ldays;
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters To include interactions, change model statement
● SAS/PROC GENMOD
● Example 2: Lung Cancer
MODEL count = age history concern history*concern
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
/ LINK=log DIST=poisson OFFSET=Ldays;
● Model 1: Age and City both
Nominal
● Parameter Estimates from If we want to treat “history” as a discrete (nominal) variable,
Model 1
● Model 2: City Nominal & Age you would include the statement
Numerical
● Model 2: Observed and Fitted
Values
CLASS history;
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted If the model with “history” treated as a numerical variable
Values
● Model 4: Simpler city & Age
Quadratic
almost as well as the model with “history” treated as a nominal
● Model 4: Fitted and Observed discrete variable, which model would you prefer?
● Next Steps

Generalized Linear Models Slide 39 of 51


Example 2: Lung Cancer

Overivew
Data are from Lindsey (1995) from Andersen (1977)
Poisson regression for counts

Poisson regression for rates


■ Response Variable: Y = Number of cases of lung cancer
● Poisson regression for rates
● The Data
and it follows a Poission distribution.:
● Poisson Regression for Rates
of Events
● As a Multiplicative Model ■ Explanatory Variables:
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
◆ City in Denmark (Fredericia, Horsens, Kolding, Vejle).
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
◆ Age (40–54, 55–59, 60–64, 65–69, 70–74, >75).
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
■ Offset = Population size of each age group of each city.
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
■ We will model the rate of cases of lung cancer = Y /t.
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 40 of 51


Plot of the Rate by Age

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 41 of 51


Plot of the log(Rate) by Age

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 42 of 51


Model 1: Age and City both Nominal
Define (
1 if city is Frederica
Fredericia =
Overivew
0 other city
Poisson regression for counts
(
1 if city is Horsens
Poisson regression for rates Horsens =
● Poisson regression for rates
● The Data
0 other city
● Poisson Regression for Rates (
of Events
● As a Multiplicative Model 1 if city is Kolding
● Gardner, Mulvey, & Shaw Kolding =
(1995) 0 other city
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
Define Dummy variables for the 6 age classes (groups).
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
Model 1:
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
log(Y /pop) = α + β1 (Fredericia) + β2 (Horsens) + β3 (Kolding)
● Model 2: Observed and Fitted
Values = β4 (Age1) + β5 (Age2) + β6 (Age3) + β7 (Age4)
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
β8 (Age5)
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 43 of 51


Parameter Estimates from Model 1
Parameter Estimate df s.e. X2 p
Intercept α 1 −4.48 0.21 423.33 < .01
Overivew

Poisson regression for counts


city Frederic β1 1 0.27 0.18 2.10 .15
Poisson regression for rates city Horsens β2 1 −0.05 0.19 0.09 .76
● Poisson regression for rates
● The Data
● Poisson Regression for Rates city Kolding β3 1 −0.09 0.19 0.25 .62
of Events
● As a Multiplicative Model city Vejle 0 0.00 0.00 . .
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters age 40-54 β4 1 −1.41 0.25 32.18 < .01
● SAS/PROC GENMOD
● Example 2: Lung Cancer age 55-59 β5 1 −0.31 0.25 1.60 .21
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both age 60-64 β6 1 0.09 0.23 0.18 .67
Nominal
● Parameter Estimates from
Model 1
age 65-69 β7 1 0.34 0.23 2.22 .14
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
age 70-74 β8 1 0.43 0.23 3.34 .07
Values
● Model 3: City Nominal & Age age >75 0 0.00 0.00 . .
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age Note: G2 = 23.45, df = 15, p = .08
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 44 of 51


Model 2: City Nominal & Age Numerical
The mid-point of the age ranges were used (except for the last
one, I used 75).
Overivew

Poisson regression for counts


log(Y /pop) = α + β1 (Fredericia) + β2 (Horsens) + β3 (Kolding)
Poisson regression for rates
● Poisson regression for rates = β4 (Age Mid-point)
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model Parameter Estimate df s.e. X2 p
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
Intercept α 1 −8.22 0.44 349.18 < .01
● SAS/PROC GENMOD
● Example 2: Lung Cancer city Frederic β1 1 0.24 0.18 1.72 0.19
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
city Horsens β2 1 −0.05 0.19 0.10 0.76
Nominal
● Parameter Estimates from
Model 1
city Kolding β3 1 −0.10 0.19 0.28 0.60
● Model 2: City Nominal & Age
Numerical city Vejle 0 0.00 0.00 . .
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age age-midpoint β4 1 0.05 0.00 75.62 < .01
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age Note: G2 = 46.45, df = 19, p < .01
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 45 of 51


Model 2: Observed and Fitted Values

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 46 of 51


Model 3: City Nominal & Age Quadratic
log(Y /pop) = α + β1 (Fredericia) + β2 (Horsens) + β3 (Kolding)
= β4 (Age Mid-point) + β5 (Age Mid-point)2
Overivew

Poisson regression for counts


Parameter Estimate df s.e. X2 p
Poisson regression for rates
● Poisson regression for rates
● The Data
Intercept α1 1 −21.72 3.09 49.24 < .01
● Poisson Regression for Rates
of Events city Frederic β1 1 0.27 0.18 2.13 0.14
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
city Horsens β2 1 −0.05 0.19 0.09 0.76
● Estimated Parameters
● SAS/PROC GENMOD city Kolding β3 1 −0.10 0.19 0.26 0.61
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
city Vejle 0 0.00 0.00 . .
● Model 1: Age and City both
Nominal age-midpoint β4 1 1 0.50 0.10 24.91 < .01
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age age2 β5 1 1 −0.00 0.00 19.90 < .01
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
G2 = 26.02, df = 18, p = .10.
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 47 of 51


Model 3: Observed and Fitted Values

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 48 of 51


Model 4: Simpler city & Age Quadratic
(
1 if city is Frederica
Define Fredericia =
0 other city
Overivew

Poisson regression for counts log(Y /pop) = α+β1 (Fredericia)+β2 (Age Mid-point)+β3 (Age Mid-point)2
Poisson regression for rates
● Poisson regression for rates That is,
● The Data
● Poisson Regression for Rates (
of Events
● As a Multiplicative Model α + β1 + β2 (Age) + β3 (Age)2 if Fredericia
● Gardner, Mulvey, & Shaw log(Y /pop) =
(1995) α + β2 (Age) + β3 (Age)2 if other city
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age Parameter Estimate df s.e. X2 p
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal Intercept α1 1 −21.78 3.09 49.61 < .01
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
frederic 1 β1 1 0.32 0.14 4.92 .03
Numerical
● Model 2: Observed and Fitted
Values
frederic 0 0 0.00 0.00 . .
● Model 3: City Nominal & Age
Quadratic age-midpoint β2 1 0.50 0.10 24.93 < .01
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age age2 β3 1 −0.00 0.00 19.91 < .01
Quadratic
● Model 4: Fitted and Observed
● Next Steps
Note: G2 = 26.2815, df = 20, p = .16.

Generalized Linear Models Slide 49 of 51


Model 4: Fitted and Observed

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 50 of 51


Next Steps

Statistical Inference for Poisson Regression. . .

Overivew

Poisson regression for counts

Poisson regression for rates


● Poisson regression for rates
● The Data
● Poisson Regression for Rates
of Events
● As a Multiplicative Model
● Gardner, Mulvey, & Shaw
(1995)
● Estimated Parameters
● SAS/PROC GENMOD
● Example 2: Lung Cancer
● Plot of the Rate by Age
● Plot of the log(Rate) by Age
● Model 1: Age and City both
Nominal
● Parameter Estimates from
Model 1
● Model 2: City Nominal & Age
Numerical
● Model 2: Observed and Fitted
Values
● Model 3: City Nominal & Age
Quadratic
● Model 3: Observed and Fitted
Values
● Model 4: Simpler city & Age
Quadratic
● Model 4: Fitted and Observed
● Next Steps

Generalized Linear Models Slide 51 of 51

You might also like