|
Chapter Contents |
Previous |
Next |
| The CATMOD Procedure |
If you use raw data, PROC CATMOD first counts the number of observations having each combination of values for all variables specified in the MODEL or POPULATION statements. For example, suppose the variables A and B each take on the values 1 and 2, and their frequencies can be represented as follows.
| A=1 | A=2 | |
| B=1 | 2 | 1 |
| B=2 | 3 | 1 |
The SAS data set Raw containing the raw data might be as follows.
| Observation | A | B |
| 1 | 1 | 1 |
| 2 | 1 | 1 |
| 3 | 1 | 2 |
| 4 | 1 | 2 |
| 5 | 1 | 2 |
| 6 | 2 | 1 |
| 7 | 2 | 2 |
And the statements for PROC CATMOD would be
proc catmod data=Raw;
model A=B;
run;
For discussions of how to handle structural and random zeros with raw data as input data, see the "Zero Frequencies" section and Example 20.5.
data Summary;
input A B Count;
datalines;
1 1 2
1 2 3
2 1 1
2 2 1
;
In this case, the corresponding statements would be
proc catmod data=Summary;
weight Count;
model A=B;
run;
The data set Summary can also be created from data set Raw by using the FREQ procedure:
proc freq data=Raw;
tables A*B / out=Summary;
run;
data direct(type=est);
input b1-b4 _type_ $ _name_ $8.;
datalines;
0.590463 0.384720 0.273269 0.136458 PARMS .
0.001690 0.000911 0.000474 0.000432 COV B1
0.000911 0.001823 0.000031 0.000102 COV B2
0.000474 0.000031 0.001056 0.000477 COV B3
0.000432 0.000102 0.000477 0.000396 COV B4
;
In order to tell PROC CATMOD that the input data set contains the values of response functions and their covariance matrix,
proc catmod data=direct;
response read b1-b4;
model _f_=_response_;
factors age 2, race 2 / _response_=age race;
run;
|
Chapter Contents |
Previous |
Next |
Top |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.