SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Creating Tabular Reports
Creating One- and Three-Dimensional Tables


Throughout this lesson, you've created and enhanced a two-dimensional table. With a simple modification however, you can easily produce a one- or three-dimensional table.

Think again about the way that the TABLE statement specifies table dimensions. As shown below, a TABLE statement with two dimension expressions requests a table that displays rows and columns.

     proc tabulate data=clinic.admit;
        class sex;
        var height weight;
        table sex,height*min weight*min;
     run;

This is the two-dimensional table produced by the PROC TABULATE step.


  Height Weight
Min Min
Sex 61.00 118.00
F
M 69.00 147.00


To create a three-dimensional table, you can add a third dimension expression to the left.

In the TABLE statement below, ActLevel is specified in the page expression, Sex in the row expression, and Height and Weight in the column expression. This PROC TABULATE step produces separate pages for each value of ActLevel.

     proc tabulate data=clinic.admit;
        class sex actlevel;
        var height weight;
        table actlevel,sex,height*min weight*min;
     run;

The following output illustrates the three-dimensional table.


ActLevel HIGH
  Height Weight
Min Min
Sex 66.00 140.00
F
M 72.00 168.00

ActLevel LOW
  Height Weight
Min Min
Sex 61.00 118.00
F
M 71.00 154.00

ActLevel MOD
  Height Weight
Min Min
Sex 63.00 123.00
F
M 69.00 147.00



back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement