| Computing Frequency Distributions |
| Creating
Crosstabulations |
| N-Way Tables
For a frequency analysis of more than two variables, use PROC FREQ to create n-way crosstabulations. A series of two-way tables will result, with a table for each level of the other variables.
Suppose, for example, you want to add the variable tables sex*weight*height;
The order of the variables is important. In n-way tables, the last two variables of the TABLES statement become the two-way rows and columns. Variables preceding the last two in the TABLES statement stratify the crosstabulation tables. levels
v
tables sex*weight*height;
^ ^
rows + columns = two-way tables
Notice the structure of the output produced by the program shown below. proc format;
value weight low-139='< 140'
140-180='140-180'
181-high='> 180';
value height low-64='< 5''5"'
65-70='5''5-10"'
71-high='> 5''10"';
run;
proc freq data=clinic.diabetes;
tables sex*weight*height;
format weight weight. height height.;
run;
|
|
|
|||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||
![]() ![]() |
|
Copyright © 2002 SAS Institute Inc.,
Cary, NC, USA. All rights reserved.