Creating N-Way Tables

Overview

For a frequency analysis of more than two variables, use PROC FREQ to create n-way crosstabulations. A series of two-way tables is produced, with a table for each level of the other variables.
For example, suppose you want to add the variable Sex to your crosstabulation of Weight and Height in the data set Clinic.Diabetes. Add Sex to the TABLES statement, joined to the other variables with an asterisk (*).
tables sex*weight*height;

Determining the Table Layout

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 that precede the last two variables in the TABLES statement stratify the crosstabulation tables.
       levels
       
tables sex*weight*height;
                 
           rows + columns = two-way tables
Notice the structure of the output that is produced by the program shown below.
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; 
   format weight wtfmt. height htfmt.; 
run;
Figure 9.17 Creating N-Way Tables
Creating N-Way Tables
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.140.196.244