Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

O'Reilly logo
PROC TABULATE by Example, Second Edition

Book Description

An abundance of real-world examples highlights Lauren Haworth Lake’s and Julie McKnight's PROC TABULATE by Example, Second Edition. Beginning and intermediate SAS® users will find this step-by-step guide to producing tables and reports using the TABULATE procedure both convenient and inviting.

Topics are presented in order of increasing complexity, making this an excellent training manual or self-tutorial. The concise format also makes this a quick reference guide for specific applications for more advanced users. A very handy section on common problems and their solutions is also included.

With this book, you will quickly learn how to generate tables using macros, handle percentages and missing data, modify row and column headings, and produce one-, two-, and three-dimensional tables using PROC TABULATE. Also provided are more advanced tips on complex formatting with the Output Delivery System (ODS) and exporting PROC TABULATE output to other applications.

Table of Contents

  1. Title Page
  2. Copyright
  3. About This Book
  4. About the Author
  5. Acknowledgments
    1. Chapter 1: Benefits of Using PROC TABULATE
      1. Introduction
      2. Example without Using PROC TABULATE
      3. Example Using PROC TABULATE
    2. Chapter 2: PROC TABULATE Quick Reference
      1. Introduction
      2. One–Dimensional Table
      3. Two–Dimensional Tables
      4. Three–Dimensional Tables
      5. The Output Delivery System (ODS) and PROC TABULATE
    3. Chapter 3: Before Writing PROC TABULATE Code
      1. Introduction
      2. Sketch a Rough Draft of the Table
      3. Examine the Data
      4. Plan the Categories
      5. Select the Statistics
      6. Create a Detailed Sketch of the Table
    1. Chapter 4: Create a One-Dimensional Table
      1. Introduction
      2. The Sketch
      3. Terms to Know
      4. Make the Simplest Table Possible
      5. Add Statistics
      6. Add a Class Variable
      7. Put It All Together
      8. Quick Tips
    2. Chapter 5: Creating Two-Dimensional Tables
      1. Introduction
      2. The Sketch
      3. Terms to Know
      4. Turn a One-Dimensional Table into a Two-Dimensional Table
      5. Statistic Definitions for a Two-Dimensional Table
      6. Add Class Variables on Both Dimensions
      7. Add Another Class Variable
      8. Nest the Class Variables
      9. Add Statistics to the Nested Variables
      10. Add Totals to Rows and Columns
      11. Add Subtotals
      12. Put It All Together
      13. Quick Tips
    3. Chapter 6: Creating Three-Dimensional Tables
      1. Introduction
      2. The Sketch
      3. Terms to Know
      4. Build the Two-Dimensional Table
      5. Add a Third Dimension
      6. Comparison to Using a BY Statement
      7. Add a Page for the Totals
      8. Put a Title in Each Table
      9. Put It All Together
      10. Quick Tips
    1. Chapter 7: Handling Percentages
      1. Overview
      2. The Sketch
      3. Create Cell Percentages with the PCTN Statistic
      4. Create Cell Percentages with the PCTSUM Statistic
      5. Calculate Row and Column Percentages
      6. Add Row Totals to a Table with Row Percentages
      7. Add Column Totals to a Table with Column Percentages
      8. Quick Tips
    2. Chapter 8: Handling Complex Percentages
      1. Overview
      2. The Sketch
      3. Percentages for Multiple Row Variables
      4. Percentages for Multiple Column Variables
      5. Select the Right Denominator
      6. Percentages Combined with Other Statistics
      7. Percentages with Subtotals
      8. Percentage Subtotals on Both Dimensions
      9. Percentages for Three-Dimensional Tables
      10. Percentages for Analysis Variables
      11. Quick Tips
    3. Chapter 9: Modifying Row and Column Headings
      1. Introduction
      2. The Sketch
      3. Modify Variable Labels
      4. Modify Statistic Labels
      5. Dealing with Numerous Labels
      6. Modify Row Headings
      7. Order the Headings
      8. Reordering the Headings
      9. Reorder Class Variables
      10. Modify Headings with Inline Formatting
      11. Quick Tips
    4. Chapter 10: Formatting Table Values
      1. Introduction
      2. The Sketch
      3. Use Appropriate Formats for Statistics
      4. Use Appropriate Formats for Analysis Variables and Statistics
      5. Format Percentages
      6. Format Large Numbers
      7. Weight the Results I
      8. Weight the Results II
      9. Quick Tips
    5. Chapter 11: Using the Output Delivery System
      1. Introduction
      2. Terms to Know
      3. Create Printable Output
      4. Export Tables to a Spreadsheet
      5. Customize the Appearance of Destination Output
      6. Customize the Appearance of Selected Parts of the Output with Style Overrides
      7. Create a Custom Style Template
      8. Quick Tips
    6. Chapter 12: Handling Missing Data
      1. Overview
      2. The Sketch
      3. Report the Missing Data for Class Variables with the MISSING Option
      4. Report the Missing Data for Analysis Variables with the NMISS Statistic
      5. Customize the Way Missing Data Looks in Your Table
      6. Three-Dimensional Tables with Missing Data
      7. Break Up the Table
      8. Display Variable Categories That Have Missing Data
      9. Exclude Missing Data
      10. Quick Tips
    1. Chapter 13: Using Macros to Generate Tables
      1. Introduction
      2. Repeat a Table for a Series of Class Variables
      3. Repeat a Table for a Series of Statistics
      4. Repeat a Table for Various Time Periods - I
      5. Repeat a Table for a Series of Time Periods - II
      6. Create a Generic Macro to Produce Tables
    2. Chapter 14: PROC TABULATE Tricks: How to Cheat to Create Complex Tables
      1. Introduction
      2. Match the Table Design to Predefined Specifications
      3. Rename the Statistics and Variables
      4. Calculate Percentages Another Way
      5. Display the Results of Multiple-Response Questions
      6. Use a Variable for Both Classification and Analysis
      7. Create a One-Dimensional Table That Runs Vertically
      8. Handle ClassVariables with Missing Data
      9. Create Footnote References in Table Cells - I
      10. Create Footnote References in Table Cells - II
      11. Use the CLASSDATA Option
    1. Chapter 15: Troubleshooting Your Table
      1. Introduction
      2. What to Try First
      3. Break Your Problem Down Step-By-Step
      4. Bring in Expert Assistance
    2. Chapter 16: Decoding Error Messages
      1. Introduction
      2. "Type of Name Is Unknown"
      3. "Statistic Other Than N Was Requested without Analysis Variable"
      4. "Multiple Statistics Associated with a Single Table Cell"
      5. "Multiple Analysis Variables Associated with a Single Table Cell"
      6. "Class Variable Is Missing on Every Observation"
      7. "PCTN Base Is Not in Table" and "PCTN Crossing Has No Denominator"
    3. Chapter 17: Incorrect Tables and How to Fix Them
      1. Introduction
      2. Number of Observations Seems Too Small
      3. Some of the Values of the Class Variable Are Not Shown
      4. A Format Is Not Being Applied to a Variable
      5. Blank Label Is Not Being Applied to a Variable
      6. A Statistic’s Label Is Blank, but a Space Is Left in the Row Label
      7. Statistics Labels Do Not Appear Next to the Correct Variable
      8. Incorrectly Grouped Statistics
      9. Alternative to Using the FUZZ Option
    4. Chapter 18: Limitations of PROC TABULATE and How to Get around Them
      1. Introduction
      2. Advanced Statistical Tests
      3. Printing Record Details
      4. Formatting Text Values
    1. Chapter 19: PROC TABULATE Options Reference
      1. Introduction
      2. CLASS Statement Options
      3. CLASSLEV Statement
      4. KEYWORD Statement
      5. PROC TABULATE Statement
      6. TABLE Statement
      7. VAR Statement
      8. System Options That Affect PROC TABULATE Output
      9. Recommended SAS 9 Option Settings
      10. Quantile Statistics Examples
      11. Create Ouput Data Sets
    2. Chapter 20: ODS Reference
      1. Suggested Output Delivery System (ODS) Styles
      2. Applying Multiple Styles to Your Table
      3. Common Style Attributes
      4. Default Style Attributes for Table Regions
      5. STYLE= Option Syntax for PROC TABULATE Statements
      6. Style Elements and Style Attributes for Table Regions
      7. ODS ESCAPECHAR Statement Functions
    1. Appendix 1: PROC TABULATE Syntax
      1. Basic Syntax
      2. Available Statistics
      3. PROC TABULATE Operators:
  6. Recommended Reading
  7. Index
  8. Additional Resources