| Computing Frequency Distributions |
| Creating
Crosstabulations |
| List Output
When three or more variables are specified, the multiple levels of n-way tables can produce considerable output. Such bulky, often complex crosstabulations are often easier to read as a continuous list. Although this limits your output to summary statistics, the results are compact and clear. To generate list output for crosstabulations, add a slash (/) and the LIST option to the TABLES statement in your PROC FREQ step. |
TABLES variable-1*variable-2 <* ... variable-n> / LIST; |
| Example
Adding the LIST option to our Clinic.Diabetes program puts its frequencies in a simple, short table. proc format;
value wtfmt low-139='< 140'
140-180='140-180'
181-high='> 180';
value htfmt low-64='< 5''5"'
65-70='5''5-10"'
71-high='> 5''10"';
run;
proc freq data=clinic.diabetes;
tables sex*weight*height / list;
format weight wtfmt. height htfmt.;
run;
|
| Sex | Weight | Height | Frequency | Percent | Cumulative Frequency |
Cumulative Percent |
| F | < 140 | < 5'5" | 2 | 10.00 | 2 | 10.00 |
| F | 140-180 | < 5'5" | 5 | 25.00 | 7 | 35.00 |
| F | 140-180 | 5'5-10" | 4 | 20.00 | 11 | 55.00 |
| M | 140-180 | 5'5-10" | 1 | 5.00 | 12 | 60.00 |
| M | > 180 | 5'5-10" | 3 | 15.00 | 15 | 75.00 |
| M | > 180 | > 5'10" | 5 | 25.00 | 20 | 100.00 |
![]() ![]() |
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.