Professional Documents
Culture Documents
Notes For GLM For Binary To Negative Binomial GLM
Notes For GLM For Binary To Negative Binomial GLM
Suppose Y = 1 or 0
P (Y = 0) = 1 − π
E(Y ) = π
V ar(Y ) = π(1 − π)
62
This is a GLM for binomial random component and
identity link fn.
1 = present, 0 = absent
63
Alcohol Malformation Proportion
Consumption Present Absent Total Present
0 48 17,066 17,114 .0028
<1 38 14,464 14,502 .0026
1-2 5 788 793 .0063
3-5 1 126 127 .0079
>6 1 37 38 .0262
Using x scores (0, .5, 1.5, 4.0, 7.0), linear prob. model
for π = prob. malformation present has ML fit
At x = 0, π̂ = α̂ = .0025
64
Note
β̂ − 0
z=
SE(β̂)
(for large n has approx std. normal dist. under null)
.0011
ex. z = .0007 = 1.50
65
• Same fit if enter 5 binomial “success totals” or the
32,574 individual binary responses of 0 or 1.
66
Logistic regression model
π
log = α + βx
1−π
π̂
ex. logit(π̂) = log 1−π̂
= −5.96 + .32x
Note
67
• Both the linear probability model and logistic regres-
sion model fit adequately
e−µµy
P (y) = , y = 0, 1, 2, . . .
y!
• µ = E(y)
√
µ = V ar(Y ), σ = µ
69
Poisson regression for count data
A : 3, 7, 6, . . . ȳA = 5.0
B : 6, 9, 8, . . . ȳB = 9.0
70
For model µ = α + βx (identity link)
µ̂ = 5.0 + 4.0x
(← test, CI for β)
71
Inference for GLM parameters
CI: β̂ ± z α2 (SE)
Test: Ho : β = 0
1. Wald test
β̂
z= SE has approx. N (0, 1) dist.
72
2. Likelihood-ratio test
= −2(L0 − L1)
73
ex. Wafer defects
β = log µB − log µA
HO : µA = µB ⇔ β = 0
Wald test
β̂ .588
z= SE
= .176
= 3.33
Likelihood-ratio test
L1 = 138.2, L0 = 132.4
74
Note
75
µB
β = log µB − log µA = log µA
µB
eβ = µA
µ̂B
eβ̂ = e.5878 = 1.8 = µ̂A
.
76
Deviance of a GLM
i.e., for
Ho : model holds
Ha : saturated model
77
For Poisson and binomial models for counts,
Deviance = G2 = 2 yi log µ̂yii ← for M
P
2
P (yi−µ̂i)2
X = µ̂i
(Pearson)
78
ex. Wafer defects
deviance G2 = 16.3
Pearson X 2 = 16.0
df = 20-2 = 18
79
Note
80
Negative binomial GLM
81
ex. GSS data “In past 12 months, how many people
have you known personally that were victims of homi-
cide?”
Y Black White
0 119 1070
1 16 60
2 12 14
3 7 4
4 3 0
5 2 0
6 0 1
Model log(µ) = α + βx
82
For Poisson or neg. bin. model,
.522 ȳB
e1.73 = 5.7 = .092
= ȳW
83
For neg. bin. model, estimated dispersion para. D̂ =
4.94 (SE = 1.0)
84