The CATMOD Procedure

Example 32.4 Log-Linear Model, Three Dependent Variables

(View the complete code for this example.)

This analysis reproduces the predicted cell frequencies for Bartlett’s data by 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 32.4.1 through Output 32.4.3:

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
;
title 'Bartlett''s Data';
proc catmod data=bartlett;
   weight wt;
   model Length*Time*Status=_response_
         / noparm pred=freq;
   loglin Length|Time|Status @ 2;
   title2 'Model with No 3-Variable Interaction';
quit;

Output 32.4.1: Analysis of Bartlett's Data: Log-Linear Model

Bartlett's Data
Model with No 3-Variable Interaction

The CATMOD Procedure

Data Summary
ResponseLength*Time*StatusResponse Levels8
Weight VariablewtPopulations1
Data SetBARTLETTTotal Frequency960
Frequency Missing0Observations8

Population Profiles
SampleSample Size
1960

Response Profiles
ResponseLengthTimeStatus
1111
2112
3121
4122
5211
6212
7221
8222

Maximum Likelihood Analysis
Maximum likelihood computations converged.

Maximum Likelihood Analysis of Variance
SourceDF Chi-SquarePr > ChiSq
Length12.640.1041
Time15.250.0220
Length*Time15.250.0220
Status148.94<.0001
Length*Status148.94<.0001
Time*Status195.01<.0001
Likelihood Ratio12.290.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.

The predicted values table (Output 32.4.2) displays observed and predicted values for the generalized logits.

Output 32.4.2: Response Function Predicted Values

Maximum Likelihood Predicted Values for Response Functions
Function
Number
ObservedPredictedResidual
FunctionStandard
Error
FunctionStandard
Error
1-0.292480.105806-0.235650.098486-0.05683
2-0.911520.129188-0.949420.1299480.037901
3-0.911520.129188-0.949420.1299480.037901
4-0.292480.105806-0.235650.098486-0.05683
5-0.669510.118872-0.693620.1201720.024113
6-0.451990.110921-0.38970.102267-0.06229
7-1.908350.192465-1.731460.142969-0.17688


The predicted frequencies table (Output 32.4.3) displays observed and predicted cell frequencies, their standard errors, and residuals.

Output 32.4.3: Predicted Frequencies

Maximum Likelihood Predicted Values for Frequencies
LengthTimeStatusObservedPredictedResidual
FrequencyStandard
Error
FrequencyStandard
Error
11115611.43022161.096111.07379-5.09614
112848.75499978.903867.8086135.096139
121848.75499978.903867.8086135.096139
12215611.43022161.096111.07379-5.09614
2111079.750588101.90398.9243045.096139
21213310.70392138.096110.33434-5.09614
221315.4771336.096144.826315-5.09614
22220912.78667203.903912.212855.09614