









Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!










1
This chapter describes the algorithm to calculate maximum-likelihood estimates for the Poisson loglinear model. This algorithm is applicable only to aggregated data. See “Aggregated Data (Poisson)” on p. 16 for producing aggregated data.
The following notation is used throughout this chapter unless otherwise stated:
B Generic categorical dependent (response) variable. Its categories are indexed by an array of integers. r (^) Number of categories of B. p Number of nonredundant (nonaliased) parameters. i Generic index for the category of B. k Generic index for the parameter. ni Observed count in the ith response of B.
N Total observed count, equal to^ ni i
r
=
1
.
mi Expected count. z (^) i Cell structure value. β (^) k The kth nonredundant parameter.
x (^) ik An element in the ith row and the kth column of the design matrix.
There are two components in a loglinear model: the random component and the systematic component.
The random component describes the joint distribution of the counts.
i
n m
i i
r (^) i − i
=
∏ (^)! 1
cov
if n n (^) if
m i i i i (^) i i , ′ = i = ′ ≠ ′
% & '
(^1 6 )
The systematic component describes the linkage function between the expected counts and the parameters. The expected counts are themselves functions of parameters. For i = 1, K, r,
m z e^ z i (^) z i
v i i
i = > ≤
% &
K 'K^
β 0 + 0 0 0
if if
Let g 1 6 β = 3 g (^0) 1 6β , K, g (^) p1 6β 8 ′be the 0 p + 15 × 1 gradient vector with
g (^) k L k
β ∂ 1 6 (^) ∂β
The maximum-likelihood estimates β$^ = 4 β $^0 , K , β$p 9 ′ are regarded as a solution to the vector of likelihood equations:
g 1 6 β = 0 (3)
The likelihood equations are nonlinear functions of β. Solving them for β$ requires an iterative method. The Newton-Raphson method is used. It can be shown that
∂ β
∂β ∂β
∂β ∂β
∂β ∂β
2 (^20) 1
2 (^0 1 )
2 (^0 )
2
1
L (^) m
L (^) m x
L (^) m x
L (^) m x x
i i
r
i il i
r
k
i ik i
r
k l
i ik il i
r
=
=
=
=
Let H 1 6 β be the 0 p + 1 5 0× p+ 15 information matrix, where − H 1 6 β is the Hessian matrix of (2). The elements of H 1 6 β are
h (^) kl L^ k p l p k l
1 6 β = (^) ∂β ∂β∂ = =
2 0 , K, and 1 , K, (4)
Note: H 1 6 β is a symmetric positive definite matrix. The asymptotic covariance matrix of β$ is estimated by H −^1 1 6 β.
Let β 0 5s^ denote the sth approximation for the solution to (3). By the Newton- Raphson method,
β 0 s^ +^1 5 = β0 5s^ + H −^14 β 0 5s^ 9 4 g β 0 5s 9
Define q (^) 1 6 β = H (^) 1 6β β + g 1 6β. The kth element of q 1 6 β is
q (^) k i xik i
r 1 6^ β^ = η =
∑ 1
where
ηi = %&m vi^ i^ +^ ni^ −^ mi^ zi>^ > '
1 6 if^ and m otherwise
(^0) i 0 0
Then
H (^) 4 β 0 5s^9 β 0 s^ +^15 = q 4 β0 5s 9 (6)
Thus, given β 0 5s, the 0 s + 15 th approximation β 0 s^ +^15 is found by solving the system of equations in (6).
SPSS uses the β 0 5^0 , which corresponds to a saturated model as the initial value for β. Then the initial estimates for the expected cell counts are
m
n z i z
i i i
0 5 (^) = +^ > ≤
% & '
∆ if if (7) where ∆ ≥ 0 is a constant.
m z e^ z z
i
s (^) i v^ i i
s is
% &
K 'K
1 0
1 1 0 0 0
0 5
if if
The estimated expected count is
$ $ m z e^ z i (^) z i
v i i
= i > ≤
% &
K 'K^
β 0 + 0 0 0
if if
where
v^ $^ i xik $k k
=
∑ β 1
The Pearson chi-square statistic is
X X (^) i i
r 2 2 1
=
∑
where
n m m z n m z n m z n m
i
i i i i i i i i i i i i
2
% &
KK
'
KK
1 6 if^ and SYSMIS if and if or
If any X (^) i^2 is system missing, then X 2 is also system missing. The likelihood-ratio chi-square statistic is
G Gi i
r 2 2 1
=
∑
where
n n m n m z n m z n m m z n m z n m
i
i i i i i i i i i i i i i i i i i i
2
%
&
KK
'
K K
log / $^ $^ , , $ , , $ $ (^) , , $ $
2 1 6 7 1^6 if^ and SYSMIS if and if and if or
If any Gi^2 is system missing, then G^2 is also system missing.
The degrees of freedom for each statistic is defined as a = r − 1 − p −E, where E is the number of cells with z (^) i ≤ 0 or m$^ i= 0.
The significance level (or the p value) for the Pearson chi-square statistic is Prob 4 χ 2 a > X^29 and that for the likelihood-ratio chi-square statistic is Prob 4 χ 2 a > G^29. In both cases, χ (^2) a^ is the central chi-square distribution with a degrees of freedom.
r
n m m a z n m m iA^ z^ n^ m
i i i ii i i i i = i i i
% &
KK
'
KK
1 6 1 1 6 0 0 0 0
if , and if and SYSMIS otherwise
where
a (^) ii m (^) i h x (^) ik h k^ x (^) ik x hil kl l
p
k
p
k
p = + +
= = =
$ (^) ∑ ∑∑ 00 0 1 1 1
h kl^ is the (k,l)th element of H −^1 4 9 β$. The adjusted residuals are asymptotically standard normal.
Pierce and Schafer (1986) and McCullagh and Nelder (1989) define the signed square root of the individual contribution to the G^2 statistic as the deviance residual. This statistic for the ith cell is
ri D^ = sign 1 n (^) i −m$ (^) i 6 di
where
d
n n m n m z m n m z m n i z n m
i i i i i i i i i i i i i i i
%
&
KK
'
K K
log / $^ $^ , $^ , $ (^) , $ (^) , $
4 2 1 6 7 1^69 if^ and if and if and SYSMIS otherwise
When all z (^) i > 0 , (^) i ri D G
r 4 9
(^2 ) ∑ (^) = 1 =.
Consider a linear combination of the cell counts (^) i d ni i
r ∑ (^) = 1 , where^ d^ i^ are real numbers. The estimated expected value is
d mi i i
r $ =
∑ 1
The simple residual for this linear combination is
d (^) i n (^) i mi i
r − =
∑ 1 $^6 1
The standardized residual for this linear combination is
d n m
d m
i i^ i^ i
r
i i
r i
=
∑
∑
1 1 6 2 1
Using the results in Christensen (1990, p. 227), the adjusted residual for this linear combination is
d n m V
i i^ i^ i
r ∑ (^) = 1 1 −$^6
where
The variance is
var d (^) i m w w h i
r i k l kl l
p
k
p
= = =
∑ ∑∑
= 1 1 1
log (^) 1 6$ (10)
where
w (^) k d xi k p i
r = (^) ik = =
∑ 1
The null hypothesis is
H d (^) i m i
r 0 i 1
∑ 1 6=
The Wald statistic is
d m
w w h
i i^ i
r
l k^ l^ kl
p k
= p
^
=
= =
∑
∑ ∑
1 log^ 1 6$
2
1 1
Under H 0 , W asymptotically distributes as a chi-square distribution with 1 degree of freedom. The significance level is Prob 4 χ 12 ≥ W 9. Note: W will be system missing if (10) is 0.
The asymptotic 01 − α 5 × 100 % confidence interval for (9) is
d (^) i m z w w h i
r i k l kl l
p
k
p
= = =
∑ ± ∑∑ 1
2 1 1
log (^) 1 6$^ α/
value of α is 0.05.
This section shows how data are aggregated for a Poisson distribution. The following notation is used in this section: vi The number of SPSS cases for B = i 0 i = 1, K,r 5 nis The sth SPSS caseweight for B = i 1 s = 1, K,vi 6 x (^) is Covariate z (^) is Cell weight c (^) is GRESID coefficient eis GLOR coefficient vi+^ The number of positive^ z^ is (cell weights) for^1 ≤^ s^ ≤vi The cell count is
n n^ v v v
i s v is i i i
= (^) i
% &
K 'K
≤ ≤
∑ 1 0 0 0 0
if if or
where
n
n n z is n z
is is is is is
% & '
if and if and
and (^) ∑ 1 ≤ ≤s v i
means summation over the range of s with the terms z (^) is > 0.
The cell weight value is
Agresti, A. 1990. Categorical data analysis. New York: John Wiley & Sons, Inc.
Christensen, R. 1990. Log-linear models. New York: Springer-Verlag.
Haberman, S. J. 1973. The analysis of residuals in cross-classified tables. Biometrics, 29: 205–220.
McCullagh, P., and Nelder, J. A. 1989. Generalized linear models. 2nd ed. London: Chapman and Hall.
Pierce, D. A., and Schafer, D. W. 1986. Residuals in generalized linear models. Journal of the American Statistical Association, 81: 977–986.