University of Rochester Medical Center
SearchDirectoryNewsEventsStrong HealthURMC Home

SAS Helpful Hints

Proc Tabulate

Missing: Keeps all observations in the table, even if there are missing values.
Noseps: (optional) Removes those annoying lines that divide the rows in the table.
Class: Discrete or categorical variables.
Var: Continous variables.
Table: Everything before the comma defines the rows in the table.
        Everything after the comma defines the columns of the table.
Rts: Row Title Space.
Keylabel: Labels requested elements within the table.
Don't forget your formats and labels.

Proc Tabulate Data=work.A Missing Noseps;
    Class treatment gender;
    Var age;
    Table (
        All*N*f=8.0
        gender*(N*f=8.0 Pctn<gender>*f=8.2)
        age*(N*f=8.0 (Mean Median Std Stderr Min Max)*f=8.2)
        ),(treatment All)
        / Rts=38 Condense;
    Keylabel Pctn='%' N='N';
    Format gender fgender.;
    Label age='Age' gender='Gender' treatment='Treatment';
Run;

Here is a secret to improve the appearance of Tabulate's output.

Please send your comments and suggestions about this web page to A. Watts (watts@bst.rochester.edu)