Creating Tables in List Format

LIST Option Syntax

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 when they are arranged as a continuous list. Although this arrangement eliminates row and column frequencies and percentages, the results are compact and clear.
Tip
The LIST option is not available when you also specify statistical options.
To generate list output for crosstabulations, add a slash (/) and the LIST option to the TABLES statement in your PROC FREQ step. Here is the syntax:
TABLES variable-1 *variable-2 <* ... variable-n> / LIST;

Example: Using the LIST Option

Adding the LIST option to the 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;
Figure 9.18 Table Created by Using the LIST Option
Table Created by Using the LIST Option

Changing the Table Format

Adding the CROSSLIST option to a TABLES statement displays crosstabulation tables in ODS column format. This option creates a table that has a table definition that you can customize by using the TEMPLATE procedure.
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 / crosslist; 
   format weight wtfmt. height htfmt.; 
run;
Figure 9.19 Table Created by Using CROSSLIST Option: Sex=F
Table Created by Using CROSSLIST Option: Sex=F
Figure 9.20 Table Created by Using CROSSLIST Option: Sex=M
Table Created by Using CROSSLIST Option: Sex=M

Suppressing Table Information

Another way to control the format of crosstabulations is to limit the output of the FREQ procedure to a few specific statistics. Remember that when crosstabulations are run, PROC FREQ produces tables with cells that contain these frequencies:
  • cell frequency
  • cell percentage of total frequency
  • cell percentage of row frequency
  • cell percentage of column frequency
You can use options to suppress any of these statistics. To control the depth of crosstabulation results, add any combination of the following options to the TABLES statement:
  • NOFREQ suppresses cell frequencies
  • NOPERCENT suppresses cell percentages
  • NOROW suppresses row percentages
  • NOCOL suppresses column percentages

Example: Suppress Percentages

Suppose you want to use only the percentages of Sex and Weight combinations in the data set Clinic.Diabetes. To suppress frequency counts and row and column percentages, add the NOFREQ, NOROW, and NOCOL options to the program's TABLES statement.
proc format; 
   value wtfmt low-139='< 140' 
               140-180='140-180' 
               181-high='> 180'; 
run; 
proc freq data=clinic.diabetes; 
   tables sex*weight / nofreq norow nocol; 
   format weight wtfmt.; 
run;
Figure 9.21 Suppressing Table Information
Suppressing Table Information
Notice that Percent is the only statistic that remains in the table's legend box.
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
52.15.214.27