Example 20.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 20.4.1 through
Output 20.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 20.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 20.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 20.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 20.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 20.4.5: Response Function and Frequency Predicted Values
|
| Bartlett's Data |
| Model with No 3-Variable Interaction |
| Maximum Likelihood Predicted Values for Response Functions and Frequencies |
| Sample |
Length |
Time |
Status |
Function Number |
Observed |
Predicted |
Residual |
| Function |
Standard Error |
Function |
Standard Error |
| 1 |
|
|
|
1 |
-0.2924782 |
0.10580617 |
-0.2356473 |
0.09848616 |
-0.056831 |
| |
|
|
|
2 |
-0.9115175 |
0.12918766 |
-0.9494184 |
0.1299476 |
0.03790099 |
| |
|
|
|
3 |
-0.9115175 |
0.12918766 |
-0.9494184 |
0.1299476 |
0.03790099 |
| |
|
|
|
4 |
-0.2924782 |
0.10580617 |
-0.2356473 |
0.09848616 |
-0.056831 |
| |
|
|
|
5 |
-0.6695054 |
0.11887171 |
-0.6936188 |
0.12017169 |
0.02411336 |
| |
|
|
|
6 |
-0.4519851 |
0.11092108 |
-0.3896985 |
0.1022668 |
-0.0622866 |
| |
|
|
|
7 |
-1.908347 |
0.19246494 |
-1.7314626 |
0.14296911 |
-0.1768845 |
| |
1 |
1 |
1 |
F1 |
156 |
11.4302231 |
161.096138 |
11.0737946 |
-5.0961381 |
| |
1 |
1 |
2 |
F2 |
84 |
8.75499857 |
78.9038609 |
7.8086133 |
5.09613909 |
| |
1 |
2 |
1 |
F3 |
84 |
8.75499857 |
78.9038609 |
7.8086133 |
5.09613909 |
| |
1 |
2 |
2 |
F4 |
156 |
11.4302231 |
161.096138 |
11.0737946 |
-5.0961381 |
| |
2 |
1 |
1 |
F5 |
107 |
9.75058759 |
101.903861 |
8.9243041 |
5.09613941 |
| |
2 |
1 |
2 |
F6 |
133 |
10.7039226 |
138.096139 |
10.3343404 |
-5.0961386 |
| |
2 |
2 |
1 |
F7 |
31 |
5.47713048 |
36.0961431 |
4.82631486 |
-5.0961431 |
| |
2 |
2 |
2 |
F8 |
209 |
12.7866711 |
203.90386 |
12.2128493 |
5.09614031 |
|
The upper section of the predicted value table displays
observed and predicted values for the generalized logits.
The lower section of the table displays observed and predicted
cell frequencies, their standard errors, and residuals.
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.