Book Description
In Statistical Programming in SAS, author A. John Bailer integrates SAS tools with interesting statistical applications and uses SAS 9.2 as a platform to introduce programming ideas for statistical analysis, data management, and data display and simulation. Written using a readerfriendly and narrative style, the book includes extensive examples and case studies to present a wellstructured introduction to programming issues.
This book has two parts. The first part addresses the nuts and bolts of programming, including fostering good programming habits, getting external data sets into SAS to construct an analysis data set, generating basic descriptive statistical summaries, producing customized tables, generating more attractive output, and producing highquality graphical displays. The second part emphasizes programming in the context of a DATA step, in macros, and in SAS/IML software.
Examples of statistical methods and concepts not always encountered in basic statistics courses (for example, bootstrapping, randomization tests, and jittering) are used to illustrate programming ideas. This book provides extensive illustrations of the new ODS Statistical Graphics procedures in SAS, a description of the new ODS Graphics Editor, and a brief introduction to some of the capabilities of SAS/IML Studio, such as producing dynamically linked data displays and invoking R from SAS.
Table of Contents
 Copyright
 About This Book
 Acknowledgments

1. The Basics—Including Some Nuts and Bolts
 1. Let's Get Started—Preliminaries and a SAS Quick Start
 1.7 References

2. Reading, Combining, and Managing Data for Later Analysis
 2.1 Temporary versus Permanent Status of Data Sets

2.2 Reading Data into a SAS Data Set
 2.2.1 Reading data directly as part of a program–anyone for datalines?
 2.2.2 Reading data sets saved as text–INFILE can be your friend
 2.2.3 Sometimes variables are in particular columns or in particular formats
 2.2.4 Reading commaseparated values–text files with comma delimiters
 2.2.5 Reading Excel spreadsheets directly
 2.2.6 Reading SPSS data files–the little SPSS engine that could
 2.3 Writing Out a File or Making a Simple Report
 2.4 Concatenating Data Sets and Adding Observations
 2.5 Merging Data Sets and Adding Variables
 2.6 Database Processing with PROC SQL
 2.7 Summary
 2.8 References

3. Using SAS Procedures
 3.1 SAS System Options
 3.2 Statements That Can Modify the Output of Most Procedures
 3.3 Defining Your Own Formats for Variable Values
 3.4 Selecting or Stratifying an Analysis by Values of a Variable
 3.5 Displaying Data Set Properties and Observations
 3.6 Using PROC PRINT to List the Observations in a Data Set
 3.7 Basic Graphical Displays
 3.8 Using Scatter Plots to Display Relationships between Numeric Variables
 3.9 Summarizing Categorical Variables
 3.10 Summarizing Numeric Variables
 3.11 Selecting a Simple Random Sample
 3.12 Randomly Assigning Treatments to Observations
 3.13 Summary
 3.14 References
 4. Complex Table Construction and Output Control
 4.6 References
 5. Basic Models in SAS
 5.6 References
 6. Producing Statistical Graphics in SAS
 6.8 References
 7. Traditional SAS Graphics
 7.7 References

2. Doing More with Programming

8. Formatting Variables, Recoding Variables, and Writing Programs
 8.1 Internal Representations and Output Displays
 8.2 Character, Numeric, Time, and Date Formats
 8.3 Recoding and Transforming Variables in a DATA Step
 8.4 Ordering How Tasks Are Done
 8.5 What Goes and What Stays in a Data Set
 8.6 Structured Thinking about Writing Programs
 8.7 Case Study 1: Is the TwoSample tTest Robust Enough for Heterogeneous Variances?
 8.8 Case Study 2: Monte Carlo Integration to Estimate an Integral
 8.9 Case Study 3: Simple PercentileBased Bootstrap
 8.10 Throw Out Your Tables of Statistical Distributions
 8.11 Generating Variables Using Random Number Generators
 8.12 Summary
 8.13 References
 9. Programming in a DATA Step
 9.6 References

10. Macro Programming
 10.1 What Is a Macro and Why Would You Use It?
 10.2 Motivation for Macros: Numerical Integration to Determine P(0<Z<1.645)
 10.3 Processing Macros
 10.4 Macro Variables, Parameters, and Functions
 10.5 Conditional Execution, Looping, and Macros
 10.6 Debugging Macro Code and Programs
 10.7 Saving Macros
 10.8 Functions and Routines for Macros
 10.9 Bonus Material: Processing Multiple Data Sets
 10.10 Summary
 10.11 References

11. Programming with Matrices and Vectors
 11.1 Defining a Matrix and Subscripting
 11.2 Using Diagonal Matrices and Stacking Matrices
 11.3 Using Elementwise Operations, Repeating, and Multiplying Matrices
 11.4 Importing a Data Set into SAS/IML and Exporting Matrices from SAS/IML to a Data Set
 11.5 Case Study 1: Monte Carlo Integration to Estimate π
 11.6 Case Study 2: Bisection Root Finder
 11.7 Case Study 3: Randomization Test Using Matrices Imported from PROC PLAN
 11.8 Case Study 4: SAS/IML Module to Implement Monte Carlo Integration to Estimate π
 11.9 Introducing SAS/IML Studio
 11.10 Summary
 11.11 References

8. Formatting Variables, Recoding Variables, and Writing Programs
Product Information
 Title: Statistical Programming in SAS®
 Author(s):
 Release date: July 2010
 Publisher(s): SAS Institute
 ISBN: 9781599946566