Proc Tabulate Gallery with over 30 SAS Examples

Below are the SAS examples from the A to Z Analysis and Validaton using Proc Tabulate e-Guide.

Select from on of the table layouts below.  Select the 'SAS Code' link below each table layout to copy and paste the SAS example.  Next, customize the working Proc Tabulate syntax version as needed.  One dimensional tables - 1a, and 1b.  Two dimensional tables - 2, 3, 4, 5, 6a-g, 7a-b, 8, 10, 11, 12, 13, 14, and 15a-b.  Three dimensional tables - 9.  

See also Proc Report Gallery.  Return to Proc Tabulate.

Proc Tabulate Default Settings: Column Structure, Horizontal Additions, Formatted Display Order, N for categorical data and SUM for continuous data, No %, Non-missing data displayed, and No Subtotals/Totals

 

Percentage Calculations: Make sure the denominator is correct by first deleting duplicate records.  Before calculating percentages of subjects with AEs by System Organ Class and Preferred Term, for example, make sure to PROC SORT with NODUPKEY option and BY _ALL_ in advance.  For percentages of subject with AEs by System Organ Class, for example, apply NODUPKEY with BY USUBJID AEBODSYS.

______________________________________________


(SAS Code)

______________________________________________

1a. Formatted order, categorical and continuous data as columns

(SAS Code)

______________________________________________

1b. Formatted order, categorical and continuous data as rows

(SAS Code)

______________________________________________

2a. Formatted order, categorical data - 100% by column

(SAS Code)

______________________________________________

2b. Frequency order, categorical data - 100% by column

(SAS Code)

______________________________________________

3. Data order, categorical data - 100% by column

(SAS Code)

______________________________________________

4. Data order, categorical data - 100% by row

(SAS Code)

______________________________________________

5. Data order, categorical data - 100% by total

(SAS Code)

______________________________________________

6a. Formatted order, mixing categorical and continuous data rows

(SAS Code)    (Pharmaceutical Example)

______________________________________________

6b. Mixing categorical and continuous data percentages

(SAS Code)

______________________________________________

6c. Multiple label continuous data percentages

(SAS Code)

______________________________________________

6d. Notsorted label continuous data percentages

(SAS Code)

______________________________________________

6e. Mixing categorical and continuous data percentages with descriptive stats

(SAS Code)

______________________________________________

6f. Notsorted Label Continuous Data Percentages 

(SAS Code)

______________________________________________

6g. User Controlled Levels, Formatted Order, Mixing Categorical and Continuous Data Rows

(SAS Code)

______________________________________________

7a. Formatted order, continuous data by nesting product and sales as rows

(SAS Code)

______________________________________________

7b. Formatted order, continuous data by nesting product and sales as columns

(SAS Code)

______________________________________________

8. Formatted order, continuous data by product

(SAS Code)

______________________________________________

9. Formatted order, continuous data by product page

(SAS Code)

______________________________________________

10. Formatted order, continous data by nesting by region and subsidiary

(SAS Code)

______________________________________________

11a. Product distribution by nesting by region and subsidiary

(SAS Code)

______________________________________________

11b. Product distribution by nesting by region and subsidiary with subtotals

(SAS Code)

______________________________________________

* Example of a three level hierarchy with subtotals;

proc tabulate data=studylib.adae missing;
 class trt01a usubjid aebodsys aedecod aetoxgr;
 
 * Levels  1      (   2a  SUM) ( 2b  SUM) (          3        SUM);

 table aebodsys*(aetoxgr all aedecod all aedecod*aetoxgr all)
       , (trt01a)*(n='N'*f=5.0);

 where SAFFL='Y';
run;

12. Formatted order, multiple continuous row data

(SAS Code)

______________________________________________

13. Analysis of categorical data by column %, row % and table %

(SAS Code)

______________________________________________

14. Mixing table types - summary and detail tables

(SAS Code)

______________________________________________

15a. Single Column, Descriptive Stats as Rows

(SAS Code)

______________________________________________

15b. Multiple Columns, Descriptive Stats as Rows

(SAS Code)

______________________________________________

Pharmaceutical Table Examples (Production tables to validate.  Not produced by Proc Tabulate)

     

 

Powered by Wild Apricot Membership Software