Contents About This Book What Does This Book Cover? Requirements and Details Exam Objectives Take a Practice Exam Registering for the Exam Syntax Conventions What Should You Know about the Examples? Software Used to Develop the Book's Content Example Code and Data SAS University Edition Where Are the Exercise Solutions? We Want to Hear from You Chapter 1: Statistics and Making Sense of Our World Introduction What Is Statistics? The Two Branches of Statistics Variable Types and SAS Data Types Variable Types Table 1.1 Data for the Study of Diabetes SAS Data Types The Data Analytics Process Defining the Purpose Table 1.2 Examples of Analyses by Purpose for Various Industries Data Preparation Sampling Cleaning the Data Exploring the Data Analyzing the Data and Roadmap to the Book Table 1.3 Summary of Statistical Models for Business Analysis Certification by Variable Role Conclusions and Interpretation Getting Started with SAS Diabetic Care Management Case Ames Housing Case Table 1.4 List of Data Sets Used in the Book by Chapter Accessing the Data in the SAS Environment Program 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set SAS Log 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set Output 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set Key Terms Chapter 2: Summarizing Your Data with Descriptive Statistics Introduction Measures of Center Mean Figure 2.1 Time to Process Online Orders (in Hours) Median Mode Table 2.1 Number of Deaths for Top Ten Causes – 2014 United States Measures of Variation Range Table 2.2 Time to Process Orders (in Hours) by Retailer Figure 2.2 Time to Process Orders (in Hours) Variance Table 2.3 Descriptive Statistics for Time to Process Orders Table 2.4 Calculations for Variance as Average Squared Deviations Standard Deviation Measures of Shape Skewness Figure 2.3 Examples of Symmetric and Asymmetric Distributions Table 2.5 Sum of Z3 Values for Calculating Skewness Kurtosis Figure 2.4 Examples of Kurtosis as Compared to the Normal Distribution Table 2.6 Sum of Z4 Values for Calculating Kurtosis Other Descriptive Measures Percentiles, the Five-Number-Summary, and the Interquartile Range (IQR) Percentiles The Five-Number-Summary and the Interquartile Range (IQR) Figure 2.5 Time to Process Online Orders (in Hours) for Retailer 2 Outliers The MEANS Procedure Procedure Syntax for PROC MEANS Program 2.1 PROC MEANS of Process Time and Amount Spent for Retailer 1 Output 2.1 PROC MEANS of Process Time and Amount Spent for Retailer 1 Customizing Output with the VAR statement and Statistics Keywords Program 2.2 PROC MEANS with Additional Descriptive Statistics of Process Time for Retailer 1 Output 2.2 PROC MEANS with Additional Descriptive Statistics of Process Time for Retailer 1 Key Words for Generating Desired Statistics Table 2.7 Keywords for Requesting Statistics in the MEANS Procedure Comparing Groups Using the CLASS Statement or the BY Statement PROC MEANS Using the CLASS Statement Program 2.3 PROC MEANS of Process Time for Retailers 1 and 2 Using the CLASS Statement Output 2.3 PROC MEANS of Process Time for Retailers 1 and 2 Using the CLASS Statement PROC MEANS Using the BY Statement Program 2.4 PROC MEANS of Process Time for Retailers 1 and 2 Using the BY Statement Output 2.4 PROC MEANS of Process Time for Retailers 1 and 2 Using the BY Statement Program 2.5 Analysis of Process Time for Retailers 1 and 2 Using BY DESCENDING Output 2.5 Analysis of Process Time For Retailers 1 and 2 Using BY DESCENDING Multiple Classes and Customizing Output Using the WAYS and TYPES Statements Using Multiple Classes in the CLASS Statement Program 2.6 Three-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.6 Three-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender The WAYS Statement for Multiple Classes Program 2.7 Two-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.7 Two-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender The TYPES Statement for Multiple Classes Program 2.8 One- and Two-Way Analyses of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.8 One- and Two-Way Analyses of Ketones by Diabetes Status, Renal Disease, and Gender Saving Your Results Using the OUTPUT Statement Program 2.9 Ketones for the Diabetic Care Management Case Output 2.9 Ketones for the Diabetic Care Management Case The CLASS Statement and the _TYPE_ and _FREQ_ Variables Program 2.10 Ketones by the Class Controlled_Diabetic Output 2.10 Ketones by the Class Controlled_Diabetic Program 2.11 Ketones by the Classes Controlled_Diabetic and Renal_Disease Output 2.11 Ketones by the Classes Controlled_Diabetic and Renal_Disease SAS Log 2.1 Ketone Analysis by Two Classes Program 2.12 Ketones by the Classes Controlled_Diabetic, Renal_Disease, and Gender Output 2.12 Ketones by the Classes Controlled_Diabetic, Renal_Disease, and Gender Table 2.8 TYPE Values and the Subgroups Produced by Three-Way Analyses SAS Log 2.2 Ketone Analysis by the Classes Controlled_Diabetic, Renal_Disease, and Gender Table 2.9 TYPE, WAYS, Subgroups, and Number of Observations for One-, Two-, and Three-Way Analyses The CLASS Statement and Filtering the Output Data Set Program 2.13 Ketone Analysis by Four Classes SAS Log 2.3 Ketone Analysis by Four Classes Output 2.13 Filter of Output File for Only One-Way Analyses (_TYPE_ = 1, 2, 4, 8) The NWAY Option and Comparisons to the WAYS and TYPES Statements Program 2.14 Three-Way Analysis of Ketones Using the NWAY Option Output 2.14 Three-Way Analysis of Ketones Using the NWAY Option Program 2.15 Alternative 1 for Three-Way Analysis of Ketones Using the NWAY Option Program 2.16 Three Class Variables Connected by the Asterisk (*) in the TYPES Statement The BY Statement and the _TYPE_ and _FREQ_ Variables Program 2.17 Ketones by Controlled_Diabetic Output 2.15 Ketones by Controlled_Diabetic Program 2.18 Ketones by Controlled_Diabetic for Two Classes Output 2.16 Ketones by Controlled_Diabetic for Two Classes Handling Missing Data with the MISSING Option Program 2.19 The MEANS Procedure of Glucose by AE_DURATION Including Missing Values Output 2.17a The MEANS Procedure of Glucose by AE_DURATION Including Missing Values Output 2.17b Glucose by AE_DURATION Including Missing Values Key Terms Chapter Quiz Chapter 3: Data Visualization Introduction View and Interpret Categorical Data Frequency and Crosstabulation Tables Using the FREQ Procedure Procedure Syntax for PROC FREQ Figure 3.1 Diabetic Care Management Case Data Program 3.1 Frequency Tables of GENDER, AGE_RANGE, and CONTROLLED_DIABETIC Output 3.1 Frequency Tables of GENDER, AGE_RANGE, and CONTROLLED_DIABETIC PLOTS Options within the TABLES Statement Program 3.2 Frequency Table and Bar Chart of GENDER Output 3.2 Frequency Table and Bar Chart of GENDER Crosstabulations for Illustrating Associations between Two Categorical Variables Program 3.3 Crosstabulation of Gender by Diabetes Status Output 3.3a Crosstabulation of Gender by Diabetes Status Output 3.3b Crosstabulation of Gender by Diabetes Status: Frequency Pots of Gender by Diabetes Status Program 3.4 Cross Tabs and Frequency Plots of Diabetes Status and Renal Disease Output 3.4 Cross Tabs and Frequency Plots of Diabetes Status and Renal Disease MISSING Option within the TABLES Statement Program 3.5 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Excluded Output 3.5 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Excluded Program 3.6 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Included Output 3.6 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Included View and Interpret Numeric Data Histograms Using the UNIVARIATE Procedure Figure 3.2 Histogram for Numeric Data Procedure Syntax for PROC UNIVARIATE Program 3.7 Univariate Statistics on BMI for 200 Diabetic Patients Output 3.7 Univariate Statistics on BMI for 200 Diabetic Patients Table 3.1 Summary Data for the Variable BMI Program 3.8 Histogram of the Variable BMI Output 3.8 Histogram of the Variable BMI Q-Q Plots Using the UNIVARIATE Procedure Table 3.2 Expected Z-Scores for Number of Texts Figure 3.3 Q-Q Plot for Number of Texts Interpreting the Q-Q Plots Program 3.9 Q-Q Plot for the Variable BMI Output 3.9 Q-Q Plot for the Variable BMI Box-and-Whisker Plot Using the UNIVARIATE Procedure Calculating Quartiles for Five-Number Summary Figure 3.4 Box Plot for Number of Texts Interpreting the Box Plot Program 3.10 Distribution and Probability Plot for BMI Output 3.10 Distribution and Probability Plot for BMI UNIVARIATE Procedures Using the INSET Statement Program 3.11 Histogram with Descriptive Statistics of BMI Output 3.11 Histogram with Descriptive Statistics of BMI UNIVARIATE Procedures Using the CLASS Statement Program 3.12 Histogram of Pounds with Descriptive Statistics by Gender Output 3.12 Histogram of Pounds with Descriptive Statistics by Gender Visual Analyses Using the SGPLOT Procedure Procedure Syntax for PROC SGPLOT Exploring Bivariate Relationships with Basic Plots, Fits, and Confidence The SCATTER and REG Statements Program 3.13 Scatter Plot of Systolic and Diastolic Blood Pressure Output 3.13 Scatter Plot of Systolic and Diastolic Blood Pressure Program 3.14 Regression Line and Confidence Limits on Bivariate Scatter Plot Output 3.14 Regression Line and Confidence Limits on Bivariate Scatter Plot Program 3.15 Scatter Plot of Price by Quantity Sold Output 3.15 Scatter Plot of Price by Quantity Sold Program 3.16 Scatter Plot of Weight and Blood Pressure by Gender Output 3.16a Scatter Plot of Weight and Blood Pressure by Gender Output 3.16b Scatter Plot of Weight by Systolic Blood Pressure by Gender Exploring Other Relationships Using SGPLOT Program 3.17 Vertical Bar Charts for Diabetes Status Output 3.17 Vertical Bar Charts for Diabetes Status Program 3.18 Bar Chart of Diabetes Status by Renal Disease Output 3.18a Bar Chart of Diabetes Status by Renal Disease Output 3.18b Numbers with Renal Diseases by Diabetes Status Program 3.19 Bar Charts for Diastolic and Systolic BP by Diabetes Status Output 3.19 Bar Charts for Diastolic and Systolic BP by Diabetes Status Key Terms Chapter Quiz Chapter 4: The Normal Distribution and Introduction to Inferential Statistics Introduction Continuous Random Variables Normal Random Variables Figure 4.1 Distributions of Adult Weights for Three Populations The Empirical Rule Figure 4.2 Visualization of the Empirical Rule Figure 4.3 Empirical Rule Applied to Height of Diabetic Males Program 4.1 Actual Percentage of Males Having Heights within 1, 2, and 3 Standard Deviations from the Mean Output 4.1 Actual Percentage of Males Having Heights within 1, 2, and 3 Standard Deviations from the Mean The Standard Normal Distribution Figure 4.4 Proportion of Z-values Less Than -1.15, P(Z < -1.15) Table 4.1 Excerpt from Standard Normal Cumulative Area (for Z ≤ 0) Figure 4.5 Proportion of Z-values Less Than 1.15, P(Z +1.15) Figure 4.7 Proportion of Z-Values between -1.00 and +1.00, P(-1.00 < Z < +1.00) Figure 4.8 Proportion of Z-Values between -1.96 and +1.96, P(-1.96 < Z +1.77 Effects of Sample Size on the Sampling Distribution Figure 4.15 Sampling Distribution of the Mean for Two Sample Sizes Introduction to Hypothesis Testing Defining the Null and Alternative Hypotheses Figure 4.16 Rejection Region for a Two-Tailed Test Figure 4.17 Rejection Region for a Lower-Tailed Test Figure 4.18 Rejection Region for an Upper-Tailed Test Defining and Controlling Errors in Hypothesis Testing Hypothesis Testing for the Population Mean (σ Known) Two-Tailed Tests for the Population Mean (µ) Figure 4.19 Rejection Region for a Two-Tailed Test at α = 0.05 Table 4.3 Finding Z-Value Associated with 0.025 Area in the Lower Tail Figure 4.20 Critical Values for a Two-Tailed Test at α = 0.05 One-Tailed Tests for the Population Mean (µ) Figure 4.21 Critical Value for a One-Tailed Test at α = 0.05 Figure 4.22 Test Statistic Compared to the Critical Value Table 4.4 Critical Values Based upon α-Level and One-Tailed versus Two-Tailed Tests Hypothesis Testing Using the P-Value Approach Figure 4.23 p-Value for a One-Tailed Test The P-Value for the Two-Tailed Hypothesis Test Figure 4.24 p-Value for a Two-Tailed Test Hypothesis Testing for the Population Mean (σ Unknown) One-Tailed Tests for the Population Mean (µ) Figure 4.25 The t-Distribution for Various Sample Sizes Table 4.5 Descriptive Statistics of BMI for 25 Female Diabetic Patients Table 4.6 Excerpt from the t-Table Figure 4.26 t-Test Statistic Compared to the Critical Value Procedure Syntax for PROC TTEST Program 4.3 t-Test of BMI for Female Diabetics Output 4.3 t-Test of BMI for Female Diabetics Confidence Intervals for Estimating the Population Mean Confidence Interval for the Population Mean (σ Known) Figure 4.27 Confidence Intervals as Related to the Sampling Distribution Effects of Level of Confidence and Sample Size on Confidence Intervals Confidence Interval for the Population Mean (σ Unknown) Key Terms Chapter Quiz Chapter 5: Analysis of Categorical Variables Introduction Testing the Independence of Two Categorical Variables Hypothesis Testing and the Chi-Square Test Table 5.1 Expected Frequency Count of Online Shopping by Gender Table 5.2 Observed and Expected Frequencies Count of Online Shopping by Gender Figure 5.1 Bivariate Bar Charts of Gender and Online Shopping The Chi-Square Test Using the FREQ Procedure Procedure Syntax for PROC FREQ Program 5.1 Testing Association between Bonus and Kitchen Quality Output 5.1a Testing Association between Bonus and Kitchen Quality Output 5.1b Testing Association between Bonus and Kitchen Quality: Bivariate Bar Charts of Bonus and Kitchen Quality Assumptions Measuring the Strength of Association between Two Categorical Variables Cramer’s V The Odds Ratio Table 5.3 General Form of the 2x2 Contingency Table Using Chi-Square Tests for Exploration Prior to Predictive Analytics Program 5.2 Testing Association between Bonus and Corner Lot Output 5.2a Testing Association between Bonus and Corner Lot Output 5.2b Testing Association between Bonus and Corner Lot: Bivariate Bar Charts of Bonus and Corner Lot Key Terms Chapter Quiz Chapter 6: Two-Sample t-Test Introduction Independent Samples The Pooled Variance t-Test Assumptions Procedure Syntax of PROC TTEST Procedure Program 6.1 Independent Samples t-Test for Mean Differences in Above Ground Living Area Output 6.1a Independent Samples t-Test for Ames Housing, Above Ground Living Area by Bonus Testing the Equal Variance Assumption Using the Folded F-Test Verifying the Assumptions of a Two-Sample t-Test Output 6.1b Normal Probability Plots for Above Ground Living Area by Bonus Supplemental Plots for Data Visualization Output 6.1c Histograms and Box Plots for Above Ground Living Area by Bonus Testing the Normality Assumption Using the Kolmogorov-Smirnov Test Program 6.2 Kolmogorov-Smirnov Test of Normality for Above Ground Living Area by Bonus Output 6.2 Kolmogorov-Smirnov Test of Normality for Above Ground Living Area by Bonus Satterthwaite t-Test for Unequal Variances Program 6.3 Independent Samples t-Test for Mean Differences in Total Basement Area Output 6.3 Independent Sample t-Test for Ames Housing, Total Basement Area by Bonus Summary of Steps for the t-Test of Two Independent Populations Paired Samples Assumptions The Paired-Sample t-Test Using the PAIRED Statement in the TTEST Procedure Table 6.1 Whitley County, Indiana, 2012 and 2016 Tax Assessed Property Values Sample Data Program 6.4 Kolmogorov-Smirnov Test of Normality Assumption on the Difference Score Using the UNIVARIATE Procedure Output 6.4a Kolmogorov-Smirnov Test of Normality Assumption on the Difference Score Using the UNIVARIATE Procedure Output 6.4b Paired t-Test Results for Differences in Tax Assessed Property Values Output 6.4c Accompanying Plots for the Paired-Sample t-Test Key Terms Chapter Quiz Chapter 7: Analysis of Variance (ANOVA) Introduction One-Factor Analysis of Variance The One-Factor ANOVA Model Constructing the Test Statistic: Estimating Variance among Groups and Variance within Groups Table 7.1 Deviations within and across Groups Table 7.2 Squared Deviations within and across Groups Figure 7.1 The F-Distribution Table 7.3 General Form of the Analysis of Variance Table The GLM Procedure for Investigating Mean Differences Program 7.1 Descriptive Statistics for Computer Anxiety by Academic Major Output 7.1 Exploration of Computer Anxiety by Academic Major Program 7.2 One-Way ANOVA for Testing Differences in Computer Anxiety Output 7.2 One-Way ANOVA for Testing Differences in Computer Anxiety Predicted Values and Residuals Using the OUTPUT Statement Program 7.3 Predicted Values and Residuals for Computer Anxiety Scores Output 7.3 Predicted Values and Residuals for Computer Anxiety Scores Measures of Fit The Normality Assumption and the PLOTS Option Output 7.4 Fit Diagnostics for the One-Way Analysis of Variance Levene’s Test for Equal Variances and the MEANS Statement Program 7.4 The MEANS Statement for Additional Tests of Computer Anxiety Scores Output 7.5 Levene’s Homogeneity of Variance Test for Computer Anxiety Scores Post Hoc Tests: The Tukey-Kramer Procedure and the MEANS Statement Output 7.6 Tukey-Kramer for Testing Pairwise Differences in Computer Anxiety Other Post Hoc Procedures, the LSMEANS Statement, and the Diffogram Output 7.7 LSMEANS Statement for Testing Pairwise Differences in Computer Anxiety Output 7.8 Dunnett Adjustment for Testing Pairwise Differences in Computer Anxiety Program 7.5 Complete Analysis of Difference in Computer Anxiety Scores Across Academic Majors The Randomized Block Design The ANOVA Model for the Randomized Block Design Example and Interpretation of the Randomized Block Design Program 7.6 Exploration of Computer Anxiety by Academic Major and Block Output 7.9 Exploration of Computer Anxiety by Academic Major and Block Table 7.4 The ANOVA Table for the Randomized Block Design Program 7.7 Randomized Block Design for Testing Differences in Computer Anxiety Output 7.10 Randomized Block Design for Testing Differences in Computer Anxiety Post Hoc Tests Using the LSMEANS Statement Output 7.11 LSMEANS Statement for Testing Pairwise Differences in Computer Anxiety When Blocking Assessing the Assumptions of a Randomized Block Design Using the PLOTS Option Unbalanced Designs, the LSMEANS Statement, and Type III Sums of Squares Table 7.5 Cell Means and Sample Sizes for Computer Anxiety Scores Two-Factor Analysis of Variance The Two-Factor ANOVA Model Table 7.6 General Form of the Two-Factor ANOVA Table Example and Interpretation of the Two-Factor ANOVA Program 7.8 Exploration of Computer Anxiety by Academic Major and Gender Output 7.12 Descriptive Statistics for Computer Anxiety by Academic Major and Gender Figure 7.2 Mean Computer Anxiety Scores by Academic Major and Gender Program 7.9 Two-Factor ANOVA for Testing Differences in Computer Anxiety Output 7.13a Two-Factor ANOVA for Testing Differences in Computer Anxiety Output 7.13b Least Squares Means for Major by Gender Interaction Effects Output 7.13c Diffogram of MAJOR by GENDER Means Analyzing Simple Effects When Interaction Exists Using the LSMEANS Statement with the SLICE Option Output 7.13d Analysis of Simple Effects in the Presence of Interaction Assessing the Assumptions of a Two-Factor Analysis of Variance Key Terms Chapter Quiz Chapter 8: Preparing the Input Variables for Prediction Introduction Missing Values Complete-Case Analysis Using Imputation with a Missing Value Indicator Program 8.1 Ames Housing Data with Missing Values Output 8.1 Ames Housing Data with Missing Values Program 8.2 Ames Housing with Imputed Data Output 8.2 Ames Housing with Imputed Data Categorical Input Variables Sparse Events and Quasi-Complete Separation Greenacre’s Method Using the CLUSTER Procedure Table 8.1 Contingency Table of Bonus by Neighborhood Program 8.3 Combining Neighborhoods from Ames Data Housing Using Greenacre’s Method Output 8.3a Chi-square for Bonus by Neighborhood Output 8.3b Proportion of Houses with Bonus by Neighborhood Output 8.3c Results of Cluster Analysis on Ames Neighborhoods Output 8.3d Dendrogram of Cluster Analysis Results by Neighborhoods Output 8.3e Contents of the Cluster History Output 8.3f Log P-Value Information and the Cluster History Output 8.3g Plot of Log P-Value by Number of Clusters Output 8.3h List of Neighborhoods by Cluster Table 8.2 Contingency Table of Bonus by Clustered Neighborhoods Variable Clustering The VARCLUS Procedure for Variable Reduction Table 8.3 Correlation Matrix for Variables Q1 through Q6 Procedure Syntax for PROC VARCLUS Program 8.4 The VARCLUS Procedure for Reducing Ames Housing Inputs Output 8.4a Summary Information for VARCLUS Procedure for Ames Housing Input Data Output 8.4b Cluster Summary for 2 Clusters for Ames Housing Input Data Output 8.4c Cluster Summary for 23 Clusters for Ames Housing Input Data Output 8.4d R-Squared with Own Cluster and Next Closest Cluster for Ames Housing Input Data Output 8.4e Summary of Cluster Splitting by Stage Output 8.4f Dendrogram Illustration of Cluster Splits for Ames Housing Input Data Cluster Representative and Best Variable Selection Table 8.4 Reduced Set of Inputs After Deleting Redundant Variables for Ames Housing Variable Screening The CORR Procedure for Detecting Associations Program 8.5 Description of Input Variables Screened for Relevance for Ames Housing Data Output 8.5a Summary of Input Variables Screened for Relevance for Ames Housing Data Output 8.5b ODS Output of Spearman Data Output 8.5c Spearman’s and Hoeffding’s D Correlation Data Sorted by Spearman’s Rank Output 8.5d Rank of Spearman’s Correlation by Rank of Hoeffding’s D Using the Empirical Logit to Detect Non-Linear Associations Program 8.6 Plot of Empirical Logit by Bsmt_Unf_SF Output 8.6a Value of Bsmt_Unf_SF and Bin Variables for the First Eight Houses in Ames Housing Output 8.6b Total Frequency, Number of Houses Earning a Bonus, and Average Bsmt_Unf_SF by Bin Output 8.6c Empirical Logit by the Variable Bsmt_Unf_SF Key Terms Chapter Quiz Chapter 9: Linear Regression Analysis Introduction Exploring the Relationship between Two Continuous Variables Exploring the Relationship between Two Continuous Variables Using a Scatter Plot Program 9.1 Scatter Plot of Sale Price by Above Ground Living Area Output 9.1 Scatter Plot of Sale Price and Above Ground Living Area Program 9.2 Scatter Plot of Sale Price and Age at Time of Sale Output 9.2 Scatter Plot of Sale Price and Age at Time of Sale Program 9.3 Scatter Plot of Sale Price and Square Footage Output 9.3 Scatter Plot of Sale Price and Square Footage Quantifying the Degree of Association between Two Continuous Variables Using Correlation Statistics Figure 9.1 Scatter Plot of Perfect Positive, Perfect Negative, and No Relationship Producing Correlation Coefficients Using the CORR Procedure Program 9.4 Correlation Coefficient and Descriptive Statistics for Ames Housing Output 9.4 Correlation Coefficients and Descriptive Statistics for Ames Housing Program 9.5 Correlation Coefficients with Sale Price for Ames Housing Output 9.5a Correlation Coefficients with Sale Price for Ames Housing Output 9.5b Scatter Plots for Sale Price with Potential Predictors Testing the Hypothesis for a Bivariate Linear Relationship Using the CORR Procedure Understanding Potential Misuses of the Correlation Coefficient Simple Linear Regression Fitting a Simple Linear Regression Model Using the REG Procedure Figure 9.2 Fitting the Line Closest to All Points Program 9.6 Linear Regression for Predicting Sale Price with Ground Living Area Output 9.6 Linear Regression Output for Predicting Saleprice with Ground Living Area Measures of Fit for the Linear Regression Model The Coefficient of Determination (R2) The Standard Error of the Regression (Se) Using Measures of Fit to Compare Models Table 9.1 Measures of Fit for Simple Linear Regression Hypothesis Testing for the Slope The t-Test for Slope The F-Test for Slope Table 9.2 Analysis of Variance (ANOVA) Table for Linear Regression Producing Confidence Intervals Program 9.7 Confidence Interval for Effect of Gr_Liv_Area on Sale Price Output 9.7 Confidence Interval for Effect of Gr_Liv_Area on SalePrice Multiple Linear Regression Fitting a Multiple Linear Regression Model Using the REG Procedure Program 9.8 Multiple Linear Regression for Predicting Sale Price with Six Predictors Output 9.8 Multiple Linear Regression for Predicting SalePrice with Six Predictors Measures of Fit for the Multiple Linear Regression Model Adjusted R-Square Output 9.9 Multiple Linear Regression for Predicting SalePrice with Five Predictors Table 9.3 Measures of Fit for Multiple Linear Regression Quantifying the Relative Impact of a Predictor Program 9.9 Measures of Relative Predictor Importance in Multiple Linear Regression Output 9.10 Measure of Relative Predictor Impact in Multiple Linear Regression Checking for Collinearity Using VIF, COLLIN, and COLLINOINT The Variance Inflation Factor (VIF) for Detecting Collinearity The Condition Index (C) for Detecting Collinearity Program 9.10 VIF and Condition Numbers for Detecting Collinearity Output 9.11 VIF and Condition Numbers for Detecting Collinearity Fitting a Simple Linear Regression Model Using the GLM Procedure Program 9.11 PROC GLM for Prediction Using One Categorical Variable Output 9.12a PROC GLM for Prediction Using One Categorical Variable Output 9.12b Tukey Procedure for Detecting Differences in Mean Sale Price Program 9.12 PROC REG for Prediction Using One Categorical Variable Output 9.13 PROC REG for Prediction Using One Categorical Variable Variable Selection Using the REG and GLMSELECT Procedures The REG Procedure for Variable Selection All Possible Subsets Program 9.13 Best Subsets Regression Models Ranked by Adjusted R-Square Output 9.14 Best Subsets Regression Models Ranked by Adjusted R-Square Program 9.14 Best Subsets Regression Models Ranked by Mallows’ Cp Output 9.15a Mallows’ Cp Plot for Variable Selection Output 9.15b Best Subsets Regression Models Ranked by Mallows’ Cp Backward Elimination Program 9.15 Backward Elimination for the Ames Housing Case Output 9.16a Backward Elimination Step 0 Output 9.16b Backward Elimination Step 1 Output 9.16c Backward Elimination Step 2 Output 9.16d Backward Elimination Step 7 Output 9.16e Summary of Backward Elimination Output 9.16f Plot of Adjusted R-Square by Backward Elimination Step Forward Selection Program 9.16 Forward Selection for the Ames Housing Case Output 9.17a Forward Selection Step 1 Output 9.17b Forward Selection Step 2 Output 9.17c Forward Selection Step 7 Output 9.17d Summary of Forward Selection Output 9.17e Plot of Adjusted R-Square by Forward Selection Step Stepwise Selection Program 9.17 Stepwise Selection for the Ames Housing Case Program 9.18 Three Variable Selection Methods for the Ames Housing Case The GLMSELECT Procedure for Variable Selection Program 9.19 PROC GLMSELECT with Stepwise Selection for the Ames Housing Case Output 9.18a PROC GLMSELECT for Stepwise Selection Step 1 Output 9.18b PROC GLMSELECT for Stepwise Selection Step 2 Output 9.18c Summary for Stepwise Selection in PROC GLMSELECT Output 9.18d The Selected Model from Stepwise Selection in PROC GLMSELECT Other Features of the GLMSELECT Procedure Table 9.4 Default SLENTRY and SLSTAY Settings by Model Selection Method. Cautionary Note on Sequential Selection Methods Assessing the Validity of Results Using Regression Diagnostics The Assumptions of Linear Regression Residual Analysis for Checking Assumptions Figure 9.3 Fit Plot and Residual Plot for Illustrating a Linear Trend with Constant Variance Figure 9.4 Residual Plot Illustrating a Curvilinear Trend Figure 9.5 Residual Plot Illustrating Unequal Variance Figure 9.6 Residual Plot Illustrating Autocorrelation Program 9.20 Linear Regression Analysis Diagnostics Panel Output 9.19a Linear Regression on Revenue with Diagnostics Panel Output 9.19b Predicted Revenue and Residuals Using the Predictor AdExpense Program 9.21 Linear Regression Analysis Using Transformed Ad Expense (LnAdExp) Output 9.20 Linear Regression on Revenue Using Transformed Ad Expense (LnAdExp) Program 9.22 Diagnostics for Multiple Linear Regression Output 9.21a Multiple Linear Regression for Predicting SalePrice Output 9.21b Residual by Predicted Plot and Q-Q Plot of Residuals for SalePrice Output 9.21c Panel of Residual by Regressors for SalePrice Studentized Residuals Program 9.23 Residuals and Studentized Residuals by AdExpense for Saleprice Output 9.22a Residual and Studentized Residuals by AdExpense for SalePrice Output 9.22b Residuals and Studentized Residuals by AdExpense for Saleprice Using Statistics to Identify Potential Influential Observations Program 9.24 Comparing Regression Lines Based on Influence of Obs 15 Output 9.23 Comparing Regression Lines Based on Influence of Obs 15 Leverage (hii) Discrepancy (RSTUDENTi) Influence Program 9.25 Identifying Suspicious Observations Using Measures of Influence Output 9.24a Linear Regression Output for SalePrice with Influential Observation Output 9.24b Leverage by RStudent Plot Output 9.24c Cook’s D and DFFITS Plots for Detecting Influence Output 9.24d Deletion Statistics for Detecting Influence Output 9.25 Influence Statistics Using the INFLUENCE Option Program 9.26 DFBETA Plots for Assessing Local Influence Output 9.26 DFBETA Plots for Assessing Local Influence Program 9.27 Regression Diagnostics for the Ames Housing Case Output 9.27a Influence Panels and Influential Observations for Ames Housing Output 9.27b Observations Flagged as Influential for Ames Housing Recommendations for Handling Influential Observations Concluding Remarks Key Terms Chapter Quiz Chapter 10: Logistic Regression Analysis Introduction The Logistic Contents About This Book What Does This Book Cover? Requirements and Details Exam Objectives Take a Practice Exam Registering for the Exam Syntax Conventions What Should You Know about the Examples? Software Used to Develop the Book's Content Example Code and Data SAS University Edition Where Are the Exercise Solutions? We Want to Hear from You Chapter 1: Statistics and Making Sense of Our World Introduction What Is Statistics? The Two Branches of Statistics Variable Types and SAS Data Types Variable Types Table 1.1 Data for the Study of Diabetes SAS Data Types The Data Analytics Process Defining the Purpose Table 1.2 Examples of Analyses by Purpose for Various Industries Data Preparation Sampling Cleaning the Data Exploring the Data Analyzing the Data and Roadmap to the Book Table 1.3 Summary of Statistical Models for Business Analysis Certification by Variable Role Conclusions and Interpretation Getting Started with SAS Diabetic Care Management Case Ames Housing Case Table 1.4 List of Data Sets Used in the Book by Chapter Accessing the Data in the SAS Environment Program 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set SAS Log 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set Output 1.1 PROC CONTENTS of the Diabetes Care Management Case Data Set Key Terms Chapter 2: Summarizing Your Data with Descriptive Statistics Introduction Measures of Center Mean Figure 2.1 Time to Process Online Orders (in Hours) Median Mode Table 2.1 Number of Deaths for Top Ten Causes – 2014 United States Measures of Variation Range Table 2.2 Time to Process Orders (in Hours) by Retailer Figure 2.2 Time to Process Orders (in Hours) Variance Table 2.3 Descriptive Statistics for Time to Process Orders Table 2.4 Calculations for Variance as Average Squared Deviations Standard Deviation Measures of Shape Skewness Figure 2.3 Examples of Symmetric and Asymmetric Distributions Table 2.5 Sum of Z3 Values for Calculating Skewness Kurtosis Figure 2.4 Examples of Kurtosis as Compared to the Normal Distribution Table 2.6 Sum of Z4 Values for Calculating Kurtosis Other Descriptive Measures Percentiles, the Five-Number-Summary, and the Interquartile Range (IQR) Percentiles The Five-Number-Summary and the Interquartile Range (IQR) Figure 2.5 Time to Process Online Orders (in Hours) for Retailer 2 Outliers The MEANS Procedure Procedure Syntax for PROC MEANS Program 2.1 PROC MEANS of Process Time and Amount Spent for Retailer 1 Output 2.1 PROC MEANS of Process Time and Amount Spent for Retailer 1 Customizing Output with the VAR statement and Statistics Keywords Program 2.2 PROC MEANS with Additional Descriptive Statistics of Process Time for Retailer 1 Output 2.2 PROC MEANS with Additional Descriptive Statistics of Process Time for Retailer 1 Key Words for Generating Desired Statistics Table 2.7 Keywords for Requesting Statistics in the MEANS Procedure Comparing Groups Using the CLASS Statement or the BY Statement PROC MEANS Using the CLASS Statement Program 2.3 PROC MEANS of Process Time for Retailers 1 and 2 Using the CLASS Statement Output 2.3 PROC MEANS of Process Time for Retailers 1 and 2 Using the CLASS Statement PROC MEANS Using the BY Statement Program 2.4 PROC MEANS of Process Time for Retailers 1 and 2 Using the BY Statement Output 2.4 PROC MEANS of Process Time for Retailers 1 and 2 Using the BY Statement Program 2.5 Analysis of Process Time for Retailers 1 and 2 Using BY DESCENDING Output 2.5 Analysis of Process Time For Retailers 1 and 2 Using BY DESCENDING Multiple Classes and Customizing Output Using the WAYS and TYPES Statements Using Multiple Classes in the CLASS Statement Program 2.6 Three-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.6 Three-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender The WAYS Statement for Multiple Classes Program 2.7 Two-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.7 Two-Way Analysis of Ketones by Diabetes Status, Renal Disease, and Gender The TYPES Statement for Multiple Classes Program 2.8 One- and Two-Way Analyses of Ketones by Diabetes Status, Renal Disease, and Gender Output 2.8 One- and Two-Way Analyses of Ketones by Diabetes Status, Renal Disease, and Gender Saving Your Results Using the OUTPUT Statement Program 2.9 Ketones for the Diabetic Care Management Case Output 2.9 Ketones for the Diabetic Care Management Case The CLASS Statement and the _TYPE_ and _FREQ_ Variables Program 2.10 Ketones by the Class Controlled_Diabetic Output 2.10 Ketones by the Class Controlled_Diabetic Program 2.11 Ketones by the Classes Controlled_Diabetic and Renal_Disease Output 2.11 Ketones by the Classes Controlled_Diabetic and Renal_Disease SAS Log 2.1 Ketone Analysis by Two Classes Program 2.12 Ketones by the Classes Controlled_Diabetic, Renal_Disease, and Gender Output 2.12 Ketones by the Classes Controlled_Diabetic, Renal_Disease, and Gender Table 2.8 TYPE Values and the Subgroups Produced by Three-Way Analyses SAS Log 2.2 Ketone Analysis by the Classes Controlled_Diabetic, Renal_Disease, and Gender Table 2.9 TYPE, WAYS, Subgroups, and Number of Observations for One-, Two-, and Three-Way Analyses The CLASS Statement and Filtering the Output Data Set Program 2.13 Ketone Analysis by Four Classes SAS Log 2.3 Ketone Analysis by Four Classes Output 2.13 Filter of Output File for Only One-Way Analyses (_TYPE_ = 1, 2, 4, 8) The NWAY Option and Comparisons to the WAYS and TYPES Statements Program 2.14 Three-Way Analysis of Ketones Using the NWAY Option Output 2.14 Three-Way Analysis of Ketones Using the NWAY Option Program 2.15 Alternative 1 for Three-Way Analysis of Ketones Using the NWAY Option Program 2.16 Three Class Variables Connected by the Asterisk (*) in the TYPES Statement The BY Statement and the _TYPE_ and _FREQ_ Variables Program 2.17 Ketones by Controlled_Diabetic Output 2.15 Ketones by Controlled_Diabetic Program 2.18 Ketones by Controlled_Diabetic for Two Classes Output 2.16 Ketones by Controlled_Diabetic for Two Classes Handling Missing Data with the MISSING Option Program 2.19 The MEANS Procedure of Glucose by AE_DURATION Including Missing Values Output 2.17a The MEANS Procedure of Glucose by AE_DURATION Including Missing Values Output 2.17b Glucose by AE_DURATION Including Missing Values Key Terms Chapter Quiz Chapter 3: Data Visualization Introduction View and Interpret Categorical Data Frequency and Crosstabulation Tables Using the FREQ Procedure Procedure Syntax for PROC FREQ Figure 3.1 Diabetic Care Management Case Data Program 3.1 Frequency Tables of GENDER, AGE_RANGE, and CONTROLLED_DIABETIC Output 3.1 Frequency Tables of GENDER, AGE_RANGE, and CONTROLLED_DIABETIC PLOTS Options within the TABLES Statement Program 3.2 Frequency Table and Bar Chart of GENDER Output 3.2 Frequency Table and Bar Chart of GENDER Crosstabulations for Illustrating Associations between Two Categorical Variables Program 3.3 Crosstabulation of Gender by Diabetes Status Output 3.3a Crosstabulation of Gender by Diabetes Status Output 3.3b Crosstabulation of Gender by Diabetes Status: Frequency Pots of Gender by Diabetes Status Program 3.4 Cross Tabs and Frequency Plots of Diabetes Status and Renal Disease Output 3.4 Cross Tabs and Frequency Plots of Diabetes Status and Renal Disease MISSING Option within the TABLES Statement Program 3.5 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Excluded Output 3.5 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Excluded Program 3.6 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Included Output 3.6 Crosstabulation of Diabetes Status and Primary Medication with Missing Obs Included View and Interpret Numeric Data Histograms Using the UNIVARIATE Procedure Figure 3.2 Histogram for Numeric Data Procedure Syntax for PROC UNIVARIATE Program 3.7 Univariate Statistics on BMI for 200 Diabetic Patients Output 3.7 Univariate Statistics on BMI for 200 Diabetic Patients Table 3.1 Summary Data for the Variable BMI Program 3.8 Histogram of the Variable BMI Output 3.8 Histogram of the Variable BMI Q-Q Plots Using the UNIVARIATE Procedure Table 3.2 Expected Z-Scores for Number of Texts Figure 3.3 Q-Q Plot for Number of Texts Interpreting the Q-Q Plots Program 3.9 Q-Q Plot for the Variable BMI Output 3.9 Q-Q Plot for the Variable BMI Box-and-Whisker Plot Using the UNIVARIATE Procedure Calculating Quartiles for Five-Number Summary Figure 3.4 Box Plot for Number of Texts Interpreting the Box Plot Program 3.10 Distribution and Probability Plot for BMI Output 3.10 Distribution and Probability Plot for BMI UNIVARIATE Procedures Using the INSET Statement Program 3.11 Histogram with Descriptive Statistics of BMI Output 3.11 Histogram with Descriptive Statistics of BMI UNIVARIATE Procedures Using the CLASS Statement Program 3.12 Histogram of Pounds with Descriptive Statistics by Gender Output 3.12 Histogram of Pounds with Descriptive Statistics by Gender Visual Analyses Using the SGPLOT Procedure Procedure Syntax for PROC SGPLOT Exploring Bivariate Relationships with Basic Plots, Fits, and Confidence The SCATTER and REG Statements Program 3.13 Scatter Plot of Systolic and Diastolic Blood Pressure Output 3.13 Scatter Plot of Systolic and Diastolic Blood Pressure Program 3.14 Regression Line and Confidence Limits on Bivariate Scatter Plot Output 3.14 Regression Line and Confidence Limits on Bivariate Scatter Plot Program 3.15 Scatter Plot of Price by Quantity Sold Output 3.15 Scatter Plot of Price by Quantity Sold Program 3.16 Scatter Plot of Weight and Blood Pressure by Gender Output 3.16a Scatter Plot of Weight and Blood Pressure by Gender Output 3.16b Scatter Plot of Weight by Systolic Blood Pressure by Gender Exploring Other Relationships Using SGPLOT Program 3.17 Vertical Bar Charts for Diabetes Status Output 3.17 Vertical Bar Charts for Diabetes Status Program 3.18 Bar Chart of Diabetes Status by Renal Disease Output 3.18a Bar Chart of Diabetes Status by Renal Disease Output 3.18b Numbers with Renal Diseases by Diabetes Status Program 3.19 Bar Charts for Diastolic and Systolic BP by Diabetes Status Output 3.19 Bar Charts for Diastolic and Systolic BP by Diabetes Status Key Terms Chapter Quiz Chapter 4: The Normal Distribution and Introduction to Inferential Statistics Introduction Continuous Random Variables Normal Random Variables Figure 4.1 Distributions of Adult Weights for Three Populations The Empirical Rule Figure 4.2 Visualization of the Empirical Rule Figure 4.3 Empirical Rule Applied to Height of Diabetic Males Program 4.1 Actual Percentage of Males Having Heights within 1, 2, and 3 Standard Deviations from the Mean Output 4.1 Actual Percentage of Males Having Heights within 1, 2, and 3 Standard Deviations from the Mean The Standard Normal Distribution Figure 4.4 Proportion of Z-values Less Than -1.15, P(Z < -1.15) Table 4.1 Excerpt from Standard Normal Cumulative Area (for Z ≤ 0) Figure 4.5 Proportion of Z-values Less Than 1.15, P(Z +1.15) Figure 4.7 Proportion of Z-Values between -1.00 and +1.00, P(-1.00 < Z < +1.00) Figure 4.8 Proportion of Z-Values between -1.96 and +1.96, P(-1.96 < Z +1.77 Effects of Sample Size on the Sampling Distribution Figure 4.15 Sampling Distribution of the Mean for Two Sample Sizes Introduction to Hypothesis Testing Defining the Null and Alternative Hypotheses Figure 4.16 Rejection Region for a Two-Tailed Test Figure 4.17 Rejection Region for a Lower-Tailed Test Figure 4.18 Rejection Region for an Upper-Tailed Test Defining and Controlling Errors in Hypothesis Testing Hypothesis Testing for the Population Mean (σ Known) Two-Tailed Tests for the Population Mean (μ) Figure 4.19 Rejection Region for a Two-Tailed Test at α = 0.05 Table 4.3 Finding Z-Value Associated with 0.025 Area in the Lower Tail Figure 4.20 Critical Values for a Two-Tailed Test at α = 0.05 One-Tailed Tests for the Population Mean (μ) Figure 4.21 Critical Value for a One-Tailed Test at α = 0.05 Figure 4.22 Test Statistic Compared to the Critical Value Table 4.4 Critical Values Based upon α-Level and One-Tailed versus Two-Tailed Tests Hypothesis Testing Using the P-Value Approach Figure 4.23 p-Value for a One-Tailed Test The P-Value for the Two-Tailed Hypothesis Test Figure 4.24 p-Value for a Two-Tailed Test Hypothesis Testing for the Population Mean (σ Unknown) One-Tailed Tests for the Population Mean (μ) Figure 4.25 The t-Distribution for Various Sample Sizes Table 4.5 Descriptive Statistics of BMI for 25 Female Diabetic Patients Table 4.6 Excerpt from the t-Table Figure 4.26 t-Test Statistic Compared to the Critical Value Procedure Syntax for PROC TTEST Program 4.3 t-Test of BMI for Female Diabetics Output 4.3 t-Test of BMI for Female Diabetics Confidence Intervals for Estimating the Population Mean Confidence Interval for the Population Mean (σ Known) Figure 4.27 Confidence Intervals as Related to the Sampling Distribution Effects of Level of Confidence and Sample Size on Confidence Intervals Confidence Interval for the Population Mean (σ Unknown) Key Terms Chapter Quiz Chapter 5: Analysis of Categorical Variables Introduction Testing the Independence of Two Categorical Variables Hypothesis Testing and the Chi-Square Test Table 5.1 Expected Frequency Count of Online Shopping by Gender Table 5.2 Observed and Expected Frequencies Count of Online Shopping by Gender Figure 5.1 Bivariate Bar Charts of Gender and Online Shopping The Chi-Square Test Using the FREQ Procedure Procedure Syntax for PROC FREQ Program 5.1 Testing Association between Bonus and Kitchen Quality Output 5.1a Testing Association between Bonus and Kitchen Quality Output 5.1b Testing Association between Bonus and Kitchen Quality: Bivariate Bar Charts of Bonus and Kitchen Quality Assumptions Measuring the Strength of Association between Two Categorical Variables Cramer’s V The Odds Ratio Table 5.3 General Form of the 2x2 Contingency Table Using Chi-Square Tests for Exploration Prior to Predictive Analytics Program 5.2 Testing Association between Bonus and Corner Lot Output 5.2a Testing Association between Bonus and Corner Lot Output 5.2b Testing Association between Bonus and Corner Lot: Bivariate Bar Charts of Bonus and Corner Lot Key Terms Chapter Quiz Chapter 6: Two-Sample t-Test Introduction Independent Samples The Pooled Variance t-Test Assumptions Procedure Syntax of PROC TTEST Procedure Program 6.1 Independent Samples t-Test for Mean Differences in Above Ground Living Area Output 6.1a Independent Samples t-Test for Ames Housing, Above Ground Living Area by Bonus Testing the Equal Variance Assumption Using the Folded F-Test Verifying the Assumptions of a Two-Sample t-Test Output 6.1b Normal Probability Plots for Above Ground Living Area by Bonus Supplemental Plots for Data Visualization Output 6.1c Histograms and Box Plots for Above Ground Living Area by Bonus Testing the Normality Assumption Using the Kolmogorov-Smirnov Test Program 6.2 Kolmogorov-Smirnov Test of Normality for Above Ground Living Area by Bonus Output 6.2 Kolmogorov-Smirnov Test of Normality for Above Ground Living Area by Bonus Satterthwaite t-Test for Unequal Variances Program 6.3 Independent Samples t-Test for Mean Differences in Total Basement Area Output 6.3 Independent Sample t-Test for Ames Housing, Total Basement Area by Bonus Summary of Steps for the t-Test of Two Independent Populations Paired Samples Assumptions The Paired-Sample t-Test Using the PAIRED Statement in the TTEST Procedure Table 6.1 Whitley County, Indiana, 2012 and 2016 Tax Assessed Property Values Sample Data Program 6.4 Kolmogorov-Smirnov Test of Normality Assumption on the Difference Score Using the UNIVARIATE Procedure Output 6.4a Kolmogorov-Smirnov Test of Normality Assumption on the Difference Score Using the UNIVARIATE Procedure Output 6.4b Paired t-Test Results for Differences in Tax Assessed Property Values Output 6.4c Accompanying Plots for the Paired-Sample t-Test Key Terms Chapter Quiz Chapter 7: Analysis of Variance (ANOVA) Introduction One-Factor Analysis of Variance The One-Factor ANOVA Model Constructing the Test Statistic: Estimating Variance among Groups and Variance within Groups Table 7.1 Deviations within and across Groups Table 7.2 Squared Deviations within and across Groups Figure 7.1 The F-Distribution Table 7.3 General Form of the Analysis of Variance Table The GLM Procedure for Investigating Mean Differences Program 7.1 Descriptive Statistics for Computer Anxiety by Academic Major Output 7.1 Exploration of Computer Anxiety by Academic Major Program 7.2 One-Way ANOVA for Testing Differences in Computer Anxiety Output 7.2 One-Way ANOVA for Testing Differences in Computer Anxiety Predicted Values and Residuals Using the OUTPUT Statement Program 7.3 Predicted Values and Residuals for Computer Anxiety Scores Output 7.3 Predicted Values and Residuals for Computer Anxiety Scores Measures of Fit The Normality Assumption and the PLOTS Option Output 7.4 Fit Diagnostics for the One-Way Analysis of Variance Levene’s Test for Equal Variances and the MEANS Statement Program 7.4 The MEANS Statement for Additional Tests of Computer Anxiety Scores Output 7.5 Levene’s Homogeneity of Variance Test for Computer Anxiety Scores Post Hoc Tests: The Tukey-Kramer Procedure and the MEANS Statement Output 7.6 Tukey-Kramer for Testing Pairwise Differences in Computer Anxiety Other Post Hoc Procedures, the LSMEANS Statement, and the Diffogram Output 7.7 LSMEANS Statement for Testing Pairwise Differences in Computer Anxiety Output 7.8 Dunnett Adjustment for Testing Pairwise Differences in Computer Anxiety Program 7.5 Complete Analysis of Difference in Computer Anxiety Scores Across Academic Majors The Randomized Block Design The ANOVA Model for the Randomized Block Design Example and Interpretation of the Randomized Block Design Program 7.6 Exploration of Computer Anxiety by Academic Major and Block Output 7.9 Exploration of Computer Anxiety by Academic Major and Block Table 7.4 The ANOVA Table for the Randomized Block Design Program 7.7 Randomized Block Design for Testing Differences in Computer Anxiety Output 7.10 Randomized Block Design for Testing Differences in Computer Anxiety Post Hoc Tests Using the LSMEANS Statement Output 7.11 LSMEANS Statement for Testing Pairwise Differences in Computer Anxiety When Blocking Assessing the Assumptions of a Randomized Block Design Using the PLOTS Option Unbalanced Designs, the LSMEANS Statement, and Type III Sums of Squares Table 7.5 Cell Means and Sample Sizes for Computer Anxiety Scores Two-Factor Analysis of Variance The Two-Factor ANOVA Model Table 7.6 General Form of the Two-Factor ANOVA Table Example and Interpretation of the Two-Factor ANOVA Program 7.8 Exploration of Computer Anxiety by Academic Major and Gender Output 7.12 Descriptive Statistics for Computer Anxiety by Academic Major and Gender Figure 7.2 Mean Computer Anxiety Scores by Academic Major and Gender Program 7.9 Two-Factor ANOVA for Testing Differences in Computer Anxiety Output 7.13a Two-Factor ANOVA for Testing Differences in Computer Anxiety Output 7.13b Least Squares Means for Major by Gender Interaction Effects Output 7.13c Diffogram of MAJOR by GENDER Means Analyzing Simple Effects When Interaction Exists Using the LSMEANS Statement with the SLICE Option Output 7.13d Analysis of Simple Effects in the Presence of Interaction Assessing the Assumptions of a Two-Factor Analysis of Variance Key Terms Chapter Quiz Chapter 8: Preparing the Input Variables for Prediction Introduction Missing Values Complete-Case Analysis Using Imputation with a Missing Value Indicator Program 8.1 Ames Housing Data with Missing Values Output 8.1 Ames Housing Data with Missing Values Program 8.2 Ames Housing with Imputed Data Output 8.2 Ames Housing with Imputed Data Categorical Input Variables Sparse Events and Quasi-Complete Separation Greenacre’s Method Using the CLUSTER Procedure Table 8.1 Contingency Table of Bonus by Neighborhood Program 8.3 Combining Neighborhoods from Ames Data Housing Using Greenacre’s Method Output 8.3a Chi-square for Bonus by Neighborhood Output 8.3b Proportion of Houses with Bonus by Neighborhood Output 8.3c Results of Cluster Analysis on Ames Neighborhoods Output 8.3d Dendrogram of Cluster Analysis Results by Neighborhoods Output 8.3e Contents of the Cluster History Output 8.3f Log P-Value Information and the Cluster History Output 8.3g Plot of Log P-Value by Number of Clusters Output 8.3h List of Neighborhoods by Cluster Table 8.2 Contingency Table of Bonus by Clustered Neighborhoods Variable Clustering The VARCLUS Procedure for Variable Reduction Table 8.3 Correlation Matrix for Variables Q1 through Q6 Procedure Syntax for PROC VARCLUS Program 8.4 The VARCLUS Procedure for Reducing Ames Housing Inputs Output 8.4a Summary Information for VARCLUS Procedure for Ames Housing Input Data Output 8.4b Cluster Summary for 2 Clusters for Ames Housing Input Data Output 8.4c Cluster Summary for 23 Clusters for Ames Housing Input Data Output 8.4d R-Squared with Own Cluster and Next Closest Cluster for Ames Housing Input Data Output 8.4e Summary of Cluster Splitting by Stage Output 8.4f Dendrogram Illustration of Cluster Splits for Ames Housing Input Data Cluster Representative and Best Variable Selection Table 8.4 Reduced Set of Inputs After Deleting Redundant Variables for Ames Housing Variable Screening The CORR Procedure for Detecting Associations Program 8.5 Description of Input Variables Screened for Relevance for Ames Housing Data Output 8.5a Summary of Input Variables Screened for Relevance for Ames Housing Data Output 8.5b ODS Output of Spearman Data Output 8.5c Spearman’s and Hoeffding’s D Correlation Data Sorted by Spearman’s Rank Output 8.5d Rank of Spearman’s Correlation by Rank of Hoeffding’s D Using the Empirical Logit to Detect Non-Linear Associations Program 8.6 Plot of Empirical Logit by Bsmt_Unf_SF Output 8.6a Value of Bsmt_Unf_SF and Bin Variables for the First Eight Houses in Ames Housing Output 8.6b Total Frequency, Number of Houses Earning a Bonus, and Average Bsmt_Unf_SF by Bin Output 8.6c Empirical Logit by the Variable Bsmt_Unf_SF Key Terms Chapter Quiz Chapter 9: Linear Regression Analysis Introduction Exploring the Relationship between Two Continuous Variables Exploring the Relationship between Two Continuous Variables Using a Scatter Plot Program 9.1 Scatter Plot of Sale Price by Above Ground Living Area Output 9.1 Scatter Plot of Sale Price and Above Ground Living Area Program 9.2 Scatter Plot of Sale Price and Age at Time of Sale Output 9.2 Scatter Plot of Sale Price and Age at Time of Sale Program 9.3 Scatter Plot of Sale Price and Square Footage Output 9.3 Scatter Plot of Sale Price and Square Footage Quantifying the Degree of Association between Two Continuous Variables Using Correlation Statistics Figure 9.1 Scatter Plot of Perfect Positive, Perfect Negative, and No Relationship Producing Correlation Coefficients Using the CORR Procedure Program 9.4 Correlation Coefficient and Descriptive Statistics for Ames Housing Output 9.4 Correlation Coefficients and Descriptive Statistics for Ames Housing Program 9.5 Correlation Coefficients with Sale Price for Ames Housing Output 9.5a Correlation Coefficients with Sale Price for Ames Housing Output 9.5b Scatter Plots for Sale Price with Potential Predictors Testing the Hypothesis for a Bivariate Linear Relationship Using the CORR Procedure Understanding Potential Misuses of the Correlation Coefficient Simple Linear Regression Fitting a Simple Linear Regression Model Using the REG Procedure Figure 9.2 Fitting the Line Closest to All Points Program 9.6 Linear Regression for Predicting Sale Price with Ground Living Area Output 9.6 Linear Regression Output for Predicting Saleprice with Ground Living Area Measures of Fit for the Linear Regression Model The Coefficient of Determination (R2) The Standard Error of the Regression (Se) Using Measures of Fit to Compare Models Table 9.1 Measures of Fit for Simple Linear Regression Hypothesis Testing for the Slope The t-Test for Slope The F-Test for Slope Table 9.2 Analysis of Variance (ANOVA) Table for Linear Regression Producing Confidence Intervals Program 9.7 Confidence Interval for Effect of Gr_Liv_Area on Sale Price Output 9.7 Confidence Interval for Effect of Gr_Liv_Area on SalePrice Multiple Linear Regression Fitting a Multiple Linear Regression Model Using the REG Procedure Program 9.8 Multiple Linear Regression for Predicting Sale Price with Six Predictors Output 9.8 Multiple Linear Regression for Predicting SalePrice with Six Predictors Measures of Fit for the Multiple Linear Regression Model Adjusted R-Square Output 9.9 Multiple Linear Regression for Predicting SalePrice with Five Predictors Table 9.3 Measures of Fit for Multiple Linear Regression Quantifying the Relative Impact of a Predictor Program 9.9 Measures of Relative Predictor Importance in Multiple Linear Regression Output 9.10 Measure of Relative Predictor Impact in Multiple Linear Regression Checking for Collinearity Using VIF, COLLIN, and COLLINOINT The Variance Inflation Factor (VIF) for Detecting Collinearity The Condition Index (C) for Detecting Collinearity Program 9.10 VIF and Condition Numbers for Detecting Collinearity Output 9.11 VIF and Condition Numbers for Detecting Collinearity Fitting a Simple Linear Regression Model Using the GLM Procedure Program 9.11 PROC GLM for Prediction Using One Categorical Variable Output 9.12a PROC GLM for Prediction Using One Categorical Variable Output 9.12b Tukey Procedure for Detecting Differences in Mean Sale Price Program 9.12 PROC REG for Prediction Using One Categorical Variable Output 9.13 PROC REG for Prediction Using One Categorical Variable Variable Selection Using the REG and GLMSELECT Procedures The REG Procedure for Variable Selection All Possible Subsets Program 9.13 Best Subsets Regression Models Ranked by Adjusted R-Square Output 9.14 Best Subsets Regression Models Ranked by Adjusted R-Square Program 9.14 Best Subsets Regression Models Ranked by Mallows’ Cp Output 9.15a Mallows’ Cp Plot for Variable Selection Output 9.15b Best Subsets Regression Models Ranked by Mallows’ Cp Backward Elimination Program 9.15 Backward Elimination for the Ames Housing Case Output 9.16a Backward Elimination Step 0 Output 9.16b Backward Elimination Step 1 Output 9.16c Backward Elimination Step 2 Output 9.16d Backward Elimination Step 7 Output 9.16e Summary of Backward Elimination Output 9.16f Plot of Adjusted R-Square by Backward Elimination Step Forward Selection Program 9.16 Forward Selection for the Ames Housing Case Output 9.17a Forward Selection Step 1 Output 9.17b Forward Selection Step 2 Output 9.17c Forward Selection Step 7 Output 9.17d Summary of Forward Selection Output 9.17e Plot of Adjusted R-Square by Forward Selection Step Stepwise Selection Program 9.17 Stepwise Selection for the Ames Housing Case Program 9.18 Three Variable Selection Methods for the Ames Housing Case The GLMSELECT Procedure for Variable Selection Program 9.19 PROC GLMSELECT with Stepwise Selection for the Ames Housing Case Output 9.18a PROC GLMSELECT for Stepwise Selection Step 1 Output 9.18b PROC GLMSELECT for Stepwise Selection Step 2 Output 9.18c Summary for Stepwise Selection in PROC GLMSELECT Output 9.18d The Selected Model from Stepwise Selection in PROC GLMSELECT Other Features of the GLMSELECT Procedure Table 9.4 Default SLENTRY and SLSTAY Settings by Model Selection Method. Cautionary Note on Sequential Selection Methods Assessing the Validity of Results Using Regression Diagnostics The Assumptions of Linear Regression Residual Analysis for Checking Assumptions Figure 9.3 Fit Plot and Residual Plot for Illustrating a Linear Trend with Constant Variance Figure 9.4 Residual Plot Illustrating a Curvilinear Trend Figure 9.5 Residual Plot Illustrating Unequal Variance Figure 9.6 Residual Plot Illustrating Autocorrelation Program 9.20 Linear Regression Analysis Diagnostics Panel Output 9.19a Linear Regression on Revenue with Diagnostics Panel Output 9.19b Predicted Revenue and Residuals Using the Predictor AdExpense Program 9.21 Linear Regression Analysis Using Transformed Ad Expense (LnAdExp) Output 9.20 Linear Regression on Revenue Using Transformed Ad Expense (LnAdExp) Program 9.22 Diagnostics for Multiple Linear Regression Output 9.21a Multiple Linear Regression for Predicting SalePrice Output 9.21b Residual by Predicted Plot and Q-Q Plot of Residuals for SalePrice Output 9.21c Panel of Residual by Regressors for SalePrice Studentized Residuals Program 9.23 Residuals and Studentized Residuals by AdExpense for Saleprice Output 9.22a Residual and Studentized Residuals by AdExpense for SalePrice Output 9.22b Residuals and Studentized Residuals by AdExpense for Saleprice Using Statistics to Identify Potential Influential Observations Program 9.24 Comparing Regression Lines Based on Influence of Obs 15 Output 9.23 Comparing Regression Lines Based on Influence of Obs 15 Leverage (hii) Discrepancy (RSTUDENTi) Influence Program 9.25 Identifying Suspicious Observations Using Measures of Influence Output 9.24a Linear Regression Output for SalePrice with Influential Observation Output 9.24b Leverage by RStudent Plot Output 9.24c Cook’s D and DFFITS Plots for Detecting Influence Output 9.24d Deletion Statistics for Detecting Influence Output 9.25 Influence Statistics Using the INFLUENCE Option Program 9.26 DFBETA Plots for Assessing Local Influence Output 9.26 DFBETA Plots for Assessing Local Influence Program 9.27 Regression Diagnostics for the Ames Housing Case Output 9.27a Influence Panels and Influential Observations for Ames Housing Output 9.27b Observations Flagged as Influential for Ames Housing Recommendations for Handling Influential Observations Concluding Remarks Key Terms Chapter Quiz Chapter 10: Logistic Regression Analysis Introduction The Logistic