Statistical Programming in SAS
معرفی کتاب «Statistical Programming in SAS» نوشتهٔ A. John Bailer، منتشرشده توسط نشر Chapman and Hall/CRC در سال 2020. این کتاب در فرمت pdf، زبان انگلیسی ارائه شده است. «Statistical Programming in SAS» در دستهٔ بدون دستهبندی قرار دارد.
Statistical Programming in SAS Second Edition provides a foundation for programming to implement statistical solutions using SAS, a system that has been used to solve data analytic problems for more than 40 years. The author includes motivating examples to inspire readers to generate programming solutions. Upper-level undergraduates, beginning graduate students, and professionals involved in generating programming solutions for data-analytic problems will benefit from this book. The ideal background for a reader is some background in regression modeling and introductory experience with computer programming.The coverage of statistical programming in the second edition includes Getting data into the SAS system, engineering new features, and formatting variables Writing readable and well-documented code Structuring, implementing, and debugging programs that are well documented Creating solutions to novel problems Combining data sources, extracting parts of data sets, and reshaping data sets as needed for other analyses Generating general solutions using macros Customizing output Producing insight-inspiring data visualizations Parsing, processing, and analyzing text Programming solutions using matrices and connecting to R Processing text Programming with matrices Connecting SAS with R Covering topics that are part of both base and certification exams. Cover 1 Half Title 2 Title Page 4 Copyright Page 5 Table of Contents 6 Preface 10 Acknowledgments 14 Author 16 1: Structuring, Implementing, and Debugging Programs to Learn about Data 18 1.1 Statistical Programming 18 1.2 Learning from Constructed, Artificial Data 19 Processing a Particular Data Set—Extracting Variable Names from a Column of an Input Data Set 19 Learning More about Unfamiliar Statistical Methods—Linear Mixed Effects Models 22 Improving Your Intuition about Statistical Theory— Sampling Distribution of Means 25 1.3 Good Programming Practice 28 Document Your Programs! 28 Use Meaningful Variable Names 30 Use a Variety of CaSeS in Program Statements 31 Indent Program Statements That Naturally Go Together 31 1.4 SAS Program Structure 32 1.5 What Is a SAS Data Set? 38 1.6 Internally Documenting SAS Programs 39 1.7 Basic Debugging 40 1.8 Getting Help 44 Using Help in SAS 44 Getting Help from a Web Browser Search 46 1.9 Exercises 46 2: Reading, Creating, and Formatting Data Sets 48 2.1 What Does a SAS DATA Step Do? 48 2.2 Reading Data from External Files 50 Reading Data Directly as Part of a Program—Anyone for Datalines? 51 Reading Data Sets Saved as Text—INFILE Can Be Your Friend (PROC IMPORT Too!) 55 Sometimes, Variables Are in Particular Columns or in Particular Formats 57 2.3 Reading CSV, Excel, and TEXT Files 58 2.4 Temporary versus Permanent Status of Data Sets 60 2.5 Formatting and Labeling Variables 63 Using Formats to Read and Display Variable Values 63 Internal Representations and Output Displays 66 Character, Numeric, Time, and Date Formats 70 2.6 User-Defined Formatting 75 Saving Formats for Later Use 80 2.7 Recoding and Transforming Variables in a DATA Step 83 Indicator Variables 85 2.8 Writing Out a File or Making a Simple Report 90 Simple Report Generation 90 Exporting a File 94 2.9 Exercises 97 3: Programming a DATA Step 100 3.1 Writing Programs by Subdividing Tasks 100 Estimate the Probability That a Randomly Selected 30- to 39-Year-Old Male Is Taller than a Randomly Selected Female of the Same Age 100 Conditional Execution 101 Looping to Repeat a Task 103 Returning to the Height Probability Simulation 104 3.2 Ordering How Tasks Are Done 107 Missing Data in Functions 109 3.3 Indexable Lists of Variables (Also Known as Arrays) 110 Defining Values in the Variable List 110 Inputting Values in the Variable List 111 Reassign Missing Value Codes for Numeric Variables “.” 112 Recoding Missing Values for All Numeric and Character Variables 112 3.4 Functions Associated with Statistical Distributions 113 3.5 Generating Variables Using Random Number Generators 119 3.6 Remembering Variable Values across Observations 122 Processing Multiple Observations for a Single Observation 123 3.7 Case Study 1: Is the Two-Sample t-Test Robust to Violations of the Heterogeneous Variance Assumption? 126 Case Study 1 (Revisited with DATA Step Programming) 135 3.8 Efficiency Considerations—How Long Does It Take? 139 3.9 Case Study 2: Monte Carlo Integration to Estimate an Integral 140 3.10 Case Study 3: Simple Percentile-Based Bootstrap 145 3.11 Case Study 4: Randomization Test for the Equality of Two Populations 147 3.12 Exercises 151 4: Combining, Extracting, and Reshaping Data 154 4.1 Adding Observations by SET-ing Data Sets 154 4.2 Adding Variables by MERGE-ing Data Sets 157 4.3 Working with Tables in PROC SQL 165 4.4 Converting Wide to Long Formats 178 4.5 Converting Long to Wide Formats 181 4.6 Case Study: Reshaping a World Bank Data Set 183 4.7 Building Training and Validation Data Sets 192 4.8 Exercises 196 4.9 Self-study Lab 197 5: Macro Programming 208 5.1 What Is a Macro and Why Would You Use It? 208 5.2 Motivation for Macros: Numerical Integration to Determine P(0 < Z < 1.645) 208 5.3 Processing Macros 212 5.4 Macro Variables, Parameters, and Functions 212 5.5 Conditional Execution, Looping, and Macros 215 More Complicated Macro Variable Construction 220 Changing Locations in a Macro during Execution 221 5.6 Debugging Macro Code and Programs 223 Write Out Values of Macro Variables 223 Useful SAS Options for Debugging Macros 224 5.7 Saving Macros 228 5.8 Functions and Routines for Macros 228 5.9 Case Study: Macro for Constructing Training and Test Data Set for Model Comparison 233 5.10 Case Study: Processing Multiple Data Sets 240 5.11 Exercises 244 6: Customizing Output and Generating Data Visualizations 246 6.1 Using the Output Delivery System 246 Basic Ideas 246 Destinations—RTF, HTML, PDF, and More! 247 What’s Produced and How to Select It 252 Another Destination That Stat Programmers Should Visit—OUTPUT 260 6.2 Graphics in SAS 266 6.3 ODS Statistical Graphics 267 6.4 Modifying Graphics Using the ODS Graphics Editor 274 6.5 Graphing with Styles and Templates 277 6.6 Statistical Graphics—Entering the Land of SG Procedures 283 SGPLOT 283 SGPANEL 286 SGSCATTER 288 6.7 Case Study: Using the SG Procedures 290 6.8 Enhancing SG Displays—Options with SG Procedure Statements 296 6.9 Using Annotate Data Sets to Enhance SG Displays 301 6.10 Using Attribute Maps to Enhance SG Displays 304 6.11 Exercises 307 7: Processing Text 310 7.1 Cleaning and Processing Text Data 310 7.2 Starting with Character Functions 310 7.3 Processing Text 315 7.4 Case Study: Sentiment in State of the Union Addresses 319 7.5 Case Study: Reading Text from a Web Page 326 7.6 Regular Expressions 332 7.7 Case Study (Revisited)—Applying Regular Expressions 336 7.8 Exercises 338 8: Programming with Matrices and Vectors 340 8.1 Defining a Matrix and Subscripting 340 8.2 Using Diagonal Matrices and Stacking Matrices 346 8.3 Using Elementwise Operations, Repeating, and Multiplying Matrices 349 8.4 Importing a Data Set into SAS/IML and Exporting Matrices from SAS/IML to a Data Set 350 Creating Matrices from SAS Data Sets and Vice Versa 350 8.5 Case Study 1: Monte Carlo Integration to Estimate π 353 8.6 Case Study 2: Bisection Root Finder 354 8.7 Case Study 3: Randomization Test Using Matrices Imported from PROC PLAN 357 8.8 Case Study 4: SAS/IML Module to Implement Monte Carlo Integration to Estimate π 359 8.9 Storing and Loading SAS/IML Modules 361 8.10 SAS/IML and R 362 8.11 Exercises 367 References 372 Index 374 "The book focuses on good programming and coding practice for producing data sets for later analyses, using simulation studies to explore statistical concepts and employing computationally intensive methods. Many of the topics included in the SAS Base Certification exam are included in this book"-- Provided by publisher
دانلود کتاب Statistical Programming in SAS