Description
The aim of this textbook (previously titled SAS for Data Analytics) is to teach the use of SAS for statistical analysis of data for advanced undergraduate and graduate students in statistics, data science, and disciplines involving analyzing data. The book begins with an introduction beyond the basics of SAS, illustrated with non-trivial, real-world, worked examples. It proceeds to SAS programming and applications, SAS graphics, statistical analysis of regression models, analysis of variance models, analysis of variance with random and mixed effects models, and then takes the discussion beyond regression and analysis of variance to conclude. Pedagogically, the authors introduce theory and methodological basis topic by topic, present a problem as an application, followed by a SAS analysis of the data provided and a discussion of results. The text focuses on applied statistical problems and methods. Key features include: end of chapter exercises, downloadable SAS code and data sets, and advanced material suitable for a second course in applied statistics with every method explained using SAS analysis to illustrate a real-world problem. New to this edition: . Covers SAS v9.2 and incorporates new commands . Uses SAS ODS (output delivery system) for reproduction of tables and graphics output . Presents new commands needed to produce ODS output . All chapters rewritten for clarity . New and updated examples throughout . All SAS outputs are new and updated, including graphics . More exercises and problems . Completely new chapter on analysis of nonlinear and generalized linear models . Completely new appendix Mervyn G. Marasinghe, PhD, is Associate Professor Emeritus of Statistics at Iowa State University, where he has taught courses in statistical methods and statistical computing. Kenneth J. Koehler, PhD, is University Professor of Statistics at Iowa State University, where he teaches courses in statistical methodology at both graduate and undergraduate levels and primarily uses SAS to supplement his teaching. Mervyn G. Marasinghe, PhD, is Associate Professor Emeritus of Statistics at Iowa State University, where he has taught courses in statistical methods and statistical computing. He has taught a data analysis course based on SAS for over 35 years and offered workshops and short-courses on various aspects of SAS including traditional SAS programming, SAS Enterprise Guide, SAS Enterprise Miner, and JMP for many years to both university audiences and non-academic participants. Kenneth J. Koehler, PhD, is University Professor of Statistics at Iowa State University, where he teaches courses in statistical methodology at both graduate and undergraduate levels and primarily uses SAS to supplement his teaching. Introduction to the SAS Language 1.1 Introduction SAS Example A1 1.2 Basic Language: Rules and Syntax Data Values SAS Data Sets Variables Observations SAS Names SAS Variable Lists SAS Statements Syntax of SAS Statements Missing Values SAS Programming Statements 1.3 Creating SAS Data Sets SAS Example A2 SAS Example A3 1.4 The INPUT Statement List Input Formatted Input Column INPUT Combining INPUT Styles 1.5 SAS Data Step Programming Statements and Their Uses Assignment Statements Example 1.5.1 SAS Functions: Conditional Execution Example 1.5.2 Example 1.5.3 Example 1.5.4 Example 1.5.5 Example 1.5.6 SAS Example A4 Repetit ive Computation Example 1.5.7 Example 1.5.8 Example 1.5.9 Example 1.5.10 1.6 Data Step Processing SAS Example A5 SAS Example A6 SAS Example A7 1.7 More on INPUT Statement 1.7.1 Use of pointer controls 1.7.2 The trailing @ line-hold specifier SAS Example A8 1.7.3 The trailing @@ line-hold specifier Example 1.7.1 1.7.4 Use of RETAIN statement SAS Example A9 1.7.5 The use of line pointer controls Example 1.7.2 1.8 Using SAS Procedures The Proc Step Specifying Options in the PROC Statement Procedure Information Statements Example 1.8.1 Output 1 Output 2 Variable Attribute Statements The FORMAT statement The LABEL statement The LENGTH statement SAS Example A10 SAS Example A11 1.9 Exercises 2 More on SAS Programming and Some Applications 2.1 More on the DATA and PROC Steps 2.1.1 Reading data from _les The INFILE Statement The FILENAME Statement Example 2.1.1 Some In_le Statement Options 2.1.2 Combining SAS data sets SAS Example B1 The SET Statement 2.1.3 Saving and retrieving permanent SAS data sets SAS Example B2 SAS Example B3 2.1.4 User-defined informats and formats Example 2.1.2 SAS Example B4 Example 2.1.3 2.1.5 Creating SAS data sets in procedure steps SAS Example B5 SAS Example B6 SAS Example B7 2.2.1 The UNIVARIATE procedure Some PROC Statement Options Some CL ASS Statement Options SAS Example B8 2.2.2 The FREQ procedure Some TABLES Statement Options SAS Example B9 Phi coefficient Contingency coefficient, C Cramer’s V Gamma , Kendall’s tau-b, Somers’ D Proportional Reduction in Error (PRE) Measures Pearson correlation coefficient, r2 and Spearman rank-order correlation coefficient SAS Example B10 2.3 Some Useful Base SAS Procedures 2.3.1 The TABULATE procedure SAS Example B11 SAS Example B12 2.3.2 The REPORT procedure SAS Example B13 SAS Example B14 SAS Example B15 2.4 Exercises 3 Introduction to SAS Graphics 3.1 Introduction Template-based graphics (ODS graphics) ODS Statistical Graphics procedures SAS Example C1 Traditional SAS graphics via SAS /GRAPH 3.2 Template-based graphics (SAS/ODS graphics) SAS Example C2 SAS Example C3 SAS Example C4 3.3 SAS Statistical Graphics procedures 3.3.1 The SGPLOT procedure Some SCATTER Statement Options Some ELLIPSE Statement Options SAS Example C5 Some HISTOGRAM Statement Options Some DENSITY Statement Options SAS Example C6 Some VBOX Statement Options SAS Example C7 Some VLINE Statement Options SAS Example C8 3.3.2 The SGPANEL procedure Some PANELBY Statement Options SAS Example C9 Some VBAR Statement Options SAS Example C10 Some DOT Statement Options SAS Example C11 3.3.3 The SGSCATTER procedure Some MATRIX Statement Options SAS Example C12 Attribute Map Data Sets 3.4 ODS Graphics from other SAS procedures SAS Example C13 SAS Example C14 SAS Example C15 SAS Example C16 3.5 Exercises 4 Statistical Analysis of Regression Models 4.1 An Introduction to Simple Linear Regression Estimation of Parameters Statistical Inference 4.1.1 Simple linear regression using PROC REG SAS Example D1 4.1.2 Lack of t test SAS Example D2 4.1.3 Diagnostic use of case statistics SAS Example D3 4.1.4 Prediction of new y values using regression SAS Example D4 4.2 An Introduction to Multiple Regression Analysis Multiple Regression Model Estimation of Parameters Matrix Notation 4.2.1 Multiple regression analysis using PROC REG SAS Example D5 4.2.2 Case statistics and residual analysis Residuals Hat Matrix Con_dence Interval for the Mean E(yi) Prediction Interval for yi Studentized Residuals Externally Studentized Residuals Leverage Inuence Statistics:Cook’s D Inuence Statistics:DFFITS Inuence Statistics:DFBETAS SAS Example D5 (continued) 4.2.3 Residual plots SAS Example D6 4.2.4 Examining relationships among regression variables Multicollinearity SAS Example D7 4.3 Types of Sums of Squares Computed in PROC REG 4.3.1 Model comparison technique and extra sum of squares Reduction Notation 4.3.2 Types of sums of squares in SAS Definition: Type I (or Sequential) Sums of Squares Definition: Type II (or Partial) Sum of Squares Type I and Type II Sums of Squares in Reduction Notation SAS Example D8 Interactive Model Fitting using PROC REG 4.4 Subset Selection Methods in Multiple Regression Forward Selection Method Backward Elimination Method Stepwise Method Other Stepwise Methods Coefficient of Multiple Correlation R2 All-Subsets Methods Adjusted R2 Mallows’ Cp Statistic The AIC Criterion The BIC and the SBC Criteria 4.4.1 Subset selection using PROC REG SAS Example D9 SAS Example D10 SAS Example D11 SAS Example D12 4.4.2 Other options available in PROC REG for model selection 4.5 Model Selection using PROC GLMSELECT: Validation and Cross-Validation SAS Example D13 SAS Example D14 4.6 Exercises 5 Analysis of Va riance Models 5.1 Introduction 5.1.1 Treatment Structure 5.1.2 Experimental Designs 5.1.3 Linear Models 5.2 One-Way Classification Model Estimation Testing Hypotheses Preplanned or a Priori Comparisons of Means Example 5.2.1 Pairwise Comparisons of Means Multiple Comparisons of Pairs of Means 5.2.1 Using PROC ANOVA to analyze one-way classiffcations SAS Example E1 5.2.2 Making preplanned (or a priori) comparisons using PROC GLM SAS Example E2 5.2.3 Testing orthogonal polynomials using contrasts Example 5.2.2 SAS Example E3 5.3 One-Way Analysis of Covariance Model Estimation Testing Hypotheses 5.3.1 Using PROC GLM to perform one-way covariance analysis SAS Example E4 5.3.2 One-way cov ariance analysis: Testing for equal slopes SAS Example E5 5.4 A Two-Way Factorial in a Completely Randomized Design Model Hypotheses Testing Estimation 5.4.1 Analysis of a two-way factorial using PROC GLM SAS Example E6 5.4.2 Residual analysis and transformations 5.5 Two-Way Factorial: Analysis of Interaction SAS Example E7 5.6 Two-Way Factorial: Unequal Sample Sizes SAS Example E8 5.7 Two-Way Classi_cation: Randomized Complete Block Design Model Estimation Testing Hypotheses 5.7.1 Using PROC GLM to analyze a RCBD SAS Example E9 5.7.2 Using PROC GLM to test for nonadditivity SAS Example E10 5.8 Exercises 6 Analysis of Variance: Random and Mixed Effects Models 6.1 Introduction 6.2 One-Way Random Effects Model Model Estimation and Hypothesis Testing 6.2.1 Using PROC GLM to analyze one-way random effects models SAS Example F1 6.2.2 Using PROC MIXED to analyze one-way random effects models SAS Example F2 SAS Example F3 SAS Example F4 6.3 Two-Way Crossed Random E_ects Model Model Estimation and Hypothesis Testing 6.3.1 Using PROC GLM and PROC MIXED to analyze two-way crossed random effects models SAS Example F5 SAS Example F6 SAS Example F7 6.3.2 Randomized complete block design: Blocking when treatment factors are random 6.4 Two-Way Nested Random Effects Model Model Estimation and Hypothesis Testing 6.4.1 Using PROC GLM to analyze two-way nested random effects models SAS Example F8 6.4.2 Using PROC MIXED to analyze two-way nested random effects models SAS Example F9 6.5 Two-Way Mixed Effects Model 6.5.1 Two-way mixed effects model: Randomized complete blocks design Model Estimation and Hypothesis Testing SAS Example F10 SAS Example F11 6.5.2 Two-way mixed effects model: Crossed classification Model A Special Comment Estimation and Hypothesis Testing SAS Example F12 SAS Example F13 6.5.3 Two-way mixed effects model: Nested classification Model Estimation and Hypothesis Testing SAS Example F14 SAS Example F15 6.6 Models with Random and Nested Effects for More Complex Experiments 6.6.1 Models for nested factorials SAS Example F16 6.6.2 Models for split-plot expe riments 6.6.3 Analys is of split-plot experiments using PROC GLM SAS Example F17 6.6.4 Analysis of split-plot experiments using PROC MIXED SAS Example F18 6.7 Exercises 7 Beyond Regression and Analysis of Variance 7.1 Introduction 7.2 Non-linear Models 7.2.1 Introduction 7.2.2 Growth Curve Models SAS Example G1 7.2.3 Pharmacokinetic Models SAS Example G2 7.2.4 Models for Toxicology Assays SAS Example G3 SAS Example G4 7.3 Generalized Linear Models 7.3.1 Introduction 7.3.2 Logistic Regression SAS Example G5 7.3.3 Poisson Regression and Log-linear Models SAS Example G6 7.3.4 Models for Over-dispersion SAS Example G7 SAS Example G8 7.4 Generalized Estimating Equations (GEE ) 7.4.1 Dealing with Over-Dispersion 7.4.2 Logistic and Poisson Regression for Repeated Measures Studies SAS Example G9 7.4.3 Logistic and Poisson Regression for Nested Experiments SAS Example G10 7.4.4 Robust Estimation of Standard Errors (Sandwich Estimators) SAS Example G11 SAS Example G12 7.5 Generalized Linear Mixed Models 7.5.1 Logistic and Poisson Regression Models with Random Subject Effects 7.5.2 Models for Repeated Measures Studies SAS Example G13 7.5.3 Application to More Complex Experiments SAS Example G14 7.5.4 Models with Spatial Variability SAS Example G15 7.6 Non-linear Models with Random Effects 7.6.1 Growth Curve Model with Random Effects SAS Example G16 7.6.2 Non-linear Models with random Coefficients SAS Exampl e G17APPENDICES A SAS Templates A.1 Introduction A.2 Simple Template Modification B Tables References




