Chapter 6
Chapter 6
Chapter 6
Tables,
Model,
➔ Saturated Model
➔ ,
Poisson regression
➢ Many discrete response variables have counts as possible
outcomes. Example is Y = number of parties attended in the
past month, for a sample of students,
➢ Counts also occur in summarizing categorical variables with
contingency tables.
➢ This section introduces GLMs for count data
➢ The simplest GLMs for count data assume a Poisson
distribution for the random component. Like counts, Poisson
variates can take any nonnegative integer value.
Poisson Model
The Maximum Likelihood estimator
➔ We observe data {(xi , yi)|1 ≤ i ≤ n}. The number yi is a realization of the random
variable Yi . The total log-likelihood is, using independency, given by
and 𝛍i = exp(βtxi). Write now Log L(β) as shorthand notation for the total likelihood. Then it follows
: https://stats.idre.ucla.edu/wp-content/uploads/2016/02/poisson_sim.sav.
>p<-poisson_sim
>hist(p$num_awards,col
= "yellow",border =
"blue",xlim = c(0,8),
ylim = c(0,200),
breaks = 7,main =
"Histogram",xlab =
"Number of award")
con’t
> summary(m1 <- glm(num_awards ~ prog + math, family="poisson", data=p))
Call:
glm(formula = num_awards ~ prog + math, family = "poisson", data = p)
Deviance Residuals:
Min 1Q Median 3Q Max
-2.2043 -0.8436 -0.5106 0.2558 2.6796
Coefficients:
Estimate Std. Error z value Pr(>|z|)
(Intercept) -5.24712 0.65845 -7.969 1.60e-15 ***
progAcademic 1.08386 0.35825 3.025 0.00248 **
progVocational 0.36981 0.44107 0.838 0.40179
math 0.07015 0.01060 6.619 3.63e-11 ***
---
Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
(Dispersion parameter for poisson family taken to be 1)
Null deviance: 287.67 on 199 degrees of freedom
Residual deviance: 189.45 on 196 degrees of freedom
AIC: 373.5
Number of Fisher Scoring iterations: 6
Interpret
log(num_awards) = Intercept + b1( progAcademic) +
b2(progVocational ) + b3math.
= exp(Intercept) * exp(b1(progAcademic)) *
exp(b2(progVocational)) * exp(b3math)
The output above indicates that the award rate for [prog=Academic] is
2.9560 times the award rate for the reference group, general. Likewise,
the award rate for [prog=Vocational ] is 1.45 times the awar t rate for
the general holding the other variables at constant. The percent change
in the award rate of num_awards is an increase of 7% for every unit
increase in math.
Loglinear Models
The λXYij parameters are association terms that reflect deviations from
independence.
.
Example: Belief in Life after Death