Example 6 for PROC CATMOD
/****************************************************************/
/* S A S S A M P L E L I B R A R Y */
/* */
/* NAME: CATEX6 */
/* TITLE: Example 6 for PROC CATMOD */
/* PRODUCT: STAT */
/* SYSTEM: ALL */
/* KEYS: categorical data analysis */
/* PROCS: CATMOD */
/* DATA: */
/* */
/* SUPPORT: Bob Derr */
/* REF: SAS/STAT User's Guide, PROC CATMOD chapter */
/* MISC: */
/* */
/****************************************************************/
/*----------------------------------------------------------------
Example 6: Repeated Measures, 2 Response Levels, 3 Populations
Multi-Population Repeated Measures
----------------------------------
Subjects from 3 groups have their response (0 or 1) recorded
at each of four trials.
From: Guthrie (1981).
----------------------------------------------------------------*/
data group;
input a b c d Group wt @@;
datalines;
1 1 1 1 2 2 0 0 0 0 2 2 0 0 1 0 1 2 0 0 1 0 2 2
0 0 0 1 1 4 0 0 0 1 2 1 0 0 0 1 3 3 1 0 0 1 2 1
0 0 1 1 1 1 0 0 1 1 2 2 0 0 1 1 3 5 0 1 0 0 1 4
0 1 0 0 2 1 0 1 0 1 2 1 0 1 0 1 3 2 0 1 1 0 3 1
1 0 0 0 1 3 1 0 0 0 2 1 0 1 1 1 2 1 0 1 1 1 3 2
1 0 1 0 1 1 1 0 1 1 2 1 1 0 1 1 3 2
;
title 'Multiple-Population Repeated Measures';
proc catmod data=group;
weight wt;
response marginals;
model a*b*c*d=Group _response_ Group*_response_
/ freq;
repeated Trial 4;
title2 'Saturated Model';
run;
model a*b*c*d=Group _response_(Group=3)
/ noprofile noparm design;
title2 'Trial Nested within Group 3';
quit;