TABULATE Procedure

Example 7: Eliminating Row Headings

Features:
TABLE statement:
labels
ROW=FLOAT
Data set: ENERGY
Formats: REGFMT.

DIVFMT.

USETYPE.

Details

This example shows how to eliminate blank row headings from a table. To do so, you must both provide blank labels for the row headings and specify ROW=FLOAT in the TABLE statement.

Program

proc tabulate data=energy format=dollar12.;
   class region division type;
   var expenditures;
   table region*division*expenditures=' '*sum=' ',
         type='Customer Base'
         / rts=25 row=float;
   format region regfmt. division divfmt. type usetype.;
   title 'Energy Expenditures for Each Region';
   title2 '(millions of dollars)';
run;

Program Description

Specify the table options.The FORMAT= option specifies DOLLAR12. as the default format for the value in each table cell.
proc tabulate data=energy format=dollar12.;
Specify subgroups for the analysis.The CLASS statement identifies Region, Division, and Type as class variables.
   class region division type;
Specify the analysis variable.The VAR statement specifies that PROC TABULATE calculate statistics on the Expenditures variable.
   var expenditures;
Define the table rows.The row dimension of the TABLE statement creates a row for each formatted value of Region. Nested within these rows is a row for each formatted value of Division. The analysis variable Expenditures and the Sum statistic are also included in the row dimension, so PROC TABULATE creates row headings for them as well. The text in quotation marks specifies the headings for the corresponding variable or statistic. Although Sum is the default statistic, it is specified here so that you can specify a blank for its heading.
   table region*division*expenditures=' '*sum=' ',
Define the table columns.The column dimension of the TABLE statement creates a column for each formatted value of Type.
         type='Customer Base'
Specify the row title space and eliminate blank row headings.RTS= provides 25 characters per line for row headings. ROW=FLOAT eliminates blank row headings.
         / rts=25 row=float;
Format the output.The FORMAT statement assigns formats to the variables Region, Division, and Type.
   format region regfmt. division divfmt. type usetype.;
Specify the titles.
   title 'Energy Expenditures for Each Region';
   title2 '(millions of dollars)';
run;

Output

Compare this table with the output in Customizing Row and Column Headings. The two tables are identical, but the program that creates this table uses Expenditures and Sum in the row dimension. PROC TABULATE automatically eliminates blank headings from the column dimension, whereas you must specify ROW=FLOAT to eliminate blank headings from the row dimension.
Energy Expenditures for Each Region