Example 22.4: Log-Linear Model, Three Dependent Variables
This analysis reproduces the predicted cell frequencies for
Bartlett's data using a log-linear model of no
three-variable interaction (Bishop, Fienberg, and Holland
1975, p. 89). Cuttings of two different lengths (
Length=short or long) are planted at one of two time points
(Time=now or spring), and their survival status (
Status=dead or alive) is recorded.
As in the text, the variable levels are simply labeled 1 and
2. The following statements produce Output 22.4.1 through
Output 22.4.5:
title "Bartlett's Data";
data bartlett;
input Length Time Status wt @@;
datalines;
1 1 1 156 1 1 2 84 1 2 1 84 1 2 2 156
2 1 1 107 2 1 2 133 2 2 1 31 2 2 2 209
;
proc catmod data=bartlett;
weight wt;
model Length*Time*Status=_response_
/ noparm noresponse pred=freq;
loglin Length|Time|Status @ 2;
title2 'Model with No 3-Variable Interaction';
quit;
Output 22.4.1: Analysis of Bartlett's Data: Log-Linear Model
Bartlett's Data |
Model with No 3-Variable Interaction |
Response |
Length*Time*Status |
Response Levels |
8 |
Weight Variable |
wt |
Populations |
1 |
Data Set |
BARTLETT |
Total Frequency |
960 |
Frequency Missing |
0 |
Observations |
8 |
|
Output 22.4.2: Response Profiles
Bartlett's Data |
Model with No 3-Variable Interaction |
Response Profiles |
Response |
Length |
Time |
Status |
1 |
1 |
1 |
1 |
2 |
1 |
1 |
2 |
3 |
1 |
2 |
1 |
4 |
1 |
2 |
2 |
5 |
2 |
1 |
1 |
6 |
2 |
1 |
2 |
7 |
2 |
2 |
1 |
8 |
2 |
2 |
2 |
|
Output 22.4.3: Iteration History
Bartlett's Data |
Model with No 3-Variable Interaction |
Maximum Likelihood Analysis |
Iteration |
Sub Iteration |
-2 Log Likelihood |
Convergence Criterion |
Parameter Estimates |
1 |
2 |
3 |
4 |
5 |
6 |
0 |
0 |
3992.5278 |
1.0000 |
0 |
0 |
0 |
0 |
0 |
0 |
1 |
0 |
3812.5059 |
0.0451 |
0 |
2.961E-17 |
-2.96E-17 |
-0.2125 |
0.2125 |
0.3083 |
2 |
0 |
3800.2168 |
0.003223 |
0.0494 |
0.0752 |
-0.0752 |
-0.2486 |
0.2486 |
0.3502 |
3 |
0 |
3800.12 |
0.0000255 |
0.0555 |
0.0809 |
-0.0809 |
-0.2543 |
0.2543 |
0.3568 |
4 |
0 |
3800.12 |
3.6909E-9 |
0.0556 |
0.0810 |
-0.0810 |
-0.2544 |
0.2544 |
0.3569 |
Maximum likelihood computations converged. |
|
Output 22.4.4: Analysis of Variance Table
Bartlett's Data |
Model with No 3-Variable Interaction |
Maximum Likelihood Analysis of Variance |
Source |
DF |
Chi-Square |
Pr > ChiSq |
Length |
1 |
2.64 |
0.1041 |
Time |
1 |
5.25 |
0.0220 |
Length*Time |
1 |
5.25 |
0.0220 |
Status |
1 |
48.94 |
<.0001 |
Length*Status |
1 |
48.94 |
<.0001 |
Time*Status |
1 |
95.01 |
<.0001 |
Likelihood Ratio |
1 |
2.29 |
0.1299 |
|
The analysis of variance table shows that the model fits
since the likelihood ratio test for the three-variable
interaction is nonsignificant. All of the two-variable
interactions, however, are significant; this shows that there
is mutual dependence among all three variables.
Output 22.4.5: Response Function Predicted Values
Bartlett's Data |
Model with No 3-Variable Interaction |
Maximum Likelihood Predicted Values for Response Functions |
Sample |
Function Number |
Observed |
Predicted |
Residual |
Function |
Standard Error |
Function |
Standard Error |
1 |
1 |
-0.2924782 |
0.105806 |
-0.2356473 |
0.098486 |
-0.056831 |
|
2 |
-0.9115175 |
0.129188 |
-0.9494184 |
0.129948 |
0.03790099 |
|
3 |
-0.9115175 |
0.129188 |
-0.9494184 |
0.129948 |
0.03790099 |
|
4 |
-0.2924782 |
0.105806 |
-0.2356473 |
0.098486 |
-0.056831 |
|
5 |
-0.6695054 |
0.118872 |
-0.6936188 |
0.120172 |
0.02411336 |
|
6 |
-0.4519851 |
0.110921 |
-0.3896985 |
0.102267 |
-0.0622866 |
|
7 |
-1.908347 |
0.192465 |
-1.7314626 |
0.142969 |
-0.1768845 |
|
The predicted values table displays
observed and predicted values for the generalized logits.
Output 22.4.6: Predicted Frequencies
Bartlett's Data |
Model with No 3-Variable Interaction |
Maximum Likelihood Predicted Values for Frequencies |
Sample |
Length |
Time |
Status |
Function Number |
Observed |
Predicted |
Residual |
Frequency |
Standard Error |
Frequency |
Standard Error |
1 |
1 |
1 |
1 |
F1 |
156 |
11.43022 |
161.096138 |
11.07379 |
-5.0961381 |
|
1 |
1 |
2 |
F2 |
84 |
8.754999 |
78.9038609 |
7.808613 |
5.09613909 |
|
1 |
2 |
1 |
F3 |
84 |
8.754999 |
78.9038609 |
7.808613 |
5.09613909 |
|
1 |
2 |
2 |
F4 |
156 |
11.43022 |
161.096138 |
11.07379 |
-5.0961381 |
|
2 |
1 |
1 |
F5 |
107 |
9.750588 |
101.903861 |
8.924304 |
5.09613941 |
|
2 |
1 |
2 |
F6 |
133 |
10.70392 |
138.096139 |
10.33434 |
-5.0961386 |
|
2 |
2 |
1 |
F7 |
31 |
5.47713 |
36.0961431 |
4.826315 |
-5.0961431 |
|
2 |
2 |
2 |
F8 |
209 |
12.78667 |
203.90386 |
12.21285 |
5.09614031 |
|
The predicted frequencies table displays observed and predicted
cell frequencies, their standard errors, and residuals.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.