You are previewing SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition.
O'Reilly logo
SAS Essentials: Mastering SAS for Data Analytics, 2nd Edition

Book Description

A step-by-step introduction to using SAS statistical software as a foundational approach to data analysis and interpretation

Presenting a straightforward introduction from the ground up, SAS Essentials: Mastering SAS for Data Analytics, Second Edition illustrates SAS using hands-on learning techniques and numerous real-world examples. Keeping different experience levels in mind, the highly-qualified author team has developed the book over 20 years of teaching introductory SAS courses.

Divided into two sections, the first part of the book provides an introduction to data manipulation, statistical techniques, and the SAS programming language. The second section is designed to introduce users to statistical analysis using SAS Procedures. Featuring self-contained chapters to enhance the learning process, the Second Edition also includes:

  • Programming approaches for the most up-to-date version of the SAS platform including information on how to use the SAS University Edition

  • Discussions to illustrate the concepts and highlight key fundamental computational skills that are utilized by business, government, and organizations alike

  • New chapters on reporting results in tables and factor analysis

  • Additional information on the DATA step for data management with an emphasis on importing data from other sources, combining data sets, and data cleaning

  • Updated ANOVA and regression examples as well as other data analysis techniques

  • A companion website with the discussed data sets, additional code, and related PowerPoint slides

  • SAS Essentials: Mastering SAS for Data Analytics, Second Edition is an ideal textbook for upper-undergraduate and graduate-level courses in statistics, data analytics, applied SAS programming, and statistical computer applications as well as an excellent supplement for statistical methodology courses. The book is an appropriate reference for researchers and academicians who require a basic introduction to SAS for statistical analysis and for preparation for the Basic SAS Certification Exam.

    Table of Contents

    1. Cover
    2. Title Page
      1. Copyright
    3. PREFACE
    4. ACKNOWLEDGMENTS
      1. THE AUTHORS
    5. PART I: DATA MANIPULATION AND THE SAS® PROGRAMMING LANGUAGE
      1. 1: GETTING STARTED
        1. 1.1 USING SAS IN A WINDOWS ENVIRONMENT
        2. 1.2 YOUR FIRST SAS ANALYSIS
        3. 1.3 HOW SAS WORKS
        4. 1.4 TIPS AND TRICKS FOR RUNNING SAS PROGRAMS
        5. 1.5 SUMMARY
        6. EXERCISES
      2. 2: GETTING DATA INTO SAS
        1. 2.1 USING SAS DATA SETS
        2. 2.2 UNDERSTANDING SAS DATA SET STRUCTURE
        3. 2.3 RULES FOR SAS VARIABLE NAMES
        4. 2.4 UNDERSTANDING SAS VARIABLE TYPES
        5. 2.5 METHODS OF READING DATA INTO SAS
        6. 2.6 GOING DEEPER: MORE TECHNIQUES FOR ENTERING DATA
        7. 2.7 SUMMARY
        8. EXERCISES
      3. 3: READING, WRITING, AND IMPORTING DATA
        1. 3.1 WORKING WITH SAS LIBRARIES AND PERMANENT DATA SETS
        2. 3.2 CREATING PERMANENT SAS DATA SETS USING THE WINDOWS FILE NAME TECHNIQUE
        3. 3.3 CREATING PERMANENT SAS DATA SETS USING AN SAS LIBRARY
        4. 3.4 CREATING A SAS LIBRARY USING A DIALOG BOX
        5. 3.5 CREATING A SAS LIBRARY USING CODE
        6. 3.6 USING DATA IN PERMANENT SAS DATA SETS
        7. 3.7 IMPORTING DATA FROM ANOTHER PROGRAM
        8. 3.8 DISCOVERING THE CONTENTS OF AN SAS DATA SET
        9. 3.9 GOING DEEPER: UNDERSTANDING HOW THE DATA STEP READS AND STORES DATA
        10. 3.10 SUMMARY
        11. EXERCISES
      4. 4: PREPARING DATA FOR ANALYSIS
        1. 4.1 LABELING VARIABLES WITH EXPLANATORY NAMES
        2. 4.2 CREATING NEW VARIABLES
        3. 4.3 USING IF-THEN-ELSE CONDITIONAL STATEMENT ASSIGNMENTS
        4. 4.4 USING DROP AND KEEP TO SELECT VARIABLES
        5. 4.5 USING THE SET STATEMENT TO READ AN EXISTING DATA SET
        6. 4.6 USING PROC SORT
        7. 4.7 APPENDING AND MERGING DATA SETS
        8. 4.8 USING PROC FORMAT
        9. 4.9 GOING DEEPER: FINDING FIRST AND LAST VALUES
        10. 4.10 SUMMARY
        11. EXERCISES
      5. 5: PREPARING TO USE SAS PROCEDURES
        1. 5.1 UNDERSTANDING SAS SUPPORT STATEMENTS
        2. 5.2 UNDERSTANDING PROC STATEMENT SYNTAX
        3. 5.3 USING THE ID STATEMENT IN A SAS PROCEDURE
        4. 5.4 USING THE LABEL STATEMENT IN A SAS PROCEDURE
        5. 5.5 USING THE WHERE STATEMENT IN A SAS PROCEDURE
        6. 5.6 USING PROC PRINT
        7. 5.7 GOING DEEPER: SPLITTING COLUMN TITLES IN PROC PRINT
        8. 5.8 GOING DEEPER: COMMON SYSTEM OPTIONS
        9. 5.9 SUMMARY
        10. EXERCISES
      6. 6: SAS® ADVANCED PROGRAMMING TOPICS PART 1
        1. 6.1 USING SAS FUNCTIONS
        2. 6.2 USING PROC TRANSPOSE
        3. 6.3 THE SELECT STATEMENT
        4. 6.4 GOING DEEPER: CLEANING A MESSY DATA SET
        5. 6.5 SUMMARY
        6. EXERCISES
      7. 7: SAS® ADVANCED PROGRAMMING TOPICS PART 2
        1. 7.1 USING SAS ARRAYS
        2. 7.2 USING DO LOOPS
        3. 7.3 USING THE RETAIN STATEMENT
        4. 7.4 USING SAS MACROS
        5. 7.5 SUMMARY
        6. EXERCISES
      8. 8: CONTROLLING OUTPUT USING ODS
        1. 8.1 SPECIFYING THE ODS OUTPUT FORMAT AND DESTINATION
        2. 8.2 SPECIFYING ODS OUTPUT STYLE
        3. 8.3 USING ODS TO SELECT SPECIFIC OUTPUT TABLES FOR SAS PROCEDURES
        4. 8.4 GOING DEEPER: CAPTURING INFORMATION FROM ODS TABLES
        5. 8.5 GOING DEEPER: USING TRAFFIC LIGHTING TO HIGHLIGHT SELECTED VALUES
        6. 8.6 EXTENDED ODS FEATURES
        7. 8.7 SUMMARY
        8. EXERCISES
    6. PART II: STATISTICAL ANALYSIS USING SAS® PROCEDURES
      1. 9: EVALUATING QUANTITATIVE DATA
        1. 9.1 USING PROC MEANS
        2. 9.2 USING PROC UNIVARIATE
        3. 9.3 GOING DEEPER: ADVANCED PROC UNIVARIATE OPTIONS
        4. 9.4 SUMMARY
        5. EXERCISES
      2. 10: ANALYZING COUNTS AND TABLES
        1. 10.1 USING PROC FREQ
        2. 10.2 ANALYZING ONE-WAY FREQUENCY TABLES
        3. 10.3 CREATING ONE-WAY FREQUENCY TABLES FROM SUMMARIZED DATA
        4. 10.4 ANALYZING TWO-WAY TABLES
        5. 10.5 GOING DEEPER: CALCULATING RELATIVE RISK MEASURES
        6. 10.6 GOING DEEPER: INTER-RATER RELIABILITY (KAPPA)
        7. 10.7 SUMMARY
        8. EXERCISES
      3. 11: COMPARING MEANS USING t-TESTS
        1. 11.1 PERFORMING A ONE-SAMPLE <i xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0">T</i>-TEST-TEST
        2. 11.2 PERFORMING A TWO-SAMPLE <i xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0">T</i>-TEST-TEST
        3. 11.3 PERFORMING A PAIRED <i xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0">T</i>-TEST-TEST
        4. 11.4 SUMMARY
        5. EXERCISES
      4. 12: CORRELATION AND REGRESSION
        1. 12.1 CORRELATION ANALYSIS USING PROC CORR
        2. 12.2 SIMPLE LINEAR REGRESSION
        3. 12.3 MULTIPLE LINEAR REGRESSION USING PROC REG
        4. 12.4 GOING DEEPER: CALCULATING PREDICTIONS
        5. 12.5 GOING DEEPER: RESIDUAL ANALYSIS
        6. 12.6 SUMMARY
        7. EXERCISES
      5. 13: ANALYSIS OF VARIANCE
        1. 13.1 COMPARING THREE OR MORE MEANS USING ONE-WAY ANALYSIS OF VARIANCE
        2. 13.2 COMPARING THREE OR MORE REPEATED MEASURES
        3. 13.3 GOING DEEPER: CONTRASTS
        4. 13.4 SUMMARY
        5. EXERCISES
      6. 14: ANALYSIS OF VARIANCE, PART II
        1. 14.1 ANALYSIS OF COVARIANCE
        2. 14.2 GOING DEEPER: TWO-FACTOR ANOVA USING PROC MIXED
        3. 14.3 GOING DEEPER: REPEATED MEASURES WITH A GROUPING FACTOR
        4. 14.4 SUMMARY
        5. EXERCISES
      7. 15: NONPARAMETRIC ANALYSIS
        1. 15.1 COMPARING TWO INDEPENDENT SAMPLES USING NPAR1WAY
        2. 15.2 COMPARING <i xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xmlns:m="http://www.w3.org/1998/Math/MathML" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ibooks="http://vocabulary.itunes.apple.com/rdf/ibooks/vocabulary-extensions-1.0">k</i> INDEPENDENT SAMPLES (KRUSKAL&#8211;WALLIS) INDEPENDENT SAMPLES (KRUSKAL–WALLIS)
        3. 15.3 COMPARING TWO DEPENDENT (PAIRED) SAMPLES
        4. 15.4 COMPARING -DEPENDENT SAMPLES (FRIEDMAN'S TEST)
        5. 15.5 GOING DEEPER: NONPARAMETRIC MULTIPLE COMPARISONS
        6. 15.6 SUMMARY
        7. EXERCISES
      8. 16: LOGISTIC REGRESSION
        1. 16.1 LOGISTIC ANALYSIS BASICS
        2. 16.2 PERFORMING A LOGISTIC ANALYSIS USING PROC LOGISTIC
        3. 16.3 USING SIMPLE LOGISTIC ANALYSIS
        4. 16.4 MULTIPLE BINARY LOGISTIC ANALYSIS
        5. 16.5 GOING DEEPER: ASSESSING A MODEL'S FIT AND PREDICTIVE ABILITY
        6. 16.6 SUMMARY
        7. EXERCISES
      9. 17: FACTOR ANALYSIS
        1. 17.1 FACTOR ANALYSIS BASICS
        2. 17.2 SUMMARY
        3. EXERCISES
      10. 18: CREATING CUSTOM GRAPHS
        1. 18.1 CREATING SCATTERPLOTS AND LINE GRAPHS USING GPLOT
        2. 18.2 CREATING BAR CHARTS AND PIE CHARTS
        3. 18.3 DEFINING GRAPH PATTERNS
        4. 18.4 CREATING STACKED BAR CHARTS
        5. 18.5 CREATING MEAN BARS USING GCHART
        6. 18.6 CREATING BOXPLOTS
        7. 18.7 GOING DEEPER: CREATING AN INTERACTIVE BAR USING ODS
        8. 18.8 GOING DEEPER: SGPLOTS
        9. 18.9 OTHER WAYS TO CUSTOMIZE PLOTS
        10. 18.10 SUMMARY
        11. EXERCISES
      11. 19: CREATING CUSTOM REPORTS
        1. 19.1 USING PROC TABULATE
        2. 19.2 USING PROC REPORT
        3. EXERCISES
    7. APPENDIX A: OPTIONS REFERENCE
      1. A.1 USING SAS FONTS
      2. A.2 SPECIFYING SAS COLOR CHOICES
      3. A.3 SPECIFYING PATTERNS FOR PROCS GPLOT AND PROC UNIVARIATE
      4. A.4 BAR AND BLOCK PATTERNS FOR BAR CHARTS, PIE CHARTS, AND OTHER GRAPHICS
      5. A.5 SAS LINE STYLES
      6. A.6 USING SAS PLOTTING SYMBOLS
      7. A.7 USING ODS STYLE ATTRIBUTES
      8. A.8 COMMON (INPUT) INFORMATS
      9. A.9 COMMON (OUTPUT) FORMATS
    8. APPENDIX B: SAS® FUNCTION REFERENCE
      1. B.1 USING SAS FUNCTIONS
      2. B.2 ARITHMETIC/MATHEMATICAL FUNCTIONS
      3. B.3 TRIGONOMETRIC FUNCTIONS
      4. B.4 DATE AND TIME FUNCTIONS
      5. B.5 CHARACTER FUNCTIONS
      6. B.6 TRUNCATION FUNCTIONS
      7. B.7 FINANCIAL FUNCTIONS
      8. B.8 SPECIAL USE FUNCTIONS
    9. APPENDIX C: CHOOSING A SAS® PROCEDURE
      1. C.1 DESCRIPTIVE STATISTICS
      2. C.2 COMPARISON TESTS
      3. C.3 RELATIONAL ANALYSES (CORRELATION AND REGRESSION)
    10. APPENDIX D: QUICK REFERENCE
    11. APPENDIX E: USING SAS® UNIVERSITY EDITION WITH SAS ESSENTIALS
      1. E.1 INSTALLING SAS UNIVERSITY EDITION
      2. E.2 CREATING A PERMANENT SAS LIBRARY
      3. E.3 LIMITATIONS
      4. E.4 SUMMARY
    12. REFERENCES
      1. FURTHER READING
        1. INDEX
    13. End User License Agreement