Data Analytics assignment

profilesaikumar.battula
MindTapCourseListS.ChristianAlbrightWayneL.Winston-BusinessAnalytics_DataAnalysisDecisionMaking-CengageLearning2016.pdf

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

This is an electronic version of the print textbook. Due to electronic rights restrictions, some third party content may be suppressed. Editorial review has deemed that any suppressed

content does not materially affect the overall learning experience. The publisher reserves the right to remove content from this title at any time if subsequent rights restrictions require it. For

valuable information on pricing, previous editions, changes to current editions, and alternate formats, please visit www.cengage.com/highered to search by ISBN, author, title, or keyword for

materials in your areas of interest.

Important notice: Media content referenced within the product description or the product text may not be available in the eBook version.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Overview of Applications in the Book, by Discipline

Accounting Accounts receivable 285, 297 Auditing for price errors 329 Developing a flexible budget 537 Estimating total tax refunds 325 Estimating total taxable income 325 Overhead cost analysis 423, 437, 471, 490, 520, 524

Economics/Government Demand and cost for electricity 461 Demand for desktops and laptops 402 Demand for French bread 481 Demand for heating oil 536 Demand for microwaves 182 Electricity pricing 736 Home and condo prices 78 Housing price structure 480 Presidential elections 19 Sales of new houses 566, 572

Finance Bond investment strategy 893 Capital budgeting 714 Cash management 852 DJIA index 58, 77 Investing for college 892 Investing for retirement 481, 857 Investment strategy 703 Investor’s after-tax profit 181 Land purchase decision 274 Liquidity risk management 829 Market return scenarios 152, 157 Mutual fund returns 171, 195 New car development 847 Pension fund management 708 Portfolio analysis 743 Random walk of stock prices 562 Stock hedging 757

Human Resources Employee empowerment 389 Employee retention 361 Gender discrimination 450, 457, 514 Jobs in statistics and mathematics 897 Personnel testing 178 Productivity due to exercise 384

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Marketing Catalog marketing 503, 508 Churn in cellular phone market 136 Clustering shoe customers 934 Customer complaints 349, 378 Customer valuation 865 DVD movie renters 310 Electronics sales 108 Frozen lasagna dinner buyers 125, 915, 919, 923 Furniture pricing 480 Marketing and selling condos 873 New pizza style decisions 365, 373 New product decisions 233, 240, 243, 260 Olympics sponsors 363 Response to new sandwich 319, 346, 348 Running shoe style decisions 274 Sales presentation ratings 339 Sales response to coupons 343 Sales versus promotions 421, 433 Soft-drink can style decisions 380 Supermarket sales 197 Supermarket transactions 27 Value of free maintenance agreement 868

Miscellaneous Statistical Crime in the U.S. 54 Cruise ship entertainment 16 Election returns 200 Family income sampling 283 Forecasting U.S. population 557 IQ and bell curve 166 Predictors of successful movies 79, 482 Questionnaire responses 23 Relationship between smoking and drinking 82 Removing Vioxx from market 412 Sample size determination in legal case 279 Saving, spending, social climbing 136 Simpson’s paradox 165 University admissions 360

Operations Management Aggregate planning 693 Airline boarding strategies 759 Airline hub location decisions 729 Arrivals at bank 135 Automobile production 755 Battery lifetimes 191 Bidding for contracts 831 Blending oil 670 Developing Army helicopter component 276

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Developing electronic timing system 275 Delivery times at restaurant 361 Distribution of metal strip widths 396 Employee scheduling 663 Expensive watch production 219 Forecasting sales 551, 554, 559, 566, 572, 576, 581, 586 Inventory management 208 Learning curve for production 466 Manufacturing plastics operations 599 Ordering decisions 781, 784, 796, 806, 812, 815 Out-of-spec products 350 Overbooking at airlines 198 Product mix decisions 603, 631, 721 Production quantity decisions 827, 828 Production scheduling 641, 840 Production, inventory, distribution decisions 661 Quality control at paper company 179 Reliability of motors 336 Site selection of motor inns 417 Timing uncertainty in construction 144 Transportation, logistics decisions 677, 686 Variability in machine parts 333 Warranty costs 835

Sports/Gaming Baseball salaries 31, 40, 46, 49, 88 Games at McDonald’s 139 Golf stats on PGA tour 95 NCAA basketball tournament simulation 882 Revenue management at casino 539 Streak shooting in basketball 201 Wheel of fortune simulation 300 Winning at craps 879 Winning the lottery 220

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Australia • Brazil • Mexico • Singapore • United Kingdom • United States

Business Analytics: Data Analysis and Decision Making

6th Edition

S. Christian Albright Kelly School of Business, Indiana University, Emeritus

Wayne L. Winston Kelly School of Business, Indiana University

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Business Analytics: Data Analysis & Decision Making, Sixth Edition

S. Christian Albright and Wayne L. Winston

Vice President, General Manager, Social Science & Qualitative Business: Balraj Kalsi

Product Director: Mike Schenk

Product Manager: Aaron Arnsparger

Associate Content Developer: Brad Sullender

Product Assistant: Audrey Jacobs

Sr. Marketing Manager: Nathan Anderson

Manufacturing Planner: Ron J. Montgomery

Art and Cover Direction, Production Management, and Composition: Lumina Datamatics, Inc.

Cover Image: iStockphoto.com/derrrek

Intellectual Property

Analyst: Brittani Morgan

Project Manager: Nick Barrows

© 2017, 2015 Cengage Learning®

For product information and technology assistance, contact us at Cengage Learning Customer & Sales Support, 1-800-354-9706

For permission to use material from this text or product, submit all requests online at www.cengage.com/permissions

Further permissions questions can be emailed to [email protected]

ALL RIGHTS RESERVED. No part of this work covered by the copyright herein may be reproduced or distributed in any form or by any means, except as permitted by U.S. copyright law, without the prior written permission of the copyright owner.

Library of Congress Control Number: 2016934323

ISBN: 978-1-305-94754-2

Loose Leaf Edition ISBN: 978-1-305-86647-8

Cengage Learning 20 Channel Center Street Boston, MA 02210 USA

Cengage Learning is a leading provider of customized learning solutions with employees residing in nearly 40 different countries and sales in more than 125 countries around the world. Find your local representative at www.cengage.com.

Cengage Learning products are represented in Canada by Nelson Education, Ltd.

To learn more about Cengage Learning Solutions, visit www.cengage.com

Purchase any of our products at your local college store or at our preferred online store www.cengagebrain.com

Printed in the United States of America Print Number: 01 Print Year: 2016

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

To my wonderful wife Mary—my best friend and travel mate; to Sam, Lindsay, Teddy, and Archie; and to Bryn, our ball-playing Welsh corgi!Archie; and to Bryn, our ball-playing Welsh corgi! S.C.A

To my wonderful familyTo my wonderful family W.L.W.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

iv

S. Christian Albright got his B.S. degree in Mathematics from Stanford in 1968 and his PhD in Operations Research from Stanford in 1972. He taught in the Operations & Decision Technologies Department in the Kelley School of Business at Indiana University (IU) for close to 40 years, before retiring from teaching in 2011. While at IU, he taught courses in management science, computer simulation, statistics, and computer programming to all levels of business students, including undergraduates, MBAs, and doctoral students. In addition,

he taught simulation modeling at General Motors and Whirlpool, and he taught database analysis for the Army. He published over 20 articles in leading operations research journals in the area of applied probability, and he has authored the books Statistics for Business and Economics, Practical Management Science, Spreadsheet Modeling and Applications, Data Analysis for Managers, and VBA for Modelers. He worked for several years after “retirement” with the Palisade Corporation developing training materials for its software products, he has developed a commercial version of his Excel® tutorial, called ExcelNow!, and he continues to revise his textbooks.

On the personal side, Chris has been married for 44 years to his wonderful wife, Mary, who retired several years ago after teaching 7th grade English for 30 years. They have one son, Sam, who lives in Philadelphia with his wife Lindsay and their two sons, Teddy and Archer. Chris has many interests outside the academic area. They include activities with his family (especially traveling with Mary), going to cultural events at IU, power walking while listening to books on his iPod, and reading. And although he earns his livelihood from statistics and management science, his real passion is for playing real passion is for playing real classical piano music.

Wayne L. Winston taught in the Operations & Decision Technologies Department in the Kelley School of Business at Indiana University for close to 40 before retiring a few years ago. Wayne received his B.S. degree in Mathematics from MIT and his PhD in Operations Research from Yale. He has written the successful textbooks Operations Research: Applications and Algorithms, Mathematical Programming: Applications and Algorithms, Simulation Modeling Using @RISK, Practical Management Science, Data Analysis and Decision Making, Financial Models

Using Simulation and Optimization, and Mathletics. Wayne has published more than 20 articles in leading journals and has won many teaching awards, including the school-wide MBA award four times. He has taught classes at Microsoft, GM, Ford, Eli Lilly, Bristol-Myers Squibb, Arthur Andersen, Roche, PricewaterhouseCoopers, and NCR, and in “retirement,” he is currently teaching several courses at the

About the Authors

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

v

University of Houston. His current interest is showing how spreadsheet models can be used to solve business problems in all disciplines, particularly in finance and marketing.

Wayne enjoys swimming and basketball, and his passion for trivia won him an appearance several years ago on the television game show Jeopardy!, where he won two games. He is married to the lovely and talented Vivian. They have two children, Gregory and Jennifer.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

vi

Brief Contents

Preface xviii 1 Introduction to Business Analytics 1

Part 1 Exploring Data 17 2 Describing the Distribution of a Single Variable 19 3 Finding Relationships among Variables 79

Part 2 Probability and Decision Making Under Uncertainty 137

4 Probability and Probability Distributions 139 5 Normal, Binomial, Poisson, and Exponential Distributions 166 6 Decision Making under Uncertainty 222

Part 3 Statistical Inference 277 7 Sampling and Sampling Distributions 279 8 Confidence Interval Estimation 311 9 Hypothesis Testing 363

Part 4 Regression Analysis and Time Series Forecasting 415 10 Regression Analysis: Estimating Relationships 417 11 Regression Analysis: Statistical Inference 482 12 Time Series Analysis and Forecasting 539

Part 5 Optimization and Simulation Modeling 597 13 Introduction to Optimization Modeling 599 14 Optimization Models 661 15 Introduction to Simulation Modeling 759 16 Simulation Models 829

Part 6 Advanced Data Analysis 895 17 Data Mining 897

Introduction to Spreadsheet Modeling (only in MindTap)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Brief Contents vii

Part 7 Bonus Online Material* 18-1 18 Importing Data into Excel 18-3 19 Analysis of Variance and Experimental Design 19-1 20 Statistical Process Control 20-1 Appendix A Statistical Reporting A-1

•Bonus Online Material for this text can be found on the text companion website at cengagebrain.com.

References 943 Index 945

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

viii

Contents

Preface xviii

1 Introduction to Business Analytics 1 1-1 Introduction 3 1-2 Overview of the Book 4

1-2a The Methods 4 1-2b The Software 7

1-3 Modeling and Models 10 1-3a Graphical Models 10 1-3b Algebraic Models 11 1-3c Spreadsheet Models 12 1-3d A Seven-Step Modeling Process 13

1-4 Conclusion 15

PART 1 EXPLORING DATA 17

2 Describing the Distribution of a Single Variable 19 2-1 Introduction 21 2-2 Basic Concepts 22

2-2a Populations and Samples 22 2-2b Data Sets, Variables, and Observations 23 2-2c Types of Data 24

2-3 Descriptive Measures for Categorical Variables 26 2-4 Descriptive Measures for Numerical Variables 30

2-4a Numerical Summary Measures 31 2-4b Numerical Summary Measures with StatTools 40 2-4c Analysis ToolPak Add-In 45 2-4d Charts for Numerical Variables 45

2-5 Time Series Data 54 2-6 Outliers and Missing Values 61

2-6a Outliers 61 2-6b Missing Values 61

2-7 Excel Tables for Filtering, Sorting, and Summarizing 63 2-8 Conclusion 71

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Contents ix

3 Finding Relationships among Variables 79 3-1 Introduction 80 3-2 Relationships among Categorical Variables 82 3-3 Relationships among Categorical Variables and a Numerical Variable 86

3-3a Stacked and Unstacked Formats 86 3-4 Relationships among Numerical Variables 95

3-4a Scatterplots 95 3-4b Correlation and Covariance 101

3-5 Pivot Tables 108 3-6 Conclusion 131

PART 2 PROBABILITY AND DECISION MAKING UNDER UNCERTAINTY 137

4 Probability and Probability Distributions 139 4-1 Introduction 140 4-2 Probability Essentials 142

4-2a Rule of Complements 142 4-2b Addition Rule 142 4-2c Conditional Probability and the Multiplication Rule 143 4-2d Probabilistic Independence 146 4-2e Equally Likely Events 147 4-2f Subjective Versus Objective Probabilities 147

4-3 Probability Distribution of a Single Random Variable 150 4-3a Summary Measures of a Probability Distribution 151 4-3b Conditional Mean and Variance 154

4-4 Introduction to Simulation 156 4-5 Conclusion 160

5 Normal, Binomial, Poisson, and Exponential Distributions 166 5-1 Introduction 167 5-2 The Normal Distribution 168

5-2a Continuous Distributions and Density Functions 168 5-2b The Normal Density 169 5-2c Standardizing: Z-ValuesZ-ValuesZ 170 5-2d Normal Tables and Z-ValuesZ-ValuesZ 172 5-2e Normal Calculations in Excel 174 5-2f5-2f Empirical Rules Revisited 177 5-2g Weighted Sums of Normal Random Variables 177

5-3 Applications of the Normal Distribution 178

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

x Contents

5-4 The Binomial Distribution 190 5-4a Mean and Standard Deviation of the Binomial Distribution 193 5-4b The Binomial Distribution in the Context of Sampling 193 5-4c The Normal Approximation to the Binomial 194

5-5 Applications of the Binomial Distribution 195 5-6 The Poisson and Exponential Distributions 207

5-6a The Poisson Distribution 207 5-6b The Exponential Distribution 210

5-7 Conclusion 212

6 Decision Making under Uncertainty 222 6-1 Introduction 223 6-2 Elements of Decision Analysis 225

6-2a Identifying the Problem 225 6-2b Possible Decisions 226 6-2c Possible Outcomes 226 6-2d Probabilities of Outcomes 226 6-2e Payoffs and Costs 227 6-2f6-2f Decision Criterion 227 6-2g More about the EMV Criterion 228 6-2h Decision Trees 230

6-3 One-Stage Decision Problems 232 6-4 The PrecisionTree Add-In 236 6-5 Multistage Decision Problems 239 6-6 The Role of Risk Aversion 257

6-6a Utility Functions 258 6-6b Exponential Utility 259 6-6c Certainty Equivalents 262 6-6d Is Expected Utility Maximization Used? 263

6-7 Conclusion 264

PART 3 STATISTICAL INFERENCE 277

7 Sampling and Sampling Distributions 279 7-1 Introduction 280 7-2 Sampling Terminology 280 7-3 Methods for Selecting Random Samples 282

7-3a Simple Random Sampling 282 7-3b Systematic Sampling 287 7-3c Stratified Sampling 288 7-3d Cluster Sampling 289 7-3e Multistage Sampling Schemes 290

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Contents xi

7-4 Introduction to Estimation 292 7-4a Sources of Estimation Error 292 7-4b Key Terms in Sampling 293 7-4c Sampling Distribution of the Sample Mean 295 7-4d The Central Limit Theorem 299 7-4e Sample Size Selection 304 7-4f7-4f Summary of Key Ideas for Simple Random Sampling 305

7-5 Conclusion 307

8 Confidence Interval Estimation 311 8-1 Introduction 312 8-2 Sampling Distributions 314

8-2a The t Distributiont Distributiont 314 8-2b Other Sampling Distributions 317

8-3 Confidence Interval for a Mean 317 8-4 Confidence Interval for a Total 324 8-5 Confidence Interval for a Proportion 326 8-6 Confidence Interval for a Standard Deviation 331 8-7 Confidence Interval for the Difference between Means 335

8-7a Independent Samples 335 8-7b Paired Samples 339

8-8 Confidence Interval for the Difference between Proportions 342 8-9 Sample Size Selection 344

8-9a Sample Size Selection for Estimation of the Mean 345 8-9b Sample Size Selection for Estimation of Other Parameters 347

8-10 Conclusion 352

9 Hypothesis Testing 363 9-1 Introduction 364 9-2 Concepts in Hypothesis Testing 365

9-2a Null and Alternative Hypotheses 366 9-2b One-Tailed Versus Two-Tailed Tests 366 9-2c Types of Errors 367 9-2d Significance Level and Rejection Region 368 9-2e Significance from p-valuesp-valuesp 368 9-2f Type II Errors and Power 370 9-2g Hypothesis Tests and Confidence Intervals 371 9-2h Practical versus Statistical Significance 371

9-3 Hypothesis Tests for a Population Mean 372 9-4 Hypothesis Tests for Other Parameters 377

9-4a Hypothesis Tests for a Population Proportion 377 9-4b Hypothesis Tests for Differences between Population Means 379

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xii Contents

9-4c Hypothesis Test for Equal Population Variances 387 9-4d Hypothesis Tests for Differences between Population Proportions 388

9-5 Tests for Normality 395 9-6 Chi-Square Test for Independence 401 9-7 Conclusion 406

PART 4 REGRESSION ANALYSIS AND TIME SERIES FORECASTING 415

10 Regression Analysis: Estimating Relationships 417 10-1 Introduction 418 10-2 Scatterplots: Graphing Relationships 421

10-2a Linear versus Nonlinear Relationships 426 10-2b Outliers 426 10-2c Unequal Variance 427 10-2d No Relationship 427

10-3 Correlations: Indicators of Linear Relationships 428 10-4 Simple Linear Regression 430

10-4a Least Squares Estimation 430 10-4b Standard Error of Estimate 438 10-4c The Percentage of Variation Explained: R-Square 440

10-5 Multiple Regression 443 10-5a Interpretation of Regression Coefficients 443 10-5b Interpretation of Standard Error of Estimate and R-Square 446

10-6 Modeling Possibilities 449 10-6a Dummy Variables 450 10-6b Interaction Variables 456 10-6c Nonlinear Transformations 460

10-7 Validation of the Fit 470 10-8 Conclusion 472

11 Regression Analysis: Statistical Inference 482 11-1 Introduction 484 11-2 The Statistical Model 484 11-3 Inferences about the Regression Coefficients 488

11-3a Sampling Distribution of the Regression Coefficients 489 11-3b Hypothesis Tests for the Regression Coefficients and p-Valuesp-Valuesp 491 11-3c A Test for the Overall Fit: The ANOVA Table 492

11-4 Multicollinearity 496 11-5 Include/Exclude Decisions 502 11-6 Stepwise Regression 507 11-7 Outliers 512

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Contents xiii

11-8 Violations of Regression Assumptions 517 11-8a Nonconstant Error Variance 517 11-8b Nonnormality of Residuals 518 11-8c Autocorrelated Residuals 519

11-9 Prediction 521 11-10 Conclusion 527

12 Time Series Analysis and Forecasting 539 12-1 Introduction 540 12-2 Forecasting Methods: An Overview 541

12-2a Extrapolation Models 541 12-2b Econometric Models 542 12-2c Combining Forecasts 543 12-2d Components of Time Series Data 543 12-2e Measures of Accuracy 546

12-3 Testing for Randomness 548 12-3a The Runs Test 550 12-3b Autocorrelation 552

12-4 Regression-Based Trend Models 556 12-4a Linear Trend 556 12-4b Exponential Trend 559

12-5 The Random Walk Model 562 12-6 Moving Averages Forecasts 565 12-7 Exponential Smoothing Forecasts 570

12-7a Simple Exponential Smoothing 571 12-7b Holt’s Model for Trend 575

12-8 Seasonal Models 580 12-8a Winters’ Exponential Smoothing Model 581 12-8b Deseasonalizing: The Ratio-to-Moving-Averages Method 584 12-8c Estimating Seasonality with Regression 585

12-9 Conclusion 590

PART 5 OPTIMIZATION AND SIMULATION MODELING 597

13 Introduction to Optimization Modeling 599 13-1 Introduction 600 13-2 Introduction to Optimization 601 13-3 A Two-Variable Product Mix Model 602 13-4 Sensitivity Analysis 615

13-4a Solver’s Sensitivity Report 616 13-4b SolverTable Add-In 619 13-4c Comparison of Solver’s Sensitivity Report and SolverTable 626

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xiv Contents

13-5 Properties of Linear Models 626 13-6 Infeasibility and Unboundedness 629 13-7 A Larger Product Mix Model 631 13-8 A Multiperiod Production Model 640 13-9 A Comparison of Algebraic and Spreadsheet Models 649 13-10 A Decision Support System 750 13-11 Conclusion 652

14 Optimization Models 661 14-1 Introduction 662 14-2 Employee Scheduling Models 663 14-3 Blending Models 670 14-4 Logistics Models 676

14-4a Transportation Models 677 14-4b Other Logistics Models 685

14-5 Aggregate Planning Models 693 14-6 Financial Models 703 14-7 Integer Optimization Models 714

14-7a Capital Budgeting Models 714 14-7b Fixed-Cost Models 720 14-7c Set-Covering Models 729

14-8 Nonlinear Optimization Models 735 14-8a Basic Ideas of Nonlinear Optimization 735 14-8b Managerial Economics Models 736 14-8c Portfolio Optimization Models 740

14-9 Conclusion 749

15 Introduction to Simulation Modeling 759 15-1 Introduction 760 15-2 Probability Distributions for Input Variables 762

15-2a Types of Probability Distributions 763 15-2b Common Probability Distributions 766 15-2c Using @RISK to Explore Probability Distributions 770

15-3 Simulation and the Flaw of Averages 780 15-4 Simulation with Built-in Excel Tools 783 15-5 Introduction to @RISK 794

15-5a @RISK Features 795 15-5b Loading @RISK 795 15-5c @RISK Models with a Single Random Input Variable 796 15-5d Some Limitations of @RISK 806 15-5e @RISK Models with Several Random Input Variables 806

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Contents xv

15-6 The Effects of Input Distributions on Results 811 15-6a Effect of the Shape of the Input Distribution(s) 812 15-6b Effect of Correlated Input Variables 815

15-7 Conclusion 820

16 Simulation Models 829 16-1 Introduction 831 16-2 Operations Models 831

16-2a Bidding for Contracts 831 16-2b Warranty Costs 835 16-2c Drug Production with Uncertain Yield 840

16-3 Financial Models 847 16-3a Financial Planning Models 847 16-3b Cash Balance Models 852 16-3c Investment Models 857

16-4 Marketing Models 864 16-4a Models of Customer Loyalty 864 16-4b Marketing and Sales Models 872

16-5 Simulating Games of Chance 879 16-5a Simulating the Game of Craps 879 16-5b Simulating the NCAA Basketball Tournament 882

16-6 Conclusion 885

PART 6 ADVANCED DATA ANALYSIS 895

17 Data Mining 897 17-1 Introduction 898 17-2 Data Exploration and Visualization 900

17-2a Introduction to Relational Databases 900 17-2b Online Analytical Processing (OLAP) 901 17-2c Power Pivot and Self-Service BI Tools in Excel 904 17-2d Visualization Software 911

17-3 Classification Methods 912 17-3a Logistic Regression 913 17-3b Neural Networks 918 17-3c Naïve Bayes 923 17-3d Classification Trees 926 17-3e Measures of Classification Accuracy 927 17-3f17-3f Classification with Rare Events 930

17-4 Clustering 933 17-5 Conclusion 938

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xvi Contents

PART 7 BONUS ONLINE MATERIAL 18-1

18 Importing Data into Excel 18-3 18-1 Introduction 18-4 18-2 Rearranging Excel Data 18-5 18-3 Importing Text Data 18-9 18-4 Importing Data into Excel 18-15

18-4a Importing from Access with Old Tools 18-15 18-4b Importing from Access with Power Query 18-16 18-4c Using Microsoft Query 18-18 18-4d SQL Statements and M 18-26 18-4e Web Queries 18-26

18-5 Cleansing Data 18-28 18-6 Conclusion 18-35

19 Analysis of Variance and Experimental Design 19-1 19-1 Introduction 19-2 19-2 One-Way ANOVA 19-5

19-2a The Equal-Means Test 19-5 19-2b Confidence Intervals for Differences between Means 19-8 19-2c Using a Logarithmic Transformation 19-11

19-3 Using Regression to Perform ANOVA 19-17 19-4 The Multiple Comparison Problem 19-20 19-5 Two-Way ANOVA 19-24

19-5a Confidence Intervals for Contrasts 19-31 19-5b Assumptions of Two-Way ANOVA 19-34

19-6 More about Experimental Design 19-35 19-6a Randomization 19-36 19-6b Blocking 19-38 19-6c Incomplete Designs 19-42

19-7 Conclusion 19-45

20 Statistical Process Control 20-1 20-1 Introduction 20-3 20-2 Deming’s 14 Points 20-4 20-3 Introduction to Control Charts 20-7 20-4 Control Charts for Variables 20-9

20-4a Control Charts and Hypothesis Testing 20-15 20-4b Other Out-of-Control Indications 20-16 20-4c Rational Subsamples 20-17 20-4d Deming’s Funnel Experiment and Tampering 20-20 20-4e Control Charts in the Service Industry 20-23

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Contents xvii

20-5 Control Charts for Attributes 20-27 20-5a The p Chartp Chartp 20-27 20-5b The Red Bead Experiment 20-31

20-6 Process Capability 20-34 20-6a Process Capability Indexes 20-37 20-6b More on Motorola and 6-sigma 20-42

20-7 Conclusion 20-45

Appendix A: Statistical Reporting A-1 A-1 Introduction A-1 A-2 Suggestions for Good Statistical Reporting A-2

A-2a Planning A-2 A-2b Developing a Report A-3 A-2c Be Clear A-4 A-2d Be Concise A-5 A-2e Be Precise A-5

A-3 Examples of Statistical Reports A-7 A-4 Conclusion A-18

References 943

Index 945

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xviii

With today’s technology, companies are able to collect tremendous amounts of data with relative ease. Indeed, many companies now have more data than they can handle. However, the data are usually meaningless until they are analyzed for trends, patterns, relationships, and other useful information. This book illustrates in a practical way a variety of methods, from simple to complex, to help you analyze data sets and uncover important information. In many business contexts, data analysis is only the �rst step in the solution of a problem. Acting on the solution and the information it provides to make good decisions is a critical next step. Therefore, there is a heavy emphasis throughout this book on analytical methods that are useful in decision making. Again, the methods vary considerably, but the objective is always the same—to equip you with decision-making tools that you can apply in your business careers.

We recognize that the majority of students in this type of course are not majoring in not majoring in not a quantitative area. They are typically business majors in �nance, marketing, operations management, or some other business discipline who will need to analyze data and make quantitative-based decisions in their jobs. We offer a hands-on, example-based approach and introduce fundamental concepts as they are needed. Our vehicle is spreadsheet soft- ware—speci�cally, Microsoft Excel®. This is a package that most students already know and will almost surely use in their careers. Our MBA students at Indiana University have been so turned on by the required course that is based on this book that almost all of them almost all of them almost all (mostly �nance and marketing majors) have taken at least one of our follow-up elective courses in spreadsheet modeling. We are convinced that students see value in quantitative analysis when the course is taught in a practical and example-based approach.

Rationale for Writing This Book

Business Analytics: Data Analysis and Decision Making is different from the many �ne textbooks written for statistics and management science. Our rationale for writing this book is based on four fundamental objectives.

■ Integrated coverage and applications. The book provides a uni�ed approach to business-related problems by integrating methods and applications that have been tra- ditionally taught in separate courses, speci�cally statistics and management science.

■ Practical in approach. The book emphasizes realistic business examples and the processes managers actually use to analyze business problems. The emphasis is not on abstract theory or computational methods.

■ Spreadsheet-based teaching. The book provides students with the skills to analyze business problems with tools they have access to and will use in their careers. To this end, we have adopted Excel and commercial spreadsheet add-ins.

■ Latest tools. This is not a static �eld. The software keeps changing, and even the mathematical algorithms behind the software continue to evolve. Each edition of this book has presented the most recent tools in Excel and the accompanying Excel add- ins, and the current edition is no exception.

Preface

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Preface xix

Integrated Coverage and Applications

In the past, many business schools, including ours at Indiana University, have offered a required statistics course, a required decision-making course, and a required management science course—or some subset of these. A current trend, however, is to have only one required course that covers the basics of statistics, some regression analysis, some decision making under uncertainty, some linear programming, some simulation, and some advanced data analysis methods. Essentially, faculty in the quantitative area get one opportunity to teach all business students, so we attempt to cover a variety of useful quantitative methods. We are not necessarily arguing that this trend is ideal, but rather that it is a re�ection of the reality at our university and, we suspect, at many others. After several years of teaching this course, we have found it to be a great opportunity to attract students to the subject and to more advanced study.

The book is also integrative in another important aspect. It not only integrates a number of analytical methods, but it also applies them to a wide variety of business problems—that is, it analyzes realistic examples from many business disciplines. We include examples, prob- lems, and cases that deal with portfolio optimization, workforce scheduling, market share analysis, capital budgeting, new product analysis, and many others.

Practical in Approach

This book has been designed to be very example-based and practical. We strongly believe that students learn best by working through examples, and they appreciate the material most when the examples are realistic and interesting. Therefore, our approach in the book differs in two important ways from many competitors. First, there is just enough conceptual development to give students an understanding and appreciation for the issues raised in the examples. We often introduce important concepts, such as standard deviation as a measure of variability, in the context of examples rather than discussing them in the abstract. Our experience is that students gain greater intuition and understanding of the concepts and applications through this approach.

Second, we place virtually no emphasis on hand calculations. We believe it is more important for students to understand why they are conducting an analysis and what it means than to emphasize the tedious calculations associated with many analytical techniques. Therefore, we illustrate how powerful software can be used to create graphical and numeri- cal outputs in a matter of seconds, freeing the rest of the time for in-depth interpretation of the results, sensitivity analysis, and alternative modeling approaches. In our own courses, we move directly into a discussion of examples, where we focus almost exclusively on interpretation and modeling issues, and we let the software perform the number crunching.

Spreadsheet-based Teaching

We are strongly committed to teaching spreadsheet-based, example-driven courses, regard- less of whether the basic area is data analysis or management science. We have found tremendous enthusiasm for this approach, both from students and from faculty around the world who have used our books. Students learn and remember more, and they appreciate the material more. In addition, instructors typically enjoy teaching more, and they usually receive immediate reinforcement through better teaching evaluations. We were among the �rst to move to spreadsheet-based teaching about two decades ago, and we have never regretted the move.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xx Preface

What We Hope to Accomplish in This Book

Condensing the ideas in the previous paragraphs, we hope to:

■ continue to make quantitative courses attractive to a wide audience by making these topics real, accessible, and interesting;

■ give students plenty of hands-on experience with real problems and challenge them to develop their intuition, logic, and problem-solving skills;

■ expose students to real problems in many business disciplines and show them how these problems can be analyzed with quantitative methods; and

■ develop spreadsheet skills, including experience with powerful spreadsheet add-ins, that add immediate value to students’ other courses and for their future careers.

New in the Sixth Edition

There are several important changes in this edition.

■ MindTap: Offered for the �rst time with this text, MindTap is a customizable digital course solution that includes an interactive eBook, auto-graded exercises from the textbook, author-created videos, �ashcards, and more. MindTap includes all videos in support of the text, using StatTools or using JMP, as well as Excel solutions �les for students to use for checking selected problems from the text (odd-numbered ques- tions). MindTap also includes a chapter on Spreadsheet Modeling, which is not found in the print text, as an additional resource for faculty and students. For more informa- tion on MindTap, as well as ordering options, please contact your Cengage Learning consultant.

■ Focus on Excel 2016: The newest version of Excel was released just in time for this book’s revision, so all of the explanations and screenshots are based on this newest version. Except for cosmetic changes in the user interface, you will see almost no changes, and if you are still using Excel 2013 or a previous version, you shouldn’t have any problems following along with this book. However, Excel 2016 does have some nice features that are included here, including histograms, box plots, and the “power” tools discussed in Chapters 17 and 18.

■ Revised Chapter 6: The chapter on decision making under uncertainty has been totally rewritten. Now, a single “new product decisions” example is developed and extended throughout the chapter to promote continuity.

■ BigPicture diagrams: In the optimization and simulation chapters, it has always been dif�cult for students to go from a verbal description of a problem to an eventual spreadsheet model. In this edition, we include “big picture” diagrams of the models that will hopefully act as a bridge from the verbal descriptions to the spreadsheet models. These diagrams have been created from the latest add-in in the Palisade DecisionTools Suite, the BigPicture add-in. Users of the book have access to BigPicture, just like @RISK and the other Palisade add-ins.

■ Somewhat less reliance on StatTools: Although we continue to rely on the StatTools add-in for much of the statistical number crunching, especially in the regression and time series chapters, we rely on Excel formulas for the “easier” material in the con�- dence interval and hypothesis testing chapters, where Excel’s functions are perfectly adequate and might even be more insightful. Nevertheless, we include many brief videos that walk you through the StatTools procedures. These videos can be found within the MindTap product that accompanies this text.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Preface xxi

■ Inclusion of JMP: The book continues to use Excel and Excel add-ins as the pri- mary tools for data analysis. However, the student edition of the statistical software package JMP from SAS can be bundled with the text for minimal cost for users of our book. We do not try to replicate JMP’s �ne and extensive online help for learn- ing the software, but for many of the statistical examples in the book, we provide short videos showing how JMP can generate the results from Excel or StatTools. These videos can be found within the MindTap product that is available for this text. For ordering information on how to include JMP student edition with the book, please contact your Cengage learning consultant.

■ Updated videos: As in the �fth edition, the materials for the book include over 50 videos, particularly for the models in the optimization and simulation chapters. These videos have been redone (and shortened). These videos can be found within the MindTap product that accompanies this text.

■ Updated Problems: As in previous editions, there are some new and some updated problems. Again, we have included a �le, essentially a database of problems, which is available to instructors. This �le, DADM 6e Problem Database.xlsx, indicates the context of each of the problems, and it also shows the correspondence between problems in this edition and those in the previous edition.

■ More Data Mining Content: Chapter 17 on data mining has been expanded. First, there is more coverage on Excel’s newest “power” tools, especially Power Pivot, which are now included with Excel 2016 (at least in versions Professional Plus and higher). Second, there are detailed sections on the Naïve Bayes method for classi�ca- tion and an Excel-only method for clustering.

Software

This book is based entirely on Microsoft Excel, the spreadsheet package that has become the standard analytical tool in business. Excel is an extremely powerful package, and one of our goals is to convert casual users into casual users into casual power users who can take full advantage of its feapower users who can take full advantage of its feapower - tures. If you learn no more than this, you will be acquiring a valuable skill for the business world. However, Excel has some limitations. Therefore, this book includes several Excel add-ins that greatly enhance Excel’s capabilities. As a group, these add-ins comprise what is arguably the most impressive assortment of spreadsheet-based software accompanying any book on the market.

DecisionTools® Suite Add-in

The textbook website for Business Analytics: Data Analysis and Decision Making provides a link to the powerful DecisionTools® Suite by Palisade Corporation. (The version avail- able is compatible with Excel 2016 and previous versions of Excel.) This suite includes seven separate add-ins:

■ @RISK, an add-in for simulation

■ StatTools, an add-in for statistical data analysis

■ PrecisionTree, a graphical-based add-in for creating and analyzing decision trees

■ TopRank, an add-in for performing what-if analyses

■ NeuralTools®, an add-in for estimating complex, nonlinear relationships

■ EvolverTM, an add-in for performing optimization (an alternative to Excel’s Solver)

■ BigPicture, a very smart drawing add-in, useful for depicting model relationships

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xxii Preface

We use @RISK and PrecisionTree extensively in the chapters on simulation and decision making under uncertainty, and we use StatTools extensively in the data analysis chapters. We also use BigPicture in the optimization and simulation chapters to provide a “bridge” between a problem statement and an eventual spreadsheet model.

Online access to the DecisionTools Suite, available with new copies of the book, is an academic version, slightly scaled down from the professional version that sells for hun- dreds of dollars and is used by many leading companies. It functions for two years when properly installed, and it puts only modest limitations on the size of data sets or models that can be analyzed.1

SolverTable Add-in

We also include SolverTable, a supplement to Excel’s built-in Solver for optimization.2 If you have ever had dif�culty understanding Solver’s sensitivity reports, you will appreciate SolverTable. It works like Excel’s data tables, except that for each input (or pair of inputs), the add-in runs Solver and reports the optimal output values. SolverTable is used extenoptimal output values. SolverTable is used extenoptimal - sively in the optimization chapters.

Windows versus Mac

In our own courses, we have seen an increasing number of students using Macintosh lap- tops rather than Windows laptops. Fortunately, this is not a problem, and our students not a problem, and our students not have followed along �ne with their Macs. However, these students should be advised to use a Windows emulation program (Bootcamp or Parallels are good candidates), along with Of�ce for Windows. Be aware that a few Excel features discussed in the book, such as pivot charts and Power Pivot, are not yet supported by Excel 2016 for the Mac, and the not yet supported by Excel 2016 for the Mac, and the not SolverTable and Palisade add-ins will not work in Excel 2016 for the Mac.not work in Excel 2016 for the Mac.not

Potential Course Structures

Although we have used the book for our own required one-semester course, there is admit- tedly much more material than can be covered adequately in one semester. We have tried to make the book as modular as possible, allowing an instructor to cover, say, simulation before optimization or vice-versa, or to omit either of these topics. The one exception is statistics. Due to the natural progression of statistical topics, the basic topics in the early chapters should be covered before the more advanced topics (regression and time series analysis) in the later chapters. With this in mind, there are several possible ways to cover the topics.

■ One-semester Required Course, with No Statistics Prerequisite (or where MBA students need a refresher for whatever statistics they learned previously): If data analysis is the primary focus of the course, then Chapters 2–5, 7–11, and possibly Chapter 17 should be covered. Depending on the time remaining, any of the topics in Chapters 6 (decision making under uncertainty), 12 (time series analysis), 13–14 (optimization), or 15–16 (simulation) can be covered in practically any order.

■ One-semester Required Course, with a Statistics Prerequisite: Assuming that students know the basic elements of statistics (up through hypothesis testing), the

1 Visit www.kelley.iu.edu/albrightbooks for specific details on these limitations. 2 Although SolverTable is available on this textbook’s website, it is also available for free from Albright’s website, www.kelley.iu.edu/albrightbooks.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Preface xxiii

material in Chapters 2–5 and 7–9 can be reviewed quickly, primarily to illustrate how Excel and add-ins can be used to do the number crunching. The instructor can then choose among any of the topics in Chapters 6, 10–11, 12, 13–14, or 15–16 (in practically any order), or to �ll the remainder of the course.

■ Two-semester Required Sequence: Given the luxury of spreading the topics over two semesters, the entire book, or at least most of it, can be covered. The statistics topics in Chapters 2–5 and 7–9 should be covered in chronological order before other statistical topics (regression and time series analysis), but the remaining chapters can be covered in practically any order.

Custom Publishing

Cengage Learning is dedicated to making the educational experience unique for all learn- ers by creating custom materials that best suit your course needs. With Cengage Learning you can create a custom solution where you have the ability to choose your book’s content, length, sequence, even the cover design. You may combine content from multiple Cengage Learning titles and add other materials, including your own original work, to create your ideal customized text. If you would like to learn more about our custom publishing ser- vices, please contact your Cengage Learning representative3 or visit us at www.cengage .com/custom.

Instructor Supplements

Textbook Website: cengage.com/login

The companion website provides immediate access to an array of teaching resources— including data and solutions �les for all of the Examples, Problems, and Cases in the book, Chapters 18–20 and Appendix A, Test Bank �les, PowerPoint slides, and access to the DecisionTools® Suite by Palisade Corporation and the SolverTable add-in. You can easily download the instructor resources you need from the password-protected, instructor-only section of the site.

Test Bank

Cengage Learning Testing Powered by Cognero is a �exible, online system that allows you to:

■ author, edit, and manage test bank content from multiple Cengage Learning solutions

■ create multiple test versions in an instant

■ deliver tests from your LMS, your classroom, or wherever you want

3 Find your Learning Consultant at sites.cengage.com/repfinder.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

xxiv Preface

Student Supplements

Textbook Website: www.cengagebrain.com

Every new student edition of this book comes with access to the Business Analytics: Data Analysis and Decision Making, 6e textbook website that links to the following �les and tools:

■ Excel �les for the examples in the chapters (usually two versions of each— a template, or data-only version, and a �nished version)

■ Data �les required for the Problems and Cases

■ Excel Tutorial for Windows.xlsx, which contains a useful tutorial for getting up to speed in Excel (Excel Tutorial for the Mac.xlsx is also available)

■ Chapters 18–20 and Appendix A

■ DecisionTools® Suite software by Palisade Corporation (described earlier)

■ SolverTable add-in

The resources listed above can be accessed through our MindTap learning system. For additional free resources go to www.cengagebrain .com, search by ISBN 9781305947542, click on the “Free Materials” tab, and select “Access Now.” The resources you need will be listed both per chapter (by selecting a chapter from the drop-down list) and for the entire book (under Book Resources).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Preface xxv

Acknowledgements

We are also grateful to many of the professionals who worked behind the scenes to make this book a success: Mike Schenk, Product Director; Sr. Product Team Manager, Joe Sabatino; Product Manager, Aaron Arnsparger; Associate Content Developer, Brad Sullender; Product Project Manager, Kailash Rawat; Marketing Manager, Nate Anderson, Marketing Coordinator, Eileen Corcoran; and Product Assistant, Audrey Jacobs.

We also extend our sincere appreciation to the reviewers who provided feedback on the authors’ proposed changes that resulted in this sixth edition:

John Aloysius, Walton College of Business, University of Arkansas

Henry F. Ander, Arizona State University

Dr. Baabak Ashuri, School of Building Construction, Georgia Institute of Technology

James Behel, Harding University

Robert H. Burgess, Scheller College of Business, Georgia Institute of Technology

Paul Damien, McCombs School of Business, University of Texas in Austin

Parviz Ghandforoush, Virginia Tech

Betsy Greenberg, University of Texas

Anissa Harris, Harding University

Tim James, Arizona State University

Norman Johnson, C.T. Bauer College of Business, University of Houston

Shivraj Kanungo, The George Washington University

Miguel Lejeune, The George Washington University

José Lobo, Arizona State University

Stuart Low, Arizona State University

Lance Matheson, Virginia Tech

Patrick R. McMullen, Wake Forest University

Barbara A. Price, PhD, Georgia Southern University

Laura Wilson-Gentry, University of Baltimore

Toshiyuki Yuasa, University of Houston

S. Christian Albright

Wayne L. Winston

December 2015

6th Edition

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1

BUSINESS ANALYTICS PROVIDES INSIGHTS AND IMPROVES PERFORMANCE

This book is all about using quantitative modeling to help companies make better decisions and improve performance. We have been teaching management science for decades, and companies have been using the management science methods discussed in this book for decades to improve performance and save millions of dollars. Indeed, the applied journal Interfaces, discussed later in this chapter, has chronicled management science success stories for years. Therefore, we were a bit surprised when a brand new term, Business Analytics (BA), became hugely popular several years ago. All of a sudden, BA promised to be the road to success. By using quantitative BA methods—data analysis, optimization, simulation, prediction, and others—companies could drastically improve business performance. Haven’t those of us in management science been doing this for years? What is different about BA that has made it so popular, both in the academic world and even more so in the business world?

The truth is that BA does use the same quantitative methods that have been the hallmark of management science for years, the same methods you will learn in this book. BA has not all of a sudden invented brand new quanti- tative methods to eclipse traditional management science methods. The main difference is that BA uses big data to solve business problems and provide insights. Companies now have access to huge sources of data, and the technology is now available to use huge data sets for statistical and quantitative analysis, predictive modeling, optimization, and simulation. In short, the same quantitative methods that have been available for years can now be even more effective by utilizing big data and the corresponding technology.

Introduction to Business Analytics

C H A P T E R

1

m ic

h a e lju

n g

/S h u tt e rs

to c k.

c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2 Chapter 1 Introduction to Business Analytics

For a quick introduction to BA, you should visit the BA Wikipedia site (search the Web for “business analytics”). Among other things, it lists areas where BA plays a prominent role, including the following: retail sales analytics; financial services analyt- ics; risk and credit analytics; marketing analytics; pricing analytics; supply chain analytics; and transportation analytics. If you glance through the examples and problems in this book, you will see that most of them come from these same areas. Again, the differ-book, you will see that most of them come from these same areas. Again, the differ-book, you will see that most of them come from these same areas. Again, the differ ence is that we use relatively small data sets to get you started—we do not want to overwhelm you with gigabytes of data—whereas real applications of BA use huge data sets to advantage.

A more extensive discussion of BA can be found in the Fall 2011 research report, Analytics: The Widening Divide, published in the MIT Sloan Management Review in collabo- ration with IBM, a key developer of BA software (search the Web for the article’s title). This 22-page article discusses what BA is and provides several case studies. In addition, it lists three key competencies people need to compete successfully in the BA world—and hopefully you will be one of these people.

■ Competency 1: Information management skills to manage the data. This competency involves expertise in a variety of techniques for managing data. Given the key role of data in BA methods, data quality is extremely important. With data com- ing from a number of disparate sources, both internal and external to an organization, achieving data quality is no small feat.

■ Competency 2: Analytics skills and tools to understand the data. We were not surprised, but rather very happy, to see this competency listed among the requirements because these skills are exactly the skills we cover throughout this book—optimization with advanced quantitative algorithms, simulation, and others.

■ Competency 3: Data-oriented culture to act on the data. This refers to the culture within the organization. Everyone involved, especially top management, must believe strongly in fact-based decisions arrived at using analytical methods.

The article argues persuasively that the companies that have these competencies and have embraced BA have a distinct competitive advantage over companies that are just starting to use BA methods or are not using them at all. This explains the title of the article. The gap between companies that embrace BA and those that do not will only widen in the future.

One final note about the relationship between BA and management science is that, at the time this book was being revised (Winter 2014), a special issue of the journal Management Science was about to be published. The entire focus of this special issue is on BA. The following is an excerpt from the Call for Papers for this issue (search the Web for “management science business analytics special issue”).

“We envision business analytics applied to many domains, including, but surely not limited to: digital market design and operation; network and social-graph analysis; pricing and revenue management; targeted marketing and customer relationship management; fraud and security; sports and entertainment; retailing to healthcare to financial services to many other industries. We seek novel modeling and empirical work which includes, among others, probability modeling, structural empirical models, and/or optimization methods.”

This is even more confirmation of the tight relationship between BA and manage- ment science. As you study this book, you will see examples of most of the topics listed in this quote. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-1 Introduction 3

1-1 INTRODUCTION We are living in the age of technology. This has two important implications for everyone enter- ing the business world. First, technology has made it possible to collect huge amounts of data. Retailers collect point-of-sale data on products and customers every time a transaction occurs; credit agencies have all sorts of data on people who have or would like to obtain credit; invest- ment companies have a limitless supply of data on the historical patterns of stocks, bonds, and other securities; and government agencies have data on economic trends, the environment, social welfare, consumer product safety, and virtually everything else imaginable. It has become relatively easy to collect the data. As a result, data are plentiful. However, as many organizations easy to collect the data. As a result, data are plentiful. However, as many organizations easy have discovered, it is quite a challenge to make sense of all the data they have collected.

A second important implication of technology is that it has given many more people the power and responsibility to analyze data and make decisions on the basis of quantitative analy- sis. People entering the business world can no longer pass all of the quantitative analysis to the “quant jocks,” the technical specialists who have traditionally done the number crunching. The vast majority of employees now have a desktop or laptop computer at their disposal, access to relevant data, and training in easy-to-use software, particularly spreadsheet and database soft- ware. For these employees, statistics and other quantitative methods are no longer forgotten top- ics they once learned in college. Quantitative analysis is now an integral part of their daily jobs.

A large amount of data already exists, and it will only increase in the future. Many com- panies already complain of swimming in a sea of data. However, enlightened companies are seeing this expansion as a source of competitive advantage. In fact, one of the hottest topics in today’s business world is business analytics, also called data analytics. These terms have been created to encompass all of the types of analysis discussed in this book, so they aren’t really new; we have been teaching them for years. The new aspect of business analytics is that it typically implies the analysis of very large data sets, the kind that companies currently encounter. (For this reason, the term big data has also become popular.) By using quantitative methods to uncover the information in these data sets and then acting on this information— again guided by quantitative analysis—companies are able to gain advantages that their less enlightened competitors are not able to gain. Here are several pertinent examples.

■ Direct marketers analyze enormous customer databases to see which customers are likely to respond to various products and types of promotions. Marketers can then target different classes of customers in different ways to maximize pro�ts—and give their customers what they want.

■ Hotels and airlines also analyze enormous customer databases to see what their custom- ers want and are willing to pay for. By doing this, they have been able to devise very clever pricing strategies, where different customers pay different prices for the same accommodations. For example, a business traveler typically makes a plane reservation closer to the time of travel than a vacationer. The airlines know this. Therefore, they reserve seats for these business travelers and charge them a higher price for the same seats. The airlines pro�t from clever pricing strategies, and the customers are happy.

■ Financial planning services have a virtually unlimited supply of data about security prices, and they have customers with widely differing preferences for various types of investments. Trying to �nd a match of investments to customers is a very challenging problem. However, customers can easily take their business elsewhere if good decisions are not made on their behalf. Therefore, �nancial planners are under extreme competitive pressure to analyze masses of data so that they can make informed decisions for their customers.1 on their behalf. Therefore, �nancial planners are under extreme competitive pressure to

1 on their behalf. Therefore, �nancial planners are under extreme competitive pressure to

1For a great overview of how quantitative techniques have been used in the �nancial world, read the book The Quants, by Scott Patterson. It describes how quantitative models made millions for a lot of bright young analysts, but it also describes the dangers of relying totally on quantitative models, at least in the complex world of global �nance.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4 Chapter 1 Introduction to Business Analytics

■ We all know about the pressures U.S. manufacturing companies have faced from foreign competition in the past couple of decades. The automobile companies, for example, have had to change the way they produce and market automobiles to stay in business. They have had to improve quality and cut costs by orders of magnitude. Although the struggle continues, much of the success they have had can be attributed to data analysis and wise decision making. Starting on the shop �oor and moving up through the organization, these companies now measure almost everything, analyze these measurements, and then act on the results of their analysis.

We talk about companies analyzing data and making decisions. However, companies don’t really do this; people do it. And who will these people be in the future? They will be you! We know from experience that students in all areas of business, at both the undergraduate and graduate level, will be required to describe large complex data sets, run regression analyses, required to describe large complex data sets, run regression analyses, required make quantitative forecasts, create optimization models, and run simulations. You are the person who will be analyzing data and making important decisions to help your company gain a competitive advantage. And if you are not willing or able to do so, there will be plenty not willing or able to do so, there will be plenty not of other technically trained people who will be more than happy to replace you.

The goal of this book is to teach you how to use a variety of quantitative methods to analyze data and make decisions in a very hands-on way. We discuss a number of quan- titative methods and illustrate their use in a large variety of realistic business situations. As you will see, this book includes many examples from �nance, marketing, operations, accounting, and other areas of business. To analyze these examples, we take advantage of the Microsoft Excel® accounting, and other areas of business. To analyze these examples, we take advantage of the

® accounting, and other areas of business. To analyze these examples, we take advantage of the

spreadsheet software, together with a number of powerful Excel add-ins. In each example we provide step-by-step details of the method and its implementation in Excel.

This is not a “theory” book. It is also not a book where you can lean comfortably back not a “theory” book. It is also not a book where you can lean comfortably back not in your chair and read about how other people use quantitative methods. It is a “get your other people use quantitative methods. It is a “get your other hands dirty” book, where you will learn best by actively following the examples throughout the book on your own computer. By the time you have �nished, you will have acquired some very useful skills for today’s business world.

1-2 OVERVIEW OF THE BOOK This book is packed with quantitative methods and examples, probably more than can be covered in any single course. Therefore, we purposely intend to keep this introductory chapter brief so that you can get on with the analysis. Nevertheless, it is useful to introduce the methods you will be learning and the tools you will be using. This section provides an overview of the methods covered in this book and the software that is used to implement them. Then the next section presents a brief discussion of models and the modeling pro- cess. The primary goal at this point is to stimulate your interest in what follows.

1-2a The Methods

This book is rather unique in that it combines topics from two separate �elds: statistics and management science. Statistics is the study of data analysis, whereas management science is the study of model building, optimization, and decision making. In the academic arena these two �elds have traditionally been separated, sometimes widely. Indeed, they are often housed in separate academic departments. However, from a user’s standpoint it makes little sense to separate them. Both are useful in accomplishing what the title of this book prom- ises: data analysis and decision making.

Therefore, we do not distinguish between the statistics and the management science parts of this book. Instead, we view the entire book as a collection of useful quantitative methods that can be used to analyze data and help make business decisions. In addition, our

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-2 Overview of the Book 5

choice of software helps to integrate the various topics. By using a single package, Excel, together with a number of add-ins, you will see that the methods of statistics and manage- ment science are similar in many important respects. Most importantly, their combination gives you the power and �exibility to solve a wide range of business problems.

Three important themes run through this book. Two of them are in the title: data anal- ysis and decision making. The third is dealing with uncertainty.2

Three important themes run through this book. Two of them are in the title: data anal 2

Three important themes run through this book. Two of them are in the title: data anal Each of these themes

has subthemes. Data analysis includes data description, data inference, and the search for relationships in data. Decision making includes optimization techniques for problems with no uncertainty, decision analysis for problems with uncertainty, and structured sen- sitivity analysis. Dealing with uncertainty includes measuring uncertainty and modeling uncertainty explicitly. There are obvious overlaps between these themes and subthemes. When you make inferences from data and search for relationships in data, you must deal with uncertainty. When you use decision trees to help make decisions, you must deal with uncertainty. When you use simulation models to help make decisions, you must deal with uncertainty, and then you often make inferences from the simulated data.

Figure 1.1 shows where these themes and subthemes are discussed in the book. The next few paragraphs discuss the book’s contents in more detail.

We begin in Chapters 2 and 3 by illustrating a number of ways to summarize the infor- mation in data sets. These include graphical and tabular summaries, as well as numerical summary measures such as means, medians, and standard deviations. The material in these two chapters is elementary from a mathematical point of view, but it is extremely impor- tant. As stated earlier, organizations are now able to collect huge amounts of raw data, but what does it all mean? Although there are very sophisticated methods for analyzing data, some of which are covered in later chapters, the “simple” methods in Chapters 2 and 3 are crucial for obtaining an initial understanding of the data. Fortunately, Excel and available add-ins now make this quite easy. For example, Excel’s pivot table tool for “slicing and dicing” data is an analyst’s dream come true. You will be amazed by the insights you can gain from pivot tables—with very little effort.

2The fact that the uncertainty theme did not �nd its way into the title of this book does not detract from its impor- tance. We just wanted to keep the title reasonably short.

Figure 1.1 Themes and Subthemes

Themes Subthemes Chapters Where Emphasized

2, 3, 10, 12, 17−18

7−9, 11, 19−20

3, 10−12, 17, 19

6, 13−16

4−12, 15−16, 19−20

4−6, 10−12, 15−16, 19−20

13, 14

6

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6 Chapter 1 Introduction to Business Analytics

Uncertainty is a key aspect of most business problems. To deal with uncertainty, you need a basic understanding of probability. We discuss the key concepts in Chapters 4 and 5. Chapter 4 covers basic rules of probability and then discusses the extremely important concept of probability distributions. Chapter 5 follows up this discussion by focusing on two of the most important probability distributions, the normal and binomial distributions.

One of the best ways to make probabilistic concepts easier to understand is by using computer simulation. Therefore, simulation is a common theme that runs through this book, beginning in Chapter 4. Although Chapters 15 and 16 are devoted entirely to simula- tion, we do not hesitate to use simulation in earlier chapters to illustrate statistical concepts.

In Chapter 6 we apply probability to decision making under uncertainty. These types of problems—faced by all companies on a continual basis—are characterized by the need to make a decision now, even though important information, such as demand for a prod- uct or returns from investments, will not be known until later. The methods in Chapter 6 provide a rational basis for making such decisions. These methods do not guarantee per- fect outcomes—the future could unluckily turn out differently than expected—but they do enable decision makers to proceed rationally and make the best of their current informa- tion. Additionally, the software used to implement these methods allows decision makers, with very little extra work, to see how sensitive the optimal decisions are to inputs. This is crucial, because the inputs to many business problems are, at best, educated guesses. Finally, we examine the role of risk aversion in these types of decision problems.

In Chapters 7, 8, and 9 we discuss sampling and statistical inference. Here the basic problem is to estimate one or more characteristics of a population. If it is too expensive or time-consuming to learn about the entire population—and it usually is—it is instead common to select a random sample from the population and then use the information in the sample to infer the characteristics of the population. You see this continually on news infer the characteristics of the population. You see this continually on news infer shows that describe the results of various polls. You also see it in many business contexts. For example, auditors typically sample only a fraction of a company’s records. Then they infer the characteristics of the entire population of records from the results of the sample to conclude whether the company has been following acceptable accounting standards.

In Chapters 10 and 11 we discuss the extremely important topic of regression analysis, which is used to study relationships between variables. The power of regression analysis is its generality. Every part of a business has variables that are related to one another, and regression can often be used to estimate relationships between these variables. In managerial accounting, regression can be used to estimate how overhead costs depend on direct labor hours and pro- duction volume. In marketing, regression can be used to estimate how sales volume depends on advertising and other marketing variables. In �nance, regression can be used to estimate how the return of a stock depends on the “market” return. In real estate studies, regression can be used to estimate how the selling price of a house depends on the assessed valuation of the house and characteristics such as the number of bedrooms and square footage.

From regression, we move to time series analysis and forecasting in Chapter 12. This topic is particularly important for providing inputs into business decision problems. For example, manufacturing companies must forecast demand for their products to make sensible decisions about order quantities from their suppliers. Similarly, fast-food restau- rants must forecast customer arrivals, sometimes down to the level of 15-minute inter- vals, so that they can staff their restaurants appropriately. There are many approaches to forecasting, ranging from simple to complex. Some involve regression-based methods, whereas other methods are based on extrapolation. In an extrapolation method the his- torical patterns of a time series variable, such as product demand or customer arrivals, are studied carefully and are then extrapolated into the future to obtain forecasts. In Chapter 12 extrapolated into the future to obtain forecasts. In Chapter 12 extrapolated we discuss both regression and extrapolation methods for forecasting.

Chapters 13 and 14 are devoted to spreadsheet optimization. We assume a company must make several decisions, and there are constraints that limit the possible decisions. The

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-2 Overview of the Book 7

job of the decision maker is to choose the decisions such that all of the constraints are satis- �ed and an objective, such as total pro�t or total cost, is optimized. The solution process consists of two steps. The �rst step is to build a spreadsheet model that relates the decision variables to other relevant quantities by means of logical formulas. In this �rst step there is no attempt to �nd the optimal solution; its only purpose is to relate all relevant quantities optimal solution; its only purpose is to relate all relevant quantities optimal in a logical way. The second step is then to �nd the optimal solution. Fortunately, Excel contains a Solver add-in that performs the optimization. All you need to do is specify the objective, the decision variables, and the constraints; Solver then uses powerful algorithms to �nd the optimal solution. As with regression, the power of this approach is its generality. An enormous variety of problems can be solved with spreadsheet optimization.

Chapters 15 and 16 illustrate a number of computer simulation models. This is not your �rst exposure to simulation—it is used in several previous chapters to illustrate sta- tistical concepts—but here it is studied in its own right. As mentioned earlier, most busi- ness problems have some degree of uncertainty. The demand for a product is unknown, future interest rates are unknown, the delivery lead time from a supplier is unknown, and so on. Simulation allows you to build this uncertainty explicitly into spreadsheet models. Essentially, some cells in the model contain random values with given probability distribu- tions. Every time the spreadsheet recalculates, these random values change, which causes “bottom-line” output cells to change as well. The trick then is to force the spreadsheet to recalculate many times and keep track of interesting outputs. In this way you can see an entire distribution of output values that might occur, not just a single best guess.

Spreadsheet simulations can be performed entirely with Excel’s built-in tools, but this is quite tedious. Therefore, we use a spreadsheet add-in to streamline the process. In particular, you will learn how the @RISK add-in from Palisade Corporation can be used to run repli- cations of a simulation, keep track of outputs, create useful charts, and perform sensitivity analyses. With the inherent power of spreadsheets and the ease of using add-ins such as @ RISK, spreadsheet simulation is becoming one of the most popular quantitative tools in the business world.

Chapter 17 then returns to data analysis. It provides an introduction to data mining, a topic of increasing importance in today’s data-driven world. Data mining is all about exploring data sets, especially large data sets, for relationships and patterns that can help companies gain a competitive advantage. It employs a number of relatively new technolo- gies to implement various algorithms, several of which are discussed in this chapter.

Finally, there are three online chapters, 18–20, that complement topics included in the book itself. Chapter 18 discusses methods for importing data from a variety of data sources into Excel for analysis. Chapter 19 discusses analysis of variance (ANOVA) and experi- mental design. Chapter 20 discusses quality control and statistical process control. These three online chapters follow the same structure as the chapters in the book, complete with many examples and problems.

1-2b The Software

The quantitative methods in this book can be used to analyze a wide variety of business problems. However, they are not of much practical use unless you have the software to perform the number crunching. Very few business problems are small enough to be solved with pencil and paper. They require powerful software.

The software included in new copies of this book, together with Microsoft Excel, pro- vides you with a powerful combination. This software is being used—and will continue to be used—by leading companies all over the world to analyze large, complex problems. We �rmly believe that the experience you obtain with this software, through working the examples and problems in this book, will give you a key competitive advantage in the business world.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8 Chapter 1 Introduction to Business Analytics

It all begins with Excel. All of the quantitative methods that we discuss are implemented in Excel. Speci�cally, in this edition, we use Excel 2016.3

It all begins with Excel. All of the quantitative methods that we discuss are implemented 3

It all begins with Excel. All of the quantitative methods that we discuss are implemented We cannot forecast the state of com-

puter software in the long-term future, but Excel is currently the most heavily used spreadsheet package on the market, and there is every reason to believe that this state will persist for many years. Most companies use Excel, most employees and most students have been trained in Excel, and Excel is a very powerful, �exible, and easy-to-use package.

Built-in Excel Features Virtually everyone in the business world knows the basic features of Excel, but relatively few know some of its more powerful features. In short, relatively few people are the “power users” we expect you to become by working through this book. To get you started, the �les Excel Tutorial for Windows.xlsx and Excel Tutorial for the Mac.xlsx explain some of the “intermediate” features of Excel—features that we expect you to be able to use. (See the Preface for instructions on how to access the resources that accompany this textbook.) These include the SUMPRODUCT, VLOOKUP, IF, NPV, and COUNTIF, functions. They also include range names, data tables, Paste Special, Goal Seek, and many others. Finally, although we assume you can perform routine spreadsheet tasks such as copying and pasting, the tutorial provides many tips to help you perform these tasks more ef�ciently.4 Finally, although we assume you can perform routine spreadsheet tasks such as copying and

4 Finally, although we assume you can perform routine spreadsheet tasks such as copying and

In the body of the book, we describe several of Excel’s advanced features in more detail. For example, we provide a fairly extensive explanation of pivot tables in Chapter 3. This Excel tool enables you to summarize data sets in an almost endless variety of ways. As another example, we explain Excel’s RAND and RANDBETWEEN functions for generating random numbers in Chapter 4. These functions are used in all spreadsheet simulations (at least those that do not take advantage of an add-in). In short, when an Excel tool is useful for a particular type of analysis, we usually provide step-by-step instructions on how to use it.

Solver Add-in Chapters 13 and 14 make heavy use of Excel’s Solver add-in. This add-in, developed by Frontline Systems® Chapters 13 and 14 make heavy use of Excel’s Solver add-in. This add-in, developed by

® Chapters 13 and 14 make heavy use of Excel’s Solver add-in. This add-in, developed by

, not Microsoft, uses powerful algorithms to perform spreadsheet opti- mization. Before this type of spreadsheet optimization add-in was available, specialized (nonspreadsheet) software was required to solve optimization problems. Now you can do it all within the familiar Excel environment.

SolverTable Add-in An important theme throughout this book is sensitivity analysis: How do outputs change when inputs change? Typically these changes are made in spreadsheets with a data table, a built-in Excel tool. However, data tables don’t work in optimization models, where we want to see how the optimal solution changes when certain inputs change. Therefore, we include an Excel add-optimal solution changes when certain inputs change. Therefore, we include an Excel add-optimal in called SolverTable, which works almost exactly like Excel’s data tables. (This add-in was developed by Albright.) Chapters 13 and 14 illustrate the use of SolverTable.

DecisionTools Suite In addition to SolverTable and built-in Excel add-ins, an educational version of Palisade Corporation’s powerful DecisionTools® Suite is available. (See the Preface for instructions on how to access it.) All of the programs in this suite are Excel add-ins, so the learning curve isn’t very steep. There are seven separate add-ins in this suite: @RISK, BigPicture,

3As you probably know, Microsoft made sweeping changes to Excel when it went from version 2003 to version 2007. The subsequent move to version 2010 introduced a few new changes, but nothing too dramatic, and the same is true of the two most recent versions, Excel 2013 and 2016. If you are using version 2007, 2010, or 2013 you will see a few differences in the screenshots (which are from version 2016), but you should be able to follow along without trouble. 4 differences in the screenshots (which are from version 2016), but you should be able to follow along without trouble. 4 differences in the screenshots (which are from version 2016), but you should be able to follow along without trouble. Albright and several colleagues have created a more robust commercial version of this tutorial called ExcelNow!.

The Excel Tutorial �les explain how you can upgrade to this commercial version at a very reasonable price.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-2 Overview of the Book 9

StatTools, PrecisionTree, NeuralTools, TopRank, and Evolver.5 We use only the �rst �ve in this book, but all are useful for certain tasks and are described brie�y below.

@RISK The simulation add-in @RISK enables you to run as many replications of a spreadsheet simulation as you like. As the simulation runs, @RISK automatically keeps track of the out- puts you select, and it then displays the results in a number of tabular and graphical forms. @RISK also enables you to perform a sensitivity analysis, so that you can see which inputs have the most effect on the outputs. Finally, @RISK provides a number of spreadsheet func- tions that enable you to generate random numbers from a variety of probability distributions.

RISKOptimizer, part of @RISK, combines optimization with simulation. There are often times when you want to use simulation to model some business problem, but you also want to optimize a summary measure, such as a mean, of an output distribution. This opti- mization can be performed in a trial-and-error fashion, where you try a few values of the decision variable(s) and see which provides the best solution. However, RISKOptimizer provides a more automatic optimization procedure.

BigPicture BigPicture is the newest addition to the Palisade suite. It is a smart drawing add-in that com- plements Excel’s built-in drawing tools. The goal of BigPicture, at least for our purposes, is to represent the elements and relationships in a model so that you can better visualize the problem. We use it in most of the optimization and simulation examples as a “bridge” from the verbal description of a problem to the eventual spreadsheet model of the problem.

StatTools Much of this book discusses basic statistical analysis. Fortunately, the Palisade suite includes a statistical add-in called StatTools. StatTools is powerful, easy to use, and capable of generating output quickly in an easily interpretable form.

PrecisionTree The PrecisionTree add-in is used in Chapter 6 to analyze decision problems with uncer- tainty. The primary method for performing this type of analysis is to draw a decision tree. Decision trees are inherently graphical, and they have always been dif�cult to implement in spreadsheets, which are based on rows and columns. However, PrecisionTree does this in a very clever and intuitive way. Equally important, once the basic decision tree is built, you can use PrecisionTree to perform a sensitivity analysis on the model’s inputs.

NeuralTools Chapters 10 and 11 discuss how regression can be used to �nd a linear equation that quanti- �es the relationship between a dependent variable and one or more explanatory variables. Although linear regression is a powerful tool, it is not capable of quantifying all possi- ble relationships. The NeuralTools add-in mimics the working of the human brain to �nd “neural networks” that quantify complex nonlinear relationships. It is used in Chapter 17 as one of several possible classi�cation methods.

Evolver Although we will not use it in this book, Evolver provides an alternative to Excel’s built-in Solver add-in for optimization.

5The Palisade suite used to have another separate add-in, RISKOptimizer. Now RISKOptimizer is contained entirely in @RISK.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10 Chapter 1 Introduction to Business Analytics

TopRank TopRank is a “what-if” add-in used for sensitivity analysis. It starts with any spreadsheet model, where a set of inputs, along with a number of spreadsheet formulas, leads to one or more outputs. TopRank then performs a sensitivity analysis to see which inputs have the larg- est effect on a given output. Unlike @RISK, TopRank does not explicitly model uncertainty.

So�ware Guide Figure 1.2 illustrates how these add-ins are used throughout the book. Excel doesn’t appear explicitly in this �gure because it is used extensively in all of the chapters.all of the chapters.all

With Excel and the add-ins available with the book, you have a wealth of software at your disposal. The examples and step-by-step instructions throughout the book will help you become a power user of this software. Admittedly, this takes plenty of practice and a willingness to exper-a power user of this software. Admittedly, this takes plenty of practice and a willingness to exper-a power user of this software. Admittedly, this takes plenty of practice and a willingness to exper iment, but it is certainly within your grasp. When you are �nished, it is very possible that you will rate “improved software skills” as the most valuable thing you have learned from the book.

1-3 MODELING AND MODELS The term model has already appeared several times in this chapter. Models and the modeling model has already appeared several times in this chapter. Models and the modeling model process are key elements throughout the book, so we explain them here in more detail.6

has already appeared several times in this chapter. Models and the modeling 6

has already appeared several times in this chapter. Models and the modeling

A model is an abstraction of a real problem. A model tries to capture the essence and key features of the problem without getting bogged down in relatively unimportant details. There are different types of models, and depending on an analyst’s preferences and skills, each can be a valuable aid in solving a real problem. We brie�y describe three types of models here: graphical models, algebraic models, and spreadsheet models.

1-3a Graphical Models

Graphical models are probably the most intuitive and least quantitative type of model. They attempt to portray graphically how different elements of a problem are related—what affects

6Management scientists tend to use the terms model and model and model modeling more than statisticians. However, many tradi- tional statistics topics such as regression analysis and forecasting are de�nitely applications of modeling.

Figure 1.2 Software Guide

Developer Add-In Chapter(s) Where Used

15–16

2, 3, 7–12, 17, 19–20

6

17

@RISK

StatToolsStatToolsStatT

NeuralToolsNeuralToolsNeuralT

PrecisionTreePrecisionTreePrecisionT

BigPicture 13–16

Solver

SolverTableerTableerTAlbright

Frontline Systems, Inc.

13, 14

13, 14

Palisade Corp.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-3 Modeling and Models 11

what. A fairly simple graphical model for an ordering decision appears in Figure 1.3. (It was created with Palisade’s BigPicture add-in.)

Figure 1.3 Graphical Model of an Ordering Decision

Parameters of Demand Func�on

Unit Cost to Produce

Maximize Profit

Unit Price

Demand

Cost Rt Rt Rt Rt Rt Rt Revenue

© C

e n g

a g

e L

e a rn

in g

Algebraic Product Mix Model

maxan j = 1

pjpjp xjxjx (1.1)

subjbjb ect to an j = 1

aijiji xjxjx ≤ bi, 1 ≤ i ≤ m (1.2)

0 ≤ xjxjx ≤ ujuju , 1 ≤ j ≤ n (1.3)

This diagram indicates fairly intuitively what affects what. It does not provide enough quantitative details to “solve” the company’s problem, but this is usually not the purpose of a graphical model. Instead, its purpose is usually to show the important elements of a problem and how they are related. For complex problems, this can be very enlightening information for management.

1-3b Algebraic Models

Algebraic models are at the opposite end of the spectrum. Using algebraic equations and inequalities, they specify a set of relationships in a very precise way. Their preciseness and lack of ambiguity are very appealing to people with a mathematical background. In addi- tion, algebraic models can usually be stated concisely and with great generality.

A typical example is the “product mix” problem in Chapter 13. A company can make several products, each of which contributes a certain amount to pro�t and consumes certain amounts of several scarce resources. The problem is to select the product mix that maxi- mizes pro�t subject to the limited availability of the resources. All product mix problems All product mix problems All can be stated algebraically as follows:

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12 Chapter 1 Introduction to Business Analytics

Here xjxjx is the amount of product j produced, ujuju is an upper limit on the amount of product j that can be produced, pjpjp is the unit pro�t margin for product j, aijiji is the amount of resource i consumed by each unit of product j, bi is the amount of resource i available, n is the number of products, and m is the number of scarce resources. This algebraic model states very concisely that we should maximize total pro�t [Expression (1.1)], subject to consuming no more of each resource than is available [Inequality (1.2)], and all production quantities should be between 0 and their upper limits [Inequality (1.3)].

Algebraic models appeal to mathematically trained analysts. They are concise, they spell out exactly which data are required (the values of the ujuju ’s, the pjpjp ’s, the aijiji ’s, and the bjbjb ’s would need to be estimated from company data), they scale well (a problem with 500 products and 100 resource constraints is just as easy to state as one with only �ve products and three resource constraints), and many software packages accept algebraic models in essentially the same form as shown here, so that no “translation” is required. Indeed, alge- braic models were the preferred type of model for years—and still are by many analysts. Their main drawback is that they require an ability to work with abstract mathematical symbols. Some people have this ability, but many perfectly intelligent people do not.

1-3c Spreadsheet Models

An alternative to algebraic modeling is spreadsheet modeling. Instead of relating various quantities with algebraic equations and inequalities, they are related in a spreadsheet with cell formulas. In our experience, this process is much more intuitive to most people. One of the primary reasons for this is the instant feedback available from spreadsheets. If you enter a formula incorrectly, it is often immediately obvious (from error messages or unreal- istic numbers) that you have made an error, which you can then go back and �x. Algebraic models provide no such immediate feedback.

A speci�c comparison might help at this point. You already saw a general algebraic model of the product mix problem. Figure 1.4, taken from Chapter 13, illustrates a spread- sheet model for a speci�c example of this problem. The spreadsheet model should be fairly self-explanatory. All quantities in shaded cells (other than in rows 16 and 25) are inputs to the model, the quantities in row 16 are the decision variables (they correspond to the xjxjx ’s in the algebraic model), and all other quantities are created through appropriate Excel formu- las. To indicate constraints, inequality signs have been entered as labels in appropriate cells.

Although a well-designed and well-documented spreadsheet model such as the one in Figure 1.4 is undoubtedly more intuitive for most people than its algebraic counterpart, the art of developing good spreadsheet models is not easy. Obviously, they must be correct. The formulas relating the various quantities must have the correct syntax, the correct cell references, and the correct logic. This can be quite a challenge in complex models.

However, correctness is not enough. If spreadsheet models are to be used in the busi- ness world, they must also be well designed and well documented. Otherwise, no one other than you (and maybe not even you after a few weeks have passed) will be able to understand what your models do or how they work. The strength of spreadsheets is their �exibility—you are limited only by your imagination. However, this �exibility can be a liability in spreadsheet modeling unless you design your models carefully.

Note the clear design in Figure 1.4. Most of the inputs are grouped at the top of the spreadsheet. All of the �nancial calculations are done at the bottom. When there are con- straints, the two sides of the constraints are placed next to each other (as in the range B21:D22). Colored backgrounds (which appear on a computer monitor but not in the book) are used for added clarity, and descriptive labels are used liberally. Excel itself imposes none of these “rules,” but you should impose them on yourself.

We have made a conscious effort to establish good habits for you to follow throughout the book. We have designed our spreadsheet models so that they are as clear as possible.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-3 Modeling and Models 13

This does not mean that you have to copy everything we do—everyone tends to develop their own spreadsheet style—but our models should give you something to emulate. Just remember that in the business world, you typically start with a blank spreadsheet. It is blank spreadsheet. It is blank then up to you to develop a model that is not only correct but is also intelligible to you and others. This takes a lot of practice and a lot of editing, but it is a skill well worth developing.

1-3d A Seven-Step Modeling Process

Most of the modeling you will do in this book is only part of an overall modeling process typically done in the business world. We portray it as a seven-step process, as discussed here. Admittedly, not all problems require all seven steps. For example, the analysis of survey data might entail primarily steps 2 (data analysis) and 5 (decision making) of the process, without the formal model building discussed in steps 3 and 4.

�e Modeling Process 1. Define the problem. Typically, a company does not develop a model unless it believes

it has a problem. Therefore, the modeling process really begins by identifying an underlying problem. Perhaps the company is losing money, perhaps its market share is declining, or perhaps its customers are waiting too long for service. Any number of problems might be evident. However, as several people have warned [see Miser (1993) and Volkema (1995) for examples], this step is not always as straightforward as

Figure 1.4 Product Mix Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

GFEDCBA Assembling and tes�ng gRtpc nec negc ngnc nnac naRc nRsc nsrc nrec netc ntuc nupc npmc nmoc no ames used:

Hours_available =Model!$D$21:$D$22 Cost per labor hour assembling $g $11 Hours_used =Model!$B$21:$B$22 Cost per labor hour tes�ng $g $15 Maximum_sales =Model!$B$18:$C$18

Number_to_produce =Model!$B$16:$C$16 Inputs for assembling and tes�ng a 52$D$!ledoM=tiforp_latoTretupmoc

Basic XP Labor hours for 65ylbmessa Labor hours for 21gnitset Cost of component parts $150 $225 Selling 0g 0g 05g 0g 04g 0$g 0$g 0g 00g 0g 00g 0g 03g 0$g 0$g 0g 0eg 0g 0cg 0ig 0ig 0g 0rg 0g 0pg 0 Unit 921$08$nigram

Assembling, tes�ng plan (# of computers) Basic XP

Number to 0021065ecudorp <= <=

Maximum 0021006selas

Constraints (hours per month) Hours used Hours available Labor availability for assembling 10000 <= 10000 Labor availability for tes�ng 2960 <= 3000

Net profit ($ this month) Basic XP Total $44,800 $154,800 $199,600

c nc nc nc n

0 < 0 <

e =

s = e =

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14 Chapter 1 Introduction to Business Analytics

it might appear. The company must be sure that it has identified the correct problem correct problem correct before it spends time, effort, and money trying to solve it.

For example, Miser cites the experience of an analyst who was hired by the military to investigate overly long turnaround times between fighter planes landing and taking off again to rejoin the battle. The military was convinced that the prob- lem was caused by inefficient ground crews; if they were faster, turnaround times would decrease. The analyst nearly accepted this statement of the problem and was about to do classical time-and-motion studies on the ground crew to pinpoint the sources of their inefficiency. However, by snooping around, he found that the prob- lem obviously lay elsewhere. The trucks that refueled the planes were frequently late, which in turn was due to the inefficient way they were refilled from storage tanks at another location. Once this latter problem was solved—and its solution was embarrassingly simple—the turnaround times decreased to an acceptable level without any changes on the part of the ground crews. If the analyst had accepted the military’s statement of the problem, the real problem might never have been located or solved.

2. Collect and summarize data. This crucial step in the process is often the most tedious. All organizations keep track of various data on their operations, but these data are often not in the form an analyst requires. They are also typically scattered in different places throughout the organization, in all kinds of different formats. Therefore, one of the first jobs of an analyst is to gather exactly the right data and summarize the data appropriately—as discussed in detail in Chapters 2 and 3—for use in the model. Collecting the data typically requires asking questions of key peo- ple (such as the accountants) throughout the organization, studying existing data- bases, and performing time-consuming observational studies of the organization’s processes. In short, it entails a lot of legwork. Fortunately, many companies have understood the need for good clean data and have spent large amounts of time and money to build data warehouses for quantitative analysis.

3. Develop a model. This is the step we emphasize, especially in the latter chapters of the book. The form of the model varies from one situation to another. It could be a graphical model, an algebraic model, or a spreadsheet model. The key is that the model must capture the important elements of the business problem in such a way that it is understandable by all parties involved. This latter requirement is why we favor spreadsheet models, especially when they are well designed and well docu- mented.

4. Verify the model. Here the analyst tries to determine whether the model developed in the previous step is an accurate representation of reality. A first step in determin- ing how well the model fits reality is to check whether the model is valid for the current situation. This verification can take several forms. For example, the analyst could use the model with the company’s current values of the input parameters. If the model’s outputs are then in line with the outputs currently observed by the company, the analyst has at least shown that the model can duplicate the current situation.

A second way to verify a model is to enter a number of input parameters (even if they are not the company’s current inputs) and see whether the outputs from the model are reasonable. One common approach is to use extreme values of the inputs to see whether the outputs behave as they should. If they do, this is another piece of evidence that the model is reasonable.

If certain inputs are entered in the model and the model’s outputs are not as not as not expected, there could be two causes. First, the model could be a poor representation of reality. In this case it is up to the analyst to refine the model so that it is more realistic.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1-4 Conclusion 15

The second possible cause is that the model is fine but our intuition is not very good. In this case the fault lies with us, not the model. The fact that outcomes sometimes defy intuition is an important reason why models are important. These models prove that our ability to predict outcomes in complex environments is often not very good.

5. Select one or more suitable decisions. Many, but not all, models are decision models. For any specific decisions, the model indicates the amount of profit obtained, the amount of cost incurred, the level of risk, and so on. If the model is working correctly, as discussed in step 4, then it can be used to see which decisions produce the best outputs.best outputs.best

6. Present the results to the organization. In a classroom setting you are typically finished when you have developed a model that correctly solves a particular prob- lem. In the business world a correct model, even a useful one, does not always suffice. An analyst typically has to “sell” the model to management. Unfortunately, the people in management are sometimes not as well trained in quantitative methods as the analyst, so they are not always inclined to trust complex models.

There are two ways to mitigate this problem. First, it is helpful to include relevant people throughout the company in the modeling process—from beginning to end—so that everyone has an understanding of the model and feels an ownership of it. Second, it helps to use a spreadsheet model whenever possible, especially spreadsheet model whenever possible, especially spreadsheet if it is designed and documented properly. Almost everyone in today’s business world is comfortable with spreadsheets, so spreadsheet models are more likely to be accepted.

7. Implement the model and update it over time. Again, there is a big difference between a classroom situation and a business situation. When you turn in a classroom assignment, you are typically finished with that assignment and can await the next one. In contrast, an analyst who develops a model for a company usually cannot pack up his bags and leave. If the model is accepted by management, the company will then need to implement it company-wide. This can be very time consuming and politically difficult, especially if the model’s suggestions represent a significant change from the past. At the very least, employees must be trained how to use the model on a day-to-day basis.

In addition, the model will probably have to be updated over time, either because of changing conditions or because the company sees more potential uses for the model as it gains experience using it. This presents one of the greatest chal- lenges for a model developer, namely, the ability to develop a model that can be modified as the need arises.

1-4 CONCLUSION In this chapter we have tried to convince you that the skills in this book are important for you to know as you enter the business world. The methods we discuss are no longer the sole province of the “quant jocks.” By having a computer that is loaded with powerful software, you incur a responsibility to use this software to analyze business problems effectively. We have described the types of problems you will learn to analyze in this book, along with the software you will use to analyze them. We also discussed the modeling process, a theme that runs throughout this book. Now it is time for you to get started!

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 1.1 ENTERTAINMENT ON A CRUISE SHIP

Cruise ship traveling has become big business. Many cruise lines are now competing for customers of all age groups and socioeconomic levels. They offer all types of cruises, from relatively inexpensive 3- to 4-day cruises in the Caribbean, to 12- to 15-day cruises in the Mediterranean, to several-month around-the-world cruises. Cruises have several features that attract customers, many of whom book six months or more in advance: (1) they offer a relaxing, everything-done-for-you way to travel; (2) they serve food that is plentiful, usually excellent, and included in the price of the cruise; (3) they stop at a number of interesting ports and offer travelers a way to see the world; and (4) they provide a wide variety of entertainment, particularly in the evening.

This last feature, the entertainment, presents a difficult problem for a ship’s staff. A typical cruise might have well over 1000 passengers, including elderly singles and couples, middle-aged people with or without children, and young people, often honeymooners. These various types of passengers have varied tastes in terms of their after-dinner preferences in entertainment. Some want traditional dance music, some want comedians, some want rock music, some want movies, some want to go back to their cabins and read, and so on. Obviously, cruise entertainment directors want to provide the variety of entertainment their customers desire—within a reasonable budget—because satisfied customers tend to be repeat customers. The question is how to provide the right mix of entertainment.

On a cruise one of the authors and his wife took a few years ago, the entertainment was of high quality and there was plenty of variety. A seven-piece show band played dance music nightly in the largest lounge, two other small musical combos played nightly at two smaller lounges, a pianist played nightly at a piano bar in an intimate lounge, a group of professional singers and dancers played Broadway-type shows about twice weekly, and various professional singers and comedians played occasional single-night

performances.7 Although this entertainment was free to all of the passengers, much of it had embarrassingly low attendance. The nightly show band and musical combos, who were contracted to play nightly until midnight, often had less than a half-dozen people in the audience—sometimes literally none. The professional singers, dancers, and comedians attracted larger audiences, but there were still plenty of empty seats. In spite of this, the cruise staff posted a weekly schedule, and they stuck to it regardless of attendance. In a short-term financial sense, it didn’t make much difference. The performers got paid the same whether anyone was in the audience or not, the passengers had already paid (indirectly) for the entertainment as part of the cost of the cruise, and the only possible opportunity cost to the cruise line (in the short run) was the loss of liquor sales from the lack of passengers in the entertainment lounges. The morale of the entertainers was not great—entertainers love packed houses—but they usually argued, philosophically, that their hours were relatively short and they were still getting paid to see the world.

If you were in charge of entertainment on this ship, how would you describe the problem with entertainment: Is it a problem with deadbeat passengers, low-quality entertainment, or a mismatch between the entertainment offered and the entertainment desired? How might you try to solve the problem? What constraints might you have to work within? Would you keep a strict schedule such as the one followed by this cruise director, or would you play it more by ear? Would you gather data to help solve the problem? What data would you gather? How much would financial considerations dictate your decisions? Would they be long-term or short-term considerations?

7There was also a moderately large onboard casino, but it tended to attract the same people every night, and it was always closed when the ship was in port.

16 Chapter 1 Introduction to Business Analytics Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Exploring Data CHAPTER 2 Describing the Distribution of a Single Variable

CHAPTER 3 Finding Relationships among Variables

PA RT

1

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19

RECENT PRESIDENTIAL ELECTIONS

Presidential elections in the United States are scrutinized more than ever. It hardly seems that one is over before we start hearing plans and polls for the next. There is thorough coverage of the races leading up to the elections, but it is also interesting to analyze the results after the elections have been held. This is not difficult, given the many informative websites that appear immediately with election results. For example, a Web search for “2012 presi- dential election results” finds many sites with in-depth results, interactive maps, and more. In addition, the resulting data can often be imported into Excel® dential election results” finds many sites with in-depth results, interactive maps,

® dential election results” finds many sites with in-depth results, interactive maps,

rather easily for further analysis. The file Presidential Elections 2000–2012.xlsx contains such

downloaded data for the 2000 (Bush versus Gore), 2004 (Bush versus Kerry), 2008 (Obama versus McCain), and 2012 (Obama versus Romney) elections. The results of the 2000 election are particularly interesting. As you might remember, this was one of the closest elections of all time, with Bush defeating Gore by a very narrow margin in the electoral vote, 271 to 266, following a disputed recount in Florida. In fact, Gore actually beat Bush in the total count of U.S. votes, 50,999,897 to 50,456,002. However, because of the all-or-nothing nature of electoral votes in each state, Bush’s narrow margin of victory in many closely contested states won him a lot of electoral votes. In contrast, Gore outdistanced Bush by a wide margin in several large states, winning him the same electoral votes he would have won even if these races had been much closer.

A closer analysis of the state-by-state results shows how this actually happened. The Excel file contains two new columns: Bush Votes

Describing the Distribution of a Single Variable

C H A P T E R

2

Z U

M A

P re

ss , In

c ./ A

la m

y

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20 Chapter 2 Describing the Distribution of a Single Variable

Each of these charts tells the same story, but in slightly different ways. From Figure 2.1, you can see how Gore won big (large vote difference) in several large states, most notably California, Massachusetts, and New York. Bush’s only comparable margin of victory was in his home state of Texas. Texas. T However, Bush won a lot of close races in states with relatively few electoral votes—but enough to add up to an overall win. As Figure 2.2 indicates, many of these “close” races, such as Alaska and Idaho for Bush and District of Columbia for Gore, were not that close after all, at least not from a per-District of Columbia for Gore, were not that close after all, at least not from a per-District of Columbia for Gore, were not that close after all, at least not from a per centage standpoint. This is one case of many where multiple charts can be created to “tell a story.” Perhaps an argument can be made that Figure 2.1 tells the story best, but Figure 2.2 is also interesting.

The bottom line is that the election could easily have gone the other way. With one more swing state, particularly Florida, Al Gore would have been president. On the other hand, Gore won some very close races as well, particularly in Iowa, Minnesota,

minus Gore Votes and Pct for Bush minus Pct for Gore, with a value for each state (including the District of Columbia). We then created column charts of these two variables, as shown in Figures 2.1 and 2.2.

–2,000,000

–1,500,000

–1,000,000

–500,000

0

500,000

1,000,000

1,500,000

2,000,000

A la

b am

a A

la b

am a

A la

sk a

A la

sk a

A ri

zo n

a A

ri zo

n a

A rk

an sa

s A

rk an

sa s

C al

if o

rn ia

C al

if o

rn ia

C al

if o

rn ia

C al

if o

rn ia

C o

lo ra

d o

C o

lo ra

d o

D el

aw ar

e D

el aw

ar e

D is

tr ic

t o

f C

o lu

m b

ia D

is tr

ic t

o f

C o

lu m

b ia

D is

tr ic

t o

f C

o lu

m b

ia D

is tr

ic t

o f

C o

lu m

b ia

Fl o

ri d

a Fl

o ri

d a

G eo

rg ia

G eo

rg ia

H aw

ai i

H aw

ai i

Id ah

o Id

ah o

Ill in

o is

Ill in

o is

Ill in

o is

Ill in

o is

In d

ia n

a In

d ia

n a

Io w

a Io

w a

K an

sa s

K an

sa s

K en

tu ck

y K

en tu

ck y

Lo u

is ia

n a

Lo u

is ia

n a

M ai

n e

M ai

n e

M ar

yl an

d M

ar yl

an d

M ar

yl an

d

M ic

h ig

an M

ic h

ig an

M ic

h ig

an M

in n

es o

ta M

in n

es o

ta M

in n

es o

ta M

is si

ss ip

p i

M is

si ss

ip p

i M

is si

ss ip

p i

M is

so u

ri M

is so

u ri

M o

n ta

n a

M o

n ta

n a

N eb

ra sk

a N

eb ra

sk a

N ev

ad a

N ev

ad a

N ew

H am

p sh

ir e

N ew

H am

p sh

ir e

N ew

H am

p sh

ir e

N ew

J er

se y

N ew

J er

se y

N ew

J er

se y

N ew

J er

se y

N ew

J er

se y

N ew

M ex

ic o

N ew

M ex

ic o

N ew

M ex

ic o

N ew

Y o

rk N

ew Y

o rk

N ew

Y o

rk N

ew Y

o rk

N o

rt h

C ar

o lin

a N

o rt

h C

ar o

lin a

N o

rt h

C ar

o lin

a N

o rt

h D

ak o

ta N

o rt

h D

ak o

ta N

o rt

h D

ak o

ta O

h io

O h

io O

kl ah

o m

a O

kl ah

o m

a O

re go

n O

re go

n P

en n

sy lv

an ia

P en

n sy

lv an

ia P

en n

sy lv

an ia

P en

n sy

lv an

ia R

h o

d e

Is la

n d

R h

o d

e Is

la n

d R

h o

d e

Is la

n d

So u

th C

ar o

lin a

So u

th C

ar o

lin a

So u

th C

ar o

lin a

So u

th D

ak o

ta So

u th

D ak

o ta

So u

th D

ak o

ta Te

n n

es se

e Te

n n

es se

e Te

n n

es se

e Te

xa s

Te xa

s U

ta h

U ta

h V

er m

o n

t V

er m

o n

t V

ir gi

n ia

V ir

gi n

ia W

as h

in gt

o n

W as

h in

gt o

n W

as h

in gt

o n

W es

t V

ir gi

n ia

W es

t V

ir gi

n ia

W es

t V

ir gi

n ia

W is

co n

si n

W is

co n

si n

W yo

m in

g W

yo m

in g

Votes for Bush minus Votes for Gore

Figure 2.1 Chart of Vote Differences

–100.00%

60.00%

A la

b am

a A

la b

am a

W yo

m in

g W

yo m

in g

Pct for Bush minus Pct for Gore

A la

sk a

A la

sk a

A ri

zo n

a A

ri zo

n a

A rk

an sa

s A

rk an

sa s

C al

if o

rn ia

C al

if o

rn ia

C al

if o

rn ia

C o

lo ra

d o

C o

lo ra

d o

D el

aw ar

e D

el aw

ar e

D el

aw ar

e D

is tr

ic t

o f

C o

lu m

b ia

D is

tr ic

t o

f C

o lu

m b

ia D

is tr

ic t

o f

C o

lu m

b ia

D is

tr ic

t o

f C

o lu

m b

ia D

is tr

ic t

o f

C o

lu m

b ia

Fl o

ri d

a Fl

o ri

d a

G eo

rg ia

G eo

rg ia

H aw

ai i

H aw

ai i

H aw

ai i

Id ah

o Id

ah o

Ill in

o is

Ill in

o is

Ill in

o is

In d

ia n

a In

d ia

n a

Io w

a Io

w a

K an

sa s

K an

sa s

K en

tu ck

y K

en tu

ck y

Lo u

is ia

n a

Lo u

is ia

n a

M ai

n e

M ai

n e

M ar

yl an

d M

ar yl

an d

M ar

yl an

d

M ic

h ig

an M

ic h

ig an

M in

n es

o ta

M in

n es

o ta

M in

n es

o ta

M is

si ss

ip p

i M

is si

ss ip

p i

M is

si ss

ip p

i M

is so

u ri

M is

so u

ri M

o n

ta n

a M

o n

ta n

a N

eb ra

sk a

N eb

ra sk

a N

ev ad

a N

ev ad

a N

ew H

am p

sh ir

e N

ew H

am p

sh ir

e N

ew H

am p

sh ir

e N

ew J

er se

y N

ew J

er se

y N

ew J

er se

y N

ew J

er se

y N

ew M

ex ic

o N

ew M

ex ic

o N

ew M

ex ic

o N

ew Y

o rk

N ew

Y o

rk N

ew Y

o rk

N o

rt h

C ar

o lin

a N

o rt

h C

ar o

lin a

N o

rt h

C ar

o lin

a N

o rt

h D

ak o

ta N

o rt

h D

ak o

ta N

o rt

h D

ak o

ta O

h io

O h

io O

kl ah

o m

a O

kl ah

o m

a O

re go

n O

re go

n P

en n

sy lv

an ia

P en

n sy

lv an

ia P

en n

sy lv

an ia

R h

o d

e Is

la n

d R

h o

d e

Is la

n d

R h

o d

e Is

la n

d R

h o

d e

Is la

n d

So u

th C

ar o

lin a

So u

th C

ar o

lin a

So u

th C

ar o

lin a

So u

th D

ak o

ta So

u th

D ak

o ta

So u

th D

ak o

ta Te

n n

es se

e Te

n n

es se

e Te

n n

es se

e Te

xa s

Te xa

s U

ta h

U ta

h V

er m

o n

t V

er m

o n

t V

er m

o n

t V

ir gi

n ia

V ir

gi n

ia W

as h

in gt

o n

W as

h in

gt o

n W

as h

in gt

o n

W es

t V

ir gi

n ia

W es

t V

ir gi

n ia

W es

t V

ir gi

n ia

W is

co n

si n

W is

co n

si n

–80.00%

–60.00%

–40.00%

–20.00%

0.00%

20.00%

40.00%

Figure 2.2 Chart of Percent Differences

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-1 Introduction 21

New Mexico, and Oregon. If these had gone the other way, the popular vote would still have been very close, but Bush’s victory in the electoral vote would have been more impressive. ■

2-1 INTRODUCTION The goal of this chapter and the next chapter is very simple: to make sense of data by constructing appropriate summary measures, tables, and graphs. Our purpose here is to present the data in a form that makes sense to people. There are numerous ways to do this, limited only by your imagination, but there are several tools used most often: (1) a vari- ety of graphs, including bar charts, pie charts, histograms, scatter charts, and time series graphs; (2) numerical summary measures such as counts, percentages, averages, and meas- ures of variability; and (3) tables of summary measures such as totals, averages, and counts, grouped by categories. These terms might not all be familiar to you at this point, but you have undoubtedly seen examples of them in newspapers, magazine articles, and books.

The material in these two chapters is simple, complex, and important. It is simple because there are no dif�cult mathematical concepts. With the possible exception of vari- ance, standard deviation, and correlation, all of the numerical measures, graphs, and tables are natural and easy to understand.

If it is so easy, why do we also claim that the material in this chapter is complex? The data sets available to companies in today’s digital world tend to be extremely large and �lled with “unstructured” data. As you will see, even in data sets that are quite small in comparison with those that real companies face, it is a challenge to summarize the data so that the important information stands out clearly. It is easy to produce summary measures, graphs, and tables, but the real goal is to produce the most appropriate ones.

The typical employees of today—not just the managers and technical specialists— have a wealth of easy-to-use tools at their disposal, and it is frequently up to them to summarize data in a way that is both meaningful and useful to their constituents: people within their company, their company’s stockholders, their company’s suppliers, and their company’s customers. It takes some training and practice to do this effectively.

Because today’s companies are inundated with data, and because virtually every employee in the company must summarize data to some extent, the material in this chapter and the next one is arguably the most important material in the book. There is sometimes a tendency to race through the “descriptive statistics” chapters to get to the more “interest- ing” material in later chapters as quickly as possible. We resist this tendency. The material covered in these two chapters deserves close examination, and this takes some time.

Data analysis in the real world is almost never done in a vacuum. It is almost always done to solve a problem. Typically, there are four steps that are followed, whether the con- text is business, medical science, or any other �eld. The �rst step is to recognize a problem that needs to be solved. Perhaps a retail company is experiencing decreased sales in a particular region or for a particular product. Why is this happening? The second step is to gather data to help understand and then solve the problem. This might be done through a survey of customers, by assembling data from already-existing company systems, by �nd- ing relevant data on the Web, or from other sources. Once the data is gathered, the third step is to analyze the data using the tools you will learn in the book. The fourth step is to act on this analysis by changing policies, undertaking initiatives, publishing reports, and so on. Of course, the analysis can sometimes repeat steps. For example, once a given set of data is analyzed, it might be apparent that even more data needs to be collected.

As we discuss the tools for analyzing data, we will often jump into the third step directly, providing you with a data set to analyze. Although this data set may not be directly connected to the goal of solving some company’s problem, you should still strive to ask

It is customary to refer to the raw numbers as data and the output of data analysis as information. You start with the data, and you hope to end with information that an organization can use for competitive advantage.

Use your imagination to ask interesting questions about the many data sets available to you. We will supply you with the tools to answer these questions.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

22 Chapter 2 Describing the Distribution of a Single Variable

interesting questions of the data. (We have tried to include interesting data sets, often con- taining real data, that make this possible.) If the data set contains salaries, you might ask what drives these salaries. Does it depend on the industry a person is in? Does it depend on gender? Does it depend on educational background? Is the salary structure, whatever it is, changing over time? If the data set contains cost-of-living indexes, there are also a lot of interesting questions you can ask. How are the indexes changing over time? Does this behavior vary in different geographical regions? Does this behavior vary across different items such as housing, food, and automobiles? These early chapters provide you with many tools to answer such questions, but it is up to you to ask good questions—and then take advantage of the most appropriate tools to answer them.

The material in these chapters is organized as follows. This chapter discusses a num- ber of ways to analyze one variable at a time. The next chapter discusses ways to discover relationships between variables. In addition, there is a bonus Chapter 18 on importing data from external sources into Excel, a natural companion to Chapters 2 and 3. This bonus chapter is available on this textbook’s website (see Preface for instructors on accessing the resources that accompany this book).

2-2 BASIC CONCEPTS We begin with a short discussion of several important concepts: populations and samples, data sets, variables and observations, and types of data.

2-2a Populations and Samples

First, we distinguish between a population and a sample. A population includes all of the entities of interest: people, households, machines, or whatever. The following are three typical populations:

■ All potential voters in a presidential election

■ All subscribers to cable television

■ All invoices submitted for Medicare reimbursement by nursing homes

In these situations and many others, it is virtually impossible to obtain information about all members of the population. For example, it is far too costly to ask all potential voters which presidential candidates they prefer. Therefore, we often try to gain insights into the characteristics of a population by examining a sample, or subset, of the population. In later chapters, we examine populations and samples in some depth, but for now it is enough to know that samples should be representative of the population so that observed characteris- tics of the sample can be generalized to the population as a whole.

A population includes all of the entities of interest in a study. A sample is a subset of the population, often randomly chosen and preferably representative of the population as a whole.

We use the terms population and sample a few times in this chapter, which is why we have de�ned them here. However, the distinction is not really important until later chap- ters. Our intent in this chapter is to focus entirely on the data in a given data set, not to generalize beyond it. Therefore, the given data set could be a population or a sample from a population. For now, the distinction is irrelevant. (Sampling is discussed in more detail in Chapter 7.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-2 Basic Concepts 23

2-2b Data Sets, Variables, and Observations

We now discuss the types of data sets we will examine. Although the focus of this book is Excel, virtually all statistical software packages use the same concept of a data set: A data set is generally a rectangular array of data where the columns contain variables, such as height, gender, and income, and each row contains an observation. Each observation includes the attributes of a particular member of the population: a person, a company, a city, a machine, or whatever. This terminology is common, but other terms are often used. A variable (column) is often called a �eld or an attribute, and an observation (row) is often called a case or a record. Also, data sets are occasionally rearranged, so that the variables are in rows and the observations are in columns. However, the most common arrangement by far is to have vari- ables in columns, with variable names in the top row, and observations in the remaining rows.

A data set is usually a rectangular array of data, with variables in columns and observations in rows. A variable (or field (or field (or or attributeor attributeor ) is a characteristic of members of a population, such as height, gender, or salary. An observation (or case (or case (or or recordor recordor ) is a list of all variable values for a single member of a population.

The data set shown in Figure 2.3 represents 30 responses from a questionnaire concern-ing the president’s environmental policies, where several observations have been hid- den. (See the file Questionnaire Data.xlsx.)

E X A M P L E 2.1 DATA FROM AN ENVIRONMENTAL SURVEY

Figure 2.3 Environmental Survey Data

1 2 3 4 5 6 7

28 29

A BA B C DC D E FE F G Person Age Gender State Children Salary

1 31 35 M5 Male Minnesota 1 $65,400 2 62 61 Female TexasTexasT 2 $62,000 3 33 35 M5 Male Ohio 0 $63,200 4 34 37 M7 Male Florida 2 $52,000 5 35 32 Female California 3 $81,400 6 36 33 Female New YorkNew YorkNew Y 3 $46,300

27 27 Male Illinois 3 $45,400 28 63 Michigan $53,900

30 31

Male 2 29 52 Male California 1 $44,100 30 48 Female New YorkNew YorkNew Y 2 $31,000

Opinion 5 1 3 5 1 5 2 1 3 4

Objective To illustrate variables and observations in a typical data set.

Solution Each observation lists the person’s age, gender, state of residence, number of children, annual salary, and opinion of the president’s environmental policies. These six pieces of information represent the variables. It is customary to include a row (row 1 in this case) that lists variable names. These variable names should be concise but meaningful. Note that an index of the observation is often included in column A. If you sort on other vari- ables, you can always sort on the index to get back to the original sort order. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

24 Chapter 2 Describing the Distribution of a Single Variable

2-2c Types of Data

There are several ways to categorize data, as we explain in the context of Example 2.1. A basic distinction is between numerical and categorical data. The distinction is whether you intend to do any arithmetic on the data. It makes sense to do arithmetic on numerical data, but not on categorical data. (Actually, there is a third data type, a date variable. As you may know, Excel stores dates as numbers, but for obvious reasons, dates are treated differently from typical numbers.)

A categorical variable is ordinal if there is a natural ordering of its possible categories. If there is no natural ordering, the variable is nominal.

A variable is numerical if meaningful arithmetic can be performed on it. Otherwise, the variable is categorical.

In the questionnaire data set, Age, Children, and Salary are clearly numerical. For example, it makes perfect sense to sum or average any of these. In contrast, Gender and State are clearly categorical because they are expressed as text, not numbers.

The Opinion variable is less obvious. It is expressed numerically, on a 1-to-5 scale. However, these numbers are really only codes for the categories “strongly disagree,” “disa- gree,” “neutral,” “agree,” and “strongly agree.” There is never any intent to perform arith- metic on these numbers; in fact, it is not really appropriate to do so. Therefore, it is most appropriate to treat the Opinion variable as categorical. Note, too, that there is a de�nite ordering of its categories, whereas there is no natural ordering of the categories for the Gender or State variables. When there is a natural ordering of categories, the variable is classi�ed as ordinal. If there is no natural ordering, as with the Gender or State variables, the variable is classi�ed as nominal. Remember, though, that both ordinal and nominal variables are categorical.

Three types of variables that appear to be numerical but are usually treated as categorical are phone numbers, zip codes, and Social Security numbers. Do you see why? Can you think of others?

Excel Tip: Horizontal Alignment Conventions Excel automatically right-aligns numbers and left-aligns text. We will use this automatic for- matting, but we will add our own. Speci�cally, we will right-align all numbers that are avail- able for arithmetic; we will left-align all text such as Male, Female, Yes, and No, and No, and ; and we will center-align everything else, including dates, indexes such as the Person column, numbers that are indicators of categories such as in the Opinion column, and numbers such as phone num- bers that aren’t available for arithmetic. You don’t need to follow this convention, but it helps to identify the appropriate roles of variables.

Excel Tip: Documenting with Cell Comments To remember, for example, that “1” stands for “strongly disagree” in the Opinion variable, you can enter a comment—a reminder to yourself and others—in any cell. To do so, right-click a cell and select Insert Comment. A small red tag appears in any cell with a comment. Moving the cursor over that cell causes the comment to appear. You will see numerous comments in the �les that accompany the book.

Categorical variables can be coded numerically. In Figure 2.3, Gender has not been coded, whereas Opinion has been coded. This is largely a matter of taste—so long as you realize that coding a categorical variable does not make it numerical and appropriate for arithmetic opera- tions. An alternative way of displaying the data set appears in Figure 2.4. Now Opinion has been replaced by text, and Gender has been coded as 1 for males and 0 for females. This 0−1 coding for a categorical variable is very common. Such a variable is called a dummy vari- able, and it often simpli�es the analysis. You will see dummy variables throughout the book.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-2 Basic Concepts 25

A dummy variable is a 0−1 coded variable for a specific category. It is coded as 1 for all observations in that category and 0 for all observations not in that category.

1 2 3 4 5 6 7 8 9

A BA B C DC D E FE F G HG H I JI J K LK L Person Age Ge Gender State Ce Children Salary Oy Opinion

1 11 11 11 1 Minnesota 1 2 E2 Elderly 0 Texas 2 3 13 13 13 1 Ohio 0 N0 N0 N0 Neutral 4 14 14 14 1 Florida 2 5 Young 0 California 3 6 Young 0 30 30 3 Strongly agree

Strongly agree

Strongly agree

7 Elderly 0 Minnesota 2 8 18 18 18 1 New York

0 3New Y0 30 3ork0 30 3New Y0 3ork0 3New Y0 3

1 S1 S1 S1 Strongly agree

Strongly disagree

Strongly disagree

Strongly disagree Note the formulas in columns B, C, and G that generate this recoded data. The formulas in columns B and G are based on the lookup tables below.

9999 10 11 12 13 14 15 16 17 18 19

18 118 1 9 19 19 19 1 Texas 3s 3 $47,700

$49,600 $46,300 $81,400 $52,000 $63,2000 N$63,2000 N $62,000 $65,400

$45,9001 S$45,9001 S Agree

10 YoungYoungY 0 T0 Tex0 Tex0 T as 1 $59,900 Agree 11 1 N1 New York 1 $48,100 Agree 12 0 V0 Virginia 0a 0 $58,100 Neutral 13 0 I0 Illinois 2s 2 $56,000 14 Middle-aged

Middle-aged Middle-aged Middle-aged

Middle-age9 1Middle-age9 1d9 1d9 1 Middle-age8 1Middle-age8 1d8 1d8 1

Middle-age4 1Middle-age4 1d4 1d4 1 Middle-age3 1Middle-age3 1d3 1d3 1

Middle-age1 1Middle-age1 1d1 1d1 1

0 V0 Virginia 2a 2 $53,400 Strongly disagree Strongly disagree

Strongly disagree

Strongly agree

0 Y0 Young0 Young0 Y

15 Middle-aged 0d 0 New York 2 $39,000

Middle-aged53

16 Middle-aged 1d 1 Michigan 1 $61,500

Elderly06

Disagree Disagree

17 Middle-aged 1d 1 Ohio 0o 0 $37,700 Strongly disagree Middle-aged 0d 0 Michigan19191919

28 29

181818 222 $36,700 Agree

1 Disagree2 Neutral3 Agree4

5

29292929 30 31

27 YoungYoungY 1 I1 Illinois 3s 3 $45,400 Disagree 28 1 21 21 21 21 2 $53,900282828 Elderly Michi1 2Michi1 2ga1 2ga1 2n 2n 21 2n 21 21 2n 21 2 Strongly disagree 29 Middle-aged 1d 1 California 1 $44,100 Neutral 30 Middle-aged 0d 0 New York 2 $31,000 Agree

Opinion lookup table (range name OpinionLookup)

Age lookup tatable (range name AgeLookup)

Figure 2.4 Environmental Data Using a Different Coding

In addition, the Age variable has been categorized as “young” (34 years or younger), “middle-aged” (from 35 to 59 years), and “elderly” (60 years or older). This method of categorizing a numerical variable is called binning (putting the data into discrete bins), and it is also common. (It is also called discretizing.) The purpose of the study dictates whether age should be treated numerically or categorically; there is no absolute right or wrong way.

A binned (or discretized (or discretized (or ) variable corresponds to a numerical variable that has been categorized into discrete categories. These categories are usually called bins.

Excel Tip: VLOOKUP Function As Figure 2.4 indicates, we used lookup tables, along with the very important VLOOKUP function, to transform the data set from Figure 2.3 to Figure 2.4. Take a look at these functions in the questionnaire �le. There is arguably no more important Excel function than VLOOKUP, so you should de�nitely learn how to use it.

Numerical variables can be classi�ed as discrete or continuous. The basic distinction is whether the data arise from counts or continuous measurements. The variable Children is clearly a count (discrete), whereas the variable Salary is best treated as continuous. This distinction between discrete and continuous variables is sometimes important because it dictates the most natural type of analysis.

A numerical variable is discrete if it results from a count, such as the number of children. A continuous variable is the result of an essentially continuous measurement, such as weight or height.

Data sets can also be categorized as cross-sectional or time series. The opinion data set in Example 2.1 is cross-sectional. A pollster evidently sampled a cross section of people at

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

26 Chapter 2 Describing the Distribution of a Single Variable

one particular point in time. In contrast, a time series data set tracks one or more variables through time. A typical time series variable is the series of daily closing values of the Dow Jones Industrial Average (DJIA). Very different types of analyses are appropriate for cross- sectional and time series data, as will become apparent in this and later chapters.

Cross-sectional data are data on a cross section of a population at a distinct point in time. Time series data are data collected over time.

1 2 3 4 5 6

A BA B C DC D E FE F Quarter Revenue Q1-2013 1026 Q2-2013 1056 Q3-2013 1182 Q4-2013 2861 Q1 2014 14 1172

7 8 9

10 11 12

- Q2-2014 1249 Q3-2014 1346 Q4-2014 3402 Q1-2015 1286 Q2-2015 1317 Q3-2015 1449

13 14 15 16 17

Q4-2015 3893 Q1-2016 1462 Q2-2016 1452 Q3-2016 1631 Q4-2016 4200

All monetary values are inAll monetary values are inAll monetary values are in thousands of dollars.

Figure 2.5 Typical Time Series Data Set

A time series data set generally has the same layout—variables in columns and obser- vations in rows—but now each variable is a time series. Also, one of the columns usu- ally indicates the time period. A typical example appears in Figure 2.5. (See the �le Toy Revenues.xlsx.) It has quarterly observations on revenues from toy sales over a four-year period in column B, with the time periods listed chronologically in column A.

The only meaningful way to summarize categorical data is with counts of observations in the categories.

2-3 DESCRIPTIVE MEASURES FOR CATEGORICAL VARIABLES This section discusses methods for describing a categorical variable. Because it is not appropriate to perform arithmetic on the values of the variable, there are only a few possi- bilities for describing the variable, and these are all based on counting. First, you can count the number of categories. Many categorical variables such as Gender have only two categonumber of categories. Many categorical variables such as Gender have only two categonumber - ries. Others such as Region can have more than two categories. As you count the catego- ries, you can also give the categories names, such as Male and Female. Keep in mind that categorical variables, such as Opinion in Example 2.1, can be coded numerically. In these cases, it is still a good idea to supply text descriptions of the categories, such as “strongly agree,” and it is often useful to substitute these meaningful descriptions for the numerical codes, as in Figure 2.4. This is especially useful for statistical reports.

Once you know the number of categories and their names, you can count the num- ber of observations in each category. The resulting counts can be reported as “raw counts” or as percentages of totals. For example, if there are 1000 observations, you

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-3 Descriptive Measures for Categorical Variables 27

can report that there are 560 males and 440 females, or you can report that 56% of the observations are males and 44% are females. Actually, it is often useful to report the counts in both ways. Finally, once you have the counts, you can display them graphi- cally, usually in a column chart or possibly a pie chart. Example 2.2 illustrates how to do this in Excel.

Figure 2.6 Supermarket Data Set

1 2 3 4 5 6 7 8 9

10 11

A BA B C DC D E FE F G HG H I JI J K OK O P Purchase DateTransac�on

Customer ID Gender

Marital Status Homeowner Children Annual Incom e City

State or Provinc e Country

Units Sold Revenue

1 12/18/2014 7223 F S Y 2 $30K - $50K Los Angele s CA USA 5 $27.38 2 12/20/2014 7841 M M Y 5 $70K - $90K Los Angele s CA USA 5 $14.90 3 12/21/2014 8374 F M N 2 $50K - $70K Bremerto n WA USA 3 $5.52 4 12/21/2014 9619 M M Y 3 $30K - $50K Portlan d OR USA 4 $4.44 5 12/22/2014 1900 F S Y 3 $130K - $150K Beverly Hills CA USA 4 $14.00 6 12/22/2014 6696 F M Y 3 $10K - $30K Beverly Hills CA USA 3 $4.37 7 12/23/2014 9673 M S Y 2 $30K - $50K Salem OR USA 4 $13.78 8 12/25/2014 354 F M Y 2 $150K + Yakima WA USA 6 $7.34 9 12/25/2014 1293 M M Y 3 $10K - $30K Bellingha m WA USA 1 $2.41

10 12/25/2014 7938 M S N 1 $50K - $70K San Diego CA USA 2A 2A $8.96

3 F 1 M 4 F 9 M 0 F 6 F 3 M

4 F 3 M 8 M

S Y M Y M N M Y S Y M Y S Y M Y M Y S N

e C K L K L

K B K B K S

+ Y K B K S

s C s C

d O s C s C

a W m W

e C A U A U

R U A U A U

A U A U

A 3

A 4

A

A 3

A 4

A

A 3

A 4

A

A 3

A 4

A

A 3

A 4

A

d R

E X A M P L E 2.2 SUPERMARKET SALES

The file Supermarket Transactions.xlsx contains over 14,000 transactions made by supermarket customers over a period of approximately two years. (The data are not real, but real supermarket chains have huge data sets just like this one.) A small sample of the data appears in Figure 2.6. Column B contains the date of the purchase, column C is a unique identifier for each customer, columns D–H contain information about the customer, columns I–K contain the location of the store, columns L–N contain information about the product purchased (these columns have been hidden to conserve space), and the last two columns indicate the number of items purchased and the amount paid.

Objective To summarize categorical variables in a large data set.

Solution Most of the variables in this data set are categorical. Only Children, Units Sold, and Revenue are numerical. Purchase Date is a date variable, and Transaction and Customer ID are used only to identify transactions and customers. All of the other variables are cat- egorical, including Annual Income, which has been binned into categories. Three of the categorical variables—Gender, Marital Status, and Homeowner—have only two catego- ries. The others have more than two categories.

The first question is how you can discover all of the categories for a variable such as State or Province. Without good tools, this is not a trivial problem. One option is to sort on this variable and then manually go through the list, looking for the different categories. Another possibility is to copy the categorical column to a blank area of the worksheet and then use the Remove Duplicates item on the Data ribbon. Fortunately, there are easier ways, using Excel’s built-in table and pivot table tools. We will postpone these for later and deal for now only with the “easy” categorical variables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

28 Chapter 2 Describing the Distribution of a Single Variable

When you have a choice between a “simple” chart and a “fancier” chart, keep it simple. Simple charts tend to reveal the information in the data more clearly.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

R SR S T UT U V WV W X YX Y Z AZ AA AA AB AB AC AC AD AD AE Categorical summaries Gender Count Percent M 6889 49.0% F 7170 51.0%

100.0%

Marital Status Count Percent S 7193 51.2% M 6866 48.8%

100.0%

Homeowner Count Percent Y 8444 60.1% N 5615 39.9%

100.0%

Annual Income Count Percent $10K - $30K 3090 22.0% $30K - $50K 4601 32.7% $50K - $70K 2370 16.9% $70K - $90K 1709 12.2% $90K - $110K 613 4.4% $110K - $130K 643 4.6% $130K - $150K 760 5.4% $150K + 273 1.9%

100.0%

r C

t P

t P

t P

6700 6800 6900 7000 7100 7200

M F

Gender Count

0

2000

4000

6000

8000

M F

Gender Count (different scale)

48.0%

49.0%

50.0%

51.0%

52.0%

M F

Gender Percent

0.0%

20.0%

40.0%

60.0%

M F

Gender Percent (different scale)

Gender Count

M

F

Gender Percent

M

F

Figure 2.7 Summaries of Categorical Variables

As the charts indicate, you get essentially the same chart whether you graph the counts or the percentages. However, be careful with misleading scales. If you select the range R2:S4 and then insert a column chart, you get the top left chart by default. Its vertical scale starts well above 6000, which makes it appear that there are many more females than males. By resetting the vertical scale to start at 0, as in the two middle charts, you see more accu- rately that there are almost as many males as females. Finally, you can decide whether you prefer a column chart or a pie chart. We tend to prefer column charts, but this is entirely a matter of taste. (We also tend to prefer column charts to horizontal bar charts, but this is again a matter of taste.) Our only recommendation in general is to keep charts simple so that the information they contain emerges as clearly as possible.

Excel Tip: Creating and Modifying an Excel Chart Efficiently If you are new to Excel charts, particularly in post-2003 versions of Excel, you should try creat- ing the charts in Figure 2.7 on your own. One way is to select a blank cell, select a desired chart type from the Insert ribbon, and then designate the data to be included in the chart. However, it is usually more efficient to select the data to be charted and then insert the chart. For example,

Figure 2.7 displays summaries of Gender, Marital Status, Homeowner, and Annual Income, along with several corresponding charts for Gender. Each of the counts in column S can be obtained with Excel’s COUNTIF function. For example, the formula in cell S3 is =COUNTIF($D$2:$D$14060,R3). This function takes two arguments, the data range and a criterion, so it is perfect for counting observations in a category. Then the percentages in column T are the counts divided by the total number of observations. (As a check, it is a good idea to sum these percentages. They should sum to 100% for each variable.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-3 Descriptive Measures for Categorical Variables 29

try highlighting the range R2:S4 and then inserting a column chart. Except for a little cleanup (deleting the legend, changing the chart title, and possibly changing the vertical scale), you get almost exactly what you want with very little work. Fortunately, as you have probably noticed if you have progressed through various versions of Excel, the chart tools for manipulating charts have gotten easier to use. Don’t be afraid to right-click for context-sensitive chart menus or to use the special ribbons that appear when a chart is selected. You can learn a lot by experiment- ing with these tools.

If this example of summarizing categorical variables appears to be overly tedious, be patient. As indicated earlier, Excel has some powerful tools, especially pivot tables, that make this summarization much easier. We discuss pivot tables in depth in the next chapter. For now, just remember that the only meaningful way to summarize a categorical variable is to count observations in its categories.

Before leaving this section, we mention one other ef�cient way to �nd counts for a categorical variable. This method uses dummy (0−1) variables. To see how it works, focus on any category of some categorical variable, such as M for Gender. Recode the variable so that each M is replaced by a 1 and all other values are replaced by 0. (This can be done in Excel in a new column, using a simple IF formula. See column E of Figure 2.8.) Now you can �nd the count of males by summing the 0s and 1s, and you can �nd the percentage of males by averaging the 0s and 1s. That is, the formulas in cells E14061 and E14062 use the SUM and AVERAGE functions on the data in column E. You should convince yourself why this works (for example, what arithmetic are you really doing when you average 0’s and 1’s?), and you should remember this method. It is one reason why dummy variables are used so frequently in data analysis. ■

1

2

3

4

5

6

7

8

9

10

1

2

3

4

5

6

7

8

9

1011

14055 14054

1405514056

14056

14057

14058

14059

14057

14058

14059

14060

14061

14062

A B C D E

Purchase Date Customer ID Gender Gender Dummy for MTransac on

F

M

F

M

F

F

M

F

M

12/18/2014

12/20/2014

12/21/2014

12/21/2014

12/22/2014

12/22/2014

12/23/2014

12/25/2014

12/25/2014

12/25/2014

12/29/2016

12/29/2016

12/29/2016

12/31/2016 12/31/2016

12/31/2016

7223

7841

8374

9619

1900

6696

9673

354

1293

7938

2032

9102

4822

6153

3656

250

M

F

F

F

F M

M

Count Percent

0

1

0

1

0

0

1

0

1

1

0

0

0

1

0

1

6889

49.0%

A B C DFigure 2.8 Summarizing a Category with a Dummy Variable

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

30 Chapter 2 Describing the Distribution of a Single Variable

2-4 DESCRIPTIVE MEASURES FOR NUMERICAL VARIABLES There are many ways to summarize numerical variables, both with numerical summary meas- ures and with charts, and we discuss the most common ways in this section. But before get- ting into details, it is important to understand the basic goal of this section. We begin with a numerical variable such as Salary, where there is one observation for each person. Our basic goal is to learn how these salaries are distributed across people. To do this, we can ask a num- ber of questions, including the following: (1) What are the most “typical” salaries? (2) How spread out are the salaries? (3) What are the “extreme” salaries on either end? (4) Is a chart of the salaries symmetric about some middle value, or is it skewed in one direction? (5) Does the chart of salaries have any other peculiar features besides possible skewness? In the next chap- ter, we explore methods for checking whether a variable such as Salary is related to other variother variother - ables, but for now we simply want to explore the distribution of values in the Salary column.

Excel has a number of built-in tools for summarizing numerical variables, and we will discuss these. However, even better tools are available in Excel add-ins, and in this section we will introduce a very powerful add-in from Palisade Corporation called StatTools. There are two important advantages of StatTools over other statistical software. First, it works inside

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a color box are available for purchase at www.cengagebrain.com.

Level A 1. The file The file The f P02_01.xlsx indicates the gender and national-

ity of the MBA incoming class in two successive years at the Kelley School of Business at Indiana University. a. For each year, create tables of counts of gender and

of nationality. Then create column charts of these counts. Do they indicate any noticeable change in the composition of the two classes?

b. Repeat part a for nationality, but recode this variable so that all nationalities that have counts of 1 or 2 are classified as Other.

2. The file The file The f P02_02.xlsx contains information on over 200 movies that were released in 2006 and 2007. a. Create two column charts of counts, one of the

different genres and one of the different distributors. b. Recode the Genre column so that all genres with

a count of 10 or less are lumped into a category called Other. Then create a column chart of counts for this recoded variable. Repeat similarly for the Distributor variable.

3. The file The file The f P02_03.xlsx contains data from a survey of 399 people regarding a government environmental policy. a. Which of the variables in this data set are categorical?

Which of these are nominal; which are ordinal? b. For each categorical variable, create a column chart

of counts. c. Recode the data into a new data set, making four

transformations: (1) change Gender to list “Male”

or “Female”; (2) change Children to list “No children” or “At least one child”; (3) change Salary to be categorical with categories “Less than $40K,” “Between $40K and $70K,” “Between $70K and $100K,” and “Greater than $100K ” (where you can treat the breakpoints however you like); and (4) change Opinion to be a numerical code from 1 to 5 for Strongly Disagree to Strongly Agree. Then create a column chart of counts for the new Salary variable.

4. The file The file The f P02_04.xlsx contains salary data on all Major League Baseball players for each year from 2002 to 2011. (It is an older version of the data used for examples later in this chapter.) For any three selected years, create a table of counts of the various positions, expressed as percentages of all players for the year. Then create a column chart of these percentages for these years. Do they remain fairly constant from year to year?

Level B 5. The file The file The f DJIA Monthly Close.xlsx contains monthly DJIA Monthly Close.xlsx contains monthly DJIA Monthly Close.xlsx

values of the Dow Jones Industrial Average from 1950 through July 2015. It also contains the percentage changes from month to month. (This file is used in an example later in this chapter.) Create a new column for recoding the percentage changes into six categories: Large negative (<−3%), Medium negative (<−1%, ⩾−3%), Small negative (<0%, ⩾−1%), Small positive positive positi (<1%, ⩾0%), Medium positive (<3%, ⩾1%), and Large positive (⩾3%). Then create a column chart of the counts of this categorical variable. Comment on its shape.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 31

CHANGES IN EXCEL 2010

Microsoft modified many of the statistical functions and added a few new ones in Excel 2010. Although Microsoft advertises the superiority of the new functions, all of the old functions can still be used. When a modified or new function is relevant, we indicate this in the text. Note that if you look up the Statistical group under More Functions on the Formulas ribbon, you will see only the new functions. new functions. new However, you can still find help on the old functions in the Compatibility group, also under More Functions.

Excel, which is an obvious advantage if you prefer to work in Excel. Second, it is extremely easy to learn, with virtually no learning curve. Just keep in mind that StatTools is not part of Microsoft Of�ce. You get the academic version of StatTools free with this book, but if you eventually want to use StatTools in your job, you will have to persuade your company to pur- chase it if the company has not already done so. Fortunately, many companies, large and small, already use the Palisade software on a regular basis, and the number is constantly increasing.

2-4a Numerical Summary Measures

Throughout this section, we focus on a Salary variable. Speci�cally, we examine the 2015 salaries for Major League Baseball players, as described in the following extended example.

E X A M P L E 2.3 BASEBALL SALARIES

The file Baseball Salaries.xlsx contains data on 868 Major League Baseball (MLB) players in the 2015 season. (The 2011 salaries discussed in the previous edition of this book are also included.) There are four variables, as shown in Figure 2.9: the player’s name, team, position, and salary. How can these 868 salaries be summarized?

Figure 2.9 Baseball Salaries

1 2 3 4 5 6 7 8 9

10 11 12 13 14

DCBA SalaryPosi�onTeamPlayer

A.J. Burne A.J. Ellis A.J. Griffin A.J. Pierzynski A.J. Pollock A.J. Ramos Aaron Barre Aaron Crow Aaron Harang Aaron Hill Aaron Loup Aaron Sanchez Aaron Thompson

Pi sburgh Pirates Los Angeles Dodgers Oakland Athle�cs Atlanta Braves Arizona Diamondbacks Miami Marlins Washington Na�onals Miami Marlins Philadelphia Phillies Arizona Diamondbacks Toronto Blue Jays Toronto Blue Jays Minnesota Twins

Pitcher Catcher Pitcher Catcher Center Fielder Pitcher Pitcher Pitcher Pitcher Second Baseman Pitcher Pitcher Pitcher

$8,500,000 $4,250,000

$517,500 $2,000,000

$519,500 $530,000 $514,200

$1,975,000 $5,000,000

$12,000,000 $527,000 $510,800 $520,000

Objective To learn how salaries are distributed across all 2015 MLB players.

Solution The various numerical summary measures can be categorized into several groups: measures of central tendency; minimum, maximum, percentiles, and quartiles; measures of variability; and measures of shape. We explain each of these in this extended example. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

32 Chapter 2 Describing the Distribution of a Single Variable

Measures of Central Tendency There are three common measures of central tendency, all of which try to answer the basic question of which value is most “typical.” These are the mean, the median, and the mode.

The mean is the average of all values. If the data set represents a sample from some larger population, this measure is called the sample mean and is denoted by X (pronounced “X-bar”). If the data set represents the entire population, it is called the population mean and is denoted by μ (the Greek letter mu). This distinction is not important in this chapter, but it will become relevant in later chapters on statistical inference. In either case, the for- mula for the mean is given by Equation (2.1).

Here, n is the number of observations and XiXiX is the value of observation i. Equation (2.1) says to add all the observations and divide by n, the number of observations. The Σ (Greek capital sigma) symbol means to sum from i = 1 to i = n, that is, to sum over all observations.

For Excel data sets, you can calculate the mean with the AVERAGE function. This is shown for the baseball data (along with a lot of other summary measures we will dis- cuss shortly) in Figure 2.10. Speci�cally, the average salary for all players is a whopping $4,214,614. Is this a “typical” salary? Keep reading.

The median is the middle observation when the data are sorted from smallest to larg- est. If the number of observations is odd, the median is literally the middle observation. For example, if there are nine observations, the median is the �fth smallest (or �fth largest). If the number of observations is even, the median is usually de�ned as the average of the two middle observations (although there are some slight variations of this de�nition). For example, if there are 10 observations, the median is usually de�ned as the average of the �fth and sixth smallest values.

The median can be calculated in Excel with the MEDIAN function. Figure 2.10 shows that the median salary is $1,650,000. In words, half of the players make less than this, and half make more. Why is the median in this example so much smaller than the mean, and which is more appropriate? These are important questions, and they are relevant questions for many real-world data sets. In this case, the vast majority of baseball players have rela- tively modest salaries that are dwarfed by the astronomical salaries of a few stars. Because it is an average, the mean is strongly in�uenced by these really large values, so it is quite high. In contrast, the median is completely unaffected by the magnitude of the really large salaries, so it is much smaller. (For example, the median would not change by a single cent if Clayton Kershaw, the highest paid player, made $31 billion instead of his $31 million, but the mean would increase to almost $40 million.)

In many situations like this, where the data are skewed to the right (a few extremely large salaries not balanced by any extremely small salaries), most people would argue that the median is a more representative measure of central tendency than the mean. However, both are often quoted. And for variables that are not skewed in one direction or the other, not skewed in one direction or the other, not the mean and median are often quite close to one another.

The mode is the value that appears most often, and it can be calculated in Excel with the MODE function. In most cases where a variable is essentially continuous, the mode is not very interesting because it is often the result of a few lucky ties. However, the mode for the salary data in Figure 2.10 is not a result of luck. Its value, $507,500, is the minimum

For highly skewed data, the median is typically a better measure of central tendency. The median is unaffected by the extreme values, whereas the mean can be very sensitive to extreme values.

Formula for the Mean

Mean = an i = 1

XiXiX

n (2.1)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 33

possible salary set by the league. As shown in cell C4 (with a COUNTIF formula), this value occurred 44 times. In other words, close to 5% of the players earn the minimum possible salary. This is a good example of learning something you probably didn’t know simply by exploring the data.

CHANGES IN EXCEL 2010

Two new versions of the MODE function were introduced in Excel 2010: MODE.MUTwo new versions of the MODE function were introduced in Excel 2010: MODE.MUT LT and MODE.SNGL. The latter is the same as the older MODE function. The MULT version returns multiple modes if there are multiple modes.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20

FEDCBA Measures of central tendency Measures of variability

$30,492,500 $5,249,750

30,047,313,992,349 $5,481,543 $4,084,496

Range Interquar�le range Variance Standard devia�on Mean absolute devia�on

$4,214,614Mean $1,650,000 Mode countMedian

Mode $507,500 44

Min, max, percen les, quar les Min $507,500

$31,000,000 $507,500 $507,570 $510,000 $515,000

$1,650,000 $7,500,000

$12,054,166 $16,148,172 $24,000,000

$519,000 $1,650,000 $5,768,750

Max Measures of shape 1.9398 3.5924

Skewness Kurtosis

0.01 0.05 0.10 0.20 0.50 0.80 0.90 0.95 0.99

1 2 3

P01 P05 P10 P20 Percentages of values <= given values

ValueP50 Percentage <= 43.32% 49.31% 53.69% 58.53% 62.44%

$1,000,000 $1,500,000 $2,000,000 $2,500,000 $3,000,000

P80 P90 P95 P99 Q1 Q2 Q3

Figure 2.10 Summary Measures of Baseball Salaries Using Excel Functions

Minimum, Maximum, Percentiles, and Quartiles Given a certain percentage such as 25%, what is the salary value such that this percentage of salaries is below it? This type of question leads to percentiles and quartiles. Speci�cally, for any percentage p, the pth percentile is the value such that a percentage p of all values are less than it. Similarly, the �rst, second, and third quartiles are the percentiles corresponding to p = 25%, p = 50%, and p = 75%. These three values divide the data into four groups, each with (approximately) a quarter of all observations. Note that the second quartile is equal to the median by de�nition. To complete this group of descriptive measures, we add the minimum and maximum values, with the obvious meanings.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

34 Chapter 2 Describing the Distribution of a Single Variable

You are probably aware of percentiles from standardized tests. For example, if you learn that your score in the verbal SAT test is at the 93rd percentile, this means that you scored better than 93% of those taking the test.

The minimum and maximum can be calculated with Excel’s MIN and MAX functions. For the percentiles and quartiles, you can use Excel’s PERCENTILE and QUARTILE functions. The PERCENTILE function takes two arguments: the data range and a value of p between 0 and 1. (It has to be between 0 and 1. For example, if you want the 95th percen- tile, you must enter the second argument as 0.95, not as 95.) The QUARTILE function also takes two arguments: the data range and 1, 2, or 3, depending on which quartile you want. Figure 2.10 shows the minimum, maximum, the three quartiles, and several commonly requested percentiles for the baseball data. Note that 25% of the players make no more than $519,000 (very close to the league minimum), and 25% of all players make more than $5,768,750. In fact, more than 1% of the players make more than $24 million, with Clayton Kershaw topping the list at $31 million.

Excel Tip: Entering Arguments for Copying Note the values in column C of Figure 2.10 for percentiles and quartiles. These allow you to enter one formula for the percentiles and one for quartiles that can then be copied down. Speci�cally, the formulas in cells B9 and B18 are

=PERCENTILE(‘Salaries 2015’!$D$2:$D$869,C9)

and

= QUARTILE(‘Salaries 2015’!$D$2:$D$869,C18)

(Here, ‘Salaries 2015’! is a reference to the worksheet that contains the data.) Always look for ways to make your Excel formulas copyable. It saves time and it avoids errors. And if you don’t want the values in column C to be visible, just color them white.

CHANGES IN EXCEL 2010

Excel’s PERCENTILE and QUARTILE functions can give strange results when there are only a few observations. For this reason, Microsoft added new functions in Excel 2010: PERCENTILE.EXC, PERCENTILE.INC, QUARTILE.EXC, and QUARTILE.INC, where EXC and INC stand for exclusive and inclusive. The INC functions work just like the older PERCENTILE and QUARTILE functions. The EXC versions are recommended especially for a small number of observations. We continue to use the “old” PERCENTILE and QUARTILE functions, which still work fine.

If you are given a salary �gure such as $1 million, you might want to �nd the percent- age of all salaries less than or equal to this. This is essentially the opposite of a percentile question. In a percentile question, you are given a percentage and you want to �nd a value. Now you are given a value and you want to �nd a percentage. You can �nd this percentage in Excel by dividing a COUNTIF function by the total number of observations. A few such values are shown in the bottom right of Figure 2.10. The typical formula in cell F14, which is then copied down, is

=COUNTIF(‘Salaries 2015’!$D$2:$D$869,”<=”&E14)/COUNT(‘Salaries 2015’!$D$2:$D$869)

The following Excel tip explains this formula in more detail.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 35

Excel Tip: Creating a Condition with Concatenation The condition in this COUNTIF formula is a bit tricky. You literally want it to be “<=1000000”, but you want the formula to refer to the values in column E to enable copying. Therefore, you can concatenate (or string together) the literal part, “<=”, and the variable part, the reference to cell E14. The ampersand symbol (&) in the middle is the symbol used to concatenate in Excel. This use of concatenation to join literal and variable parts is especially useful in functions like COUNTIF that require a condition, so you should learn how to use it.

Measures of Variability If you learn that the mean (or median) salary in some company is $100,000, this tells you something about the “typical” salary, but it tells you nothing about the variability of the sala- ries. Percentiles and quartiles certainly tell you something about variability. In fact, by seeing a lot of percentiles, you know almost exactly how the data are spread out. (Just look at the list of percentiles in Figure 2.10 and add a few more if you want to �ll in the gaps.) In this subsection, we list a few other measures that summarize variability. These include the range, the interquar- tile range, the variance and standard deviation, and the mean absolute deviation. None of these says as much about variability as a complete list of percentiles, but they are all useful.

The range is a crude measure of variability. It is de�ned as the maximum value minus the minimum value. For the baseball salaries, this range is $30,492,500. This value cer- tainly indicates how spread out the salaries are, but it is too sensitive to the extremes. For example, if Clayton Kershaw’s salary increased to $41 million, the range would increase by $10 million—just because of one player.

A less sensitive measure is the interquartile range (abbreviated IQR). It is de�ned as the third quartile minus the �rst quartile, so it is really the range of the middle 50% of the data. For the baseball data, the IQR is $5,249,750. If you excluded the 25% of players with the lowest salaries and the 25% with the highest salaries, this IQR would be the range of the remaining salaries.

The range or a modi�ed range such as the IQR probably seems like a natural measure of variability, but there is another measure that is quoted much more frequently: standard deviation. Actually, there are two related measures, variance and standard deviation, and we begin with a de�nition of variance. The variance is essentially the average of the squared deviations from the variance is essentially the average of the squared deviations from the variance mean, where if XiXiX is a typical observation, its squared deviation from the mean is i is a typical observation, its squared deviation from the mean is i (XiXiX − mean)

2. As in the discussion of the mean, there is a sample variance, denoted by s2, and a population variance, denoted by σ2 (where σ is the Greek letter sigma). They are de�ned as follows:

Formula for Sample Variance

s2 = an i = 1

(XiXiX − mean) 2

n − 1 (2.2)

Formula for Population Variance

σ2 = an i = 1

(XiXiX − mean) 2

n (2.3)

Technical Note: Denominators of Variance Formulas It is traditional to use the capital letter N for the population size and lowercase n for the sample size, but this distinction is not important in this chapter. Furthermore, there is a technical rea- son why the sample variance uses n−1 in the denominator, not n, and this is explained in a later

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

36 Chapter 2 Describing the Distribution of a Single Variable

chapter. In any case, the difference is negligible when n is large. Excel implements both of these formulas. You can use the VAR.S function to obtain the sample variance (denominator n−1), and you can use the VAR.P function to obtain the population variance (denominator n).

To understand why the variance is indeed a measure of variability, look closely at either formula. If all observations are close to the mean, their squared deviations from the mean will be relatively small, and the variance will be relatively small. On the other hand, if at least a few of the observations are far from the mean, their squared deviations from the mean will be large, and this will cause the variance to be large. Note that because deviations from the mean are squared, an observation a certain amount below the mean contributes the same to variance as an observation that same amount above the mean.

There is a fundamental problem with variance as a measure of variability: It is in squared units. For example, if the observations are measured in dollars, the variance is in squared dollars. A more natural measure is the square root of variance. This is called the stand- ard deviation. Again, there are two versions of standard deviation. The sample standard deviation, denoted by s, is the square root of the quantity in Equation (2.2). The population standard deviation, denoted by σ, is the square root of the quantity in Equation (2.3).

To calculate either standard deviation in Excel, you can �rst �nd the variance with the VAR.S or VAR.P function and then take its square root. Alternatively, you can �nd it directly with the STDEV.S (sample) or STDEV.P (population) function.

We used these functions, actually the sample versions, in cells F4 and F5 of Figure 2.10 for the baseball salaries. The huge value for variance is in dollars squared, whereas the standard deviation is in dollars, about $5.48 million. By the way, you might argue that the population versions of these parameters should be used instead, and you would have a point. After all, the data set includes all 2015 baseball players. However, you can check that all 2015 baseball players. However, you can check that all with 868 players, the difference between the sample and population measures is negligible.

CHANGES IN EXCEL 2010

The functions for variance and standard deviation were renamed in Excel 2010. VARhe functions for variance and standard deviation were renamed in Excel 2010. VARhe functions for variance and standard deviation were renamed in Excel 2010. V and VARP and VARP and V were renamed to VARwere renamed to VARwere renamed to V .S and VAR.S and VAR.S and V .P, and SP, and SP TDEV and STDEVP were renamed to STDEV.S and STDEV.P. We decided to use the “new” versions for clarity (a switch from previous editions of the P. We decided to use the “new” versions for clarity (a switch from previous editions of the P book), but you can use either the old or the new versions.

The data in Figure 2.11 help clarify these concepts. It is in the �le Variability.xlsx. (It will help if you open this �le and look at its formulas as you read this.) The variable Diameter1 on the left has relatively low variability; its 10 values vary closely around its mean of approximately 100 (found in cell A16 with the AVERAGE function). To show how variance is calculated, we explicitly calculated the 10 squared deviations from the mean in column B. Then either variance, sample or population, can be calculated (in cells A19 and A22) as the sum of squared deviations divided by 9 or 10. Alternatively, they can be calculated more directly (in cells B19 and B22) with Excel’s VAR.S and VAR.P functions. Next, either standard deviation, sample or population, can be calculated as the square root of the corresponding variance or with Excel’s STDEV.S or STDEV.P functions.

The calculations are exactly the same for Diameter2 on the right. This variable also has mean approximately equal to 100, but its observations vary much more around 100 than the observations for Diameter1. As expected, this increased variability is obvious in a comparison of the variances and standard deviations for the two suppliers.

This example also indicates why variability is important. Imagine that you are about to buy 10 parts from one of two suppliers, and you want each part’s diameter to be close to

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 37

100 centimeters. Furthermore, suppose that Diameter1 in the example represents 10 ran- domly selected parts from supplier 1, whereas Diameter2 represents 10 randomly selected parts from Supplier 2. You can see that both suppliers are very close to the target of 100 on average, but the increased variability for Supplier 2 makes this supplier much less attrac- tive. There is a famous saying in operations management: Variability is the enemy. This example illustrates exactly what this saying means.

Empirical Rules for Interpreting Standard Deviation Now you know how to calculate the standard deviation, but there is a more important question: How do you interpret its value? Fortunately, the standard deviation often has a very natural interpretation, which is why it is quoted so frequently. This interpretation can be stated as three empirical rules. (“Empirical” means that they are based on com- monly observed data, as opposed to theoretical mathematical arguments.) Speci�cally, if

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F Low variability supplier High variability supplier

Diameter 1 Sq dev from qS2eteaiDaem qm qSm S2m 2rm rem etm tm em emm mam aim iDm Dnm nam aem e dev from mean 694438.912.301140016.616.201 693931.1466.39125013.0152.301 616374.23478.021106286.3143.69 695457.30162.011163502.4172.69 696970.79213.711163029.3177.301 633441.30132.011129207.654.79 651752.27845.07167803.322.89 639575.566335.93148304.767.201 613756.890122.331144313.265.101 698073.319.101146035.361.89

MeannaeM 100.074930.001

Sample e variancelpmaSecnairav e variancev e variancelv lpv pmv mav aSv Sev ecv cv nv nav aiv irv rv av a 3563.6373563.6378901.98901.9

noitalupoPecnairav nv nov oiv itv tav alv luv upv pov oPv Pev ecv cnv nav aiv irv rv av a variance 7827.2667827.2668891.88891.8

Sample standard lpd ed eld lpd pmd mad aSd Snd nod oid itd tad aid ivd ved e standard 1631.721631.722810.32810.3

standard lpd nd nod oid itd tad ald lud upd pod oPd Pnd nod oid itd tad aid ivd ved e standard 5347.525347.524368.24368.2

m

r H

m

v

v

d

d

r H

m

v

v

d

d

r H

m

v

v

d

d

Figure 2.11 Calculating Variance and Standard Deviation

Variability is usually the enemy. Being close to a target value on average is not good enough if there is a lot of variability around the target.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

38 Chapter 2 Describing the Distribution of a Single Variable

the values of this variable are approximately normally distributed (symmetric and bell- shaped), then the following rules hold:

■ Approximately 68% of the observations are within one standard deviation of the mean, that is, within the interval X ± s.

■ Approximately 95% of the observations are within two standard deviations of the mean, that is, within the interval X ± 2s.

■ Approximately 99.7% of the observations—almost all of them—are within three standard deviations of the mean, that is, within the interval X ± 3s.

Fortunately, many variables in real-world data are approximately normally distributed, so these empirical rules correctly apply. (The normal distribution is discussed in depth in Chapter 5.)

Usefulness of Standard Deviation Variability is an important property of any numerical variable, and there are several measures for quantify- ing the amount of variability. Of these, standard devia- tion is by far the most frequently quoted measure.

It is measured in the same units as the variable, it has a long tradition, and, at least for many data sets, it obeys the empirical rules discussed here. These empirical rules give a very specific meaning to stand- ard deviation.

F u n da m e n ta l I n s i g h t

1 2 3 4 5

H IH I J KJ K L ML M N ON O Do empirical rules apply?

Lower endpoint Upper endpoint # below lower# below lower # above upper# above upper % below lower% below lower % above upper % between –$1,266,930 –$6,748,473

–$12,230,016

$9,696,157 $15,177,700 $20,659,243

0 0% 14.75% 5.99% 2.76%

85.25% 94.01% 97.24%

0 0% 0

0 01280 0 520 0520 0 24 0%

0 0 0 0 0 0 0 0

Rule 1 Rule 2 Rule 3

Figure 2.12 Empirical Rules for Baseball Salaries

These empirical rules give a concrete meaning to standard deviation for symmetric, bell-shaped distributions. However, they tend to be less accurate for skewed distributions.

As an example, if the parts supplied by the suppliers in Figure 2.11 have diameters that are approximately normally distributed, then the intervals in the empirical rules for supplier 1 are about 100 ± 3, 100 ± 6, and 100 ± 9. Therefore, about 68% of this supplier’s parts will have diameters from 97 to 103, 95% will have diameters from 94 to 106, and almost none will have diameters below 91 or above 109. Obviously, the situation for supplier 2 is much worse. With a standard deviation slightly larger than 25, the second empirical rule implies that about 1 out of every 20 of this supplier’s parts will be below 50 or above 150. It is clear that supplier 2 has to reduce its variability. In fact, this is exactly what almost all suppliers are continuously trying to do: reduce variability.

Returning to the baseball data, Figure 2.10 indicates that the standard deviation of sal- aries is about $5.482 million. (The variance is shown, but because it is in squared dollars, it is a huge value with no meaningful interpretation.) Can the empirical rules be applied to these baseball salaries? The answer is that you can always try, but if the salaries are not at least approximately normally distributed, the rules won’t be very accurate. And because of obvious skewness in the salary data (due to the stars with astronomical salaries), the assumption of a normal distribution is not a good one.

Nevertheless, the rules are checked in Figure 2.12. For each of the three rules, the lower and upper endpoints of the corresponding interval are found in columns I and J. Right away there are problems. Because the standard deviation is larger than the mean, all three lower larger than the mean, all three lower larger

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 39

endpoints are negative, which automatically means that there can be no salaries below them. But continuing anyway, the COUNTIF was used (again with concatenation) to �nd the number of salaries above the upper endpoints in column L, and the corresponding percentages appear in column N. Finally, subtracting columns M and N from 100% in column O gives the percent- ages between the endpoints. These three percentages, according to the empirical rules, should be about 68%, 95%, and 99.7%. Rules 2 and 3 are not way off, but rule 1 isn’t even close.

The point of these calculations is that even though the empirical rules give substantive meaning to the standard deviation for many variables, they should be applied with caution, especially when the data are clearly skewed.

Before leaving variance and standard deviation, you might ask why the deviations from the mean are squared in the de�nition of variance. Why not simply take the squared in the de�nition of variance. Why not simply take the squared absolute deviation from the mean? For example, if the mean is 100 and two observations have values 95 and 105, then each has a squared deviation of squared deviation of squared 25, but each has an absolute deviation of only 5. Wouldn’t this latter value be a more natural measure of variability? Intuitively, it would, but there is a long history of using squared deviations. They have many attractive theoretical properties that are not shared by absolute deviations. Still, some analysts quote the mean absolute deviation (abbreviated as MAD) as another measure of variability, particularly in time series analysis. It is de�ned as the average of the absolute deviations.

Formula for Mean Absolute Deviation

MAD = an i = 1

│XiXiX − mean│

n (2.4)

There is another empirical rule for MAD: For many (but not all) variables, the standard deviation is approximately 25% larger than MAD, that is, s ≈ 1.25MAD. Fortunately, Excel has a function, AVEDEV, that performs the calculation in Equation (2.4). Using it for the base- ball salaries in Figure 2.10, you can see that MAD is about $4.08 million. If this is multiplied by 1.25, the result is slightly over $5.1 million, which is not too far from the standard deviation.

Measures of Shape There are two �nal measures of a distribution you will hear occasionally: skewness and kurtosis. Each of these has not only an intuitive meaning but also a speci�c numeric meas- ure. We have already mentioned skewness in terms of the baseball salaries. It occurs when there is a lack of symmetry. A few stars have really large salaries, and no players have really small salaries. More speci�cally, the largest salaries are much farther to the right of the mean than the smallest salaries are to the left of the mean. This lack of symmetry is usually appar- ent from a histogram of the salaries, discussed in the next section. We say that these salaries are skewed to the right (or skewed to the right (or skewed to the right positively skewed) because the skewness is due to the really large salaries. If the skewness were due to really small values (as might occur with tempera- ture lows in Antarctica), then we would call it skewness to the left (or skewness to the left (or skewness to the left negatively skewed).

In either case, a measure of skewness can be calculated with Excel’s SKEW func- tion. For the baseball data, it is approximately 1.9, as shown in Figure 2.10. You don’t need to know exactly what this value means. Simply remember that (1) it is positive when there is skewness to the right, (2) it is negative when there is skewness to the left, (3) it is approximately zero when there is no skewness (the symmetric case), and (4) its magnitude increases as the degree of skewness increases.

The other measure, kurtosis, has to do with the “fatness” of the tails of the distribution relative to the tails of a normal distribution. Remember from the third empirical rule that a normal distribution has almost all of its observations within three standard deviations of the

Kurtosis is all about extreme events—the kind that occurred in late 2008 and sent Wall Street into a panic.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

40 Chapter 2 Describing the Distribution of a Single Variable

mean. In contrast, a distribution with high kurtosis has many more extreme observations. Is this important in reality? It certainly is. For example, many researchers believe the Wall Street meltdown in late 2008 was at least partly due to �nancial analysts relying on the normal distribution, whereas in reality the actual distribution had much fatter tails. More speci�cally, �nancial analysts followed complex mathematical models that indicated really extreme events would virtually never occur. Unfortunately, a number of extreme events did occur, and they sent the economy into a deep recession.1 extreme events would virtually never occur. Unfortunately, a number of extreme events

1 extreme events would virtually never occur. Unfortunately, a number of extreme events

Although kurtosis can be calculated in Excel with the KURT function (it is about 3.6 for the baseball salaries), we won’t have any use for this measure in the book. Nevertheless, when you hear the word kurtosis, think of fat tails and extreme events. And if you plan to work on Wall Street, you should de�nitely learn more about kurtosis.

Numerical Summary Measures in the Status Bar You might have noticed that summary measures sometimes appear automatically in the status bar at the bottom of your Excel window. The rule is that if you select multiple cells (in a single column or even in multiple columns), selected summary measures appear for the selected cells. (Nothing appears if only a single cell is selected.) These can be very handy for quick lookups. Also, you can choose the summary measures that appear by right- clicking the status bar and selecting your favorites.

2-4b Numerical Summary Measures with StatTools

In the previous subsection, Excel’s built-in functions (AVERAGE, STDEV, and others) were used to calculate a number of summary measures. A much quicker way is to use Palisade’s StatTools add-in. As we promised earlier, StatTools requires almost no learning curve. After you go through this section, you will know everything you need to know to use StatTools like a professional.

1The popular book The Black Swan, by Nassim Nicholas Taleb, is all about extreme events and the trouble they can cause.

Introduction to StatTools

E X A M P L E 2.3 BASEBALL SALARIES (CONTINUED)

Use the StatTools add-in to generate the same summary measures of baseball salaries that were calculated in the previous subsection. Objective To learn the fundamentals of StatTools and to use this add-in to generate sum- mary measures of baseball salaries.

Solution Because this is your first exposure to StatTools, we first explain how to get started. StatTools is part of the Palisade DecisionTools Suite® Because this is your first exposure to StatTools, we first explain how to get started.

® Because this is your first exposure to StatTools, we first explain how to get started.

, and you have access to the free academic version of this suite as a result of purchasing the book. The explanations and screenshots in the book are based on version 7 of the suite. (It is possible that by the time you are reading this, you might have a later version.) In any case, you must install the suite before you can use StatTools.

Once the suite is installed, you can load StatTools by double-clicking the StatTools item in the list of programs on the Windows Start menu. (It is in the Palisade group.) If Excel is already running, this will load StatTools on top of Excel. If Excel isn’t running, this will launch Excel and load StatTools as well. You will know that StatTools is loaded when you see the StatTools tab and ribbon, as shown in Figure 2.13.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 41

Figure 2.14 StatTools Application Settings Dialog Box

Figure 2.13 StatTools Ribbon

The buttons in the Analyses group on this ribbon are for performing the various statis- tical analyses, many of which are explained in the book. But before you can use these, you need to know a few basic features of StatTools.

Basic StatTools Features

1. There is an Application Settings item on the Utilities dropdown list. When you click it, you get the dialog box in Figure 2.14. (All of the other add-ins in the Palisade

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

42 Chapter 2 Describing the Distribution of a Single Variable

suite have a similar Application Settings item.) This is where you can change overall settings of StatTools. You can experiment with these settings, but the only one you will probably ever need to change is the Reports Placement setting—where your results are placed. The dropdown list in Figure 2.14 shows the four possibilities. We tend to prefer the Active Workbook option (this places the results on a new worksheet) or the Query for Starting Cell option (this lets you choose the cell where your results will start).

2. If you want to unload StatTools without closing Excel, you can select Unload StatTools Add-In from the Utilities dropdown list.

3. Although you probably won’t need it, there is plenty of online help, including example spreadsheets, on the Help dropdown list. (These example files were created by Albright.)

4. This is the important one. Before you can perform any statistical analysis, you must define a StatTools data set. You do this by clicking the Data Set Manager button. Try it now. With the Baseball Salaries.xlsx file open, make sure any cell in the 2015 data set is selected, and click the Data Set Manager button. You will first be asked whether you want to add the range $A$1:$D$869 as a new StatTools data set. Click Yes. Then you will see the dialog box in Figure 2.15. StatTools makes several guesses about your data set. They are generally correct, but you can always override them. First, it gives your data set a generic name, such as Data Set #1. You can accept this or supply a more meaningful name as has been done here. Second, you can override the data range. (Note that this range should include the variable names in row 1.) Third, the default layout is that variables are in columns, with variable names in the top row. You should override these settings only in rare cases where your data set has the roles of rows and columns reversed. Finally, if you want to apply some color to your data set, you can check the Apply Cell Formatting option. (We generally don’t, but that’s just a personal preference.)

Figure 2.15 StatTools Data Set Manager Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 43

For now, simply click OK. You now have a StatTools data set, and you can begin the analysis. Fortunately, this step has to be done only once. If you save the �le and reopen it at a later date, StatTools remembers this data set. So when we said that StatTools has a short learning curve, this is it—simply remember to designate a StatTools data set before you begin any analysis.

Now that the preliminaries are over, you can quickly generate the summary meas- ures for the Salary variable. To do so, select One-Variable Summary from the Summary Statistics dropdown list. You will see the dialog box in Figure 2.16. (If you see two col- umns of variables in the top pane, click the Format button and select Unstacked.) This is a typical StatTools dialog box. In the top section, you can select a StatTools data set and one or more variables. In the bottom section, you can select the measures you want. For this example, we have chosen all of the measures. (In addition, you can add other percentiles if you like.) Before you click OK, click the “double-check” button to the left of the OK button. This brings up the Application Settings dialog box already shown in Figure 2.14. This is your last chance to designate where you want to place the results. (We chose Active Workbook, which means that the results are placed in a new worksheet automatically named One Var Summary.)

StatTools Tip: Saving Favorite StatTools ChoicesSaving Favorite StatTools ChoicesSaving F In general, you might want to choose only your favorite summary measures, such as mean, median, standard deviation, minimum, and maximum. This requires you to uncheck all of the others. To avoid all of this unchecking in future analyses, you can click the Save button in the middle of the bottom left group. This saves your choices as the defaults from then on.

The results appear in Figure 2.17. If you compare these to the measures from Excel functions in Figure 2.10, you will see some slight discrepancies in the percentiles and quar- tiles. (The kurtosis is also quite different.) When Palisade developed StatTools, it did not fully trust Excel’s statistical functions, so it developed its own based on best practices from

Figure 2.16 StatTools One Variable Summary Dialog Box

You must create a StatTools data set with the Data Set Manager before you can perform any analysis with StatTools. But this generally takes only a few mouse clicks.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

44 Chapter 2 Describing the Distribution of a Single Variable

the statistical literature. In fact, if you select any of the result cells, you will see functions such as StatMean, StatStdDev, StatPercentile, and so on. Don’t be overly concerned that the percentiles and quartiles don’t exactly match. Both sets provide the same basic picture of how the salaries are distributed.

Technical Note: Discrepancies in Percentiles and Quartiles Why is there a discrepancy at all in the percentiles and quartiles? Suppose, for exam- ple, that you want the 95th percentile and there are 868 observations. By de�nition, the 95th percentile is the value such that 95% of the values are below it and 5% are above it. Now, 95% of 868 is 824.6. This suggests that you should sort the 868 observations in increasing order and locate the 824th and 825th smallest. For the baseball data, these salaries are $16,6,6 000,0,0 000 and $16,6,6 227,7,7 957. Excel reports the 95th percentile as $16,6,6 148,172727 , whereas StatTools reports it as $16,6,6 227,7,7 957. In words, Excel interpolates and StatTools

7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

A BA B Salary

One Variable SummaryOne Variable SummaryOne Variable Summar Salary 2015 Data

Mean

Variance

Std. Dev.

Skewness

Kurtosis

Median

Mean Abs. Dev.

Mode

Minimum

Maximum

Range

Count

Sum

1st Quar�le

3rd Quar�le

Interquar�le Range

$4214613.53 30047313992348.70 $5481543.03 1.9398 6.5924 $1650000.00 $4084496.49 $507500.00 $507500.00 $31000000.00 $30492500.00 868 $3658284542.00 $519000.00 $5750000.00 $5231000.00

1.00%

2.50%

5.00%

10.00%

20.00%

80.00%

90.00%

95.00%

97.50%

99.00%

$507500.00 $507500.00 $507500.00 $510000.00 $515000.00 $7500000.00 $12083333.00 $16227957.00 $21250000.00 $24000000.0034

Figure 2.17 StatTools Summary Measures for Salaries

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 45

doesn’t, but either is reasonable. As for kurtosis, Excel provides an index that is 0 for a normal distribution, whereas StatTools returns a value 3 for a normal distribution. So the two indexes differ by 3. (For what it’s worth, Wikipedia indicates that either de�nition of kurtosis is acceptable.)

There are several other things to note about the StatTools output. First, it formats the results according to its own rules. If you would like fewer or more decimals or any other formatting changes, you can certainly reformat in the usual way. Second, the fact that there are formulas in these result cells indicates that they are “live.” If you go back to the data and change any of the salaries, the summary measures will update automatically. This is true for most, but not quite all, StatTools outputs. (Regression analysis, discussed in Chapters 10 and 11, is the most important situation where the StatTools results are not live.) Finally, if you open a file with StatTools outputs but StatTools is not loaded, you might see #VALUE! errors in the cells. These can be fixed by loading StatTools. (You might have to close the file, load StatTools, and open the file again.) ■

2-4c Analysis ToolPak Add-In

There is another Excel add-in that can be used to generate summary measures and other statistical outputs: the Analysis ToolPak. Its advantage is that it is free and is included in Excel. In fact, it has been included in Excel for decades. However, it has remained virtually (or completely?) unchanged in all those years, essentially Excel’s forgotten stepchild. As Excel has evolved, the Analysis ToolPak has become increasingly outdated. For example, it contains a tool for creating histograms that is far surpassed by the histogram graph type introduced in Excel 2016. Evidently, Microsoft continues to include the Analysis ToolPak for backward compatibility, but it is at the bottom of Microsoft’s priority list.

We won’t say more about the Analysis ToolPak in the book because we much prefer Excel’s other built-in statistical tools and/or StatTools. However, for those of you who might want to use it, we created a “how to” guide at the author’s website: http://kelley .iu.edu/albrightbooks/Free_downloads.htm.

2-4d Charts for Numerical Variables

There are many graphical ways to indicate the distribution of a numerical variable, but the two we prefer and discuss in this subsection are histograms and box plots (also called box-whisker plots). Each of these is useful primarily for cross-sectional variables. If they are used for time series variables, the time dimension is lost. Therefore, we discuss time series graphs for time series variables separately in the next section.

Histograms A histogram is the most common type of chart for showing the distribution of a numerical variable. It is based on binning the variable—that is, dividing it up into discrete categories. The histogram is then a column chart of the counts in the various categories (usually with no gaps between the vertical bars). In general, a histogram is great for showing the shape of a distribution. We are particularly interested in whether the distribution is symmetric or is skewed in one direc- tion. The concept is a simple one, as illustrated in the following continuation of the baseball salary example.

Histograms Versus Summary Measures It is important to remember that each of the summary measures we have discussed for a numerical variable—mean, median, standard deviation, and others—describes only one aspect of a numerical variable. In contrast, a histogram provides the complete picture. It indicates the “center” of the distribution, the variability, the skewness, and other aspects, all in one convenient chart.

F u n da m e n ta l I n s i g h t

If you open a file and it has errors in StatTools outputs, load StatTools. It is possible that you might have to close the file and reopen it.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

46 Chapter 2 Describing the Distribution of a Single Variable

A histogram can be created with Excel tools only, but the process is quite tedious. It is much easier to use StatTools.

Figure 2.18 Settings for Histogram Bins

E X A M P L E 2.3 BASEBALL SALARIES (CONTINUED)

We have already mentioned that the 2015 baseball salaries are skewed to the right. How does this show up in a histogram of salaries? Objective To see the shape of the salary distribution through a histogram.

Solution There are several ways to create a histogram in Excel, as illustrated in the finished version of the baseball salaries file. The easiest way, assuming you are using Excel 2016, is to use the Histogram chart type introduced in Excel 2016. You simply select the Salary variable and choose the Histogram chart type from the Statistics group (the icon that looks like a histogram) on the Insert ribbon. There are actually two histogram types. We chose the one on the left, but you can experiment with the one on the right that has a cumulative curve above it.

Excel automatically chooses bins for the histogram, but you can right-click the hori- zontal axis and select Format Axis. This leads to the dialog box in Figure 2.18, where you can choose the Bin width or the Number of bins (but not both). This takes some

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 47

experimentation, but we chose 10 bins, and we checked the Overflow bin option with a value of 20 million, so that the rightmost bar will be the count of all salaries greater than $20 million. We also chose a number format of currency with zero decimals for the bin labels.

The resulting histogram appears in Figure 2.19. It has one added enhancement, where data labels “outside” the bars indicate the counts of the various bins. You can use the Chart Elements dropdown list on the Chart Tools Design ribbon to add the data labels. This ribbon also lets you modify the histogram in a variety of ways.

Figure 2.19 Salary Histogram (Excel 2016)

Histogram of Salary

($

17 ,83

4,1 67

,...

>$ 20

,00 0,0

00

600

500 520

98 6868 46 37 34 15 14 12 24

400

300

200

100

0

($ 15

,66 8,3

33 ,...

($ 13

,50 2,5

00 ,...

($ 13

,50 2,5

00 ,...

($ 13

,50 2,5

00 ,...

($ 50

7,5 00

,...

($ 2,6

73 ,33

3,. ..

($ 2,6

73 ,33

3,. ..

($ 2,6

73 ,33

3,. ..

($ 4,8

39 ,16

7,. ..

($ 9,1

70 ,83

3,. ..

($ 11

,33 6,6

67 ,...

($ 7,0

05 ,00

0,. ..

If you are not yet using Excel 2016 and you want to create a histogram with Excel tools only, it is possible but tedious. You have to list the desired bins, use Excel formulas to �nd the bin counts, and create a column chart from these counts. The procedure is illus- trated in the �nished version of the baseball salaries �le.

Alternatively, you can use StatTools to create a histogram very quickly. Once you have designated a StatTools data set, you select Histogram from the Summary Graphs dropdown list. This leads to the dialog box in Figure 2.20.

Figure 2.20 StatTools Histogram Dialog Box

You can check Salary and simply click OK to get the histogram in Figure 2.21 with the StatTools “auto” bins. Alternatively, you can change the options at the bottom of the dialog box to �ne-tune the bins. The output shows the histogram and the bin information. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

48 Chapter 2 Describing the Distribution of a Single Variable

Figure 2.21 StatTools Salary Histogram

7

9 8

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

A BA B C DC D E FE F G

Histogram Bin Min Bin Max Freq. Rel. Freq.Bin Midpoint Prb. Density Bin #1 Bin #2 Bin #3 Bin #4 Bin #5 Bin #6 Bin #7 Bin #8 Bin #9 Bin #10 Bin #11

$507500.00 $3279545.45 $6051590.91 $8823636.36

$11595681.82 $14367727.27 $17139772.73 $19911818.18 $22683863.64 $25455909.09 $28227954.55

$3279545.45 $6051590.91 $8823636.36

$11595681.82 $14367727.27 $17139772.73 $19911818.18 $22683863.64 $25455909.09 $28227954.55 $31000000.00

$1893522.73 $4665568.18 $7437613.64

$10209659.09 $12981704.55 $15753750.00 $18525795.45 $21297840.91 $24069886.36 $26841931.82 $29613977.27

557 104 63 47 40 18 12 13 11 2 1

0.6417 0.1198 0.0726 0.0541 0.0461 0.0207 0.0138 0.0150 0.0127 0.0023 0.0012

0.000000231 0.000000043 0.000000026 0.000000020 0.000000017 0.000000007 0.000000005 0.000000005 0.000000005 0.000000001 0.000000000

Salary/Salary 2015 Data

$507500.00 $3279545.45 $1893522.73

Histogram of Salary/Salary 2015 Data

37

600

Fr eq

ue nc

y

500

400

300

200

100

35 00

00 00

.0 0

30 00

00 00

.0 0

25 00

00 00

.0 0

20 00

00 00

.0 0

15 00

00 00

.0 0

10 00

00 00

.0 0

50 00

00 0.

00

0. 00

0

Admittedly, getting exactly the bins you want can be a challenge either with Excel 2016’s histogram chart type or with StatTools. For example, the �le Late or Lost Baggage.xlsx contains (�ctional) data on bags late or lost on 456 �ights. Speci�cally, column B contains the count of bags late or lost on each �ight, and these counts are all integers from 0 to 8. In this case, the “natural” bins for a histogram are the nine possible integer values. Unfortunately, these are not Excel’s (or StatTools’) default bins. You can not Excel’s (or StatTools’) default bins. You can not check the �nished version of the �le to see how the desired integer bins can be created, as illustrated in Figure 2.22. It helps to understand that the histogram bin convention, for Excel or otherwise, is to be “greater than” on the left end and “less than or equal to” on the right end. For example, the label (1, 2] for the third bar means greater than 1 and less than or equal to 2. But because the variable’s values are integers, this translates to “exactly 2.”

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 49

Box Plots A box plot (also called a box-whisker plot) is an alternative type of chart for showing the distribution of a variable. For the distribution of a single variable, a box plot is not nearly as popular as a histogram, but as you will see in the next chapter, side-by-side box plots are very useful for comparing distributions, such as salaries for men versus salaries for women. As with histograms, box plots are “big picture” charts. They show you at a glance some of the key features of a distribution. We explain how they do this in the following continuation of the baseball salary example.

Figure 2.22 Excel 2016 Histogram with Integer Bins

Histogram of Bags Late or Lost

120

100

1616

67

113113

101

7777

44

23 13

2 ≤ 0 (0, 1) (1, 2) (2, 3) (3, 4) (4, 5) (5, 6) (6, 7) > 7

80

60

40

20

0

E X A M P L E 2.3 BASEBALL SALARIES (CONTINUED)

A histogram of the salaries clearly indicated the skewness to the right. Does a box plot of salaries indicate the same behavior? Objective To illustrate the features of a box plot, particularly how it indicates skewness.To illustrate the features of a box plot, particularly how it indicates skewness.T

Solution Box plots are fairly complex chart types, and until Excel 2016, the only viable option in Excel was to use StatTools. However, recognizing their importance, Microsoft introduced box plots in Excel 2016. You can create a box plot of a single variable like Salary almost exactly like you create a histogram. You select the variable and then choose the Box and Whisker chart type from the Statistics group on the Insert ribbon. The resulting box plot appears in Figure 2.23. This default box plot is probably sufficient for your needs, but you can right-click anywhere on the plot, select Format Data Series, and experiment with the options. The Chart Tools Design ribbon contains more options.

Alternatively, you can use StatTools. One advantage of StatTools, as you will see shortly, is that it contains a generic box plot for explaining the box plot elements. To get a StatTools box plot, you choose Box-Whisker Plot from the Summary Graphs dropdown list and fill out the resulting dialog box as shown in Figure 2.24. (If there are two columns of variables, click the Format button and select the Unstacked option.) To get a generic box plot (for learning purposes), you can check the bottom option.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

50 Chapter 2 Describing the Distribution of a Single Variable

The resulting box plot appears in Figure 2.25. It is essentially the same as the Excel version except that it is rotated 90 degrees.

The generic box plot at the bottom (not drawn to scale) spells out the various box plot elements. The box itself (top to bottom for the Excel version, left to right for the StatTools version) extends from the first quartile to the third quartile, so it contains the middle half of the data. The line inside the box is positioned at the median, and the asterisk is positioned at the mean. The lines (whiskers) coming out either side of the box extend to 1.5 IQRs (interquartile ranges) from the corresponding quartile. These lines generally include most of the observations outside the box. More dis- tant values, called outliers, are denoted separately. Some software packages, including StatTools, distinguish between “mild” and “extreme” outliers, but Excel doesn’t make this distinction.

The box plot of salaries in Figure 2.23 (or 2.25) should now make more sense. It is typical of an extremely right-skewed distribution. The mean is much larger than the median, there is virtually no whisker out of the low side of the box (because the first quar- tile is barely above the minimum value—remember all the players earning $507,500?), and there are many outliers on the high side (the stars). In fact, many of these outliers overlap

Figure 2.23 Box Plot of Salary (Excel 2016)

Box Plot of Salary

$35,000,000

$30,000,000

$25,000,000

$20,000,000

$15,000,000

$10,000,000

1

$5,000,000

$0

Figure 2.24 StatTools Box Plot Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 51

one another. You can decide whether you prefer the histogram of salaries to the box plot or vice versa, but both are clearly telling the same story.

Box plots have existed for several decades, and they are probably more popular now than ever. The implementation of box plots in StatTools is just one version of what you might see. Some software packages draw box plots vertically, not horizontally. Also, some vary the height of the box to indicate some other feature of the distribution. (The height of the box is irrelevant in Excel’s and StatTools’s box plots.) Nevertheless, they all follow the same basic rules and provide the same basic information. ■

Figure 2.25 StatTools Box Plot of Salary

Box-Whisker Plot of Salary/Salary 2015 Data

0 5000000

Whiskers extend to the furthest observa�ons that are no more than 1.5 IQR from the edges of the box. Mild outliers are observa�ons between 1.5 IQR and 3 IQR from the edges of the box. Extreme outliers are greater than 3 IQR from the edges of the box.

10000000 15000000 20000000

1st Quar�le Mean

25000000 30000000 35000000

3rd Quar�le

Lower Whisker

Extreme Outlier

Mild Outlier

Median

Upper Whisker

Interquar�le Range (IQR)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

52 Chapter 2 Describing the Distribution of a Single Variable

P R O B L E M S

Level A 6. The file P02_06.xlsx lists the average time (in

minutes) it takes citizens of 379 metropolitan areas to travel to work and back home each day. a. Create a histogram of the daily commute times. b. Find the most representative average daily

commute time across this distribution. c. Find a useful measure of the variability of these

average commute times around the mean. d. The empirical rule for standard deviations

indicates that approximately 95% of these average travel times will fall between which two values? For this particular data set, is this empirical rule at least approximately correct?

7. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. a. Indicate the data type for each of the six variables

included in this data set. b. Create a histogram of the Age variable. How would

you characterize the age distribution for these employees?

c. What proportion of these full-time Beta employees are female?

d. Find appropriate summary measures for each of the numerical variables in this data set.

e. For the Salary variable, explain why the empirical rules for standard deviations do or do not apply.

8. The file P02_08.xlsx contains data on 500 shipments of one of the computer components that a company manufactures. Specifically, the proportion of items that are defective is listed for each shipment. a. Create a histogram that will help a production

manager understand the variation of the proportion of defective components in the company’s shipments.

b. Is the mean or median the most appropriate measure of central location for this data set? Explain your reasoning.

c. Discuss whether the empirical rules for standard deviations apply. Can you tell, or at least make

an educated guess, by looking at the shape of the histogram? Why?

9. The file P02_09.xlsx lists the times required to service 200 consecutive customers at a (fictional) fast-food restaurant. a. Create a histogram of the customer service times.

How would you characterize the distribution of service times?

b. Calculate the mean, median, and first and third quartiles of this distribution.

c. Which measure of central tendency, the mean or the median, is more appropriate in describing this distribution? Explain your reasoning.

d. Find and interpret the variance and standard deviation of these service times.

e. Are the empirical rules for standard deviations applicable for these service times? If not, explain why. Can you tell whether they apply, or at least make an educated guess, by looking at the shape of the histogram? Why?

10. The file P02_10.xlsx contains midterm and final exam scores for 96 students in a corporate finance course. a. Create a histogram for each of the two sets of exam

scores. b. What are the mean and median scores on each of

these exams? c. Explain why the mean and median values are

different for these data. d. Based on your previous answers, how would

you characterize this group’s performance on the midterm and on the final exam?

e. Create a new column of differences (final exam score minus midterm score). A positive value means the student improved, and a negative value means the student did the opposite. What are the mean and median of the differences? What does a histogram of the differences indicate?

11. The file P02_11.xlsx contains data on 148 houses that were recently sold in a (fictional) suburban community. The data set includes the selling price of each house,

Box Plots Versus Histograms Box plots and histograms are complementary ways of displaying the distribution of a numeri- cal variable. Although histograms are much more

popular and are arguably more intuitive, box plots are still informative. Besides, side-by-side box plots are very useful for comparing two or more populations, as illustrated in the next chapter.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-4 Descriptive Measures for Numerical Variables 53

along with its appraised value, square footage, number of bedrooms, and number of bathrooms. a. Which of these variables are continuous? Which

are discrete? b. Create histograms for the appraised values and

selling prices of the houses. How are these two distributions similar? How are they different?

c. Find the maximum and minimum sizes (measured in square footage) of all sample houses.

d. Find the house(s) at the 80th percentile of all sample houses with respect to appraised value. Find the house(s) at the 80th percentile of all sample houses with respect to selling price.

e. What are the typical number of bedrooms and the typical number of bathrooms in this set of houses? How do you interpret the word “typical”?

12. The file P02_12.xlsx includes data on the 50 top graduate programs in the United States, according to a 2009 U.S. News & World Report survey.U.S. News & World Report survey.U.S. News & World Report a. Indicate the type of data for each of the 10 variables

considered in the formulation of the overall ranking. b. Create a histogram for each of the numerical variables

in this data set. Indicate whether each of these distributions is approximately symmetric or skewed. Which, if any, of these distributions are skewed to the right? Which, if any, are skewed to the left?

c. Identify the schools with the largest and smallest annual out-of-state tuition and fee levels.

d. Find the annual out-of-state tuition and fee levels at each of the 25th, 50th, and 75th percentiles for these schools. For post-2007 Excel users only, find these percentiles using both the PERCENTILE. INC and PERCENTILE.EXE functions. Can you explain how and why they are different (if they are indeed different)?

e. Create a box plot to characterize this distribution of these MBA salaries. Is this distribution essentially symmetric or skewed? If there are any outliers on either end, which schools do they correspond to? Are these same schools outliers in box plots of any of the other numerical variables (from columns E to L)?

13. The file P02_13.xlsx contains the thickness (in centimeters) of 252 mica pieces. A piece meets specifications if its thickness is between 7 and 15 centimeters. a. What fraction of mica pieces meets specifications? b. Are the empirical rules for standard deviations at

least approximately valid for these data? Can you tell, or at least make an educated guess, by looking at a histogram of the data?

c. If the histogram of the data is approximately bell- shaped and you want about 95% of the observations to meet specifications, is it sufficient for the average and standard deviation to be, at least approximately, 11 and 2 centimeters, respectively?

14. Recall that the file Supermarket Transactions.xlsx contains over 14,000 transactions made by super- market customers over a period of approximately two years. Using these data, create side-by-side box plots for revenues broken down by state or province. Are these distributions essentially symmetric or skewed? Note that these box plots include revenues from coun- tries besides the United States. Do whatever it takes to create side-by-side box plots of revenue for only states within the United States.

(Hint: If you use StatTools, note that it will not let you define a second data set that is a subset of an existing data set. But you can copy data for the second question to a new worksheet or some other range of the data sheet.)

15. Recall that the file Baseball Salaries.xlsx contains data on 868 MLB players in the 2015 season. Using these data, create a box plot to characterize the distri- bution of salaries of all pitchers. Do the same for non- pitchers. Summarize your findings. (See the hint in the previous problem.)

16. The file P02_16.xlsx contains traffic data from 256 weekdays on four variables. Each variable lists the number of vehicle arrivals to a tollbooth during a specific five-minute period of the day. a. Create a histogram of each variable. How would

you characterize and compare these distributions? b. Find a table of summary measures for these

variables that includes (at least) the means, medians, standard deviations, first and third quartiles, and 5th and 95th percentiles. Use these to compare the arrival process at the different times of day.

Level B 17. The file P02_17.xlsx contains salaries of 200 recent

graduates from a (fictional) MBA program. a. What salary level is most indicative of those earned

by students graduating from this MBA program this year?

b. Do the empirical rules for standard deviations apply to these data? Can you tell, or at least make an educated guess, by looking at the shape of the histogram? Why?

c. If the empirical rules apply here, between which two numbers can you be about 68% sure that the salary of any one of these 200 students will fall?

d. If the MBA program wants to make a statement such as “Some of our recent graduates started out making X dollars or more, and almost all of them X dollars or more, and almost all of them X started out making at least Y dollars” for their Y dollars” for their Y promotional materials, what values of X and X and X Y would you suggest they use? Defend your choice.

e. As an admissions officer of this MBA program, how would you proceed to use these findings to market the program to prospective students?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

54 Chapter 2 Describing the Distribution of a Single Variable

18. The file P02_18.xlsx contains daily values of the Standard & Poor’s 500 Index from 1970 to mid-2015. It also contains percentage changes in the index from each day to the next. a. Create a histogram of the percentage changes and

describe its shape. b. Check the percentage of these percentage changes

that are more than k standard deviations from k standard deviations from k

the mean for k = 1, 2, 3, 4, and 5. Are these approximately what the empirical rules indicate or are there “fat” tails? Do you think this has any real implications for the financial markets? (Note that we have discussed the empirical rules only for k = 1, 2, and 3. For k = 4 and 5, they indicate that only 0.006% and 0.0001% of the observations should be this distant from the mean.)

2-5 TIME SERIES DATA When we analyze time series variables, summary measures such as means and standard deviations and charts such as histograms and box plots are often inappropriate. Our main interest in time series variables is how they change over time, and this information is lost in traditional summary measures and in histograms or box plots. Imagine, for example, that you are interested in daily closing prices of a stock that has historically been between 20 and 60. If you create a histogram with a bin such as 45 to 50, you will get a count of all daily closing prices in this interval—but you won’t know when they occurred. The histogram is missing a key feature: time. Similarly, if you report the mean of a time series such as the monthly Dow Jones average over the past 40 years, you will get a measure that isn’t very relevant for the current and future values of the Dow.

Therefore, we turn to a different but very intuitive type of graph called a time series graph. This is a graph of the values of one or more time series, using time on the horizontal axis, and it is always the place to start a time series analysis. We illustrate some possibilities in the following example.

E X A M P L E 2.4 CRIME IN THE UNITED STATES

The file Crime in US.xlsx contains annual data on violent and property crimes for the years 1960 to 2010. Part of the data is listed in Figure 2.26. This shows the number of crimes. The rates per 100,000 population are not shown, but they can be calculated easily.

Figure 2.26 Crime Data

1 2 3 4 5 6 7 8 9

10

A BA B C DC D E FE F G HG H I JI J K

Ye ar

V io

le nt

c ri

m e

to ta

l

Po pu

la �

on

M ur

de r

an d

no nn

eg lig

en t

m an

sl au

gh te

r

Fo rc

ib le

r ap

e

Ro bb

er y

A gg

ra va

te d

as sa

ul t

Pr op

er ty

c ri

m e

to ta

l

Bu rg

la ry

La rc

en y-

th e�

M ot

or v

eh ic

le th

e�

179,323,175 288,460 1,855,400 182,992,000 289,390 1,913,000 185,771,000 301,510 2,089,600 188,483,000 316,970 2,297,800 191,141,000 364,220 2,514,400 193,526,000 387,390 2,572,600 195,576,000 430,180 2,822,000 197,457,000 499,930 3,111,600

1960 1961 1962 1963 1964 1965 1966 1967 1968 199,399,000 595,010

9,110 8,740 8,530 8,640 9,360 9,960

11,040 12,240 13,800

17,190 17,220 17,550 17,650 21,420 23,410 25,820 27,620 31,670

107,840 106,670 110,860 116,470 130,390 138,690 157,990 202,910 262,840

154,320 156,760 164,570 174,210 203,050 215,330 235,330 257,160 286,700

3,095,700 3,198,600 3,450,700 3,792,500 4,200,400 4,352,000 4,793,300 5,403,500 6,125,200

912,100 949,600 994,300

1,086,400 1,213,200 1,282,500 1,410,100 1,632,100 1,858,900 3,482,700

328,200 336,000 366,800 408,300 472,800 496,900 561,200 659,800 783,600

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-5 Time Series Data 55

Are there any apparent trends in this data? If so, are the trends the same for the different types of crime?

Excel Tip: Formatting Long Variable Names Note the format of the variable names in row 1. If you have long variable names, one pos- sibility is to align them vertically and check the Wrap Text option. (These are both available through the Format Cells command, which can be accessed by right-clicking any cell.) With these changes, the row 1 labels are neither too tall nor too wide.

Objective To see how time series graphs help to detect trends in crime data.

Solution It is actually quite easy to create a time series graph with Excel tools only—no add-ins. We illustrate the process to the right of the data in the finished version of the crime file. But StatTools is a bit quicker and easier. We illustrate a few of the many time series graphs you could create from this data set. As usual, start by designating a StatTools data set. Then select Time Series Graph from the Time Series and Forecasting dropdown list. (Note that this item is not in the Summary Graphs group.) The resulting dialog box appears in not in the Summary Graphs group.) The resulting dialog box appears in not Figure 2.27. At the top, you can choose between a graph with a label and one without a label. The label is for time, so if you have a time variable (in this case, Year), choose the “with label” option. This leads to two columns of variables, one for the label (Lbl) and one for values (Val). Check Year in the Lbl column and select one or more variables in the Val column. For this first graph, we selected the Violent crime total and Property crime total variables to get started.

If you select multiple Val variables, the first option at the bottom lets you plot all variables in a single graph or create a separate graph for each. We chose a single graph. Furthermore, if you select exactly two Val variables, you can use two different Y-axis scales for the two variables. This is useful when the two variables are of very different mag- nitudes, as is the case for violent and property crimes, so we checked this option. (This option isn’t available if you select more than two Val variables. In that case, all are forced

Figure 2.27 StatTools Time Series Graph Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

56 Chapter 2 Describing the Distribution of a Single Variable

to share the same Y-axis scale.) The resulting time series graph appears in Figure 2.28. The graph shows that both types of crimes increased sharply until the early 1990s and have gradually decreased since then.

However, the time series population in Figure 2.29 indicates that the U.S. population has increased steadily since 1960, so it is possible that the trend in crime rates is different than the trends in Figure 2.28. This is indeed true, as seen in Figure 2.30. It shows the good news that the crime rate has been falling since its peak in the early 1990s.2 than the trends in Figure 2.28. This is indeed true, as seen in Figure 2.30. It shows the good

2 than the trends in Figure 2.28. This is indeed true, as seen in Figure 2.30. It shows the good

The whole purpose of time series graphs is to detect historical patterns in the data. In this crime example, you are looking for broad trends.

Figure 2.28 Total Violent and Property Crimes

2500000

2000000

1500000

1000000

Vi ol

en t c

ri m

e to

ta l/

Cr im

e D

at a

500000

0

19 60

19 62

19 64

19 66

19 68

19 70

19 72

19 74

19 76

19 78

19 80

19 82

19 84

19 86

19 88

19 90

19 92

19 94

19 96

19 98

20 00

20 02

20 04

20 06

20 08

20 10

14000000

Time Series

12000000

10000000

8000000

6000000

4000000

2000000

0

Pr op

er ty

c ri

m e

to ta

l/ Cr

im e

D at

a

Violent crime total/Crime Data Property crime total/Crime Data

Figure 2.29 Population Totals

0

50000000

100000000

150000000

200000000

250000000

300000000

350000000

19 60

19 62

19 64

19 66

19 68

19 70

19 72

19 74

19 76

19 78

19 80

19 82

19 84

19 86

19 88

19 90

19 92

19 94

19 96

19 98

20 00

20 02

20 04

20 06

20 08

20 10

Time Series of Popula�on/Crime Data

2Why did this occur? One compelling reason was suggested by Levitt and Dubner in their popular book Freakonomics. You can read their somewhat controversial analysis to see if you agree.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-5 Time Series Data 57

Figure 2.30 Violent and Property Crime Rates

19 60

19 62

19 64

19 66

19 68

19 70

19 72

19 74

19 76

19 78

19 80

19 82

19 84

19 86

19 88

19 90

19 92

19 94

19 96

19 98

20 00

20 02

20 04

20 06

20 08

20 10

800

700

600

500

Vi ol

en t c

ri m

e ra

te /C

ri m

e D

at a

400

300

200

100

0

6000

Time Series

5000

4000

3000

Pr op

er ty

c ri

m e

ra te

/C ri

m e

D at

a

2000

1000

0

Violent crime rate/Crime Data Property crime rate/Crime Data

StatTools Tip: StatTools Remembers Previous Choices StatTools remembers your previous choices for any particular type of analysis such as time series graphs. Therefore, if you run another analysis of the same type, make sure you uncheck variables you don’t want in the current analysis.

Because it is so easy, we also created two more time series graphs that appear in Figures 2.31 and 2.32. The first shows the crime rates for the various types of violent crimes, and the second does the same for property crimes. The patterns (up, then down) are similar for each type of crime, but they are certainly not identical. For example, the larceny-theft and motor vehicle theft rates both peaked in the early 1990s, but the burglary rate was well in decline by this time. Finally, Figure 2.31 indicates one problem with having multiple time series variables on a single graph—any variable with small values can be dominated by variables with much larger values. It might be a good idea to create two separate graphs for these four variables, with murder and rape on one and robbery and aggravated assault on the other. Then you could see the murder and rape patterns more clearly. ■

Figure 2.31 Rates of Violent Crime Types

1200000

1000000

800000

600000

400000

200000

0

19 60

19 62

19 64

19 66

19 68

19 70

19 72

19 74

19 76

19 78

19 80

19 82

19 84

19 86

19 88

19 90

19 92

19 94

19 96

19 98

20 00

20 02

20 04

20 06

20 08

20 10

Time Series

Murder and nonnegligent manslaughter/Crime Data Forcible rape/Crime Data

Robbery/Crime Data

Aggravated assault/Crime Data

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

58 Chapter 2 Describing the Distribution of a Single Variable

Figure 2.32 Rates of Property Crime Types

3500

3000

2500

2000

1500

1000

500

0

19 60

19 62

19 64

19 66

19 68

19 70

19 72

19 74

19 76

19 78

19 80

19 82

19 84

19 86

19 88

19 90

19 92

19 94

19 96

19 98

20 00

20 02

20 04

20 06

20 08

20 10

Burglary rate/Crime Data Larceny-the� rate/Crime Data Motor vehicle the� rate/ Crime Data

Time Series

As mentioned earlier, traditional summary measures such as means, medians, and standard deviations are often not very meaningful for time series data, at least not for the original data. However, it is often useful to �nd differences or percentage changes in the data from period to period and then report traditional summary measures of these. The following example illustrates these ideas.

CHANGES IN EXCEL 2010

One feature introduced in Excel 2010 is the sparkline. This is a mini-chart embedded in a cell. Although it applies to any kind of data, it is especially useful for time series data. Try the following. Open a file, Try the following. Open a file, T such as the problem file P03_30.xlsx, that has multiple time series—one per column. Highlight the cell below the last time series value of the first time series and click the Line button in the Sparklines group on the Insert ribbon. In the resulting dialog box, select the data in the first time series. You will get a mini-time-series graph in the cell. Now copy this cell across for the other time series, and increase the row height to expand the graphs. Change any of the time series values to see how the sparklines change automatically. We suspect that these instant sparkline graphs are becoming quite popular.

E X A M P L E 2.5 THE DJIA INDEX

The Dow Jones Industrial Average (DJIA or simply “the Dow”) is an index of 30large publicly traded U.S. stocks and is one of the most quoted stock indexes. The file DJIA  Monthly Close.xlsx contains monthly values of the Dow from 1950 through mid-2015. What is a useful way to summarize the data in this file?

Objective To find useful ways to summarize the monthly Dow data.

Solution A time series graph and a few summary measures of the Dow appear in Figure 2.33. The graph clearly shows a gradual increase through the early 1990s (except for Black Monday in 1987), then a sharp increase through the rest of the 1990s, and finally huge swings since 2000. The mean (4137), the median (1020), and any of the other traditional summary measures are of historical interest at best.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-5 Time Series Data 59

Figure 2.33 Summary Measures and Graph of the Dow

0

Ja n-

50 Ju

n- 52

N ov

-5 4

A pr

-5 7

Se p-

59 Fe

b- 62

Ju l-6

4 D

ec -6

6

M ar

-7 4

A ug

-7 6

Ja n-

79 Ju

n- 81

A pr

-8 6

Se p-

88 Fe

b- 91

N ov

-8 3

D ec

-9 5

M ay

-9 8

Ju l-9

3

O ct

-0 0

A ug

-0 5

A pr

-1 5

M ar

-0 3

Ja n-

08 Ju

n- 10

N ov

-1 2

M ay

-6 9

O ct

-7 1

2000

4000

6000

8000

10000

12000

14000

20000

16000

18000

Closing Value

One Variable SummarOne Variable SummarOne V yariable Summaryariable Summar Mean Std. Dev. Median 1st Quar�le 3rd Quar�le

4137.09 4799.67 1020.02 792.45 8480.09

DJIA Data Time Series of Closing Value/Time Series of Closing Value/Time Series of Closing V DJIA Data

Figure 2.34 Summary Measures and Graph of Percentage Changes of the Dow

0.2

0.15

0.1 0.05

0

–0.05

–0.1 –0.15

–0.2 –0.25

–0.3

Ja n-

50 Ju

n- 52

N ov

-5 4

A pr

-5 7

Se p-

59 Fe

b- 62

Ju l-6

4 D

ec -6

6

M ar

-7 4

A ug

-7 6

Ja n-

79 Ju

n- 81

A pr

-8 6

Se p-

88 Fe

b- 91

N ov

-8 3

D ec

-9 5

M ay

-9 8

Ju l-9

3

M ar

-0 3

N ov

-1 2

A pr

-1 5

O ct

-0 0

A ug

-0 5

Ja n-

08 Ju

n- 10

M ay

-6 9

O ct

-7 1

Time Series of Percentage Change/DJIA Data

Mean One Variable SummarOne Variable SummarOne V yariable Summaryariable Summar

Std. Dev. Median 1st Quar�le 3rd Quar�le

0.00657 0.04114 0.00851 –0.01620

0.03231

Percentage Change DJIA Data

In situations like this, it is useful to look at percentage changes in the Dow. These have been calculated in the file and have been used to create the summary measures and time series graph in Figure 2.34. The graph shows that these percentage changes have fluctuated around zero, sometimes with wild swings (like Black Monday). Actually, the mean and median of the percentage changes are slightly positive, about 0.66% and 0.85%, respectively. In addition, the quartiles show that 25% of the changes have been less than −1.62% and 25% have been greater than 3.23%. Finally, the empirical rules indicate, for example, that about 95% of the percentage changes over this period have been no more than two standard devia- tions (8.23%) from the mean. (You can check that the actual percentage within two standard deviations of the mean is close to 95%, so this empirical rule applies very well.)3

) from the mean. (You can check that the actual percentage within two standard 3

) from the mean. (You can check that the actual percentage within two standard ■

3One of the problems asks you to check whether all three of the empirical rules apply to similar stock price data. The extreme tails are where there are some surprises.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

60 Chapter 2 Describing the Distribution of a Single Variable

P R O B L E M S

Level A 19. The file P02_19.xlsx lists annual percentage changes

in the Consumer Price Index (CPI) from 1914 through 2014. Find and interpret the first and third quartiles and the interquartile range for these annual percentage changes. Discuss whether these are meaningful summary measures for this time series data set. Suppose that the data set listed the actual CPI values, not percentage changes, for each year. Would the quartiles and interquartile range be meaningful in this case? Why or why not?

20. The Consumer Confidence Index (CCI) attempts to measure people’s feelings about general business conditions, employment opportunities, and their own income prospects. Monthly average values of the CCI are listed in the file P02_20.xlsx. a. Create a time series graph of the CCI values. b. Have U.S. consumers become more or less

confident through time? c. How would you explain recent variations in the

overall trend of the CCI?

21. The file P02_21.xlsx contains monthly interest rates on 30-year fixed-rate mortgages in the United States from 1977 to 2009. The file also contains rates on 15-year fixed-rate mortgages from late 1991 to 2009. What conclusion(s) can you draw from a time series graph of these mortgage rates? Specifically, what has been happening to mortgage rates in general, and how does the behavior of the 30-year rates compare to the behavior of the 15-year rates?

22. The file P02_22.xlsx contains annual trade balances (exports minus imports) from 1980 to 2010. a. Create a times series graph for each of the three

time series in this file. b. Characterize recent trends in the U.S. balance of

trade figures using your time series graphs.

23. What has happened to the total number and average size of farms in the U.S. since the middle of the 20th century? Answer this question by creating a time series graph of the data from the U.S. Department of Agriculture in the file P02_23. xlsx. Is the observed result consistent with your knowledge of the structural changes within the U.S. farming economy?

24. Is educational attainment in the United States on the rise? Explore this question by creating time series graphs for each of the variables in the file P02_24. xlsx. Comment on any observed trends in the annual educational attainment of the general U.S. population over the given period.

25. The monthly averages of the federal funds rate and the bank prime loan rate are listed in the file P02_25.xlsx. a. Describe the time series behavior of these two

variables. Can you discern any cyclical or other patterns in the times series graphs of these key interest rates?

b. Discuss whether it would make much sense, especially to a person at the present time, to quote traditional summary measures such as means or percentiles of these series.

Level B 26. In which months of the calendar year do U.S. gaso-

line service stations typically have their lowest retail lowest retail lowest sales levels? In which months of the calendar year do the service stations typically have their highest retail highest retail highest sales levels? Create time series graphs for the monthly data in the file P02_26.xlsx to respond to these two questions. There are really two series, one of actual values and one of seasonally adjusted values. The lat- ter adjusts for any possible seasonality, such as higher values in June and lower values in January, so that any trends are more apparent.

27. The file P02_27.xlsx contains monthly data for total U.S. electronic and appliance store sales. There are really two series, one of actual values and one of seasonally adjusted values. The latter adjusts for any possible seasonality, such as higher values in June and lower values in January, so that any trends are more apparent. a. Is there an observable trend in these data? That

is, do the values of the series tend to increase or decrease over time?

b. Is there a seasonal pattern in these data? If so, what is the seasonal pattern?

28. The file P02_28.xlsx contains total monthly U.S. retail sales data for a number of years. There are really two series, one of actual sales and one of seasonally adjusted sales. The latter adjusts for any possible seasonality, such as higher sales in December and lower sales in February, so that any trends are more apparent. a. Create a graph of both time series and comment

on any observable trends, including a possible seasonal pattern, in the data. Does seasonal adjustment make a difference? How?

b. Based on your time series graph of actual sales, make a qualitative projection about the total retail sales levels for the next 12 months. Specifically, in which months of the subsequent year do you expect retail sales levels to be highest? In which months of the subsequent year do you expect retail sales levels to be lowest?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-6 Outliers and Missing Values 61

2-6 OUTLIERS AND MISSING VALUES Most textbooks on data analysis, including this one, tend to use example data sets that are “cleaned up.” Unfortunately, the data sets you are likely to encounter in your job are often not so clean. Two particular problems you will encounter are outliers and missing data, the topics of this section. There are no easy answers for dealing with these problems, but you should at least be aware of the issues.

2-6a Outliers

An outlier is literally a value or an entire observation (row) that lies well outside of the norm. For the baseball data, Clayton Kershaw’s salary of $31 million is de�nitely an out- lier. This is indeed his correct salary—the number wasn’t entered incorrectly—but it is way beyond what most players make. Actually, statisticians disagree on an exact de�nition of an outlier. Going by the third empirical rule, you might de�ne an outlier as any value more than three standard deviations from the mean, but this is only a rule of thumb. Let’s just agree to de�ne outliers as extreme values, and then for any particular data set, you can decide how extreme a value needs to be to qualify as an outlier.

Sometimes an outlier is easy to detect and deal with. For example, this is often the case with data entry errors. Suppose a data set includes a Height variable, a person’s height measured in inches, and you see a value of 720. This is certainly an outlier—and it is cer- tainly an error. Once you spot it, you can go back and check this observation to see what the person’s height should be. Maybe an extra 0 was accidentally appended and the true value is 72. In any case, this type of outlier is usually easy to discover and �x.

Sometimes a careful check of the variable values, one variable at a time, will not reveal any outliers, but there still might be unusual combinations of values. For example, it would be strange to �nd a person with Age equal to 10 and Height equal to 72. Neither of these values is unusual by itself, but the combination is certainly unusual. Again, this would probably be a result of a data entry error, but it would be harder to spot. (The scatter charts discussed in the next chapter are useful for spotting unusual combinations.)

It isn’t always easy to detect outliers, but an even more important issue is what to do about them when they are detected. Of course, if they are due to data entry errors, they can be �xed, but what if they are legitimate values like Clayton Kershaw’s salary? One or a few wild outliers like this one can dominate a statistical analysis. For example, they can make a mean or standard deviation much different than if the outliers were not present.

For this reason, some people argue, possibly naïvely, that outliers should be eliminated before running statistical analyses. However, it is not appropriate to eliminate outliers simply to not appropriate to eliminate outliers simply to not produce “nicer” results. There has to be a legitimate reason for eliminating outliers, and such a reason sometimes exists. For example, suppose you want to analyze salaries of “typical” man- agers at your company. Then it is probably appropriate to eliminate the CEO and possibly other high-ranking executives from the analysis, arguing that they aren’t really part of the population of interest and would just skew the results. Or if you are interested in the selling prices of “typi- cal” homes in your community, it is probably appropriate to eliminate the few homes that sell for over $2 million, again arguing that these are not the types of homes you are interested in.

Probably the best advice for dealing with outliers is to run the analyses two ways: with the outliers and without them. This way, you can report the results both ways—and you are being honest.

2-6b Missing Values

There are no missing data in the baseball salary data set. All 868 observations have a value for each of the four variables. For real data sets, however, this is probably the exception

One good way of dealing with outliers is to report results with the outliers and without them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

62 Chapter 2 Describing the Distribution of a Single Variable

rather than the rule. Unfortunately, most real data sets have gaps in the data. This could be because a person didn’t want to provide all the requested personal information (what business is it of yours how old I am or whether I drink alcohol?), it could be because data doesn’t exist (stock prices in the 1990s for companies that went public after 2000), or it could be because some values are simply unknown. Whatever the reason, you will undoubtedly encounter data sets with varying degrees of missing values.

As with outliers, there are two issues: how to detect missing values and what to do about them. The �rst issue isn’t as simple as you might imagine. For an Excel data set, you might expect missing data to be obvious from blank cells. This is certainly one possibil- ity, but there are others. Missing data are coded in a variety of strange ways. One common method is to code missing values with an unusual number such as −9999 or 9999. Another method is to code missing values with a symbol such as − or *. If you know the code (and it is often supplied in a footnote), then it is usually a good idea, at least in Excel, to perform a global search and replace, replacing all of the missing value codes with blanks.

The more important issue is what to do about missing values. One option is to ignore them. Then you will have to be aware of how the software deals with missing values. For example, if you use Excel’s AVERAGE function on a column of data with missing val- ues, it reacts the way you would hope and expect—it adds all the nonmissing values and divides by the number of nonmissing values. StatTools reacts in the same way for all of the measures discussed in this chapter (after alerting you that there are indeed missing values). We will say more about how StatTools deals with missing data for other analyses in later chapters. If you are using other statistical software such as SPSS or SAS, you should read its online help to learn how its various statistical analyses deal with missing data.

Because this is such an important topic in real-world data analysis, researchers have studied many ways of �lling in the gaps so that the missing data problem goes away (or is at least disguised). One possibility is to �ll in all of the missing values in a column with the average of the nonmissing values in that column. Indeed, this is an option in some soft- ware packages, but we don’t believe it is usually a very good option. (Is there any reason to believe that missing values would be average values if they were known? Probably not.) Another possibility is to examine the nonmissing values in the row of any missing value. It is possible that they provide some clues on what the missing value should be. For example, if a person is male, is 55 years old, has an MBA degree from Harvard, and has been a man- ager at an oil company for 25 years, this should probably help to predict his missing salary. (It probably isn’t below $100,000.) We will not discuss this issue any further here because it is quite complex, and there are no easy answers. But be aware that you will undoubtedly have to deal with missing data at some point in your job, either by ignoring the missing values or by �lling in the gaps in some way.

P R O B L E M S

Level A 29. The file P02_29.xlsx contains monthly percentages of P02_29.xlsx contains monthly percentages of P02_29.xlsx

on-time arrivals at several of the largest U.S. airports and all of the major airlines from 1988 to 2008. The “By Airline” sheet contains a lot of missing data, presumably because some of the airlines were not in existence in 1988 and some went out of business before 2008. The “By Airport” sheet contains missing data only for Atlantic City International Airport (and we’re not sure why).

a. Use StatTools to calculate summary measures (means, medians, standard deviations, and any other measures you would like to report) for each airline and each airport. How does it deal with missing data?

b. Use StatTools to create histograms for a few of the airports and a few of the airlines, including Atlantic City International. How does it deal with missing data?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-7 Excel Tables for Filtering, Sorting, and Summarizing 63

c. Use StatTools to create time series graphs for a few of the airports and a few of the airlines, including Atlantic City International. How does it deal with missing data?

d. Which airports and which airlines have done a good job? Which would you like to avoid?

30. The Wall Street Journal CEO Compensation Study analyzed CEO pay for many U.S. companies with fis- cal year 2008 revenue of at least $5 billion that filed their proxy statements between October 2008 and March 2009. The data are in the file P02_30.xlsx. a. Create a new variable that is the sum of salary and

bonus, and create a box plot of this new variable. b. As the box plot key indicates, mild outliers are

observations between 1.5 IQR (interquartile range) and 3.0 IQR from the edge of the box, whereas extreme outliers are greater than 3 IQR from the edge of the box. Use these definitions to identify the names of all CEOs who are mild outliers and all those who are extreme outliers.

Level B 31. There is no consistent way of defining an outlier that

everyone agrees upon. For example, some people refer to an outlier that is any observation more than three standard deviations from the mean. Other people use the box plot definition, where an outlier (moderate or extreme) is any observation more than 1.5 IQR from the edges of the box, and some people care only about

the extreme box plot-type outliers, those that are 3.0 IQR from the edges of the box. The file P02_18.xlsx contains daily percentage changes in the S&P 500 index over many years. Identify outliers—days when the percentage change was unusually large in either a negative or positive direction—according to each of these three definitions. Which definition produces the most outliers?

32. Sometimes it is possible that missing data are predictive in the sense that rows with missing data are somehow different from rows without missing data. Check this with the file P02_32.xlsx, which contains blood pressures for 1000 (fictional) people, along with variables that can be related to blood pressure. These other variables have a number of missing values, presumably because the people didn’t want to report certain information. a. For each of these other variables, find the mean

and standard deviation of blood pressure for all people without missing values and for all people with missing values. Can you conclude that the presence or absence of data for any of these other variables has anything to do with blood pressure?

b. Some analysts suggest filling in missing data for a variable with the mean of the nonmissing values for that variable. Do this for the missing data in the blood pressure data. In general, do you think this is a valid way of filling in missing data? Why or why not?

2-7 EXCEL TABLES FOR FILTERING, SORTING, AND SUMMARIZING This section discusses a great tool that was introduced in Excel 2007: tables. Tables were somewhat available in previous versions of Excel, but they were never called tables before, and some of the really useful features of Excel 2007 tables were new at the time.

It is useful to begin with some terminology and history. Earlier in this chapter, we discussed data arranged in a rectangular range of rows and columns, where each row is an observation and each column is a variable, with variable names at the top of each column. Informally, we refer to such a range as a data set. In fact, this is the technical term used by StatTools. In previous versions of Excel, data sets of this form were called lists, and Excel provided several tools for dealing with lists. In Excel 2007, recognizing the importance of data sets, Microsoft made them much more prominent and provided better tools for ana- lyzing them. Speci�cally, you now have the ability to designate a rectangular data set as a table and then employ a number of powerful tools for analyzing tables. These tools include �ltering, sorting, and summarizing.

We illustrate Excel tables in the following example. Before proceeding, however, we mention one important caveat. Some of the tools discussed in this section do not work on an Excel �le in the old .xls format. Therefore, you should apply them only to �les saved in the new .xlsx format (new to Excel 2007).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

64 Chapter 2 Describing the Distribution of a Single Variable

E X A M P L E 2.6 HYTEX’S CUSTOMER DATA

The file Catalog Marketing.xlsx contains data on 1000 customers of HyTex, a (fictional) direct marketing company, for the current year. A sample of the data appears in Figure 2.35. The definitions of the variables are fairly straightforward, but details about several of them are listed in cell comments in row 1. HyTex wants to find some useful and quick information about its customers by using an Excel table. How can it proceed?

Figure 2.35 HyTex Customer Data

1 2 3 4 5 6 7 8 9

10 11

A BA B C DC D E FE F G HG H I JI J K LK L M NM N O Person Age Gender Own Home Married Close Salary Children History Catalogs Region State City First Purchase Amount Spent

1 1 0 0 0 1 $16,400 1 1 12 South Florida Orlando 10/23/2011 $218 2 2 0 1 1 0 $108,100 3 3 18 Midwest Illinois Chicago 5/25/2009 $2,632 3 2 1 1 1 1 $97,300 1 NA 12 South Florida Orlando 8/18/2015 $3,048 4 3 1 1 1 1 $26,800 0 1 12 East Ohio Cleveland 12/26/2012 $435 5 1 1 0 0 1 $11,200 0 NA 6 Midwest Illinois Chicago 8/4/2015 $106 6 2 0 0 0 1 $42,800 0 2 12 West Arizona Phoenix 3/4/2013 $759 7 2 0 0 0 1 $34,700 0 NA 18 Midwest Kansas Kansas City 6/11/2015 $1,615 8 3 0 1 1 0 $80,000 0 3 6 West California San Francisco 8/17/2009 $1,985 9 2 1 1 0 1 $60,300 0 NA 24 Midwest Illinois Chicago 5/29/2015 $2,091

10 3 1 1 1 0 $62,300 0 3 24 South Florida Orlando 6/9/2011 $2,644

1 1 2 2 3 2 4 3 5 1 6 2 7 2 8 3 9 2

3 1

0 0 0 1 1 1 1 1 1 0 0 0 0 0 0 1 1 1

1 1

0 1 1 0 1 1 1 1 0 1 0 1 0 1 1 0 0 1

1 1 3 3 1 N 0 1 0 N 0 2 0 N 0 3 0 N 0 3

A 1

A 6

A 1

A 2

Objective To illustrate Excel tables for analyzing the HyTex data.

Solution The range A1:O1001 is in the form of a data set—it is a rectangular range bounded by blank rows and columns, where each row is an observation, each column is a variable, and variable names appear in the top row. Therefore, it is a candidate for an Excel table. However, it doesn’t benefit from the new table tools until you actually designate it as a table. To do so, select any cell in the data set, click the Table button in the left part of the Insert ribbon (see Figure 2.36), and accept the default options. Two things happen. First, the data set is designated as a table, it is formatted nicely, and a dropdown arrow appears next to each variable name, as shown in Figure 2.37. Second, a new Table Tools Design ribbon becomes available (see Figure 2.38). This ribbon is available any time the active cell is inside a table. Note that the table has a generic name like Table1 by default, but you can change this to a more descriptive name if you like.

You can also designate a table by selecting any option on the Format as Table dropdown on the Home ribbon. A third alternative is even easier: select any cell in the data set and press Ctrl+t.

One handy feature of Excel tables is that the variable names remain visible even when you scroll down the screen. Try it to see how it works. When you scroll down far enough that the variable names would disappear, the column headers, A, B, C, etc., change to the variable names. Therefore, you no longer need to freeze panes or split the screen to see the variable names. However, this works only when the active cell is within the table. If you click outside the table, the column headers revert back to A, B, C, etc.

Figure 2.36 Insert Ribbon with Table Button

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-7 Excel Tables for Filtering, Sorting, and Summarizing 65

Figure 2.37 Table with Dropdown Arrows Next to Variable Names

$16,400 $108,100

$97,300 $26,800 $11,200 $42,800 $34,700 $80,000 $60,300 $62,300

$218 $2,632 $3,048

$435 $106 $759

$1,615 $1,985 $2,091 $2,644

1 0 1 1 1 1 1 0 1 0

0 1 1 1 0 0 0 1 0 1

0 1 1 1 0 0 0 1 1 1

0 0 1 1 1 0 0 0 1 1

1 2 3 4 5 6 7 8 9

10

2 3 4 5 6 7 8 9

10 11

1 2 2 3 1 2 2 3 2 3

1 3

NA 1

NA 2

NA 3

NA 3

1 3 1 0 0 0 0 0 0 0

12 18 12 12

6 12 18

6 24 24

South Midwest South East Midwest West Midwest West Midwest South

Florida Illinois Florida Ohio Illinois Arizona Kansas California Illinois Florida

Orlando ChicagChicago Orlando Cleveland Chicago Phoenix Kansas City San Francisco Chicago Orlando

10/23/201110/23/2011 5/25/2009 8/18/2015

12/26/2012 8/4/2015 3/4/2013

6/11/2015 8/17/2009 5/29/2015 6/9/2011

History Catalogs Region State City First Purchase Amount SpentChildrenSalaryCloseMarriedOwn HomeGenderAgePerson1 A BA B C DC D E FE F G HG H I JI J K LK L M NM N O

The dropdown arrows next to the variable names allow you to filter in many differ- ent ways. For example, click the Own Home dropdown list, uncheck Select All, and check the 1 box. This filters out all customers except those who own their own home. Filtering is discussed in more detail later on, but at this point, just be aware that filtering does not delete any observations; it only hides them. There are three indications that the table has been filtered: (1) the row numbers are colored blue and some are missing; (2) a message appears at the bottom of the screen indicating that only 516 out of 1000 records are visible; and (3) there is a filter icon next to the Own Home dropdown arrow. It is easy to remove this filter by open- ing the Own Home dropdown list and selecting Clear Filter (but don’t do so yet).

As illustrated in Figure 2.38, there are various options you can apply to tables, includ- ing the following:

■ A number of table styles are available for making the table attractive. You can experiment with these, including the various table styles and table style options. Note the dropdown list in the Table Styles group. It gives you many more styles than the ones originally visible. In particular, at the top left of options, there is a “no color” style you might prefer.

■ In the Tools group, you can click Convert to Range. This undesignates the range as a table (and the dropdown arrows disappear).

■ In the Properties group, you can change the name of the table. You can also click the Resize Table button to expand or contract the table’s data range.

■ A particularly useful option is the Total Row in the Table Style Options group. If you check this, a new row is appended to the bottom of the table (see Figure 2.39). It cre- ates a sum formula in the rightmost column.4 check this, a new row is appended to the bottom of the table (see Figure 2.39). It cre-

4 check this, a new row is appended to the bottom of the table (see Figure 2.39). It cre-

This sum includes only the nonhidden rows. To prove this to yourself, clear the Own Home �lter and check the sum. It increases to $1,216,768. This total row is quite �exible. First, you can summarize the last column by a number of summary measures, such as Average, Max, Min, Count, and others. To do so, select cell O1002 and click the dropdown list that appears. Second, you can summarize any other column in the table in the same way. For example, if you select cell G1002, a dropdown list appears for Salary, and you can then summarize Salary with the same summarizing options.

The Total row in an Excel table summarizes only the visible data. The data that has been filtered out is ignored.

4The actual formula is =SUBTOTAL(109,[AmountSpent]), where 109 is a code for summing. However, you never need to type any such formula; you can choose the summary function you want from the dropdown list.

Figure 2.38 Table Tools Design Ribbon

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

66 Chapter 2 Describing the Distribution of a Single Variable

Filtering We now discuss ways of �ltering data sets—that is, �nding records that match particular criteria. Before getting into details, there are two aspects of �ltering you should be aware of. First, this section is concerned with the types of �lters called AutoFilter in pre-2007 versions of Excel. The term AutoFilter implied that these were very simple �lters, easy to learn and apply. If you wanted to do any complex �ltering, you had to move beyond AutoFilter to Excel’s Advanced Filter tool. Starting in version 2007, Excel still has Advanced Filter. However, the term AutoFilter has been changed to Filter to indicate that these “easy” �lters are now more powerful than the old AutoFilter. Fortunately, they are just as easy as AutoFilter.

Second, one way to �lter is to create an Excel table, as indicated in the previous sub- section. This automatically provides the dropdown arrows next to the �eld names that allow you to �lter. Indeed, this is the way we will �lter in this section: on an existing table. However, a designated table is not required for �ltering. You can �lter on any rectangular

Filtering is possible without using Excel tables, but there are definitely advantages to filtering with Excel tables.

Excel tables have a lot of built-in intelligence. Although there is not enough space here to explain all possibilities, try the following to see what we mean:

■ In cell R2, enter a formula by typing an equals sign, pointing to cell O2, typing a divide sign (/), and pointing to cell G2. You do not get the usual formula not get the usual formula not =O2/2/2 G2. Instead you get =Table1[[#This Row],[AmountSpent]]/Table1[[#This Row],[Salary]]. This is certainly not the Excel syntax you are used to, but it makes perfect sense.5 Row],[Salary]]

5 Row],[Salary]]

■ Similarly, you can expand the table with a new variable, such as the ratio of Amount Spent to Salary. Start by typing the variable name Ratio in cell P1. Then in cell P2, enter a formula exactly as you did in the previous bullet. You will notice two things. First, as soon as you enter the Ratio label, column P becomes part of the table. Second, as soon as you enter the new formula in one cell, it is copied to all of column P. This is what we mean by table intelligence.

■ Excel tables expand automatically as new rows are added to the bottom or new columns are added to the right. (You saw this latter behavior in the previous bullet.) To appreciate the bene�t of this, suppose you have a monthly time series data set. You designate it as a table and then build a line chart from it to show the time series behavior. Later on, if you add new data to the bottom of the table, the chart will automatically update to include the new data. This is a great feature. In fact, when we discuss pivot tables in the next chapter, we will recommend basing them on tables, not ranges, whenever possible. Then they too will update automatically when new data are added to the table.

Figure 2.39 Total Row (with Filter on OwnHome)

5If you don’t like this type of formula, you can go to Excel Options and uncheck the “Use table names in formu- las” option in the Formulas group.

$1,081 $1,857

$654 $843

$2,546 $2,464

Person 2 3 2 2 3 3

12 18

6 12 18 24

Midwest Midwest South West East West

Kansas Ohio Florida Washington Pennsylvania Utah

Kansas City Cincinna� Miami Sea�le Philadelphia Salt Lake City

12/26/2011 10/23/2012

7/7/2013 8/14/2015 8/9/2013 3/9/2012

$796,260

993 994 996 997 999

1001 1002

992 993 995 996 998

1000 Total

History 1 0 0 0 0 1

Children 1 1 0 0 1 1

Married 1 1 1 0 1 1

Gender 1 1 1 1 1 1

Own Home $65,900 $59,700 $41,900 $53,800

$102,600 $102,500

Salary 1 0 1 1 1 1

Close 2 3 3 2 2 2

Age Catalogs Rs Rs Rs Rs Rs Region Sn Sn Sn Sn State City First Purchase Amount Spent

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-7 Excel Tables for Filtering, Sorting, and Summarizing 67

data set with variable names. There are actually three ways to do so. For each method, the active cell should be a cell inside the data set.

■ Use the Filter button from the Sort & Filter dropdown list on the Home ribbon.

■ Use the Filter button from the Sort & Filter group on the Data ribbon.

■ Right-click any cell in the data set and select Filter. You get several options, the most popular of which is Filter by Selected Cell’s Value. For example, if the selected cell has value 1 and is in the Children column, then only customers with a single child will remain visible.

The point is that Microsoft realizes how important �ltering is to Excel users. Therefore, they have made �ltering a very prominent and powerful tool in all versions of Excel since 2007.

As far as we can tell, the two main advantages of �ltering on a table, as opposed to the three options just listed, are the nice formatting (banded rows, for example) provided by tables, and, more importantly, the total row. If this total row is showing, it summarizes only the visible records; the hidden rows are ignored. ■

We now continue Example 2.6 to illustrate a number of �ltering possibilities. We won’t lead you through a lot of descriptions and screenshots. Once you know the possibili- ties that are available, you should �nd them quite easy to use.

E X A M P L E 2.6 HYTEX’S CUSTOMER DATA (CONTINUED)

HyTex wants to analyze its customer data by applying one or more filters to the data. It has already designated the data set as an Excel table. What types of filters might be useful?

Objective To investigate the types of filters that can be applied to the HyTex data.

Solution There is almost no limit to the filters you can apply, but here are a few possibilities.

■ Filter on one or more values in a �eld. Click the Catalogs dropdown arrow. You will see �ve checkboxes, all checked: Select All, 6, 12, 18, and 24. To select one or more values, uncheck Select All and then check any values you want to �lter on, such as 6 and 24. In this case, only customers who received 6 or 24 catalogs will remain visible.

■ Filter on more than one �eld. With the Catalogs �lter still in place, create a �lter on some other �eld, such as customers with one child. When there are �lters on multiple �elds, only records that meet all of the criteria are visible, in this case customers with all of the criteria are visible, in this case customers with all one child who received 6 or 24 catalogs.

■ Filter on a continuous numerical �eld. The Salary and Amount Spent �elds are essentially continuous �elds, so it would not make much sense to �lter on one or a few particular values. However, it does make sense to �lter on ranges of values, such as all salaries greater than $75,000. This is easy. Click the dropdown arrow next to Salary and select Number Filters. You will see a number of obvious possibilities, including Greater Than.

■ Top 10 and Above/Below Average �lters. Continuing the previous bullet, the Number Filters include Top 10, Above Average, and Below Average options. These are particularly useful if you like to see the highs and the lows. The Above Average and Below Average �lters do exactly what their names imply. The Top 10 �lter is actually more �exible than its name implies. It can be used to select the top n items

The number of ways you can filter with Excel’s newest tools is virtually unlimited. Don’t be afraid to experiment. You can always clear filters to get back to where you started.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

68 Chapter 2 Describing the Distribution of a Single Variable

(where you can choose n), the bottom n items, the top n percent of items, or the bot- tom n percent of items. Note that if a Top 10 �lter is used on a text �eld, the ordering is alphabetical. If it is used on a date �eld, the ordering is chronological.

■ Filter on a text �eld. If you click the dropdown arrow for a text �eld such as Region, you can choose one or more of its values, such as East and South, to �lter on. You can also select the Text Filters item, which provides a number of choices, including Begins With, Ends With, Contains, and others. For example, if there were an Address �eld, you could use the Begins With option to �nd all addresses that begin with P.O. Box.

■ Filter on a date �eld. Excel has great built-in intelligence for �ltering on dates. If you click the First Purchase dropdown arrow, you will see an item for each year in the data set with plus signs next to them. By clicking on the plus signs, you can drill down to months and then days for as much control as you need. Figure 2.40 shows one possibility, where we have �ltered out all dates except the �rst part of July 2015. In addition, if you select the Date Filters item, you get a number of pos- sibilities, such as Yesterday, Next Week, Last Month, and many others.

Figure 2.40 Filtering on a Date Variable

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-7 Excel Tables for Filtering, Sorting, and Summarizing 69

■ Filter on color or icon. Starting in version 2007, Excel has many ways to color cells or enter icons in cells. Often the purpose is to denote the sizes of the numbers in the cells, such as red for small numbers and green for large numbers. We won’t cover the possibilities in this book, but you can experiment with Conditional Formatting on the Home ribbon. The point is that cells are often colored in certain ways or contain certain icons. Therefore, Excel allows you to �lter on background color, font color, or icon. For example, if certain salaries are colored yellow, you can isolate them by �ltering on yellow.

■ Use a custom �lter. If nothing else works, you can try a custom �lter, available at the bottom of the Number Filters, Text Filters, and Date Filters lists. Figures 2.41 and 2.42 illustrate two possibilities. The �rst of these �lters out all salaries between $25,000 and $75,000. Without a custom �lter, this wouldn’t be possible. The second �lter uses the * wildcard to �nd regions ending in est (West and Midwest). est (West and Midwest). est Admittedly, this is an awkward way to perform this �lter, but it indicates how �exible custom �lters can be.

We remind you once again that if you filter on an Excel table and you have summary measures in a total row at the bottom of the table, these summary measures are based only on the filtered data; they ignore the hidden rows.

One final comment about filters is that when you click the dropdown arrow for any variable, you always get three items at the top for sorting, not filtering (see Figure 2.40, for example). These allow you to perform the obvious sorts, from high to low or vice versa, and they even allow you to sort on color. As with filtering, you do not need to designate an Excel table to perform sorting (the popular A-Z and Z-A buttons work just fine without tables), but sorting is made even easier with tables.

Figure 2.41 Custom Filter for Salary

Figure 2.42 Custom Filter for Region

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

70 Chapter 2 Describing the Distribution of a Single Variable

Excel Tip: Other Useful Ways to Filter The Advanced Filter tool is useful for implementing an OR �lter, such as all customers who are either male with salary above $40,000 OR female with at least two children. In fact, it is prob- ably the most natural way to implement such a �lter. However, there is another way that is used in the solutions of a few problems in Chapter 2. Suppose you want a �lter of the type A OR B, where A and B are any conditions, maybe even AND conditions. Create two columns labeled Condition A and Condition B. Fill each with an IF formula that returns Yes or No, depending on whether the condition holds in that row. Then create a third new column labeled Condition A or B, and �ll it with a formula like =IF(OR(conditionA, conditionB), “Yes”, “No”), where conditionA and conditionB are references to the Yes/No values in the Condition A and Condition B columns. Then you can �lter on Yes in this last column to obtain the desired results.

Now that you know the possibilities, here is one particular filter you can try. Suppose HyTex wants information about all middle-aged married customers with at least two children who have above average salaries, own their own home, and live in Indiana or Kentucky. You should be able to create this filter in a few seconds. The result, sorted in decreasing order of Amount Spent and shown in Figure 2.43, indicates that the average salary for these 10 customers is $84,750, and their total amount spent at HyTex is $14,709. (We summarized Salary by average and Amount Spent by sum in the total row.) ■

Figure 2.43 Results from a Typical Filter

P R O B L E M S

Level A 33. The file P02_03.xlsx contains data from a survey of

399 people regarding an environmental policy. Use filters for each of the following. a. Identify all respondents who are female, middle-

aged, and have two children. What is the average salary of these respondents?

b. Identify all respondents who are elderly and strongly disagree with the environmental policy. What is the average salary of these respondents?

c. Identify all respondents who strongly agree with the environmental policy. What proportion of these individuals are young?

d. Identify all respondents who are either (1) middle-aged men with at least one child and an annual salary of at least $50,000, or (2) middle-aged women with two or fewer children and an annual salary of at least $30,000.

What are the mean and median salaries of the respondents who meet these conditions? What proportion of the respondents who satisfy these conditions agree or strongly agree with the environmental policy?

34. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. Use filters for each of the following. a. Identify all employees who are male and have

exactly 4 years of post-secondary education. What is the average salary of these employees?

b. Find the average salary of all female employees who have exactly 4 years of post-secondary education. How does this mean salary compare to the one obtained in part a?

c. Identify all employees who have more than 4 years of post-secondary education. What proportion of these employees are male?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-8 Conclusion 71

2-8 CONCLUSION The summary measures, charts, and tables discussed in this chapter are extremely useful for describing variables in data sets. The methods in this chapter (and the next chapter) are often called exploratory methods because they allow you to explore the characteristics of the data and at least tentatively answer interesting questions. Most of these tools have been available for many years, but with the powerful software now accessible to virtually everyone, the tools can be applied quickly and easily to gain insights. We can promise that you will be using many if not all of these tools in your job. Indeed, the knowledge you gain from these early chapters is arguably the most valuable knowledge you will gain from the book.

To help you remember which analyses are appropriate for different questions and dif-To help you remember which analyses are appropriate for different questions and dif-To help you remember which analyses are appropriate for different questions and dif ferent data types, and which tools are useful for performing the various analyses, we have created a taxonomy in the �le Data Analysis Taxonomy.xlsx. (It isn’t shown here because it doesn’t �t nicely on the printed page.) Feel free to refer back to the diagram in this �le as you apply the tools in this chapter and the next chapter.

d. Identify all full-time employees who are either (1) females between the ages of 30 and 50 (inclusive) with at least 5 years of prior work experience, at least 10 years of prior work experience at Beta, and at least 4 years of post- secondary education; or (2) males between the ages of 40 and 60 (inclusive) with at least 6 years of prior work experience, at least 12 years of prior work experience at Beta, and at least 4 years of post-secondary education.

e. For those employees who meet the conditions specified in part d, compare the mean salary of the females with that of the males. Also, compare the median salary of the female employees with that of the male employees.

f. What proportion of the full-time employees identified in part d earns less than $50,000 per year?

35. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. Use Excel filters to answer the following questions. a. What are the average monthly home mortgage

payment, average monthly utility bill, and average total debt (excluding the home mortgage) of all homeowners residing in the southeast part of the city?

b. What are the average monthly home mortgage payment, average monthly utility bill, and average total debt (excluding the home mortgage) of all homeowners residing in the northwest part of the city? How do these results compare to those found in part a?

c. What is the average annual income of the first household wage earners who rent their home

(house or apartment)? How does this compare to the average annual income of the first household wage earners who own their home?

d. What proportion of the surveyed households contains a single person who owns his or her home?

36. Recall that the file Supermarket Transactions.xlsx contains over 14,000 transactions made by super- market customers over a period of approximately two years. Use Excel filters to answer the following questions. a. What proportion of these transactions are made by

customers who are married? b. What proportion of these transactions are made by

customers who do not own a home? c. What proportion of these transactions are made by

customers who have at least one child? d. What proportion of these supermarket customers

are single and own a home?

Level B 37. The file P02_35.xlsx contains data from a survey of

500 randomly selected households. Use Excel filters to answer the following questions. a. Identify households that own their home and have a

monthly home mortgage payment in the top quartile of the monthly payments for all households.

b. Identify households with monthly expenditures on utilities that are within two standard deviations of the mean monthly expenditure on utilities for all households.

c. Identify households with total indebtedness (excluding home mortgage) less than 10% of the household’s primary annual income level.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

72 Chapter 2 Describing the Distribution of a Single Variable

Summary of Key Terms

Term Explanation Excel Pages Equation

Population Includes all objects of interest in a study— people, households, machines, etc.

22

Sample Representative subset of population, usually chosen randomly

22

Variable (or field or attribute)

Attribute or measurement of members of a population, such as height, gender, or salary

23

Observation (or case or record)

List of all variable values for a single member of a population

23

Data set (Usually) a rectangular array of data, with variables in columns, observations in rows, and variable names in the top row

23

Data type Several categorizations are possible: numerical versus categorical, discrete versus continuous, cross-sectional versus time series; categorical can be nominal or ordinal

24

Dummy variable A variable coded 1 or 0: 1 for observations in a category, 0 for observations not in the category

25

Binned (or discretized) variable

Numerical variable that has been categorized into discrete categories called bins

25

StatTools Palisade add-in for data analysis in Excel StatTools ribbon 31

Mean Average of observations AVERAGE or StatTools 32 2.1 Median Middle observation after sorting MEDIAN or StatTools 32 Mode Most frequent observation MODE or StatTools 32 Percentiles Values that have specified percentages of

observations below them PERCENTILE or StatTools

33

Quartiles Values that have 25%, 50%, or 75% of observations below them

QUARTILE or StatTools 33

Minimum Smallest observation MIN or StatTools 33 Maximum Largest observation MAX or StatTools 33

Concatenate String together two or more pieces of text & character (or CONCATENATE function)

35

Range Difference between largest and smallest observations

MAX, MIN, or StatTools 35

Interquartile range (IQR)

Difference between first and third quartiles QUARTILE or StatTools 35

Variance Measure of variability; essentially the average of squared deviations from the mean

VAR.S (or VAR.P) or StatTools

35 2.2, 2.3

Standard deviation Measure of variability in same units as observations; square root of variance

STDEV.S (or STDEV.P) or StatTools

36

Empirical rules Rules that specify approximate percentage observations within one, two, or three standard deviations of mean for symmetric, bell-shaped distributions

37

Mean absolute Deviation (MAD)

Another measure of variability; average of absolute deviations from the mean

AVEDEV or StatTools 39 2.4

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-8 Conclusion 73

Term Explanation Excel Pages Equation

Skewness When one tail of a distribution is longer than the other

SKEW or StatTools 39

Kurtosis Measure of “fatness” of tails of a distribution (relative to a normal distribution)

KURT or StatTools 39

Histogram Chart of bin counts for a numerical variable; shows shape of the distribution

Excel 2016 or StatTools 45

Frequency table Contains counts of observations in specified categories

COUNTIF or FREQUENCY

46

Box plots Alternative chart that shows the distribution of a numerical variable

Excel 2016 or StatTools 45

Time series graph Graph showing behavior through time of one or more time series variables

Excel line chart or StatTools

45

Outlier Observation that lies outside of the general range of observations in a data set

61

Missing values Values that are not reported in a data set 62 Excel tables Rectangular ranges specified as

tables; especially useful for sorting, filtering, and summarizing

Table from Insert ribbon (or Ctrl+t)

63

P R O B L E M S

Conceptual Questions C.1. An airline analyst wishes to estimate the proportion

of all American adults who are afraid to fly because of potential terrorist attacks. To estimate this percentage, the analyst decides to survey 1500 Americans from across the nation. Identify the relevant sample and population in this situation.

C.2. The number of children living in each of a large number of randomly selected households is an example of which data type? Be specific.

C.3. Does it make sense to construct a histogram for the state of residence of randomly selected individuals in a sample? Explain why or why not.

C.4. Characterize the likely shape of a histogram of the distribution of scores on a midterm exam in a graduate statistics course.

C.5. A researcher is interested in determining whether there is a relationship between the number of room air- conditioning units sold each week and the time of year. What type of descriptive chart would be most useful in performing this analysis? Explain your choice.

C.6. Suppose that the histogram of a given income distribution is positively skewed. What does this fact imply about the relationship between the mean and median of this distribution?

C.7. “The midpoint of the line segment joining the first quar-“The midpoint of the line segment joining the first quar-“The midpoint of the line segment joining the first quar tile and third quartile of any distribution is the median.” Is this statement true or false? Explain your answer.

C.8. Explain why the standard deviation would likely not be a reliable measure of variability for a disnot be a reliable measure of variability for a disnot - tribution of data that includes at least one extreme outlier.

C.9. Explain how a box plot can be used to determine whether the associated distribution of values is essentially symmetric.

C.10. Suppose that you collect a random sample of 250 salaries for the salespersons employed by a large PC manufacturer. Furthermore, assume that you find that two of these salaries are considerably higher than the others in the sample. Before analyzing this data set, should you delete the unusual observations? Explain why or why not.

Level A 38. The file P02_35.xlsx contains data from a survey of

500 randomly selected households. a. Indicate the type of data for each of the variables

included in the survey. b. For each of the categorical variables in the survey,

indicate whether the variable is nominal or ordinal, and why.

c. Create a histogram for each of the numerical variables in this data set. Indicate whether each of these distributions is approximately symmetric or skewed. Which, if any, of these distributions are skewed to the right? Which, if any, are skewed to the left?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

74 Chapter 2 Describing the Distribution of a Single Variable

d. Find the maximum and minimum debt levels for the households in this sample.

e. Find the indebtedness levels at each of the 25th, 50th, and 75th percentiles.

f. Find and interpret the interquartile range for the indebtedness levels of these households.

39. The file P02_39.xlsx contains SAT test scores (two verbal components, a mathematical component, and the sum of these three) for each state and Washington DC in 2009. It also lists the percentage of high school graduates taking the test in each of the states. a. Create a histogram for each of the numerical

variables. Are these distributions essentially symmetric or are they skewed?

b. Compare the distributions of the average verbal scores and average mathematical scores. In what ways are these distributions similar? In what ways are they different?

c. Find the mean, median, and mode of the set of percentages taking the test.

d. For each of the numerical variables, which is the most appropriate measure of central tendency? Why?

e. How does the mean of the Combined variable relate to the means of the Critical Reading, Math, and Writing variables? Is the same true for medians?

40. The Wall Street Journal CEO Compensation Study analyzed CEO pay from many U.S. companies with fiscal year 2008 revenue of at least $5 bil- lion that filed their proxy statements between October 2008 and March 2009. The data are in the file P02_30.xlsx. a. Create histograms to gain a clearer understanding of

the distributions of annual base salaries and bonuses earned by the surveyed CEOs in fiscal 2008. How would you characterize these histograms?

b. Find the annual salary below which 75% of all given CEO salaries fall.

c. Find the annual bonus above which 55% of all given CEO bonuses fall.

d. Determine the range of the middle 50% of all given total direct compensation figures. For the 50% of the executives that do not fall into this middle 50% range, is there more variability in total direct compensation to the right than to the left? Explain.

41. The file P02_41.xlsx contains monthly returns on American Express stock for several years. As the formulas in the file indicate, each return is the percentage change in the adjusted closing price from one month to the next. Do monthly stock returns appear to be skewed or symmetric?

On average, do they tend to be positive, negative, or zero?

42. The file P02_42.xlsx contains monthly returns on Mattel stock for several years. As the formu- las in the file indicate, each return is the percent- age change in the adjusted closing price from one month to the next. Create a histogram of these returns and summarize what you learn from it. On average, do the returns tend to be positive, negative, or zero?

43. The file P02_43.xlsx contains U.S. Bureau of Labor Statistics data on the monthly numbers of employees in various categories: total nonfarm, manufacturing, retail, and information. a. For each of these categories, calculate the monthly

percentage changes. Then create box plots to summarize these distributions of annual percentage changes. Discuss the similarities or differences you see.

b. Given that these are time series variables, what information is omitted from the box plots? Are box plots even relevant?

44. The file P02_44.xlsx contains annual data on the percentage of Americans under the age of 18 living below the poverty level. a. In which years of the sample has the poverty

rate for American children exceeded the rate that defines the third quartile of these data?

b. In which years of the sample has the poverty rate for American children fallen below the rate that defines the first quartile of these data?

c. What is the typical poverty rate for American children during this period?

d. Create and interpret a time series graph for these data. How successful have Americans been recently in their efforts to win “the war against poverty” for the nation’s children?

e. Given that this data set is a time series, discuss whether the measures requested in parts a-c are very meaningful at the current time.

Level B 45. The file P02_45.xlsx contains the salaries of 135

business school professors at a (fictional) large state university. a. If you increased every professor’s salary by $1000,

what would happen to the mean and median salary? b. If you increased every professor’s salary by $1000,

what would happen to the standard deviation of the salaries?

c. If you increased every professor’s salary by 5%, what would happen to the standard deviation of the salaries?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

2-8 Conclusion 75

46. The file P02_46.xlsx lists the fraction of U.S. men and women of various heights and weights. Use these data to estimate the mean and standard deviation of the height of American men and women. (Hint: Assume all heights in a group are concentrated at the group’s midpoint.) Do the same for weights.

47. Recall that HyTex Company is a direct marketer of technical products and that the file Catalog Marketing.xlsx contains recent data on 1000 HyTex customers. a. Identify all customers in the data set who are 55

years of age or younger, female, single, and who have had at least some dealings with HyTex before this year. Find the average number of catalogs sent to these customers and the average amount spent by these customers this year.

b. Do any of the customers who satisfy the conditions stated in part a have salaries that fall in the bottom 10% of all 1000 combined salaries in the data set? If so, how many?

c. Identify all customers in the sample who are more than 30 years of age, male, homeowners, married, and who have had little if any dealings with HyTex before this year. Find the average combined household salary and the average amount spent by these customers this year.

d. Do any of the customers who satisfy the conditions stated in part c have salaries that fall in the top 10% of all 1000 combined salaries in the data set? If so, how many?

48. Recall that the file Baseball Salaries.xlsx contains data on 868 MLB players in the 2015 season. Using this data set, answer the following questions: a. Find the mean and median of the salaries

of all shortstops. Are any of these measures influenced significantly by one or more unusual observations?

b. Find the standard deviation, first and third quartiles, and 5th and 95th percentiles for the salaries of all shortstops. Are any of these measures influenced significantly by one or more unusual observations?

c. Create a histogram of the salaries of all shortstops. Are any of these measures influenced significantly by one or more unusual observations?

49. In 1969 and again in 1970, a lottery was held to determine who would be drafted and sent to Vietnam in the following year. For each date of the year, a ball was put into an urn. For example, in the first lottery, January 1 was number 305 and February 14 was number 4. This means that a person born on February 14 would be drafted before a person born on January 1. The file P02_49.xlsx contains the “draft

number” for each date for the two lotteries. Do you notice anything unusual about the results of either lot- tery? What do you think might have caused this result? (Hint: Create a box plot for each month’s numbers.)

50. The file P02_50.xlsx contains the average price of gasoline in each of the 50 states. (Note: You will need to manipulate the data to some extent before perform- ing the analyses requested below.) a. Compare the distributions of gasoline price data

(one for each year) across states. Specifically, are the mean and standard deviation of these distributions changing over time? If so, how do you explain the trends?

b. In which regions of the country have gasoline prices changed the most?

c. In which regions of the country have gasoline prices remained relatively stable?

51. The file P02_51.xlsx contains data on U.S. home- ownership rates. a. Employ numerical summary measures to char-

acterize the changes in homeownership rates across the country during this period.

b. Do the trends appear to be uniform across the United States or are they unique to certain regions of the country? Explain.

52. Recall that HyTex Company is a direct marketer of technical products and that the file Catalog Marketing.xlsx contains recent data on 1000 HyTex customers. a. Identify all customers who are either (1) home-

owners between the ages of 31 and 55 who live reasonably close to a shopping area that sells similar merchandise, and have a combined salary between $40,000 and $90,000 (inclusive) and a history of being a medium or high spender at HyTex; or (2) homeowners greater than the age of 55 who live reasonably close to a shopping area that sells similar merchandise and have a combined salary between $40,000 and $90,000 (inclusive) and a history of being a medium or high spender at HyTex.

b. Characterize the subset of customers who satisfy the conditions specified in part a. In particular, what proportion of these customers are women? What proportion of these customers are married? On average, how many children do these customers have? Finally, how many catalogs do these cus- tomers typically receive, and how much do they typically spend each year at HyTex?

c. In what ways are the customers who satisfy condition 1 in part a different from those who satisfy condition 2 in part a? Be specific.

53. Recall that the file Supermarket Transactions.xlsx contains data on over 14,000 transactions. There are

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

76 Chapter 2 Describing the Distribution of a Single Variable

two numerical variables, Units Sold and Revenue. The first of these is discrete and the second is continuous. For each of the following, do whatever it takes to cre- ate a bar chart of counts for Units Sold and a histogram of Revenue for the given subpopulation of purchases. a. All purchases made during January and February

of 2016. b. All purchase made by married female

homeowners. c. All purchases made in the state of California. d. All purchases made in the Produce product

department.

54. The file P02_54.xlsx contains daily values of an EPA air quality index in Washington DC and Los Angeles from January 1980 through April 2009. For some unknown reason, the source provides slightly different dates for the two cities. a. Starting in column G, create three new columns:

Date, Wash DC Index, and LA Index. Fill the new date column with all dates from 1/1/1980 to all dates from 1/1/1980 to all 4/30/2009. Then use lookup functions to fill in the two new index columns, entering the observed index if available or a blank otherwise. (Hint: Use a combination of the VLOOKUP function with False as the last argument and the IFERROR function. Look up the latter in online help if you have never seen it before.)

b. Create a separate time series graph of each new index column. Because there are so many dates, it is difficult to see how the graph deals with missing data, but see if you can determine this (maybe by expanding the size of the graph or trying a smaller example). In spite of the few missing points, explain the patterns in the graphs and how Washington DC compares to Los Angeles. (Note: StatTools will not let you create a time series graph with missing data in the middle of the series, but you can create a line chart manually in Excel, without StatTools.)

55. The file P02_55.xlsx contains monthly sales (in millions of dollars) of beer, wine, and liquor. The data have not been seasonally adjusted, so there might be seasonal patterns that can be discovered. For any month in any year, define that month’s seasonal index

as the ratio of its sales value to the average sales value over all months of that year. a. Calculate these seasonal indexes, one for each

month in the series. Do you see a consistent pattern from year to year? If so, what is it?

b. To “deseasonalize” the data and get the seasonally adjusted series often reported, divide each monthly sales value by the corresponding seasonal index from part a. Then create a time series graph of both series, the actual sales and the seasonally adjusted sales. Explain how they are different and why the seasonally adjusted series might be of interest.

56. The file P02_56.xlsx contains monthly values of indexes that measure the amount of energy necessary to heat or cool buildings due to outside temperatures. (See the explanation in the Source sheet of the file.) These are reported for each state in the United States and also for several regions, as listed in the Locations sheet, from 1931 to 2000. Create summary measures and/or charts to see whether there is any indication of temperature changes (global warming?) through time, and report your findings.

57. The file P02_57.xlsx contains data on mortgage loans in 2008 for each state in the United States. The file is different from similar ones in this chapter in that each state has its own sheet with the same data laid out in the same format. Each state sheet breaks down all mortgage applications by loan purpose, applicant race, loan type, outcome, and denial reason (for those that were denied). The question is how a single data set for all states can be created for analysis. The Typical Data Set sheet indicates a simple way of doing this, using the powerful but little-known INDIRECT function. This sheet is basically a template for bringing in any pieces of data from the state sheet you would like to examine. a. Create histograms and summary measures for the

example data given in the Typical Data Set sheet and write a short report on your findings.

b. Create a copy of the Typical Data Set sheet and repeat part a on this copy for at least one other set of variables (of your choice) from the state sheets.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 2.1 CORRECT INTERPRETATION OF MEANS

A mean, as defined in this chapter, is a simple concept—it is the average of a set of numbers. But even this simple concept can cause confusion if you aren’t careful. The data in Figure 2.44 are typical of data presented by marketing researchers for a type of product, in this case beer. (See the file C02_01.xlsx.)

Each value is an average of the number of sixpacks of beer purchased per customer during a month. For the individual brands, the value is the average only for the customers who purchased at least one six-pack of that brand. For example, the value for Miller is the average number of six-packs purchased of all of these brands for customers who all of these brands for customers who all purchased at least one six-pack of Miller. In contrast, the “Any” average is the average number of six-packs

purchased of these brands for all customers in the population.

Is there a paradox in these averages? On first glance, it might appear unusual, or even impossible, that the “Any” average is less than each brand average. Make up your own (small) data set, where you list a number of customers, along with the number of six-packs of each brand of beer each customer purchased, and calculate the averages for your data that correspond to those in Figure 2.44. Do you get the same result (that the “Any” average is lower than all of the others)? Are you guaranteed to get this result? Does it depend on guaranteed to get this result? Does it depend on guaranteed the amount of brand loyalty in your population, where brand loyalty is greater when customers tend to stick to the same brand, rather than buying multiple brands? Write up your results in a concise report.

1

2

A BA B C D E FE F G HG H

Miller 6.77 6.66 6.64 7.11 7.29 7.3 7.17 4.71

Budweiser Coors Michelob Heineken Old Milwaukee Rolling Rock Any 6.77 6.66 6.64 7.11 7.296.77 6.66 6.64 7.11 7.29

Budweiser Coor 6.77 6.66 6.64 7.11 7.29

s M 6.77 6.66 6.64 7.11 7.29

ichelob Heineken Old Milwaukee Rolling Rock Anyichelob Heineken Old Milwaukee Rolling Rock Any 3 7

ichelob Heineken Old Milwaukee Rolling Rock Anyichelob Heineken Old Milwaukee Rolling Rock Any 7 4

Figure 2.44 Average Beer Purchases

C A S E 2.2 THE DOW JONES INDUSTRIAL AVERAGE

The monthly closing values of the Dow Jones Industrial Average (DJIAverage (DJIA A) for the period beginning A) for the period beginning A in January 1950 are given in the file C02_02.xlsx. According to Wikipedia, the Dow Jones Industrial Average, also referred to as the Industrial Average, also referred to as the Industrial A Average, the Average, the A Dow Jones, the Dow 30, or simply the Dow, is one of several stock market indices created by Charles Dow. The average is named after Dow and one of his business associates, statistician Edward Jones. It is an index that shows how 30 large, publicly owned companies based in the United States have traded during a standard trading session in the stock market. It is the second oldest U.S. market index after the Dow Jones Transportation Average, which Dow also created.Average, which Dow also created.A

The Industrial portion of the name is largely Industrial portion of the name is largely Industrial historical, as many of the modern 30 components have little or nothing to do with traditional heavy industry. The average is price-weighted, and to compensate for the effects of stock splits and other adjustments, it is currently a scaled average. The value of the Dow is not the actual average of the prices of its component stocks, but rather the sum of the component prices divided by a divisor, which changes whenever one of the component stocks has a stock split or stock dividend, so as to generate a consistent value for the index.

Along with the NASDAQ Composite, the S&P 500 Index, and the Russell 2000 Index, the Dow

Case 2.2 The Dow Jones Industrial Average 77 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

78 Chapter 2 Describing the Distribution of a Single Variable

C A S E 2.3 HOME AND CONDO PRICES

The file C02_03.xlsx contains an index of home prices and a seasonally adjusted (SA) version of this index for several large U.S. cities. It also contains a condo price index for several large cities and a national index. (The data are explained in the Source sheet.) Use the tools in this chapter to explore

these data, and write a report of your findings. Some important questions you can answer are the following: Are there trends over time? Are there differences across cities? Are there differences across months? Do condo prices mirror home prices? Why are seasonally adjusted (Sseasonally adjusted (Sseasonally adjusted A) indexes published?

is among the most closely watched benchmark indices for tracking stock market activity. Although Dow compiled the index to gauge the performance of the industrial sector within the U.S. economy, the index’s performance continues to be influenced not only by corporate and economic reports, but also by domestic and foreign political events such as war and terrorism, as well as by natural

disasters that could potentially lead to economic harm.

Using the summary measures and graphical tools from this chapter, analyze this important time series over the given period. Summarize in detail the behavior of the monthly closing values of the Dow and the associated monthly percentage changes in the closing values of the Dow.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

79

PREDICTORS OF SUCCESSFUL MOVIES

The movie industry is a high-profile industry with a highly variable revenue stream. In 1998, U.S. moviegoers spent close to $7 billion at the box office 7 billion at the box office 7 alone. Ten years later, the figure was slightly higher, despite the number of people watching DVDs and other media at home. With this much money at stake, it is not surprising that movie studios are interested in knowing what variables are useful for predicting a movie’s financial success. The article by Simonoff and Sparrow (2000) examines this issue for 311 movies released in 1998 and late 1997. (They obtained their data from a public Web site, www.imdb.com.) Although it is preferable to examine movie profits, the costs of making movies are virtually impossible to obtain. Therefore, the authors focused instead on revenues—specifically, the total U.S. domestic gross revenue for each film.

Simonoff and Sparrow obtained prerelease information on a number of variables that were thought to be possible predictors of gross revenue. (Prerelease means that this information is known about a film before the film is actually released.) These variables include: (1) the genre of the film, cat- egorized as action, children’s, comedy, documentary, drama, horror, science fiction, or thriller; (2) the Motion Picture Association of America (MPAA) rat- ing of the film, categorized as G (general audiences), PG (parental guidance suggested), PG-13 (possibly unsuitable for children under 13), R (children not admitted unless accompanied by an adult), NC-17 (no one under 17 admitted), or U (unrated); (3) the country of origin of the movie, categorized as United States, English-speaking but non–United States, or non–English- speaking; (4) number of actors and actresses in the movie who were listed in Entertainment Weekly’s lists of the 25 Best Actors and 25 Best Actresses, as of 1998; (5) number of actors and actresses in the movie who were among the top 20 actors and top 20 actresses in average box office gross per movie in their careers; (6) whether the movie was a sequel; (7) whether the movie

Finding Relationships among Variables

C H A P T E R

3

M o n ke

y B

u si

n e ss

I m

a g

e s/

S h u tt

e rs

to c k.

c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

80 Chapter 3 Finding Relationships among Variables

was released before a holiday weekend; (8) whether the movie was released during the Christmas season; and (9) whether the movie was released during the summer season.

To get a sense of whether these variables are related to gross revenue, we could calculate a lot of summary measures and create numerous tables. However, we agree with Simonoff and Sparrow that the information is best presented in a series of side-by-side box plots. (See Figure 3.1.) These box plots are slightly different from the versions introduced in the previous chapter, but they accomplish exactly the same thing. (Note that their box plots capture an extra piece of information—the widths of their boxes are proportional to the square roots of the sample sizes, so that wide boxes correspond to categories with more movies. In contrast, our box plots, either those from Excel or those from StatTools, carry no information about sample size.) Basically, each box and the lines and points extending above and below it indicate the distribution of gross revenues for any category. Remember that the box itself, from bottom to top, captures the middle 50% of the revenues in the category, the line in the middle of the box represents the median revenue, and the lines and dots indicate possible skewness and outliers.

These particular box plots indicate some interesting and possibly surprising information about the movie business. First, almost all of the box plots indicate a high degree of variability and skewness to the right, where there are a few movies that gross extremely large amounts compared to the “typical” movies in the category. Second, genre certainly makes a difference. There are more comedies and dramas (wider boxes), but they typically gross considerably less than action, children’s, and science fiction films. Third, the same is true of R-rated movies compared to movies rated G, PG, or PG-13—there are more of them, but they typically gross much less. Fourth, U.S. movies do considerably better than foreign movies. Fifth, it helps to have stars, although there are quite a few “sleepers” that succeed without having big-name stars. Sixth, sequels do better, presumably reflecting the success of the earlier films. Finally, the release date makes a big difference. Movies released before holidays, during the Christmas season, or during the summer season tend to have larger gross revenues. Indeed, as Simonoff and Sparrow discuss, movie studios compete fiercely for the best release dates.

Are these prerelease variables sufficient to predict gross revenues accurately? As you might expect from the amount of variability in most of the box plots in Figure 3.1, the answer is “no.” Many intangible factors evidently determine the ultimate success of a movie, so that some, such as There’s Something About Mary, do much better than expected, and others, such as Godzilla, do worse than expected. We will revisit this movie data set in the chapter opener to Chapter 11. There, you will see how Simonoff and Sparrow use multiple regression to predict gross revenue—with limited success. ■

3-1 INTRODUCTION The previous chapter introduced a number of summary measures, graphs, and tables to describe the distribution of a single variable. For a variable such as baseball salary, the entire focus was on how salaries were distributed over some range. This is an important �rst step in any exploratory data analysis—to look closely at variables one at a time—but it is almost never the last step. The primary interest is usually in last step. The primary interest is usually in last relationships between variables. For example, it is natural to ask what drives baseball salaries. Does it depend on qualitative factors, such as the player’s team or position? Does it depend on quanti- tative factors, such as the number of hits the player gets or the number of strikeouts? To answer these questions, you have to examine relationships between various variables and salary.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-1 Introduction 81

This chapter again discusses numerical summary measures, graphs, and tables, but they now involve at least two variables at a time. The most useful numerical summary measure is correlation, a measure that applies primarily to numerical variables. The most useful graph is a scatterplot, which again applies primarily to numerical variables. Other tools are used for relationships involving categorical variables. For example, to break down a numerical vari- able by a categorical variable, as in the chapter opener with movie gross revenues, it is often

A key issue in this chapter is that different tools should be used to examine relationships, depending on whether the variables involved are numeric or categorical.

Figure 3.1 Box Plots of Domestic Gross Revenues for 1998 Movies

Source: From “Predicting Movie Grosses, Winners and Losers, Blockbusters and Sleepers” by J.S. Simonoff & I.R. Sparrow, CHANCE, pp. 15–22,Vol. 13, No. 3, Summer 2000. Used by permission of American Statistical Association.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

82 Chapter 3 Finding Relationships among Variables

useful to create side-by-side box plots as in Figure 3.1. Finally, we discuss Excel®’s arguably most powerful tool, the pivot table. A pivot table enables you to break down one variable by others so that all sorts of relationships can be uncovered very quickly.

As you read this chapter, remember that the diagram in the �le Data Analysis Taxonomy. xlsx is available. This diagram gives you the big picture of which analyses are appropriate for which data types and which tools are best for performing the various analyses.

3-2 RELATIONSHIPS AMONG CATEGORICAL VARIABLES Consider a data set with at least two categorical variables, Smoking and Drinking. Each person is categorized into one of three smoking categories: nonsmoker (NS), occa- sional smoker (OS), and heavy smoker (HS). Similarly, each person is categorized into one of three drinking categories: nondrinker (ND), occasional drinker (OD), and heavy drinker (HD). Do the data indicate that smoking and drinking habits are related? For example, do nondrinkers tend to be nonsmokers? Do heavy smokers tend to be heavy drinkers?

As discussed in the previous chapter, the most meaningful way to describe a categori- cal variable is with counts, possibly expressed as percentages of totals, and corresponding charts of the counts. The same is true of examining relationships between two categorical variables. We can �nd the counts of the categories of either variable separately, and more importantly, we can �nd counts of the joint categories of the two variables, such as the joint categories of the two variables, such as the joint count of all nondrinkers who are also nonsmokers. Again, corresponding percentages of totals and charts help tell the story.

It is customary to display all such counts in a table called a crosstabs (for cross- tabulations). This is also sometimes called a contingency table. Example 3.1 illustrates these tables.

E X A M P L E 3.1 RELATIONSHIP BETWEEN SMOKING AND DRINKING

The file Smoking Drinking.xlsx lists the smoking and drinking habits of 8761 adults. (This is fictional data.) The categories have been coded so that “N,” “O,” and “H” stand for “Non,” “Occasional,” and “Heavy,” and “S” and “D” stand for “Smoker” and “Drinker.” Is there any indication that smoking and drinking habits are related? If so, how are they related?

Objective To use a crosstabs to explore the relationship between smoking and drinking.

Solution The first question is the data format. If you are lucky, you will be given a table of counts. However, it is also possible that you will have to create these counts. In the file for this example, the data are in long columns, a small part of which is shown in Figure 3.2. Presumably, there could be other variables describing these people, but only the Smoking and Drinking variables are relevant here.

To create the crosstabs, start by entering the category headings in row 3 and column E of Figure 3.3. The goal is to fill the table in rows 4–6 with counts of joint categories, along with row and column sums. If you are thinking about using the COUNTIF function to obtain the joint counts, you are close. Unfortunately, the COUNTIF function lets you specify only a single criterion, but there are now two criteria, one for smoking and one for drink- ing. Fortunately, Excel has a function (introduced in Excel 2007) designed exactly for this: COUNTIFS. It enables you to specify any number of range-criterion pairs. In fact, you can fill in the entire table with a single formula entered in cell F4 and copied to the range F4:H6:

=COUNTIFS($B$2:$B$8762,F$3,$C$2:$C$8762,$E4)

Use a crosstabs, a table of counts of joint cat- egories, to discover rela- tionships between two categorical variables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-2 Relationships among Categorical Variables 83

1

2

3

4

5

6

7

8

9

10

11

A BA B C

Person Smoking Drinking

1 N S OD

2 N S HD

3 O S HD

4 H S ND

5 N S OD

6 N S ND

7 N S OD

8 N S ND

9 O S HD

1 0 H S HD

1 N

2 N

3 O

4 H

5 N

6 N

7 N

8 N

9 O

S O

S H

S H

S N

S O

S N

S O

S N

S H

Figure 3.2 Smoking and Drinking Data

The first two arguments are for the condition on smoking; the last two are for the condition on drinking. You can then sum across rows and down columns to get the totals.

The resulting counts appear in the top table in Figure 3.3. For example, among the 8761 people, 4912 are nonsmokers, 2365 are heavy drinkers, and 733 are nonsmok- ers and heavy drinkers. Because the totals are far from equal (there are many more and heavy drinkers. Because the totals are far from equal (there are many more and nonsmokers than heavy smokers, for example), any relationship between smoking and

1 2 3 4 5

E FE F G HG H I Crosstabs from COUNTIFS formulas

NS OS HS Total ND 2118 435 163 2716 OD 2061 1067 552 3680

8 48 4 7 57 57 5

6 7 8 9

10 11 12

HD 733 899 733 2365 Total 4912 2401 1448 8761

Shown as percentages of row NS OS HS Total

ND 78.0 % 16.0 % 6.0% 100.0% OD 56.0 % 29.0 % 15.0 % 100.0%

13 14 15 16 17 18 19

HD 31.0 % 38.0 % 31.0 % 100.0%

Shown as percentages of column NS OS HS

ND 43.1 % 18.1 % 11.3% OD 42.0 % 44.4 % 38.1% HD 14 9% 37 4% 50 6%

20 Total 100.0 % 100.0 % 100.0%

Figure 3.3 Crosstabs of Smoking and Drinking

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

84 Chapter 3 Finding Relationships among Variables

0.0%

10.0%

20.0%

30.0%

40.0%

50.0%

60.0%

ND OD HD

Percentages of column

0.0% 10.0% 20.0% 30.0% 40.0% 50.0% 60.0% 70.0% 80.0% 90.0%

NS OS HS

Percentages of row

NS OS HSND OD HD

Figure 3.4 Column Charts of Smoking and Drinking Percentages

Counts Versus Percentages There is no single correct way to display the data in a crosstabs. Ultimately, the data are always counts, but they can be shown as raw counts, percentages of row totals, percentages of column totals, or even percentages of the overall total. Nevertheless,

when you are looking for relationships between two categorical variables, showing the counts as percentages of row totals or percentages of column totals usually makes any relationships stand out more clearly. Corresponding charts are also very useful.

F u n da m e n ta l I n s i g h t

Excel Tip: Creating Charts from Crosstabs It takes almost no work to create these charts. To get the one on the left, highlight the range E10:H13 and insert a column chart from the Insert ribbon. Do the same with the range E16:H19 to get the chart on the right, except that it will have smoking on the horizontal axis and drinking in the legend. To reverse their roles, simply click the Switch Row/Column button on the Chart Tools Design ribbon.

Although this example illustrates that it doesn’t take too much work to create crosstabs and corresponding charts, you will see a much quicker and easier way when pivot tables are discussed later in this chapter.

drinking is difficult to detect in these raw counts. Therefore, it is useful to express the counts as percentages of row in the middle table and as percentages of column in the bottom table.

The latter two tables indicate, in complementary ways, that there is definitely a rela- tionship between smoking and drinking. If there were no relationship, the rows in the middle table would be practically identical, as would the columns in the bottom table. (Make sure you understand why this is true.) But they are far from identical. For example, the middle table indicates that only 6% of the nondrinkers are heavy smokers, whereas 31% of the heavy drinkers are heavy smokers. Similarly, the bottom table indicates that 43.1% of the nonsmokers are nondrinkers, whereas only 11.3% of the heavy smokers are nondrinkers. In short, these tables indicate that smoking and drinking habits tend to go with one another. These tendencies are reinforced by the column charts of the two percentage tables in Figure 3.4. ■

Relationships between the two variables are usually more evident when the counts are expressed as percent- ages of row totals or percentages of column totals.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-2 Relationships among Categorical Variables 85

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P02_01.xlsx indicates the gender and nation-

ality of the MBA incoming class in two successive years at the Kelley School of Business at Indiana University. a. For each year separately, recode Nationality so that

all nationalities with a count of 1 or 2 are listed as Other.

b. For each year, create a crosstabs of Gender versus the recoded Nationality and an associated column chart. Does there seem to be any relationship between Gender and the recoded Nationality? Is the pattern about the same in the two years?

2. The file P02_03.xlsx contains data from a survey of 399 people regarding a government environmental policy. a. Create a crosstabs and an associated column

chart for Gender versus Opinion. Express the counts as percentages so that for either gender, the percentages add to 100%. Discuss your findings. Specifically, do the two genders tend to differ in their opinions about the environmental policy?

b. Repeat part a with Age versus Opinion. c. Recode Salary to be categorical with categories

“Less than $40K,” “Between $40K and $70K,” “Between $70K and $100K,” and “Greater than $100K” (where you can treat the breakpoints however you like). Then repeat part a with this new Salary variable versus Opinion.

3. The file P02_02.xlsx contains data about 211 movies released in 2006 and 2007. a. Recode Distributor so that all distributors except

for Paramount Pictures, Buena Vista, Fox Searchlight, Universal, Warner Bros., 20th Century Fox, and Sony Pictures are listed as Other. (Those in Other released fewer than 16 movies.) Similarly, recode Genre so that all genres except for Action, Adventure, Thriller/Suspense, Drama, and Comedy are listed as Other. (Again, those in Other are genres with fewer than 16 movies.)

b. Create a crosstabs and an associated column chart for these two recoded variables. Express the counts as percentages so that for any distributor, the percentages add to 100%. Discuss your findings.

4. Recall from Chapter 2 that the file Supermarket Transactions.xlsx contains over 14,000 transactions made by supermarket customers over a period of approximately two years. To understand which customers purchase which products, create a crosstabs and an associated column chart for each of the following. For each, express the counts as percentages so that for any value of the first variable listed, the percentages add to 100%. Do any patterns stand out? a. Gender versus Product Department b. Marital Status versus Product Department c. Annual Income versus Product Department

Level B 5. Recall from Chapter 2 that HyTex Company is a

direct marketer of technical products and that the file Catalog Marketing.xlsx contains recent data on 1000 HyTex customers. To understand these customers, first recode Salary and Amount Spent as indicated in part a, and then create each of the requested crosstabs and an associated column chart in parts b to e. Express each count as a percentage, so that for any value of the first variable listed, the percentages add up to 100%. Do any patterns stand out? a. Find the first, second, and third quartiles

of Salary, and then recode Salary as 1 to 4, depending on which quarter of the data each value falls into. For example, the first salary, $16,400, is recoded as 1 because $16,400 is less than the first quartile, $29,975. Recode Amount Spent similarly, based on its quartiles. (Hint: The recoding can be done most easily with lookup tables.)

b. Age versus the recoded Amount Spent c. Own Home versus the recoded Amount Spent d. History versus the recoded Amount Spent e. The recoded Salary versus the recoded Amount

Spent

6. The smoking/drinking example in this section used the function COUNTIFS function to find the counts of the joint categories. Without using this function (or pivot tables), devise another way to get the counts. The raw data are in the file Smoking Drinking.xlsx. (Hint: One possibility is to concatenate the values in columns B and C into a new column D. But feel free to find the counts in any way you like.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

86 Chapter 3 Finding Relationships among Variables

3-3a Stacked and Unstacked Formats

There are two possible data formats you will see, stacked and unstacked. This concept is crucial for understanding how StatTools deals with comparison problems. Consider salary data on males and females. (There could be other variables in the data set, but they aren’t relevant here.) The data are stacked if there are two “long” variables, Gender and Salary, as indicated in Figure 3.5. The idea is that the male salaries are stacked in with the female sala- ries. This is the format you will see in the majority of situations. However, you will occasion- ally see data in unstacked format, as shown in Figure 3.6. (Note that both tables list exactly

3-3 RELATIONSHIPS AMONG CATEGORICAL VARIABLES AND A NUMERICAL VARIABLE

This section describes a very common situation where the goal is to break down a numeri- cal variable such as salary by a categorical variable such as gender. This is precisely what pivot tables were built for, as you will see later in the chapter. For now, however, numerical and graphical tools in StatTools (and Excel 2016) will be used. This general problem, typi- cally referred to as the comparison problem, is one of the most important problems in data analysis. It occurs whenever you want to compare a numerical measure across two or more subpopulations. Here are some examples:

■ The subpopulations are males and females, and the numerical measure is salary.

■ The subpopulations are different regions of the country, and the numerical measure is the cost of living.

■ The subpopulations are different days of the week, and the numerical measure is the number of customers going to a particular fast-food chain.

■ The subpopulations are different machines in a manufacturing plant, and the numerical measure is the number of defective parts produced per day.

■ The subpopulations are patients who have taken a new drug and those who have taken a placebo, and the numerical measure is the recovery rate from a particular disease.

■ The subpopulations are undergraduates with various majors (business, English, history, and so on), and the numerical measure is the starting salary after graduating.

The list could continue. The discussion of the comparison problem begins in this chap- ter, where exploratory methods are used to investigate whether there appear to be differ- ences across the subpopulations on the numerical variable of interest. In later chapters, inferential methods—con�dence intervals and hypothesis tests—are used to see whether the differences in samples from the subpopulations can be generalized to the subpopula- tions as a whole.

The comparison problem, where a numerical variable is compared across two or more subpopulations, is one of the most important problems faced by data analysts in all fields of study.

Breaking Down by Category There is arguably no more powerful data analysis tech- nique than breaking down a numerical variable by a categorical variable. The methods in this chapter, espe- cially side-by-side box plots and pivot tables, get you

started with this general comparison problem. They allow you to see quickly, with charts and/or numeri- cal summary measures, how two or more categories compare. More sophisticated techniques for compar-compare. More sophisticated techniques for compar-compare. More sophisticated techniques for compar ing across categories are discussed in later chapters.

F u n da m e n ta l I n s i g h t

The stacked format is by far the most com- mon. There are one or more long numerical variables and another long variable that specifies which category each observation is in.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-3 Relationships among Categorical Variables and a Numerical Variable 87

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

A BA B

Gender Salary

Male 81600

Female 61600

Female 64300

Female 71900

Male 76300

Female 68200

Male 60900

Female 78600

Female 81700

Male 60200

Female 69200

Male 59000

Male 68600

Male 51900

Female 64100

Male 67600

Female 81100

Female 77000

Female 58800

Female 87800

Male 78900

Figure 3.5 Stacked Data

1

2

3

4

5

6

7

8

9

10

11

12

13

A BA B

Female Salary Male Salary

61600 81600

64300 76300

71900 60900

68200 60200

78600 59000

81700 68600

69200 51900

64100 67600

81100 78900

77000

58800

87800

Figure 3.6 Unstacked Data

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

88 Chapter 3 Finding Relationships among Variables

the same data. See the �le Stacked Unstacked Data.xlsx.) Now there are two “short” vari- ables, Female Salary and Male Salary. In addition, it is very possible that the two variables have different lengths. This is the case here because there are more females than males.

StatTools is capable of dealing with either stacked or unstacked format. (Not all statis- tical software can make this claim. Some packages require stacked format.) Nevertheless, there are a few times when you might want to convert from stacked to unstacked format or vice versa. StatTools has utilities for doing this. These utilities are found on the Data Utilities (not the Utilities) dropdown list on the StatTools ribbon. They are very simple to not the Utilities) dropdown list on the StatTools ribbon. They are very simple to not use, and you can try them on the data in Figures 3.5 and 3.6. (If you need help, open the �nished version of the Stacked Unstacked Data.xlsx �le, which includes instructions for using these data utilities.)

We now return to the baseball data to see which, if any, of the categorical variables makes a difference in player salaries.

E X A M P L E 3.2 BASEBALL SALARIES

The file Baseball Salaries Extra.xlsx contains the same 2015 baseball data examined in the previous chapter. In addition, several extra categorical variables are included: ■ Pitcher (Yes for all pitchers, No for the others)

■ League (American or National)

■ Division (National West, American East, and so on)

■ Yankees (Yes if team is New York Yankees, No otherwise)

■ Playoff 2014 Team (Yes for the eight teams that made it to the 2014 playoffs, No for the others)

■ World Series 2014 Team (Yes for Kansas City Royals and San Francisco Giants, No for others)

Do pitchers (or any other positions) earn more than others? Does one league pay more than the other, or do any divisions pay more than others? How does the notoriously high Yankees payroll compare to the others? Do the successful teams from 2014 tend to have larger 2015 payrolls?

Objective To learn methods in StatTools for breaking down baseball salaries by various categorical variables.

Solution It is useful to look first at some numerical summary measures for salary. These are the same summary measures from the previous chapter, but now we want to break them down by position. You could do this with Excel tools only, but it would be tedious. Fortunately, it is easy with StatTools. To get started, designate the range as a StatTools data set in the usual way and then select One-Variable Summary from the Summary Statistics dropdown list. Then the key is to click the Format button (see Figure 3.7) and choose Stacked (if it isn’t already selected). When you choose Stacked, you get two lists of variables to choose from. In the Cat (categorical) list, choose the variable that you want to categorize by, in this case Position. In the Val (value) list, choose the variable that you want to summarize, in this case Salary. Then select any of the summary measures you would like to see, such as those checked in Figure 3.7.

The results appear in Figure 3.8. This table lists each of the requested summary meas- ures for each of the nine positions in the data set. If you want to see salaries broken down by team or any other categorical variable, you can easily run this analysis again and choose a different Cat variable.

StatTools often lets you choose the stacked format. This allows you to choose a Cat (categorical) variable and a Val (value) variable for the analysis.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Figure 3.7 StatTools One- Variable Summary Dialog Box with Stacked Format

There are a lot of numbers to digest in Figure 3.8, so it is difficult to get a clear picture of differences across positions. It is more enlightening to see a graphical summary of this information. There are several types of graphs you can use. Our favorite way, discussed shortly, is to create side-by-side box plots (the same type of chart illustrated in the chapter opener). Another possibility is to create side-by-side histograms, with one histogram for each category. This is easy with StatTools, using the Stacked format option exactly as was used for summary measures. However, you should not accept the default bins because they not accept the default bins because they not will differ across categories and prevent a fair comparison. So make sure you enter your own bins. (See the finished version of the baseball file for an illustration of side-by-side histograms done with default bins and with specified bins.) A third possibility is to use pivot tables and corresponding pivot charts, as discussed later in this chapter.

For now, we illustrate side-by-side box plots. If you have Excel 2016, you can create box plots of Salary by Position very easily. First, select the two columns of data, Position and Salary. Then select a box plot from the Statistical charts list on the Insert ribbon. Excel automatically uses the distinct categories in the Position variable to create a separate box plot for each position. You can interpret each of these box plots as explained in the previ- ous chapter. More importantly, you can compare them.

The results appear in Figure 3.9. Now the differences between positions emerge fairly clearly. A few of the conclusions that can be made follow.

Side-by-side box plots are our favorite graphi- cal way of comparing the distribution of a numerical variable across categories of some categorical variable.

3-3 Relationships among Categorical Variables and a Numerical Variable 89

Figure 3.8 Summary Measures of Salary by Position

One Variable Summary

Mean

Std. Dev.

Median

Minimum

Count

1st Quar�le

3rd Quar�le

Salary (Catcher)

Salary 2015 Data

$2690741.01

$3752384.07

$1000000.00

$507500.00

70

$518290.00

$3100000.00

Salary (Center Fielder)

Salary 2015 Data

$4102195.20

$4875749.01

$1650000.00

$507500.00

59

$514500.00

$6214285.00

Salary (Designated Hi�er)

Salary 2015 Data

$8364880.86

$6273012.23

$6666666.00

$512500.00

7

$2950000.00

$14250000.00

Salary (First Baseman)

Salary 2015 Data

$8790404.78

$7961098.01

$6500000.00

$511000.00

41

$2000000.00

$14000000.00

Salary (Le  Fielder)

Salary 2015 Data

$5582728.84

$6757322.64

$2500000.00

$507500.00

50

$522500.00

$6900000.00

Salary 2015 Data

Salary (Pitcher)

$3755287.58

$5136810.49

$1312500.00

$507500.00

443

$518000.00

$5000000.00

Salary 2015 Data

Salary (Right Fielder)

$5715874.29

$5664412.46

$2666666.00

$507500.00

45

$550000.00

$9500000.00

Salary 2015 Data

Salary (Second Baseman)

$3588563.07

$4756997.85

$1800000.00

$507500.00

61

$510900.00

$5000000.00

Salary 2015 Data

Salary (Third Baseman)

$4891261.62

$5770567.43

$2500000.00

$508500.00

42

$555000.00

$6000000.00

Salary 2015 Data

Salary (Shortstop)

$3693277.48

$5357972.10

$850000.00

$507500.00

50

$513543.00

$3175000.00

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

90 Chapter 3 Finding Relationships among Variables

Figure 3.9 Excel 2016 Box Plots of Salary by Position

■ The salaries for all positions except designated hitter are skewed to the right (mean greater than median, long lines and outliers to the right).

■ As a whole, �rst basemen tend to be the highest paid players, followed by out�elders and third basemen. The designated hitters also make a lot, but there are only seven of them in the data set.

■ As a whole, pitchers don’t make as much as �rst basemen and out�elders, but there are a lot of pitchers who are high-earning outliers.

■ Except for a few notable exceptions, catchers, shortstops, and second basemen tend to be paid somewhat less than the other positions.

These box plots are also easy to create with StatTools. You select Box-Whisker Plot from the Summary Graphs dropdown list and fill in the resulting dialog box as shown in Figure 3.10. Again, the key is to select the Stacked format so that you can choose a Cat variable and a Val variable. The resulting box plots appears in Figure 3.11. Again, they are virtually identical to the box plots from Excel 2016 except that they are rotated by 90 degrees.

Figure 3.10 StatTools Box Plot Dialog Box

Box Plot of Salary by Posi�on $35,000,000

$30,000,000

$25,000,000

$20,000,000

$15,000,000

$10,000,000

$5,000,000

$0

Pit ch

er

Ca tch

er

Ce nt

er Fi

eld er

Se co

nd ...

Le �

Fie lde

r

De sig

na te

d.. .

Sh or

tst op

Th ird

Ba se

ma n

Fir st

Ba se

ma n

Rig ht

Fi eld

er

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Figure 3.11 StatTools Box Plots of Salary by Position

Box-Whisker Plot of Comparison of Salary/Salary 2015 Data

Posi�on = Pitcher

Posi�on = Catcher

Posi�on = Third Baseman

Posi�on = Second Baseman

Posi�on = First Baseman

Posi�on = Center Fielder

0 5000000 10000000 15000000 20000000 25000000 30000000 35000000

Posi�on = Designated Hi�er

Posi�on = Le� Fielder

Posi�on = Right Fielder

Posi�on = Shortstop

3-3 Relationships among Categorical Variables and a Numerical Variable 91

Because these side-by-side box plots are so easy to obtain, you can generate a lot of them to provide insights into the salary data. Several interesting examples appear in Figures 3.12–3.14. From these box plots, we can conclude the following:

■ Pitchers make somewhat less than other players, although there are many outliers in each group.

■ The Yankees payroll is indeed much larger than the payrolls for the rest of the teams. In fact, it is so large that its stars’ salaries aren’t even considered outliers relative to the rest of the team.

■ Aside from the many outliers, the playoff teams from 2014 tend to have slightly larger payrolls than the non-playoff teams. The one question we cannot answer, however, at least not without additional data, is whether these larger payrolls are a cause or an effect of being successful.

There is one StatTools limitation you should be aware of. The academic version allows only 12 categories for box plots. Therefore, you can’t choose Team as the Cat variable because there are 30 teams. This is not a limitation with Excel 2016. It can eas- ily create 30 (or more) side-by-side box plots. ■

You can often create a categorical variable on the fly with an IF formula and then use it for side-by-side box plots. We did this with the Yankees, for example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

92 Chapter 3 Finding Relationships among Variables

Figure 3.13 Box Plots of Salary by Yankees

Box Plot of Salary by Yankees/Non-Yankees $35,000,000

$30,000,000

$25,000,000

$20,000,000

$15,000,000

$10,000,000

$5,000,000

$0 No Yes

Figure 3.14 Box Plots of Salary by Playoff 2014 Team

Box Plot of Salary by Playoff Team/Non-Playoff Team $35,000,000

$30,000,000

$25,000,000

$20,000,000

$15,000,000

$10,000,000

$5,000,000

$0 Yes No

Figure 3.12 Box Plots of Salary by Pitcher

Box Plot of Salary by Pitcher/Non-Pitcher $35,000,000

$30,000,000

$25,000,000

$20,000,000

$15,000,000

$10,000,000

$5,000,000

$0 Yes No

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

P R O B L E M S

Level A 7. Recall that the file Baseball Salaries Extra.xlsx con-

tains data on 868 Major League Baseball (MLB) play- ers during the 2015 season. Find the mean, median, standard deviation, and first and third quartiles of Salary, broken down by each of the following catego- ries. Comment on your findings. a. Team b. Division c. Whether they played for the Yankees d. Whether they were in the playoffs

8. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. Find the mean, median, and standard deviation of Annual Salary, broken down by each of the following categories. Comment on your findings. a. Gender b. A recoded version of Education, with new values 1

for Education less than 4, 2 for Education equal to 4, and 3 for Education greater than 4

c. A recoded version of Age, with people aged less than 34 listed as Young, those aged at least 34 and less than 50 listed as Middle-aged, and those aged at least 50 listed as Older

9. The file Golf Stats.xlsx contains data on the 200 top golfers each year from 2003 to 2014. (This data set is used in an example in the next section.) Create a recoded Age variable, with values “Twenties,” “Thirties,” and “Forties,” based on their ages in the 2014 sheet. Then calculate the mean, median, and standard deviation of the following 2014 variables, broken down by the recoded Age. Comment on whether it appears that golfers peak in their thirties. a. Earnings b. Yards/Drive and Driving Accuracy c. Greens in Regulation d. Putting Average (Golfers want this to be small.)

10. Recall from Chapter 2 that HyTex Company is a direct marketer of technical products and that the file Catalog Marketing.xlsx contains recent data on 1000 HyTex customers. Find the mean, median, and stand- ard deviation of Amount Spent, broken down by the following variables. Then create side-by-side box plots of Amount Spent, broken down by the same variables. Comment on how the box plots complement the sum- mary measures. a. Age b. Gender c. Close d. Region e. Year of first purchase. (Hint: For this one, use

Excel’s YEAR function to create a Year column.)

f. The combination of Married and Own Home. (For this one, create a code variable, with values from 1 to 4, for the four combinations of Married and Own Home. Alternatively, create a text variable with values such as “Not married, Owns home.”)

11. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. a. Create a new column Has Second Income with

values “Yes” and “No” depending on whether the household has a reported second income.

b. Find the mean, median, and standard deviation of First Income, broken down by the variable you created in part a. Is there any indication that first income tends to be any larger or smaller, or has more or less variation, depending on whether there is a second income?

c. Repeat part b for each of the Monthly Payment and Debt variables.

12. The file P02_02.xlsx contains data about 211 movies released in 2006 and 2007. a. Recode Genre so that all genres except for Action,

Adventure, Thriller/Suspense, Drama, and Comedy are listed as Other. (Those in Other are genres with fewer than 16 movies.)

b. Find the mean, median, and standard deviation of Total US Gross, broken down by the recoded Genre variable. Also, create side-by-side box plots of Total US Gross, again broken down by the recoded Genre variable. Comment on what the results say about the popularity of different genres.

13. The Wall Street Journal CEO Compensation Study analyzed chief executive officer (CEO) pay from many U.S. companies with fiscal year 2008 revenue of at least $5 billion that filed their proxy statements between October 2008 and March 2009. The data are in the file P02_30.xlsx. a. Create a new variable Total 2008, the sum of

Salary 2008 and Bonus 2008. (Actually, this is not “total” compensation because it omits the very lucrative compensation from stock options.) Also, recode Company Type so that the Technology and Telecommunications are collapsed into a Tech/ Telecomm category.

b. Find the mean, median, and standard deviation of Total 2008, broken down by the recoded Company Type. Also, create side-by-side box plots of Total 2008, again broken down by the recoded Company Type. What do the results tell you about differences in level or variability across company types?

3-3 Relationships among Categorical Variables and a Numerical Variable 93 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

94 Chapter 3 Finding Relationships among Variables

14. The file P02_55.xlsx contains monthly sales (in millions of dollars) of beer, wine, and liquor. The data have not been seasonally adjusted, so there might be seasonal patterns that can be discovered. a. Create a new Month Name variable with values

Jan, Feb, and so on. (Use Excel’s MONTH function and then a lookup table.)

b. Create side-by-side box plots of Total Sales, broken down by Month Name. Is there any evidence of differences across months for either the level of sales or the variability of sales?

15. The file P03_15.xlsx contains monthly data on the various components of the Consumer Price Index (CPI). The source claims that these data have not been seasonally adjusted. The following parts ask you to check this claim. a. Create a new Month Name variable with values

Jan, Feb, and so on. (Use Excel’s MONTH function and then a lookup table.)

b. Create side-by-side box plots of each component of the CPI (including the All Items variable), broken down by the Month Name variable from part a. What results would you expect for “not seasonally adjusted” data? Are your results in line with this?

16. The file P02_11.xlsx contains data on 148 houses that were recently sold in a (fictional) suburban com- munity. The data set includes the selling price of each house, along with its appraised value, square footage, number of bedrooms, and number of bathrooms. a. Create two new variables, Ratio 1 and Ratio 2.

Ratio 1 is the ratio of Appraised Value to Selling Price, and Ratio 2 is the ratio of Selling Price to Square Feet. Identify any obvious outliers in these two Ratio variables.

b. Find the mean, median, and standard deviation of each Ratio variable, broken down by Bedrooms. Also, create side-by-side box plots of each Ratio variable, again broken down by Bedrooms. Comment on the results.

c. Repeat part b with Bedrooms replaced by Bathrooms.

d. If you repeat parts b and c with any obvious outlier(s) from part a removed, do the conclusions change in any substantial way?

Level B 17. The file P02_32.xlsx contains blood pressures for

1000 people, along with variables that can be related to blood pressure. These other variables have a number of missing values, probably because some people didn’t want to report certain information. For each of the Alcohol, Exercise, and Smoke variables, use StatTools to find the mean, median, and standard deviation of Blood Pressure, broken down by whether the data for that variable are missing. For example,

there should be one set of statistics for people who reported their alcohol consumption and another for those who didn’t report it. Based on your results, does it appear that there is any difference in blood pressure between those who reported and those who didn’t?

18. The file P03_18.xlsx contains the times in the Chicago marathon for the top runners each year (the top 10,000 in 2006 and the top 20,000 in 2007 and 2008). a. Merge the data in these three sheets into a single

sheet named 2006–2008, and in the new sheet, create a variable Year that lists the year.

b. The Time variable, shown as something like 2:16:12, is really stored as a time, the fraction of day starting from midnight. So 2:16:12, for example, which means 2 hours, 16 minutes, and 12 seconds, is stored as 0.0946, meaning that 2:16:12 AM is really 9.46% of the way from midnight to the next midnight. This isn’t very useful. Do whatever it takes to recode the times into a new Minutes variable with two decimals, so that 2:16:12 becomes 136.20 minutes. (Hint: Look up Time functions in Excel’s online help.)

c. Create a new variable Nationality to recode Country as “KEN, ETH,” “USA,” or “Other,” depending on whether the runner is from Kenya/ Ethiopia (the usual winners), the USA, or some other country.

d. Find the mean, median, standard deviation, and first and third quartiles of Minutes, broken down by Nationality. Also, create side-by-side box plots of Minutes, again broken down by Nationality. Comment on the results.

e. Repeat part d, replacing Nationality by Gender.

19. The file P02_18.xlsx contains daily values of the S&P Index from 1970 to mid-2015. It also contains percent- age changes in the index from each day to the next. a. Create a new variable President that lists the U.S.

presidents Nixon through Obama on each date. You can look up the presidents and dates online.

b. Find the mean, median, standard deviation, and first and third quartiles of % Change, broken down by President. Also, create side-by-side box plots of % Change, again broken down by President. Comment on the results.

20. The file P02_56.xlsx contains monthly values of indexes that measure the amount of energy necessary to heat or cool buildings due to outside temperatures. (See the explanation in the Source sheet of the file.) These are reported for each state in the United States and also for several regions, as listed in the Locations sheet, from 1931 to 2000. a. For each of the Heating Degree Days and Cooling

Degree Days sheets, create a new Season variable with values “Winter,” “Spring,” “Summer,” and

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 95

3-4 RELATIONSHIPS AMONG NUMERICAL VARIABLES This section discusses methods for �nding relationships among numerical variables. For example, you might want to examine the relationship between heights and weights of peo- ple, or between salary and years of experience of employees. To study such relationships, we introduce two new summary measures, correlation and covariance, and a new type of chart called a scatterplot.

Note that these measures can be applied to any variables that are displayed numeri- cally. However, they are appropriate only for truly numerical variables, not for categori- cal variables that have been coded numerically. In particular, many people create dummy (0–1) variables for categorical variables such as Gender and then include these dummies in a table of correlations. This is certainly possible, and it is not really “wrong.” However, if you want to investigate relationships involving categorical variables, it is better to employ the tools in the previous two sections.

3-4a Scatterplots

We �rst discuss scatterplots, a graphical method for detecting relationships between two numerical variables.1 We �rst discuss scatterplots, a graphical method for detecting relationships between two

1 We �rst discuss scatterplots, a graphical method for detecting relationships between two

Then we will discuss the numerical summary measures, correlation and covariance, in the next subsection. (We do it in this order because correlation and covariance make more sense once you understand scatterplots.) A scatterplot is a scatter of points, where each point denotes the values of an observation for two selected variables. The two variables are often labeled generically as X and Y, so a scatterplot is sometimes Y, so a scatterplot is sometimes Y called an X-Y chart. The whole purpose of a scatterplot is to make a relationship (or the lack of it) apparent. Do the points tend to rise upward from left to right? Do they tend to fall downward from left to right? Does the pattern tend to be linear, nonlinear, or no particular shape? Do any points fall outside the general pattern? The answers to these questions pro- vide information about the possible relationship between the two variables. The process is illustrated in Example 3.3.

“Fall.” Winter consists of December, January, and February; Spring consists of March, April, and May; Summer consists of June, July, and August; and Fall consists of September, October, and November.

b. Find the mean, median, and standard deviation of Heating Degree Days (HDD), broken down by Season, for the 48 contiguous states location (code 5999). (Ignore the first and last rows for the given

location, the ones that contain -9999, the code for missing values.) Also, create side-by-side box plots of HDD, broken down by season. Comment on the results. Do they go in the direction you would expect? Do the same for Cooling Degree Days (which has no missing data).

c. Repeat part b for California (code 0499). d. Repeat part b for the New England group of states

(code 5801).

In general, don’t use correlations that involve coded categorical variables such as 0–1 dummies. The methods from the previous two sections are more appropriate.

E X A M P L E 3.3 GOLF STATS ON THE PGA TOUR

For the past decade or so, the Professional Golf Association (PGA) has kept statistics on all PGA Tour players, and these stats are published on the Web. We imported yearly data from 2003–2014 into the file Golf Stats.xlsx. The file includes an observation for each of the top 200 earners for each year, including age, earnings, events played, rounds played, 36-hole cuts made (only the top scorers on Thursday and Friday get to play on the weekend; the others don’t make the cut), top 10s, and wins. It also includes stats about

1Various terms are used for this type of graph. We use the term scatterplot, the term used by StatTools. You might also see the terms scatter plot (two words), scatter plot (two words), scatter plot scatter chart, scatter diagram, or scattergram. They all mean exactly the same thing.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

96 Chapter 3 Finding Relationships among Variables

StatTools allows you to create many scatterplots at once. Just select multiple X variables and/or multiple Y variables.

efficiency in the various parts of the game (driving, putting, greens in regulation, and sand saves), as well as good holes (eagles and birdies) and bad holes (bogies). A sample of the data for 2014 appears in Figure 3.15, with the data sorted in decreasing order of earnings and a few variables not shown. What relationships can be uncovered in these data for any particular year?

4 5 6 7 8 9

10

Rank Cuts Made 17

Top 10s 12

8 11 10 10

5 5

10 11

4 8

Greens in Regula on 69.4

68 68.8 67.6 68.7 63.5 70.4 64.5 66.9 64.6 62.5

Pu�ng Average 1.708 1.737 1.787 1.732

1.75 1.759

1.79 1.755 1.755 1.759 1.717

Sand Save Pct 47.5 41.8

50 50

56.4 57.9 45.1 51.9 56.3 52.6 57.6

Driving Accuracy 59.9 60.5 73.2 51.7 62.2 62.8

67 59.9 67.4 61.3 58.8

Yards/Drive 310.5 314.3 279.3

301 294.3

291 291.6 297.5 283.8 294.9 289.7

Earnings $8,280,096 $6,336,978 $5,987,395 $5,787,016 $4,939,607 $4,854,777 $4,814,787 $4,806,117 $4,695,516 $4,532,537 $4,342,749

Wins 3 2 0 3 0 2 2 0 1 2 0

15

18

26 20

21

19 22 15

23

Rounds 64 73 80 96 58

104 90 85 88 64 98

Events 17 21 21 27 16 28 27 26 24 19 27

Age 26 36 45 37 35 30 28 26 37 30 22

Player Rory Mcllroy Bubba Watson Jim Furyk Jimmy Walker Sergio Garcia Chris Kirk Billy Horschel Rickie Fowler Ma� Kuchar Mar�n Kaymer Jordan Spieth

11 10 9 8

3

1 1 2 3

2

4 5 6 7

A B C DC D E FE F G HG H I JI J K LK L M NM N Top 10 Greens in Regula on Pu�ng AverageDriving AccuracyEarningsAgePlayer

11 2412

A B

Figure 3.15 Golf Stats

Objective To use scatterplots to search for relationships in the golf data.

Solution This example is typical in that there are many numerical variables, and it is up to you to search for possible relationships. A good first step is to ask some interesting questions and then try to answer them with scatterplots. For example, do younger players play more events? Are earnings related to age? Which is related most strongly to earnings: driving, putting, or greens in regulation? Do the answers to these questions remain the same from year to year? This example is all about exploring the data, and we will answer only a few of the questions that could be asked. Fortunately, scatterplots are easy to create, especially with StatTools, so you can do a lot of exploring very quickly.

It is possible to create a scatterplot with Excel tools only—that is, without StatTools. To do so, you highlight any two variables of interest and select a scatter chart of the top left type from the Insert ribbon. At this point, you will probably want to modify the chart by deleting the legend, inserting some titles, and possibly changing some formatting. Also, you might want to swap the roles of the X and Y variables. The point is that you can do it, but the process is somewhat tedious, especially if you want to create a lot of scatterplots.lot of scatterplots.lot

Excel Tip: Selecting Multiple Ranges Ef�ciently How do you select two long variables such as Age and Earnings? Here are the steps that make it easy. (1) Select the Age label in cell B1. (2) Hold down the Shift and Ctrl keys and press the down arrow key. This selects the Age column. (3) Hold down the Ctrl key and select the Earnings label in cell H1. (4) Hold down the Shift and Ctrl keys and press the down arrow key. Now both columns are selected.

It is much easier to use StatTools. Begin by designating a StatTools data set called Golf Stats 2014 (to distinguish it from data sets you might want to create for the other years). Then select Scatterplot from the Summary Graphs dropdown list. In the result- ing dialog box shown in Figure 3.16, you must select at least one must select at least one must X variable and at least X variable and at least X one Y variable. However, you are allowed to select multiple X variables and/or multi- ple Y variables. Then a scatterplot will be created for each X-X-X Y pair selected. For exam- ple, if you want to see how a number of variables are related to Earnings, you can select Earnings as the Y variable and the others as X variables, as shown in the figure. Note that X variables, as shown in the figure. Note that X StatTools shows the associated correlation below each scatterplot if you check the Display Correlation Coefficient option. Correlations will be discussed shortly.

Scatterplots are great for initial exploration of the data. If a scatterplot suggests a relationship between two variables, other methods can then be used to examine this relationship in more depth.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 97

Figure 3.16 StatTools Scatterplot Dialog Box

Sca�erplot of Age vs Events of Golf Stats 2014

50

60

40

A ge

/G o

lf S

ta ts

2 01

4

Events/Golf Stats 2014

30

20

10

0 0 5 10 15 20 25 30 35

60

Sca�erplot of Age vs Rounds of Golf Stats 2014

50

40

A ge

/G o

lf S

ta ts

2 01

4

Rounds/Golf Stats 2014

30

20

10

0 0 12020 40 60 80 100

Correla�on –0.168 Correla�on –0.154

Figure 3.17 Scatterplots of Age Versus Events and Earnings

Several scatterplots appear in Figures 3.17 through 3.20. (In a few of these, we modi- fied the scale on the horizontal axis so that the scatter fills the plot area.) The scatterplots in Figure 3.17 indicate the possibly surprising results that age is practically unrelated to the number of events played and earnings. Each scatter is basically a shapeless swarm of points, and a shapeless swarm always indicates “no relationship.” The scatterplots in Figure 3.18

9000000

8000000

6000000

5000000

4000000

3000000

2000000

1000000

Sca�erplot of Earnings vs Events of Golf Stats 2014 Sca�erplot of Earnings vs Cuts Made of Golf Stats 2014

Ea rn

in gs

/G ol

f S ta

ts 2

01 4

Events/Golf Stats 2014

0 0 5 10 15 20 25 30 35

7000000

8000000

6000000

5000000

4000000

3000000

2000000

1000000

Ea rn

in gs

/G ol

f S ta

ts 2

01 4

7000000

9000000

Cuts Made/Golf Stats 2014

0 0 5 10 15 20 25 30

Correla�on 0.174 Correla�on 0.573

Figure 3.18 Scatterplots of Earnings Versus Events and Cuts Made

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

98 Chapter 3 Finding Relationships among Variables

9000000

7000000

6000000

5000000

4000000

3000000

2000000

1000000

Sca�erplot of Earnings vs Yararnings vs Yararnings vs Y ds/Drive of Golf Stats 2014 Sca�erplot of Earnings vs Driving Accuracy of Golf Stats 2014

Ea rn

in gs

/G o

lf S

ta ts

2 01

4

Yards/Drive/Golf Stats 2014

0 320

8000000

265 270 275 280 285 290 295 300 305 310 315

9000000

7000000

6000000

5000000

4000000

3000000

2000000

1000000

Ea rn

in gs

/G o

lf S

ta ts

2 01

4

Driving Accuracy/Golf Stats 2014

0

8000000

40 45 50 55 60 65 70 75 80

Correla�on 0.295 Correla�on 0.046

Figure 3.19 Scatterplots of Earnings Versus Driving Length and Driving Accuracy

confirm what you would expect. Specifically, players who play in more events tend to earn more, although there are a number of exceptions to this pattern. Also, players who make more 36-hole cuts tend to earn more.

Excel Tip: Data Labels in Scatterplots Unfortunately, there is no automatic way to enter a label such as “Rory McIlroy” next to a point in a scatterplot. If you click twice on a point (don’t double-click, but slowly click twice), you can select this point. Then if you right-click, you have the option of adding a data label. However, this data label is always the value of the Y variable. In this case, it would be Rory’s earnings, not his name.

StatTools Tip: Selecting Multiple Variables in StatTools If you right-click the X or Y label in the StatTools Scatterplot dialog box, you can select or deselect all variables in the list. This is a handy shortcut if there are many variables. This same shortcut is available elsewhere in StatTools, such as in the Correlations and Covariances dialog box discussed next.

StatTools Tip: Other Scatterplot Options There are two other useful features in StatTools scatterplots. First, you are allowed to check both the X and Y boxes for any variable. By doing this for several variables, you can easily get a matrix of scatterplots, where each variable is plotted against each other variable. This is how we created the multiple scatterplots in the finished version of the golf stats file. If you want to see how variables are related to Earnings, you can examine the Earnings “row” of scatterplots. Second, in the Chart Type dropdown list, you can select Break Down by Categorical Variable. This allows you to select a categorical variable such as Gender. Then all resulting scatterplots will color all Male points one color and all Female points another color.

Golfers will be particularly interested in the scatterplots in Figures 3.19 and 3.20. First, the scatterplots in Figure 3.19 indicate almost no relationships between earnings and the two components of driving, length (yards per drive) and accuracy (percentage of fair- ways hit). At least in 2014, neither driving length nor driving accuracy seems to have much effect on earnings. In contrast, there is a reasonably strong upward relationship between greens hit in regulation and earnings. You would probably expect players who hit a lot of greens in regulation to earn more, and this appears to be the case. Finally, there is a definite downward relationship between putting average and earnings. Does this mean that better downward relationship between putting average and earnings. Does this mean that better downward

Remember that all StatTools charts are really Excel charts, so you can modify them as you like with the usual Excel chart tools.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 99

Trend Lines in Scatterplots Chapters 10 and 11 discuss regression, a method for quantifying relationships between variables. We can provide a brief introduction to regression at this point by discussing the very useful Trendline tool in Excel. Once you have a scatterplot, Excel enables you to superimpose one of several trend lines on the scatterplot. Essentially, a trend line is a line or curve that “�ts” the scatter as well as possible. This could indeed be a straight line, or it could be one of several types of curves. (By the way, you can also superimpose a trend line on a time series graph, exactly as described here for scatterplots.)

To illustrate the Trendline option, we created the scatterplot of driving length versus driving accuracy in Figure 3.21. If you are a golfer, you are probably not surprised to see that the longest hitters tend to be less accurate. This scatterplot is de�nitely downward slop- ing, and it appears to follow a straight line reasonably well.

Therefore, it is reasonable to �t a linear trend line to this scatterplot. To do this, right- click any point on the chart, select Add Trendline, and �ll out the resulting dialog box as shown in Figure 3.22. Note that we have checked the Display Equation on Chart option. The result (after moving the equation to a blank part of the chart) appears in Figure 3.23. The equation you see is a regression equation. It states that driving length (y) is 346.97 minus 0.9252 times driving accuracy (x). This line is certainly not a perfect �t because

9000000

7000000

6000000

5000000

4000000

3000000

2000000

1000000

Sca�erplot of Earnings vs Greens in Regula on of Golf Stats 2014 Ea

rn in

gs /G

o lf

S ta

ts 2

01 4

Greens in Regula�on/Golf Stats 2014

0 55 75

8000000

57 59 61 63 65 67 69 71 73

9000000

7000000

6000000

5000000

4000000

3000000

2000000

1000000

Sca�erplot of Earnings vs Pu�ng Avearnings vs Pu�ng Avearnings vs Pu�ng A rage of Golf Stats 2014

Ea rn

in gs

/G o

lf S

ta ts

2 01

4

Pu�ng Average/Golf Stats 2014

0 1.7 1.86

8000000

1.72 1.74 1.76 1.78 1.8 1.82 1.84

Correla�on 0.304 Correla�on –0.524

Figure 3.20 Scatterplots of Earnings Versus Greens in Regulation and Putting Average

putters earn less? Absolutely not! The putting stat is the average number of putts per hole, so a lower value is better. Therefore, the downward relationship indicated in the chart is lower value is better. Therefore, the downward relationship indicated in the chart is lower expected. In fact, the driving and putting scatterplots tend to confirm the old saying in golf: Drive for show, putt for dough.

You could obviously ask many more questions about the relationships in this golf data set and then attempt to answer them with scatterplots. For example, are the rela- tionships (or lack of them) in the scatterplots consistent through the years? Or would it be better to use Earnings per Round instead of Earnings as the Y variable? Or are there other variables not shown here, such as the percentage of holed putts of less than 10 feet, that are more highly related to Earnings? You now have a powerful tool, scat- terplots, for examining relationships, and the tool is easy to implement. We urge you to use it—a lot. ■

Excel allows you to superimpose a trend line, linear or curved, on a scatterplot. It is an easy way to quantify the relationship apparent in the scatterplot.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

100 Chapter 3 Finding Relationships among Variables

there are many points well above the line and others below the line. Still, it quanti�es the downward relationship reasonably well.

The tools in this subsection, scatterplots and trend lines superimposed on scatterplots, are among the most valuable tools you will learn in the book. When you are interested in a possible relationship between two numerical variables, these are the tools you should use �rst.

265 40 45 50 55 60 65 70 75 80

270

280

295

305

315

320

Sca�erplot of Yarerplot of Yarerplot of Y ds/Drive vs Driving Accuracy of Golf Stats 2014

Driving Accuracy/Golf Stats 2014

Ya rd

s/ D

ri ve

/G o

lf S

ta ts

2 01

4

310

275

285

290

300

Figure 3.21 Scatterplots of Driving Length Versus Driving Accuracy

Figure 3.22 Trendline Options Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 101

3-4b Correlation and Covariance

Many numerical summary measures for a single variable were discussed in Chapter 2. The two measures discussed in this section, correlation and covariance, involve two variables. Speci�cally, each measures the strength and direction of a linear relationship between two linear relationship between two linear numerical variables. Intuitively, the relationship is “strong” if the points in a scatterplot cluster tightly around some straight line. If this straight line rises from left to right, the rela- tionship is positive and the measures will be positive numbers. If it falls from left to right, the relationship is negative and the measures will be negative numbers.

To measure the covariance or correlation between two numerical variables X and Y — indeed, to form a scatterplot of X versus Y —X and Y must be “paired” variables. That is, they must have the same number of observations, and the X and X and X Y values for any observa- tion should be naturally paired. For example, each observation could be the height and weight for a particular person, the time in a store and the amount purchased for a particular customer, and so on.

265 40 45 50 55 60 65 70 75 80

270

280

290

295

305

300

315

320

Sca�erplot of Yarerplot of Yarerplot of Y ds/Drive vs Driving Accuracy of Golf Stats 2014

Driving Accuracy/Golf Stats 2014

y = –0.9252x + 346.97Y ar

d s/

D ri

ve /G

o lf

S ta

ts 2

01 4

310

285

275

Figure 3.23 Scatterplot with Trend Line and Equation Superimposed

Formula for Covariance

Covar(X, Y ) = an i = 1

(XiXiX − X) (YiYiY − Y)

n − 1 (3.1)

With this in mind, let XiXiX and YiYiY be the paired values for observation i, and let n be the number of observations. Then the covariance between X and Y , denoted by Covar(X, Y ), is given by the following formula.

You will probably never have to use Equation (3.1) directly—Excel has a built-in COVAR function that does it for you, and StatTools also calculates covariances automatically—but the formula does indicate what covariance is all about. It is essentially an average of products of deviations from means. If X and X and X Y vary in the same direction, then

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

102 Chapter 3 Finding Relationships among Variables

when X is above its mean, Y will tend to be above its mean, and when X is below its mean, Y will tend to be below its mean. In either case, the product of deviations will be positive— a positive times a positive or a negative times a negative—so the covariance will be posi- tive. The opposite is true when X and X and X Y vary in opposite directions. Then the covariance will be negative.

Covariance has a serious limitation as a descriptive measure because it is very sensitive to the units in which X and Y are measured. For example, the covariance can be in�ated by a factor of 1000 simply by measuring X in dollars rather than thousands of dollars. This limits the usefulness of covariance as a descriptive measure, and we will use it very little in the book.2 limits the usefulness of covariance as a descriptive measure, and we will use it very little

2 limits the usefulness of covariance as a descriptive measure, and we will use it very little

In contrast, the correlation, denoted by Correl(X, Y ), remedies this problem. It is a unitless quantity that is unaffected by the measurement scale. For example, the correlation is the same regardless of whether the variables are measured in dollars, thousands of dol- lars, or millions of dollars. The correlation is de�ned by Equation (3.2), where Stdev(X) and Stdev(Y ) denote the standard deviations of X and X and X Y . Again, you will probably never

have to use this formula for calculations—Excel does it for you with the built-in CORREL function, and StatTools also calculates correlations automatically—but it does show how correlation and covariance are related to one another.

The correlation is not only unaffected by the units of measurement of the two vari- ables, but it is always between −1 and +1. The closer it is to either of these two extremes, the closer the points in a scatterplot are to a straight line, either in the negative or positive direction. On the other hand, if the correlation is close to 0, the scatterplot is typically a “cloud” of points with no apparent relationship. However, although it is not common, it is also possible that the points are close to a curve and have a correlation close to 0. This is because correlation is relevant only for measuring linear relationships.linear relationships.linear

When there are several numerical variables in a data set, it is useful to create a table of covariances and/or correlations. Each value in the table then corresponds to a particu- lar pair of variables. StatTools allows you to do this easily, as illustrated in the following continuation of the golf example. However, we �rst make three important points about the roles of scatterplots, correlations, and covariances.

■ A correlation is a single-number summary of a scatterplot. It never conveys as much information as the full scatterplot; it only summarizes the information in the scatterplot. Still, it is often more convenient to report a table of correlations for many variables than to report an unwieldy number of scatterplots.

CHANGES IN EXCEL 2010

Excel’s old COVAR function actually uses denominator n, so it gives the population covariance, not the sample covariance (denominator n–1) in Equation (3.1). Starting in Excel 2010, both versions are available, named COVARIANCE.P (population) and COVARIANCE.S (sample).

Covariance is too sensitive to the measurement scales of X and Y to make it interpretable, so it is better to rely on correlation, which is unaffected by measurement scales.

Correlation is useful only for measuring the strength of a linear relationship. Strongly related variables can have correlation close to 0 if the relationship is nonlinear.

Formula for Correlation

Correl1X, Y2 = Covar1X, Y2 Stdev1X2 × Stdev1Y2

(3.2)

2Don’t write off covariance too quickly, however. If you plan to take a �nance course in investments, you will see plenty of covariances.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 103

Scatterplots Versus Correlations It is important to remember that a correlation is a single-number measure of the linear relationship between two numerical variables. Although a corre- lation is a very useful measure, it is hard to imagine

exactly what a correlation such as 0.3 or 0.8 actually means. In contrast, a scatterplot of two numerical var-means. In contrast, a scatterplot of two numerical var-means. In contrast, a scatterplot of two numerical var iables indicates the relationship between the two vari- ables very clearly. In short, a scatterplot conveys much more information than the corresponding correlation.

F u n da m e n ta l I n s i g h t

■ You are usually on the lookout for large correlations, those near −1 or +1. But how large is “large”? There is no generally agreed-upon cutoff, but by looking at a number of scatterplots and their corresponding correlations, you will start to get a sense of what a correlation such as −0.5 or +0.7 really means in terms of the strength of the linear relationship between the variables. (In addition, a concrete meaning will be given to the square of a correlation in Chapters 10 and 11.)

■ Do not even try to interpret covariances numerically except possibly to check whether they are positive or negative. For interpretive purposes, concentrate on correlations.

E X A M P L E 3.3 GOLF STATS (CONTINUED)

In the previous subsection, you saw how relationships between several of the golf vari-ables can be detected with scatterplots. What further insights are possible by looking at correlations between these variables?

Objective To use correlations to understand relationships in the golf data.

Solution With the many numerical variables in the golf data set, it is indeed unwieldy to create scat- terplots for all pairs of variables, but it is easy to create a table of correlations with StatTools.3 With the many numerical variables in the golf data set, it is indeed unwieldy to create scat

3 With the many numerical variables in the golf data set, it is indeed unwieldy to create scat

(If you want only one correlation, you can instead use Excel’s CORREL function. In addi- tion, if you are willing to create named ranges and use Excel’s INDIRECT function, you can create a whole table of correlations with a single copyable Excel formula. The finished version of the Stock Return Correlations file shows how to do this.) As an example, we will create a table of correlations for the golf data in 2014. To do so, select Correlation and Covariance from the Summary Statistics dropdown list, and fill in the resulting dialog box as shown in Figure 3.24. There are several options. First, you can check as many numerical variables as you like. We checked a few but not all. Second, you can ask for a table of correla- tions and/or a table of covariances. (There is a third option where you can ask for Spearman rank-order correlations, but this option is not discussed here.) We asked for correlations only. Finally, correlations (and covariances) are symmetric in that the correlation between any two variables X and X and X Y is the same as the correlation between Y is the same as the correlation between Y Y and Y and Y X. Therefore, you can choose any of the three table structure options and receive exactly the same information. We tend to favor the Entries Below the Diagonal Only option.

The resulting table of correlations appears in Figure 3.25. You can ignore the 1.000 values along the diagonal because a variable is always perfectly correlated with itself. Besides these, you are typically looking for relatively large values, either positive or nega- tive. When the table is fairly large, conditional formatting is useful. For example, you could format all correlations between 0.6 and 0.999 as red and all correlations between

You typically scan a table of correlations for the large correlations, either positive or negative. Conditional formatting is useful, especially if the table is a large one.

3Remember that StatTools can easily create a matrix of scatterplots, but this can be a lot of information to digest matrix of scatterplots, but this can be a lot of information to digest matrix if it involves many variables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

104 Chapter 3 Finding Relationships among Variables

Figure 3.24 StatTools Correlation and Covariance Dialog Box

Figure 3.25 Correlations for Golf Data

7

8

9

10

11

12

13

14

15

16

17

18

A BA B C DC D E FE F G HG H I JI J K

Correla�on Table

Age Events Rounds Cuts Made Earnings Yards/Drive Driving Accuracy Greens in Regula�on

Pu�ng Average Sand Save Pct

2011 Data 2011 Data 2011 Data 2011 Data 2011 Data 2011 Data 2011 Data 2011 Data 2011 Data 2011 Data

Age 1.000

Events –0.094

Rounds

Cuts Made

Earnings –0.209

–0.008

–0.114

Yards/Drive

Driving Accuracy 0.294 –0.056 –0.666 1.000

Greens in Regula�on

Pu�ng Average 0.170 0.118 –0.082 –0.316

1.000

–0.117 0.965 1.000

–0.175 0.748 0.884 1.000

0.139 0.282 0.533 1.000

–0.396 0.040 0.140 0.238 1.000

0.050 0.071 0.046

–0.031 –0.002 0.214 0.400 0.090 0.241 1.000

–0.461 0.000 0.115 0.045 1.000

Sand Save Pct 0.220 –0.143 –0.090 0.027 0.161 –0.358 0.156 0.050 –0.306 1.000

−1.0 and −0.6 as green. There are three large positive values, all above 0.7, involving events, rounds, and cuts made. None of these should come as a surprise. There is only one large negative correlation, the one between driving length and driving accuracy, and you already saw the corresponding scatterplot in Figure 3.21. So if you want to know what a correlation of approximately −0.6 actually means, you can look at the scatterplot in this figure. It indicates a definite downward trend, but there is still quite a lot of variability around the best-fitting straight line.

Again, a correlation is only a summary of a scatterplot. Therefore, you can learn more about any interesting-looking correlations by creating the corresponding scatterplot. For example, the scatterplot corresponding to the 0.884 correlation between Cuts Made and Rounds appears in Figure 3.26. (We also superimposed a trend line.) This chart shows the strong linear relationship between cuts made and rounds played, but it also shows that there is still considerable variability around the best-fitting straight line, even with a cor- relation as large as 0.899. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 105

Figure 3.26 Scatterplot of Cuts Made Versus Rounds

0 0 5 10 15 20 25 30

20

40

60

100

120

140

Sca�erplot of Rounds vs Cuts Made of Golf Stats 2014

Cuts Made/Golf Stats 2014

Correla�on 0.899

R o

u n

d s/

G o

lf S

ta ts

2 01

4

80

P R O B L E M S

Level A 21. The file P02_07.xlsx includes data on 204 employees

at the (fictional) company Beta Technologies. a. Create a table of correlations between the

variables Age, Prior Experience, Beta Experience, Education, and Annual Salary. Which of the first four of these variables is most highly correlated (in a positive direction) with Annual Salary?

b. Create scatterplots of Annual Salary (Y axis) versus each of Age, Prior Experience, Beta Experience, and Education.

c. For the variable from part a most highly correlated with Annual Salary, create a (linear) trend line in its scatterplot with the corresponding equation shown in the chart. What does this equation imply about the relationship between the two variables? Be specific.

22. The file P03_22.xlsx lists financial data on movies released from 1980 to 2011 with budgets of at least $20 million. a. Reduce the size of this data set by deleting all

movies with a budget of more than $100 million. Also, delete all movies where US Gross and/or Worldwide Gross is listed as Unknown.

b. For the remaining movies, create a table of correlations between the variables Budget, US Gross, and Worldwide Gross. Comment on the results. Are there any surprises?

c. For the movies remaining after part a, create a scatterplot of Worldwide Gross (Y axis) versus US Gross and another scatterplot of US Gross (Y axis) versus Budget. Briefly explain any patterns you see in these scatterplots. Do they seem to be consistent with the corresponding correlations?

23. The file P02_10.xlsx contains midterm and final exam scores for 96 students in a corporate finance course. a. Do the students’ scores for the two exams tend to

go together, so that those who do poorly on the midterm tend to do poorly on the final, and those who do well on the midterm tend to do well on the final? Create a scatterplot, along with a correlation, to answer this question.

b. Superimpose a (linear) trend line on the scatterplot, along with the equation of the line. Based on this equation, what would you expect a student with a 75 on the midterm to score on the final exam?

24. Recall that the file Golf Stats.xlsx contains data on Golf Stats.xlsx contains data on Golf Stats.xlsx the 200 top golfers each year from 2003 to 2014. The

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

106 Chapter 3 Finding Relationships among Variables

question to be explored in this problem is what drives earnings, and whether this is consistent from year to year. a. For at least three of the years, create two new

variables, Birdies/Round and Earnings/Event. The latter is potentially a better measure of earnings because some players enter more events than others.

b. Create a separate table of correlations for each of the selected years that includes Earnings/ Event, Yards/Drive, Driving Accuracy, Greens in Regulation, Putting Average, Sand Save Pct, and Birdies/Round. (If you use StatTools, it will warn you about missing data, but don’t worry about it.) Explain whether these correlations help answer the questions posed above.

c. There is a saying in golf: “Drive for show, putt for dough.” Create a separate set of scatterplots for each of the selected years of Earnings/Event (Y axis) versus each of Yards/Drive, Driving Accuracy, and Putting Average. Discuss whether these scatterplots tend to support the saying.

25. The file P02_02.xlsx contains data about 211 movies released in 2006 and 2007. The question to be explored in this problem is whether the total gross for a movie can be predicted from how it does in its first week or two. a. Create a table of correlations between the five

variables 7-day Gross, 14-day Gross, Total US Gross, International Gross, and US DVD Sales. (If you use StatTools, it will warn you about missing data, but don’t worry about it.) Does it appear that the last three variables are related to either of the first two?

b. Explore the basic question further by creating a scatterplot of each of Total US Gross, International Gross, and US DVD Sales (Y axis) versus each of 7-day Gross and 14-day Gross (X axis)—six scatterplots in all. Do these support the claim that you can tell how well a movie will do by seeing how it does in its first week or two?

26. The file P02_39.xlsx lists the average high school student scores on the SAT exam by state. There are three components of the SAT: critical reading, math, and writing. These components are listed, along with their sum. The percentage of all potential students who took the SAT is also listed by state. Create correlations and scatterplots to explore the following relationships and comment on the results. a. The relationship between the combined score and

the percentage taking the exam. b. The relationship between the critical reading and

writing components. c. The relationship between a combined verbal

component (the average of critical reading and writing) and the math component.

d. The relationship between each of critical reading, math, and writing with the combined score. Are

these bound to be highly correlated because the sum of the three components equals the combined score?

27. The file P02_16.xlsx contains traffic data from 256 weekdays on four variables. Each variable lists the number of arrivals during a specific 5-minute period of the day. a. What would it mean, in the context of traffic,

for the data in the four columns to be positively correlated? Based on your observations of traffic, would you expect positive correlations?

b. Create a table of correlations and check whether these data behave as you would expect.

28. The file P02_11.xlsx contains data on 148 houses that were recently sold in a (fictional) suburban community. The data set includes the selling price of each house, along with its appraised value, square footage, number of bedrooms, and number of bathrooms. a. Create a table of correlations between all of the

variables. Comment on the magnitudes of the correlations. Specifically, which of the last three variables, Square Feet, Bedrooms, and Bathrooms, are highly correlated with Selling Price?

b. Create four scatterplots to show how the other four variables are related to Selling Price. In each, Selling Price should be on the Y axis. Are these in line with the correlations in part a?

c. You might think of the difference, Selling Price minus Appraised Value, as the “error” in the appraised value, in the sense that this difference is how much more or less the house sold for than the appraiser expected. Find the correlation between this difference and Selling Price, and find the correlation between the absolute value of this difference and Selling Price. If either of these correlations is reasonably large, what is it telling us?

Level B 29. The file P03_29.xlsx contains monthly prices of four

precious metals: gold, silver, platinum, and palladium. The question to be explored here is whether changes in these commodities move together through time. a. Create time series graphs of the four series. Do the

series appear to move together? b. Create four new difference variables, one for each

metal. Each should list this month’s price minus the previous month’s price. Then create time series graphs of the differences. Note that there will be missing data for Jan-97 because the Dec-96 prices are not listed. Also, because the source for this data set listed prices for platinum and palladium through Nov-08 only, there will be missing data at the end of these series.

c. Create a table of correlations between the differences created in part b. Based on this table,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-4 Relationships among Numerical Variables 107

comment on whether the changes in the prices of these metals tend to move together over time.

d. For all correlations in part c above 0.6, create the corresponding scatterplots of the differences (for example, gold differences versus silver differences). Do these, along with the time series graphs from parts a and b, provide a clearer picture of how these series move together over time? Discuss in some detail.

e. Assuming that you used StatTools to find the correlations, check with your own formulas using Excel’s CORREL function that StatTools uses data through Dec-09 for the correlation between gold and silver, but it uses data through Nov-08 for correlations between gold and platinum. That is, check that StatTools uses all of the available data for either correlation.

30. The file P03_30.xlsx contains daily data on exchange rates of various currencies versus the U.S. dollar. It is of interest to financial analysts and economists to see whether exchange rates move together through time. You could find the correlations between the exchange rates themselves, but it is often more useful with time series data to check for correlations between differences from day to day. a. Create a column of differences for each currency. b. Create a table of correlations between all of the

original variables. Then on the same sheet, create a original variables. Then on the same sheet, create a original second table of correlations between the difference variables. On this same sheet, enter two cutoff values, one positive such as 0.6 and one negative such as −0.5, and use conditional formatting to color all correlations (in both tables) above the positive cutoff green and all correlations below the negative cutoff red. Do it so that the 1’s on the diagonal are not colored.

c. Based on the second table and your coloring, can you conclude that these currencies tend to move together in the same direction? If not, what can you conclude?

d. Can you explain how the correlation between two currencies can be fairly highly negatively correlated, whereas the correlation between their differences is essentially zero? Would you conclude that these two currencies “move together?” (Hint: There is no easy answer, but scatterplots and time series graphs for these two currencies and their differences are revealing.)

31. The file P02_35.xlsx contains data from a survey of 500 randomly selected (fictional) households. a. Create a table of correlations between the last five

variables (First Income to Debt). On the sheet with these correlations, enter a “cutoff ” correlation such as 0.5 in a blank cell. Then use conditional formatting to color green all correlations in the

table at least as large as this cutoff, but don’t color the 1s on the diagonal. The coloring should change automatically as you change the cutoff. This is always a good idea for highlighting the “large” correlations in a correlations table.

b. When you create the table of correlations with StatTools, you are warned about the missing values for Second Income. Do some investigation to see how StatTools deals with missing values and correlations. There are two basic possibilities (and both of these are options in some software packages). First, it could delete all rows that have missing values for any variables and then calculate all of the correlations based on the remaining data. Second, when it creates the correlation for any pair of variables, it could (temporarily) delete only the rows that have missing data for these two variables and then calculate the correlation on what remains for these two variables. Why would you prefer the second option? How does StatTools do it?

32. We have indicated that if you have two categorical variables and you want to check whether they are related, the best method is to create a crosstabs, possibly with the counts expressed as percentages. But suppose both categorical variables have only two categories and these variables are coded as dummy 0–1 variables. Then there is nothing to prevent you from finding the correlation between them with the same Equation (3.2) from this section, that is, with Excel’s CORREL function. However, if we let C(i, j) be the count of observations where the first variable has value i and the second variable has value j, there are only four joint counts that can have any bearing on the relation- ship between the two variables: C(0,0), C(0,1), C(1,0), and C(1,1). Let C1(1) be the count of 1s for the first variable and let C2(1) be the count of 1s for the second variable. Then it is clear that C1(1) = C(1,0) + C(1,1) and C2(1) = C(0,1) + C(1,1), so C1(1) and C2(1) are determined by the joint counts. It can be shown algebraically that the correlation between the two 0–1 variables is

nC11,12 − C1112C2112 "C1112 1n − C1112 2" ""C2112 1n − C2112 2"

To illustrate this, the file P03_32.xlsx contains two 0–1 variables. (The values were generated randomly.) Create a crosstabs to find the required counts, and use the above formula to calculate the correlation. Then use StatTools (or Excel’s CORREL function) to find the correlation in the usual way. Do your two results match? (Again, we do not necessarily recommend finding correlations between 0–1 variables. A crosstabs is more meaningful and easier to interpret.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

108 Chapter 3 Finding Relationships among Variables

3-5 PIVOT TABLES We now discuss one of Excel’s most powerful—and easy-to-use—tools, pivot tables. Pivot tables allow you to break the data down by categories so that you can see, for example, average sales by gender, by region of country, by time of day, or any combination of these. Sometimes pivot tables are used to display counts, such as the number of customers broken down by gender and region of country. These tables of counts, often called crosstabs or contingency tables, have been used by statisticians for years. However, crosstabs typically list only counts, whereas pivot tables can list counts, sums, averages, and other summary measures.

It is easiest to understand pivot tables by means of examples, so we illustrate several possibilities in the following example.

E X A M P L E 3.4 CUSTOMER ORDERS AT ELECMART

The file Elecmart Sales.xlsx (see Figure 3.27) contains data on 400 customer orders dur-ing a period of several months for the fictional Elecmart company.4 There are several cat- egorical variables and several numerical variables. The categorical variables include the day of week, time of day, region of country, type of credit card used, gender of customer, and buy category of the customer (high, medium, or low) based on previous behavior. The numerical variables include the number of items ordered, the total cost of the order, and the price of the highest-priced item purchased. How can the manager of Elecmart use pivot tables to sum- marize the data so that she can understand the buying patterns of her customers?

Objective To use pivot tables to break down the customer order data by a number of categorical variables.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15

A BA B C DC D E FE F G HG H I JI J Date Day Time Region Card Type Gender Buy Category Items Ordered Total Cod Total Cod T st High Item

6-Mar 6-Mar 6-Mar 6-Mar 6-Mar 6-Mar 7-Mar 7-Mar 7-Mar 8-Mar 8-Mar 8-Mar 9-Mar 9-Mar

Sun Sun Sun Sun Sun Sun Mon Mon Mon Tue Tue Tue Wed Wed

Morning Morning

Evening Evening Evening Morning Morning

Morning

West West West NorthEast West NorthEast West South West MidWest NorthEast South NorthEast NorthEast

ElecMart Other ElecMart Other ElecMart Other Other Other Other Other ElecMart Other ElecMart Other

Female Female Female Female Male Female Male Male Male Female Female Male Male Male

High Medium Medium Low Medium Medium Low High Low Low Medium Medium High Low

4 1 5 1 4 5 1 4 2 1 2 2 3 1

$136.97 $25.55

$113.95 $6.82

$147.32 $142.15

$18.65 $178.34

$25.83 $18.13 $54.52 $61.93

$147.68 $27.24

$79.97 $25.55 $90.47

$6.82 $83.21 $50.90 $18.65

$161.93 $15.91 $18.13 $54.38 $56.32 $96.64 $27.24

y Ty T e Re R r Br B d Td T

Figure 3.27 Elecmart Data

4Users of previous editions of the book will notice that the year in this data set has been changed to 2016. This changes the days of the week in column B, so any pivot tables that use the Day �eld will be different from before.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 109

Pivot tables are perfect for breaking down data by categories. Many people refer to this as “slicing and dicing” the data.

Solution First, we preview the results you can obtain. Pivot tables are useful for breaking down numerical variables by categories, or for counting observations in categories and possibly expressing the counts as percentages. So, for example, you might want to see how the aver- age total cost for females differs from the similar average for males. Or you might simply want to see the percentage of the 400 sales made by females. Pivot tables allow you to find such averages and percentages easily.

Actually, you could find such averages or percentages without using pivot tables. For exam- ple, you could sort on gender and then find the average of the Female rows and the average of the Male rows. However, this takes time, and more complex breakdowns are even more difficult and time-consuming. They are all easy and quick with pivot tables. Besides that, the resulting tables can be accompanied with corresponding charts that require virtually no extra effort to create. Pivot tables are a manager’s dream. Fortunately, Excel makes them a manager’s reality.

We begin by building a pivot table to find the sum of Total Cost broken down by time of day and region of country. Although we show this in a number of screen shots, just to help you get the knack of it, the process takes only a few seconds after you gain some experience with pivot tables.

To start, click the PivotTable button at the far left on the Insert ribbon (see Figure 3.28). This produces the dialog box in Figure 3.29. The top section allows you to specify the

Figure 3.28 PivotTable Button on the Insert Ribbon

Beginning in Excel 2013, there is a Recommended Pivot Tables option. It guesses which pivot tables you might want.

Figure 3.29 Create PivotTable Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

110 Chapter 3 Finding Relationships among Variables

Figure 3.30 Blank Pivot Table

table or range that contains the data. (You can also specify an external data source, but we will not cover this option here.) The bottom section allows you to select the location where you want the results to be placed. If you start by selecting any cell inside the data set, Excel’s guess for the table or range is usually correct, although you can override it if necessary. Make sure the range selected for this example is A1:J401. This selected range should include the variable names at the top of each column. Then click OK. Note that with these settings, the pivot table will be placed in a new worksheet with a generic name such as Sheet1. You will probably want to rename it something like Pivot Table.

This produces a blank pivot table, as shown in Figure 3.30. Also, assuming any cell inside this blank pivot table is selected, the PivotTable Tools “super tab” is visible. This super tab has two ribbons, Analzye and Design. (The Analyze ribbon was named Options in Excel 2007 and 2010. To avoid confusing users of those versions, we will refer to it as the “Analyze (or Options)” ribbon from here on.) The Analyze (or Options) ribbon appears in Figure 3.31, and the Design ribbon appears in Figure 3.32. Each of these has a variety of buttons for manipulating pivot tables, some of which we will explore shortly. Finally, the PivotTable Fields pane in Figure 3.33 is visible. By default, it is docked at the right of the screen, but you can move it if you like.

Note that the two pivot table ribbons and the PivotTable Fields pane are visible only when the active cell is inside a pivot table. If you click outside the pivot table, say, in cell D1, all three of these will disappear. Don’t worry. You can get them back by selecting any cell inside the pivot table.

If you have used pivot tables in a pre-2007 version of Excel, the blank pivot table in Figure 3.30 will look different. Here are two things to be aware of. First, if you open a file in the

We refer to the PivotTable Tools Analyze (or Options) ribbon; you will see it as either the Options ribbon (Excel 2010 and earlier) or the Analyze ribbon (Excel 2013 and later).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 111

Figure 3.31 PivotTable Analyze (or Options) Ribbon

Figure 3.33 PivotTable Fields Pane

Figure 3.32 PivotTable Design Ribbon

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

112 Chapter 3 Finding Relationships among Variables

Figure 3.35 Switching to Classic PivotTable Layout

Figure 3.34 Old-Style Blank Pivot Table

old .xls format (Excel 2003 or earlier) and go through the same steps as above, you will get an “old style” pivot table, as shown in Figure 3.34. Second, if you prefer the old style, Excel 2007 or later lets you revert back to it. To do so, right-click the pivot table, select PivotTable Options, select the Display tab, and check the Classic PivotTable layout option (see Figure 3.35).

The pivot table “look” changed considerably in Excel 2007, but the functionality is very similar.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 113

A 1 2 3 Row Labels Sum of Total Cost

24265.6A�ernoon

18834.3Evening

18427.31Morning

MidWest 3187.16 NorthEast South

8159.78 5729.72

West 7188.94

MidWest 2552.89 NorthEast South

5941.49 3864.12

West 6475.8

MidWest 3878.22 NorthEast South

5084.57 3835.86

West

4 5 6 7 8 9

10 11 12 13 14 15 16 17

B

5628.6618 19 61527.21Grand Total

Figure 3.36 Sum of Total Cost by Time and Region (Compact Layout)

The PivotTable Fields pane indicates that a pivot table has four areas. These are for Filters, Rows, Columns, and Values. They correspond to the four areas in Figure 3.34 where you can put fields.5 Filters, Rows, Columns, and Values. They correspond to the four areas in Figure 3.34

5 Filters, Rows, Columns, and Values. They correspond to the four areas in Figure 3.34

Note that the terminology has changed slightly through different versions of Excel. The terminology used here is for Excel 2013 and later.

Essentially, a Rows field has categories that go down the left side of a pivot table, a Columns field has categories that go across the top of a pivot table, a Filters field lets you filter the whole pivot table by its categories, and a Values field contains the data you want to summarize. Typically (but not always), you will place categorical variables in the Filters, Rows, and/or Columns areas, and you will place numeric variables in the Values area.

In the present example, check the Time, Region, and Total Cost boxes in the upper half of the PivotTable Fields pane. With no extra work whatsoever, you get the pivot table in Figure 3.36. It shows the sum of Total Cost, broken down by time of day and region of country. For example, the total cost of orders in the morning in the South was $3835.86, and the total cost of orders in the morning (over all regions) was $18,427.31.

Excel applies two rules to variables checked at the top of the PivotTable Fields pane:

■ When you check a text variable or a date variable in the �eld list, it is added to the Rows area.

■ When you check a numeric variable in the �eld list, it is added to the Values area and summarized with the Sum function.

This is exactly what happens when you check Time, Region, and Total Cost. However, this is just the beginning. With very little work, you can do a lot more. Some of the many pos- sibilities are explained in the remainder of this example.

First, however, we mention the new look of pivot tables in Excel 2007 and later. Notice that the pivot table in Figure 3.36 has both Rows fields, Time and Region, in column A. This wasn’t possible in pre-2007 pivot tables, where the two Rows fields would have been in separate columns. Microsoft decided to offer this new layout because of its clean,

5In discussing pivot tables, Microsoft uses the term �eld rather than �eld rather than �eld variable, so we will do so as well.

Starting with Excel 2007, there are three different layouts for pivot tables, but the differences are relatively minor. Ultimately, it is a matter of taste.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

114 Chapter 3 Finding Relationships among Variables

A 1 2 3

3187.16A�ernoon

A�ernoon Total

Evening Total

2552.89Evening

18834.3 Morning

Morning Total

MidWest 8159.78NorthEast

South 5729.72 7188.94West

MidWest NorthEast South West

MidWest NorthEast South West

24265.6

5941.49 3864.12

6475.8

3878.22 5084.57 3835.86

4 5 6 7 8 9

10 11 12 13 14 15 16 17

CB

Evening Total

5628.66 18 19

18427.31 Grand Total

Time Sum of Total CostRegion

61527.21

Figure 3.37 Sum of Total Cost by Time and Region (Tabular Layout)

streamlined look. In fact, you can now choose from three layouts: Compact, Outline, or Tabular. These are available from the Report Layout dropdown list on the Design ribbon. When you create a pivot table (in an .xlsx file), you get the compact layout by default. If you would rather have the tabular or outline layout, it is easy to switch to them. In particu- lar, the tabular layout, shown in Figure 3.37, is closer to what was used in pre-2007 ver- sions of Excel. (Outline layout, not shown here, is very similar to tabular layout except for the placement of its subtotals.)

One significant advantage to using tabular (or outline) layout instead of compact lay- out is that you can see which fields are in the Rows and Columns areas. Take another look at the pivot table in Figure 3.36. It is fairly obvious that categories such as Afternoon and Morning have to do with time of day and that categories such as Midwest and South have to do with region of country. However, there are no labels that explicitly name the Rows fields. In contrast, the tabular layout in Figure 3.37 names them explicitly, and it makes fil- tering more transparent. Some critics have been very vocal about their dislike for compact layout due to the lack of meaningful labels, and we tend to agree. Therefore, the remaining screenshots in this chapter will show tabular layout.

Hiding Categories (Filtering) The pivot table in Figure 3.36 shows all times of day for all regions, but this is not neces- sary. You can filter out any of the times or regions you don’t want to see. Assuming you are in tabular layout as in Figure 3.37 and you want to filter on Time, you simply click the dropdown arrow next to Time and check the categories to show, as in Figure 3.38. The unchecked categories will be filtered out. (Note that this type of filter can be implemented in compact view, but it is more confusing and is not discussed here.)6 unchecked categories will be filtered out. (Note that this type of filter

6 unchecked categories will be filtered out. (Note that this type of filter

Figure 3.39 shows the same pivot table as in Figure 3.37, but with filters on both Time and Region.

6You have probably noticed that the dialog box in Figure 3.38 is exactly like the one for Excel tables discussed in the previous chapter. This is no accident. You already learned how to �lter tables, so there is nothing new to learn for �ltering pivot tables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 115

Figure 3.38 Filtering on Time

Sorting on Values or Categories It is easy to sort in a pivot table, either by the numbers in the Values area of the table or by the labels in a Rows or Columns field. To sort by the numbers in the Values area, right- click any number and select Sort. If a simple A–Z or Z–A sort isn’t enough, you can select More Sort Options. For example, this allows you to sort on the column of numbers that contains the selected cell or on the row of numbers that contains this cell.

To sort on the labels of a Rows or Columns field, you can again right-click any of the categories such as Morning and select Sort. Alternatively, you can click the drop- down arrow for the field, such as Time in Figure 3.39, and you will get the dialog box in Figure 3.38 that allows both sorting and filtering.

However, be aware that sorting on labels is always in alphabetical or reverse alpha- betical order. This is not always what you want. For example, suppose you want the natural sort order: Morning, Afternoon, Evening. This isn’t the A–Z or Z–A order, but it is still possible to sort manually. The trick is to select the cell of some label such as Morning and place the cursor on the border of the cell so that it becomes a four-sided arrow. Then you can drag the label up or down, or to the left or right. It takes a little practice, but it isn’t difficult. The times of day in the remaining screenshots will be shown in the natural order: Morning, Afternoon, Evening.

Figure 3.39 Pivot Table with Time and Region Filters

A 1 2 3

3187.16A�ernoon

A�ernoon Total Morning

Morning Total Grand Total

MidWest South 5729.72

7188.94West

MidWest South West

16105.82 3878.22 3835.86 5628.66

13342.74 29448.56

4 5 6 7 8 9

10 11 12

CB

Time Sum of Total CostRegion

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

116 Chapter 3 Finding Relationships among Variables

Figure 3.40 Placing Region in the Columns Area

Changing the locations of fields in pivot tables is easy. We favor drag- ging the fields to the various areas, but you can experiment with the various options.

Changing Locations of Fields (Pivoting) Starting with the pivot table in Figure 3.39 (but with the �lters removed), you can choose where to place either Time or Region; it does not have to be in the Rows area. To place the not have to be in the Rows area. To place the not Region variable in the Columns area, for example, drag the Region button from the Rows area of the PivotTable Fields pane to the Columns area. The pivot table changes automati- cally, as shown in Figure 3.40.

Alternatively, you can categorize by a third �eld such as Day and locate it in a different area. As before, if you check Day in the PivotTable Fields pane, it goes to the Rows area by default, but you can then drag it to another area. The pivot table in Figure 3.41 shows the result of placing Day in the Filters area. By clicking the dropdown arrow in row 1, you can then show the pivot table for all days or any particular day. In fact, you can check the Show Multiple Items option. We checked this option and then selected Friday and Saturday to obtain the pivot table in Figure 3.41. It reports data only for Fridays and Saturdays. (Slicers, discussed toward the end of this section, provide a more transparent way of implementing this �lter.)

Figure 3.41 Filtering on Day in the Filters Area

This ability to categorize by multiple �elds and rearrange the �elds as you like is a big reason why pivot tables are so powerful and useful—and easy to use.

Changing Field Settings You can change various settings in the Field Settings dialog box. You can get to this dialog box in at least two ways. First, there is a Field Setting button on the Analyze (or Options) ribbon. Second, you can right-click any of the pivot table cells and select the Field Settings item. The �eld settings are particularly useful for �elds in the Values area.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 117

For now, right-click any number in the pivot table in Figure 3.41 and select Value Field Settings to obtain the dialog box in Figure 3.42. This allows you to choose how you want to summarize the Total Cost variable—by Sum, Average, Count, or several others. You can also click the Number Format button to choose from the usual number formatting options, and you can click the Show Values As tab to display the data in various ways (more on this later). If you choose Average and format as currency with two decimals, the resulting pivot table appears as in Figure 3.43. Now each number is the average of Total Cost for all orders in its combination of categories. For example, the average of Total Cost for all Friday and Saturday morning orders in the South is $153.59, and the average of all Friday all Friday all and Saturday orders in the South is $152.24.

The key to summariz- ing the data the way you want it summa- rized is the Value Field Settings dialog box. Get used to it because you will use it often.

Figure 3.42 Value Field Settings Dialog Box

Figure 3.43. Pivot Table with Average of Total Cost

Pivot Charts It is easy to accompany pivot tables with pivot charts. These charts are really Excel charts, but they are better because they adapt automatically to the underlying pivot table. If you make a change to the pivot table, such as pivoting the Rows and Columns �elds, the pivot chart makes the same change automatically. To create a pivot chart, click anywhere inside the pivot table, select the PivotChart button on the Analyze (or Options) ribbon, and select a chart type. That’s all there is to it. The resulting pivot chart (using the default column chart option) for the pivot table in Figure 3.43 appears in Figure 3.44. If you decide to pivot the Rows and Columns �elds, the pivot chart changes automatically, as shown in Figure 3.45. Note that the categories on the horizontal axis are always based on the Rows �eld, and the categories in the legend are always based on the Columns �eld.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

118 Chapter 3 Finding Relationships among Variables

Note that when you activate a pivot chart, the PivotTable Tools “super tab” changes to PivotChart Tools. This super tab includes three ribbons for manipulating pivot charts: Analyze, Design, and Format (see Figure 3.46, where slight ribbon changes from Excel 2010 to Excel 2013/2016 are again apparent). There is not enough space here to discuss the many options on these ribbons, but they are intuitive and easy to use. As usual, don’t be afraid to experiment.

Multiple Variables in the Values Area More than a single variable can be placed in the Values area. In addition, a given variable in the Values area can be summarized by more than one summarizing function. This can create a rather busy pivot table, so we indicate our favorite way of doing it. Starting with the pivot table in Figure 3.43 (including the �lter on Friday and Saturday), drag Total Cost in the top of the PivotTable Fields pane (the item that is already checked) to the Values area. The bottom part of the PivotTable Fields pane should now appear as in Figure 3.47, and the

$0.00 A�ernoon Evening

Day

Morning

$250.00

$200.00

$150.00

$100.00

$50.00

Time

Region

MidWest

NorthEast

South

West

Figure 3.44 Pivot Chart Based on Pivot Table

$0.00 MidWest NothEast South

Day

West

$250.00

$200.00

$150.00

$100.00

$50.00

Region

Time

A�ernoon

Evening

Morning

Figure 3.45 Pivot Chart after Pivoting Rows and Columns Fields

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 119

Figure 3.46 PivotChart Tools Tabs

Figure 3.47 Choosing Two Values Fields

pivot table should now appear as in Figure 3.48. (The  South and West regions have been �ltered out to conserve space.) Note in particular the Values button in the Columns area of Figure 3.47. This button controls the placement of the data in the pivot table. You have a number of options for this button: (1) leave it where it is, (2) drag it above the Region button, (3) drag it to the Rows area, below the Time button, or (4) drag it to the Rows area, above the Time button. You can experiment with these options, but we tend to prefer option (2), which leads to the pivot table in Figure 3.49.

Figure 3.48 Pivot Table with Two Values Fields

In a similar manner, you can experiment with the buttons in the Values area. However, the effect here is less striking. If you drag the Sum of Total Cost button above the Average of Total Cost button in the �eld list, the effect is simply to switch the ordering of these sum- maries in the pivot table, as shown in Figure 3.50.

Summarizing by Count The �eld in the Values area, whatever it is, can be summarized by the Count function. This is useful when you want to know, for example, how many of the orders were placed by females in the South. When summarizing by Count, the key is to understand that the actual

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

120 Chapter 3 Finding Relationships among Variables

Figure 3.49 Rearranged Pivot Table with Two Values Fields

Figure 3.50 Another Rearrangement of the Pivot Table with Two Values Fields

�eld placed in the Values area is irrelevant, so long as you summarize it by the Count func- tion. To illustrate, start with the pivot table in Figure 3.43, where Total Cost is summarized with the Average function, and delete the Day �lter. Next, right-click any number in the pivot table, select Value Field Settings, and select the Count function (see Figure 3.51). The default Custom Name you will see in this dialog box, Count of Total Cost, is misleading, because Total Cost has nothing to do with the counts obtained. Therefore, we like to change this Custom Name label to Count, as shown in the �gure. The resulting pivot table, with values formatted as numbers with zero decimals (and the �lter on Day removed), appears in Figure 3.52. For example, 27 of the 400 orders were placed in the morning in the South, and 115 of the 400 orders were placed in the NorthEast. (Do you now see why the counts

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 121

have nothing to do with Total Cost?) This type of pivot table, with counts for various cat- egories, is the same as the crosstabs discussed in Section 3-2. However, these counts can be created much more quickly with a pivot table.

When data are summarized by counts, there are a number of ways they can be dis- played. The pivot table in Figure 3.52 shows “raw counts.” Depending on the type of infor- mation you want, it might be more useful to display the counts as percentages. Three particular options are typically chosen: as percentages of total, as percentages of row totals, and as percentages of column totals. When shown as percentages of total, the percentages in the table sum to 100%; when shown as percentages of row totals, the percentages in each row sum to 100%; when shown as percentages of column totals, the percentages in each column sum to 100%. Each of these options can be useful, depending on the question you are trying to answer. For example, if you want to know whether the daily pattern of orders varies from region to region, showing the counts as percentages of column totals is useful so that you can compare columns. But if you want to see whether the regional ordering pattern varies by time of day, showing the counts as percentages of row totals is useful so that you can compare rows.

Figure 3.51 Field Settings Dialog Box with Count Selected

Counts can be displayed in a number of ways. You should choose the way that best answers the question you are asking.

Figure 3.52 Pivot Table with Counts

As an example, to display the counts as percentages of column totals, right-click any number in the pivot table, select Show Values As, and select the option you want. (You can also get to these options from the Show Values As tab in the Value Field Settings

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

122 Chapter 3 Finding Relationships among Variables

dialog box in Figure 3.53.) The resulting pivot table and corresponding pivot chart appear in Figure 3.54. As you can see by comparing columns, the pattern of regional orders varies somewhat by time of day.

Figure 3.53 Value Field Settings Dialog Box with “Show Values As” Options

Figure 3.54 Pivot Table and Pivot Chart with Counts As Percentages of Column Totals

Sometimes it is useful to see the raw counts and the percentages. This can be done easand the percentages. This can be done easand - ily by dragging any variable to the Values area, summarizing it by Count, and displaying it as “Normal.” Figure 3.55 shows one possibility, where we have changed the custom names of the two Count variables to make them more meaningful. Alternatively, the counts and percentages could be shown in two separate pivot tables.

Pivot Table Tip: Right-Clicking to Choose Options We keep saying to make changes in the Value Field Settings dialog box. However, you can also make changes directly by right-clicking a value in the pivot table. For example, when you right- click a number in the Values area, you see Number Format, Summarize Values By, and Show Values As menu items, among others.

Grouping Finally, categories in a Rows or Columns variable can be grouped. This is especially useful when a Rows or Columns variable has many distinct values. Because a pivot table creates

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 123

a row or column for each distinct value, the results can be unwieldy. We present two pos- sibilities. First, suppose you want to summarize Sum of Total Cost by Date. Starting with a blank pivot table, check both Date and Total Cost in the PivotTable Fields pane. This creates a separate row for each distinct date in the data set—more than 100 separate dates. This is too much detail, so it is useful to group on the Date variable. To do so, right-click any date in column A and select Group. (Group options are also available on the Analyze/ Options ribbon.) Accept the default selections in the Grouping dialog box (see Figure 3.56) to obtain the pivot table in Figure 3.57.

Pivot Table Tip: Grouping on Dates Suppose you have multiple years of data and you would like a monthly grouping such as January 2007 through December 2009. If you simply select Months as in Figure 3.56, all of the Januaries, for example, will be lumped together. The trick is to select both Months and Years in the dialog box.

Figure 3.56 Grouping Dialog Box

A 1 2 3 Date Sum of Total Cost

$9,383.26Mar Apr May Jun

$14,589.91 $19,468.11 $18,085.93

4 5 6 7 8

B

$61,527.21Grand Total

Figure 3.57 Pivot Table after Grouping by Month

Figure 3.55 Pivot Table with Percentages of Column Totals and Raw Counts

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

124 Chapter 3 Finding Relationships among Variables

CHANGES IN EXCEL 2016

In Excel 2016, you will see slightly different date behavior than described here. If you drag a date field to the Rows or Columns areas, it will automatically be grouped. Then you can drill down by automatically be grouped. Then you can drill down by automatically month, quarter, and year, for example. Microsoft evidently decided that users almost always want to group on dates. Still, you can then ungroup on the date field if you need to.

Figure 3.58 Grouping Dialog Box for a Non-Date Variable

A 1 2 3

$72.78

Grand Total

$139.66 $172.71 $253.55 $324.26 $328.92 $361.53 $415.17 $153.82

4 6.82-56.82 56.82-106.82 106.82-156.82 156.82-206.82 206.82-256.82 256.82-306.82 306.82-356.82 356.82-406.82

5 6 7 8 9

10 11 12

B

4 6 High Item Average of Total Cost

Figure 3.59 Pivot Table after Grouping by 50 on High Item

By now, we have illustrated the pivot table features that are most commonly used. Be aware, however, that there are many more features available. These include (but are not limited to) the following:

■ Showing/hiding subtotals and grand totals (check the Layout options on the Design ribbon)

■ Dealing with blank rows, that is, categories with no data (right-click any number, choose PivotTable Options, and check the options on the Layout & Format tab)

■ Displaying the data behind a given number in a pivot table (double-click any number in the Values area to get a new worksheet)

■ Formatting a pivot table with various styles (check the style options on the Design ribbon)

■ Moving or renaming pivot tables (check the PivotTable and Action groups on the Analyze (or Options) ribbon)

■ Refreshing pivot tables as the underlying data changes (check the Refresh dropdown list on the Analyze (or Options) ribbon)

As a second possibility for grouping, suppose you want to see how the average of Total Cost varies by the amount of the highest priced item in the order. You can drag Total Cost to the Values area, summarized by Average, and drag High Item to the Rows area. Because High Item has nearly 400 distinct values, the resulting pivot table is virtually worthless. Again, however, the trick is to group on the Rows variable. This time there are no natural groupings as there are for a date variable, so it is up to you to create the groupings. Excel pro- vides a suggestion, as shown in Figure 3.58, but you can override it. For example, changing the bottom entry to 50 leads to the pivot table in Figure 3.59. Some experimentation is typi- cally required to obtain the grouping that presents the results in the most appropriate way.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 125

■ Creating pivot table formulas for calculated �elds or calculated items (check the Formulas dropdown list on the Analyze (or Options) ribbon)

■ Basing pivot tables on external databases (not covered here)

Not only are these (and other) features available, but Excel usually provides more than one way to implement them. The suggestions given here are just some of the ways they can be implemented. The key to learning pivot table features is to experiment. There are entire books written about pivot tables, but we don’t recommend them. You can learn a lot more, and a lot more quickly, by experimenting with data such as the Elecmart data. Don’t be afraid to mess up. Pivot tables are very forgiving, and you can always start over. ■

Excel Tip: How Excel Stores Pivot Table Data When you create a pivot table, Excel stores a snapshot of your source data in memory in a pivot cache. The amount of memory depends on the size of the data source, but it can be large. Fortunately, if you create another pivot table based on the same data source, Excel is intelligent enough to use the same pivot cache, thus conserving memory. (This sharing behavior began with Excel 2010.) There is a way to mimic the pre-2010 behavior (creating a separate pivot cache for each pivot table, but it is not discussed here.)

We complete this section by providing one last example to illustrate how pivot tables can answer business questions very quickly.

1 2 3 4 5 6 7 8 9

10 11

A BA B C DC D E FE F G HG H I JI J K LK L M Person Age Weight Income Pay Type Type T Car ValueCar ValueCar V CC Debt Gender Live Alone Dwell TypeDwell TypeDwell T Mall Trips Nbhd Have Tried

1 48 175 65500 Hourly 2190 3510 Male No Home 7 East No 2 33 202 29100 Hourly 2110 740 Female No Condo 4 East Yest Yest Y 3 51 188 32200 Salaried 5140 910 Male No Condo 1 East No 4 56 244 19000 Hourly 700 1620 Female No Home 3 West No 5 28 218 81400 Salaried 26620 600 Male No Apt 3 West Yes 6 51 173 73000 Salaried 24520 950 Female No Condo 2 East No 7 44 182 66400 Salaried 10130 3500 Female Yes Condo 6 West Yest Yest Y 8 29 189 46200 Salaried 10250 2860 Male No Condo 5 West Yest Yest Y 9 28 200 61100 Salaried 17210 3180 Male No Condo 10 West Yes

10 29 209 9800 Salaried 2090 1270 Female Yes Apt 7 East Yest Yest Y

1 4 2 3 3 5 4 5 5 2 6 5 7 4 8 2 9 2

e W 8 1 3 2 1 1 6 2 8 2 1 1 4 1 9 1 8 2

9 9

e P

0 S d 2

0 M

0 F

0 F 0 M 0 M 0 F

r L e N

e N e N

o H

s A

e 7

t 3

4 E 1 E 3 W

2 E 6 W 5 W

7 E

d H

t Y t N t N

t N t Y t Y

t Y

Figure 3.60 Lasagna Trier Data

E X A M P L E 3.5 FROZEN LASAGNA DINNERS

The file Lasagna Triers.xlsx contains data on over 800 potential customers being tracked by a (fictional) company that has been marketing a frozen lasagna dinner. The file contains a number of demographics on these customers, as indicated in Figure 3.60: their age, weight, income, pay type, car value, credit card debt, gender, whether they live alone, dwelling type, monthly number of trips to the mall, and neighborhood. It also indi- cates whether they have tried the company’s frozen lasagna. The company wants to under- stand why some potential customers are triers and others are not. Does gender make a difference? Does income make a difference? In general, what distinguishes triers from nontriers? How can the company use pivot tables to explore these questions?

Pivot tables, with counts in the Values area, are a great way to discover which variables have the largest effect on a Yes/No variable.

Objective To use pivot tables to explore which demographic variables help to distinguish lasagna triers from nontriers.

Solution The key is to set up a pivot table that shows counts of triers and nontriers for different categories of any of the potential explanatory variables. For example, one such pivot table

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

126 Chapter 3 Finding Relationships among Variables

80.00%

70.00%

60.00%

50.00%

40.00%

30.00%

20.00%

10.00%

0.00% No Yes

Yes

No

Count

Live Alone

Have Tried

No Yes Grand Total

IHGFEDCBA 1

2

3

4

5

6

7

8

9

10

11

12

13

100.00%

100.00%

100.00%

45.57%

25.52%

42.17%

No

Yes

Grand Total

54.43%

74.48%

57.83%

Figure 3.62 Pivot Table and Pivot Chart for Examining the Effect of Live Alone

shows the percentages of triers and nontriers for males and females separately. If the per- centages are different for males than for females, the company will know that gender has an effect. On the other hand, if the percentages for males and females are about the same, the company will know that gender does not make much of a difference.

The typical pivot table should be set up as shown in Figure 3.61. The Rows variable is any demographic variable you want to investigate—in this case, Gender. The Columns variable is Have Tried (Yes or No). The Values variable can be any variable, as long as it is expressed as a count. Finally, it is useful to show these counts as percentage of row totals. This way you can easily look down column C to see whether the percentage in one category (Female) who have tried the product is any different from the percentage in another category (Male) who have tried the product. As you can see, males are somewhat more likely to try the product than females: 60.92% versus 54.27%. This is also apparent from the associated pivot chart.

0.00%

10.00%

20.00%

30.00%

40.00%

50.00%

60.00%

70.00%

No

Yes

Female Male

1

2

3

4

5

6

7

8

9

10

11

12

13

A BA B C DC D E FE F G HG H I

Female Male

Grand Total

45.73%

42.17%

39.08% 54.27%

57.83%

60.92% 100.00%

100.00%

100.00%

Count

Gender

Have Tried

No Yes Grand Total

Figure 3.61 Pivot Table and Pivot Chart for Examining the Effect of Gender

Once this generic pivot table and associated pivot chart are set up, you can easily explore other demographic variables by swapping them for Gender. For example, Figure 3.62 indicates that people who live alone are (not surprisingly) much more likely to try this frozen microwave product than people who don’t live alone.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 127

CHANGES IN EXCEL 2010 AND 2013

Microsoft made the already user-friendly pivot tables even friendlier in Excel 2010 with the addition of slicers. These are essentially lists of the distinct values of any variable, which you can then filter on. You add a slicer from the Analyze (or Options) ribbon under PivotTable Tools. For example, in the

IHGFEDCBA

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

Count

Income

Have Tried

No Yes Grand Total

0-49999

50000-99999

100000-149999

150000-199999

Grand Total

Count

Income

Have Tried

No Yes Grand Total

0-49999

50000-99999

100000-149999

150000-199999

Grand Total

307

152

32

4

495

563

243

46

4

856

256

91

14

361

45.47%

37.45%

30.43%

0.00%

42.17%

54.53%

62.55%

69.57%

100.00%

57.83%

Count

Income

Have Tried

Count

Income

Have Tried

120.00% 100.00%

80.00% 60.00% 40.00% 20.00%

0.00%

0- 49

99 9

50 00

0- 99

99 9

10 00

00 -1

49 99

9

15 00

00 -1

99 99

9

No

Yes

0- 49

99 9

400 300 200 100

0

50 00

0- 99

99 9

10 00

00 -..

.

15 00

00 -..

. No

Yes

100.00%

100.00%

100.00%

100.00%

100.00%

Figure 3.63 Pivot Table and Pivot Chart for Examining the Effect of Income

As another example, Figure 3.63 indicates that people with larger incomes are slightly more likely to try the product. There are two things to note about this income pivot table. First, because there are so many individual income values, grouping is useful. You can experiment with the grouping to get the most meaningful results. Second, you should be a bit skeptical about the last group, which has 100% triers. It is possible that there are only one or two people in this group. (It turns out that there are four.) For this reason, it is a good idea to create two pivot tables of the counts, one showing percentage of row totals and one showing the raw counts. This second pivot table is shown at the bottom of Figure 3.63.

The problem posed in this example is a common one in real business situations. One variable indicates whether people are in one group or another (triers or nontriers), and there are a lot of other variables that could potentially explain why some people are in one group and others are in the other group. There are a number of sophisticated techniques for attacking this classification problem, and some of these are discussed in Chapter 17. However, you can go a long way toward understanding which variables are important by the simple pivot table method illustrated here. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

128 Chapter 3 Finding Relationships among Variables

Level A 33. Solve problem 1 with pivot tables and create corre-

sponding pivot charts. Express the counts as percent- ages of row totals. What do these percentages indicate

about this particular data set? Then repeat, expressing the counts as percentages of column totals.

34. Solve problem 2 with pivot tables and create corresponding pivot charts. Express the counts as

P R O B L E M S

Elecmart sales data, you can choose Region as a slicer. You then see a list on the screen with a button for each possible value: Midwest, Northeast, South, and West. You can then click any combination of these buttons to filter on the chosen regions. Note that a slicer variable does not have to be part of not have to be part of not the pivot table. For example, if you are showing sum of Total Cost, and Region is not part of the pivot table, a Region slicer will still filter sum of Total Cost for the regions selected. On the other hand, if Region is already in the Rows area, say, you can filter on it through the slicer. In this case, selecting regions from the slicer is equivalent to filtering on the same regions in the Rows area. Basically, the slicers have been added as a convenience to users. They make filtering easier and more transparent.

A similar Timeline feature was added in Excel 2013. A timeline is like a slicer, but it is specifically for filtering on a date variable.

As an example, Figure 3.64 shows a pivot table accompanied by two slicers and a timeline. The Rows field is Time, which has been filtered in the usual way (through the dropdown list in the Rows area) to show only Afternoon and Evening. The two slicers appear next to the pivot table. The Region slicer has been filtered on Midwest and South, and the Gender slicer has been filtered on Male. Note that the Date field for the timeline has been renamed to Purchase Date so that the timeline works properly. Here you can see that the sum of Total Cost for all sales in the evening by males in the Midwest and South during the months of April and May is $2442.05.

IHGFEDCBA

Row Labels

A�ernoon

Evening

Grand Total

Sum of Total Cost

$650.80

$2,442.05

$3,092.85

Purchase Date

Region Gender

MidWest

NorthEast

Female

Male

South

West

Apr - May 2012 MONTHS

2012

EB MAR APR MAY JMAY JMA UN JUL AUG

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

Figure 3.64 Pivot Table with Slicers and a Timeline

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-5 Pivot Tables 129

percentages of row totals. What do these percentages indicate about this particular data set? Then repeat, expressing the counts as percentages of column totals.

35. Solve problem 3 with pivot tables and create corresponding pivot charts. Express the counts as percentages of row totals. What do these percentages indicate about this particular data set? Then repeat, expressing the counts as percentages of columns totals.

36. Solve problem 4 with pivot tables and create corresponding pivot charts. Express the counts as percentage of row totals. What do these percentages indicate about this particular data set? Then repeat, expressing the counts as percentages of column totals.

37. Solve problem 7 with pivot tables and create corre- sponding pivot charts. However, find only means and standard deviations, not medians or quartiles. (This is one drawback of pivot tables. Medians, quartiles, and percentiles are not in the list of summary measures.)

38. Solve problem 8 with pivot tables and create corresponding pivot charts. However, find only means and standard deviations, not medians. (This is one drawback of pivot tables. Medians are not among their summary measures.)

39. Solve problem 9 with pivot tables and create corresponding pivot charts. However, find only means and standard deviations, not medians. (This is one drawback of pivot tables. Medians are not among their summary measures.)

40. The file P03_40.xlsx contains monthly data on the number of vehicles crossing the border from Mexico into four southwestern states. a. Restructure this data set on a new sheet so that

there are three long columns: Month, State, and Crossings. Essentially, you should stack the original columns B through E on top of one another to get the Crossings column, and you should also indicate which state each row corresponds to in the State column. The Month column should have four replicas of the original Month column.

b. Create a pivot table and corresponding pivot table chart based on the restructured data. It should break down the average of Crossings by Year and State. Comment on any patterns you see in the chart.

41. The Wall Street Journal CEO Compensation Study analyzed CEO pay from many U.S. companies with fiscal year 2008 revenue of at least $5 billion that filed their proxy statements between October 2008 and March 2009. The data are in the file P02_30.xlsx. a. Create a pivot table and a corresponding pivot

chart that simultaneously shows average of Salary 2008 and average of Bonus 2008, broken down by Company Type. Comment on any striking results in the chart.

b. In the Data sheet, create a new column, Total 2008, which is the sum of Salary 2008 and Bonus 2008.

Then create two pivot tables and corresponding pivot charts on a single sheet. The first should show the counts of CEOs broken down by Company Type, and the second should simultaneously show the average of Total 2008, the minimum of Total 2008, and the maximum of Total 2008, all broken down by Company Type. Comment on any striking results in these charts.

42. One pivot table element we didn’t explain is a calculated item. This is usually a new category for some categorical variable that is created from existing categories. It is easiest to learn from an example. Open the file Elecmart Sales.xlsx from this section, create a pivot table, and put Day in the Rows area. Proceed as follows to create two new categories, Weekday and Weekend. a. Select any day and select Calculated Item from

the Formulas dropdown list on the PivotTable Tools Options ribbon. This will open a dialog box. Enter Weekend in the Name box and enter the formula =Sat+Sun in the formula box. (You can double-click the items in the Items list to help build this formula.) When you click OK, you will see Weekend in the pivot table.

b. Do it yourself. Create another calculated item, Weekday, for Mon through Fri.

c. Filter out all of the individual days from the row area, so that only Weekday and Weekend remain, and then find the sum of Total Cost for these two new categories. How can you check whether these sums are what you think they should be? (Notes about calculated items: First, if you have Weekend, Weekday, and some individual days showing in the Rows area, the sum of Total Cost will double- count these individual days, so be careful about this. Second, be aware that if you create a calculated item from some variable such as Day, you are no longer allowed to drag that variable to the Filters area.)

43. Building on the previous problem, another pivot table element we didn’t explain is a calculated field. This is usually a new numerical variable built from numerical variables that can be summarized in the Values area. It acts somewhat like a new column in the spreadsheet data, but there is an important difference. Again, it is easiest to learn from an example. Open the file Elecmart Sales.xlsx and follow the instructions below. a. Create a new column in the data, CostPerItem,

which is Total Cost divided by Items Ordered. Then create a pivot table and find the average of CostPerItem, broken down by Region. You should find averages such as $50.41 for the MidWest. Explain exactly how this value was calculated. Would such an average be of much interest to a manager at Elecmart? Why or why not?

b. Select any average in the pivot table and then select Calculated Field from the Formulas dropdown list

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

130 Chapter 3 Finding Relationships among Variables

on the Analyze/Options ribbon. This will open a dialog box. Enter CF_CostPerItem in the name box (we added CF, for calculated field, because we are not allowed to use the CostPerItem name that already exists), enter the formula =TotalCost/ItemsOrdered, and click OK. You should now see a new column in the pivot table, Sum of CF_CostPerItem, with different values different values different than in the Average of CostPerItem column. For example, the new value for the MidWest should be $46.47. Do some investigation to understand how this “sum” was calculated. From a manager’s point of view, does it make any sense? (Note on calculated fields: When you summarize a calculated field, it doesn’t matter whether you express it as sum, average, max, or any other summary measure. It is calculated in exactly the same way in each case.)

44. The file P02_18.xlsx contains daily values of the S&P Index from 1970 to mid-2015. It also contains percentage changes in the index from each day to the next. Create a pivot table with average of % Change in the Values area and Date in the Rows area. You will see every single date, with no real averaging taking place. This problem lets you explore how you can group naturally on a date variable. For each part below, explain the result briefly. (Note that if you are using Excel 2016, grouping by date will be done automatically.) a. Group by Month. b. Group by Year. c. Group by Month and Year (select both in the

Group dialog box). Can you make it show the year averages from part b?

d. Group by Quarter. e. Group by Month and Quarter. Can you make it

show the averages from part c? f. Group by Quarter and Year. g. Group by Month, Quarter, and Year.

45. (For Excel 2010 or later users only) Using the Elecmart Sales.xlsx file from this section, experiment with slicers as follows. a. Create a pivot table that shows the average of Total

Cost, broken down by Region in the Rows area and Time in the Columns area. Then insert two slicers, one for Region and one for Time. Select the West and NorthEast buttons on the Region slicer and the Morning and Afternoon buttons on the Time slicer. Explain what happens in the pivot table.

b. Create a pivot table that shows the average of Total Cost, broken down by Region in the Rows area and Time in the Columns area. Insert a Day slicer and select the Sat and Sun buttons. Explain what averages are now showing in the pivot table. Verify this by deleting the slicer and placing Days in the Filters area, with Sat and Sun selected.

46. (For Excel 2010 or later users only) We used the Lasagna Triers.xlsx file in this section to show how pivot tables can help explain which variables are related to the buying behavior of customers. Illustrate how the same information could be obtained with slicers. Specifically, set up the pivot table as in the example, but use a slicer instead of a Rows variable. Then set it up exactly as in the example, with a Rows variable, but include a slicer for some other variable. Comment on the type of results you obtain with these two versions. Do slicers appear to provide any advantage in this type of problem?

Level B 47. Solve problem 5 with pivot tables and create cor-

responding pivot charts. If you first find the quartiles of Salary and Amount Spent (by any method), is it possible to create the desired crosstabs by grouping, without recoding these variables?without recoding these variables?without

48. Solve problem 17 with pivot tables. However, find only means and standard deviations, not medians. (This is one drawback of pivot tables. Medians are not among their summary measures. Can you think of a way to calculate medians by category?)

49. The file P03_22.xlsx lists financial data on movies released from 1980 to 2011 with budgets of at least $20 million. a. Create three new variables, Ratio1, Ratio2, and

Decade. Ratio1 should be US Gross divided by Budget, Ratio2 should be Worldwide Gross divided by Budget, and Decade should list 1980s, 1990s, or 2000s, depending on the year of the release date. If either US Gross or Worldwide Gross is listed as “Unknown,” the corresponding ratio should be blank. (Hint: For Decade, use the YEAR function to fill in a new Year column. Then use a lookup table to populate the Decade column.)

b. Use a pivot table to find counts of movies by various distributors. Then go back to the data and create one more column, Distributor New, which lists the distributor for distributors with at least 30 movies and lists Other for the rest. (Hint: Use a lookup table to populate Distributor New, but also use an IF to fill in Other where the distributor is missing.)

c. Create a pivot table and corresponding pivot chart that shows average and standard deviation of Ratio1, broken down by Distributor New, with Decade in the Filters area. Comment on any striking results.

d. Repeat part c for Ratio2.

50. The file P03_50.xlsx lists NBA salaries for five sea- sons. (Each NBA season straddles two calendar years.) a. Merge all of the data into a single new sheet called

All Data. In this new sheet, add a new column Season that lists the season, such as 2006–2007.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-6 Conclusion 131

b. Note that many of the players list a position such as C-F or F-C. Presumably, the first means the player is primarily a center but sometimes plays forward, whereas the second means the opposite. Recode these so that only the primary position remains (C in the first case, F in the second). To complicate matters further, the source lists positions differently in 2007–2008 than in other years. It lists PG and SG (point guard and shooting guard) instead of just G, and it lists SF and PF (small forward and power forward) instead of just F. Recode the positions for this season to be consistent with the other seasons (so that there are only three positions: G, F, and C).

c. Note that many players have (p) or (t) in their Contract Thru value. The Source sheet explains this. Create two new columns in the All Data sheet, Years Remaining and Option. The Years Remaining column should list the years remaining in the contract. For example, if the season is 2004–2005 and the contract is through 2006–2007, years remaining should be 2. The Option column should

list Player if there is a (p), Team if there is a (t), and blank if neither.

d. Use a pivot table to find the average Salary by Season. Change it to show average Salary by Team. Change it to show average Salary by Season and Team. Change it to show average Salary by Primary Position. Change it to show average Salary by Team and Primary Position, with filters for Season, Contract Years, Years Remaining, and Option. Comment on any striking findings.

51. The file P02_29.xlsx contain monthly percentages of on-time arrivals at several of the largest U.S. airports. a. Explain why the current format of either data set

limits the kind of information you can obtain with a pivot table. For example, does it allow you find the average on-time arrival percentage by year for any selected subset of airports, such as the average for O’Hare, Los Angeles International, and La Guardia?

b. Restructure the data appropriately and then use a pivot table to answer the specific question in part a.

3-6 CONCLUSION Finding relationships among variables is arguably the most important task in data analysis. This chapter has equipped you with some very powerful tools for detecting relationships. As we have discussed, the tools vary depending on whether the variables are categorical or numerical. (Again, refer to the diagram in the Data Analysis Taxonomy.xlsx �le.) Tables and charts of counts are useful for relationships among categorical variables. Summary measures broken down by categories and side-by-side box plots are useful for �nding rela- tionships between a categorical and a numerical variable. Scatterplots and correlations are useful for �nding relationships among numerical variables. Finally, pivot tables are useful for all types of variables.

Term Explanation Excel Pages Equation

Crosstabs (or contingency table)

Table of counts of joint categories of two categorical variables

COUNTIFS function or pivot table

82

Comparison problem Comparing a numerical variable across two or more subpopulations

86

Stacked or unstacked data formats

Stacked means long columns, one for categories and another for values; unstacked means a separate values column for each category

86

Scatterplot (or X-Y chart)

Chart for detecting a relationship between two numerical variables; one point for each observation

Scatter from Insert ribbon or StatTools

95

Trend line Line or curve fit to scatterplot (or time series graph)

Right-click on chart point, select Add Trendline

99

Summary of Key Terms

(continued)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

132 Chapter 3 Finding Relationships among Variables

P R O B L E M S

Conceptual Questions C.1. When you are trying to discover whether there is a

relationship between two categorical variables, why is it useful to transform the counts in a crosstabs to percentages of row or column totals? Once you do this, how can you tell if the variables are related?

C.2. Suppose you have a crosstabs of two “Yes/No” cat- egorical variables, with the counts shown as percent- ages of row totals. What will these percentages look like if there is absolutely no relationship between the variables? Besides this case, list all possible types of relationships that could occur. (There aren’t many.)

C.3. If you suspect that a company’s advertising expen- ditures in a given month affect its sales in future months, what correlations would you look at to con- firm your suspicions? How would you find them?

C.4. Suppose you have customer data on whether they have bought your product in a given time period, along with various demographics on the customers. Explain how you could use pivot tables to see which demographics are the primary drivers of their “yes/no” buying behavior.

C.5. Suppose you have data on student achievement in high school for each of many school districts. In spreadsheet format, the school district is in column A, and various student achievement measures are in columns B, C, and so on. If you find fairly low correlations (magnitudes from 0 to 0.4, say) between the variables in these achievement columns, what exactly does this mean?

C.6. A supermarket transactions data set is likely to have “hierarchical” columns of data. For example, for the

product sold, there might be columns like Product Family, Product Department, Product Category, and maybe even more. (See the file Supermarket Transactions.xlsx from Chapter 2 as an example.) Another hierarchy is for store location, where there might be columns for Country, State or Province, City, and possibly more. One more hierarchy is time, with the hierarchy Year, Quarter, Month, and so on. How could a supermarket manager use pivot tables to “drill down” through a hierarchy to exam- ine revenues? For example, you might start at the Drink level, then drill down to Alcoholic Beverages, and then to Beer and Wine? Illustrate with the file mentioned.

C.7. Suppose you have a large data set for some sport. Each row might correspond to a particular team (as in the file P03_57.xlsx on football outcomes, for example) or it might even correspond to a given play. Each row contains one or more measures of success as well as many pieces of data that could be drivers of success. How might you find the most important drivers of success if the success measure is categori- cal (such as Win or Lose)? How might you find the most important drivers of success if the success measure is numerical and basically continuous (such as Points Scored in basketball)?

C.8. If two variables are highly correlated, does this imply that changes in one cause changes in the other? If not, give at least one example from the real world that illustrates what else could cause a high correlation.

C.9. Suppose there are two commodities A and B with strongly negatively correlated daily returns, such as

Term Explanation Excel Pages Equation

Covariance Measure of linear relationship between two numerical variables, but affected by units of measurement

COVAR function or StatTools

101 3.1

Correlation Measure of linear relationship between two numerical variables, always from −1 to +1

CORREL function or StatTools

102 3.2

Pivot table Table for breaking down data by category; can show counts, averages, or other summary measures

PivotTable from Insert ribbon

108

Pivot chart Chart corresponding to a pivot table PivotChart from PivotTable Tools Analyze/Options ribbon

117

Slicers Graphical elements for filtering in pivot tables

Introduced in Excel 2010 127

Summary of Key Terms (Continued )

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3-6 Conclusion 133

a stock and gold. Is it possible to find another com- modity with daily returns that are strongly negatively correlated with both A and B?

C.10. In checking whether several times series, such as monthly exchange rates of various currencies, move together, why do most analysts look at correlations between their differences rather than correlations between the original series?

Level A 52. Unfortunately, StatTools doesn’t have a stacked option

for its correlation procedure, which would allow you to get a separate table of correlations for each category of a categorical variable. The only alterna- tive is to sort on the categorical variable, insert some blank rows between values of different categories, copy the headings to each section, create separate StatTools data sets for each, and then ask for correla- tions from each. Do this with the movie data in the file P02_02.xlsx. Specifically, separate the data into three data sets based on Genre: one for Comedy, one for Drama, and one for all the rest. For this problem, you can ignore the third group. For each of Comedy and Drama, create a table of correlations between 7-day Gross, 14-day Gross, Total US Gross, International Gross, and US DVD Sales. Comment on whether the correlation structure is much different for these two popular genres.

53. The file P03_53.xlsx lists campaign contributions, by number of contributors and contribution amount, by state (including Washington DC) for the four lead- ing contenders in the 2008 presidential race. Create a scatterplot and corresponding correlation between Dollar Amount (Y axis) and Contributors for each of the four contenders. For each scatterplot, super- impose a linear trend line and show the correspond- ing equation. Interpret each equation and compare them across candidates. Finally, identify the state for any points that aren’t on or very close to the corre- sponding trend line.

54. The file P03_54.xlsx lists data for 593 movies released in 2011. Obviously, some movies are simply more popular than others, but success in 2011, measured by 2011 gross or 2011 tickets sold, could also be influenced by the release date. To check this, create a new variable, Days Out, which is the number of days the movie was out during 2011. For example, a movie released on 12/15 would have Days Out equal to 17 (which includes the release day). Create two scatterplots and corresponding correlations, one of 2011 Gross (Y axis) versus Days Out and one of 2011 Tickets Sold (Y axis) versus Days Out. Describe the behavior you see. Do you think a movie’s success can be predicted very well just by knowing how many days it has been out?

55. The file P03_55.xlsx lists the average salary for each MLB team from 2004 to 2011, along with the number of team wins in each of these years. a. Create a table of correlations between the Wins

columns. What do these correlations indicate? Are they higher or lower than you expected?

b. Create a table of correlations between the Salary columns. What do these correlations indicate? Are they higher or lower than you expected?

c. For each year, create a scatterplot and the associated correlations between Wins for that year (Y axis) and Salary for that year. Does it appear that teams are buying their way to success?

d. The coloring in the Wins columns indicates the playoff teams. Create a new Yes/No column for each year, indicating whether the team made it to the playoffs that year. Then create a pivot table for each year showing average of Salary for that year, broken down by the Yes/No column for that year. Do these pivot tables indicate that teams are buying their way into the playoffs?

56. The file P03_56.xlsx lists the average salary for each NBA team from the 2004–2005 season to the 2009–2010 season, along with the number of team wins each of these years. Answer the same questions as in the previous problem for this basketball data.

57. The file P03_57.xlsx lists the average salary for each NFL team from 2002 to 2009, along with the number of team wins each of these years. Answer the same questions as in problem 55 for this football data.

58. The file P03_58.xlsx lists salaries of MLB players in the years 2007 to 2009. Each row corresponds to a particular player. As indicated by blank salaries, some players played in one of these years, some played in two of these years, and the rest played in all three years. a. Create a new Yes/No variable, All 3 Years, that

indicates which players played all three years. b. Create two pivot tables and corresponding pivot

charts. The first should show the count of players by position who played all three years. The second should show the average salary each year, by position, for all players who played all three years. (For each of these, put the All 3 Years variable in the Filters area.) Explain briefly what these two pivot tables indicate.

c. Define a StatTools data set on only the players who played all three years. Using this data set, create a table of correlations of the three salary variables. What do these correlations indicate about player salaries?

59. The file P03_59.xlsx lists the results of about 20,000 runners in the 2008 New York Marathon. a. For all runners who finished in 3.5 hours or less,

create a pivot table and corresponding pivot chart

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

134 Chapter 3 Finding Relationships among Variables

of average of Time by Gender. (To get a fairer com- parison in the chart, change it so that the vertical axis starts at zero.) For the same runners, and on the same sheet, create another pivot table and pivot chart of counts by Gender. Comment on the results.

b. For all runners who finished in 3.5 hours or less, create a pivot table and corresponding pivot chart of average of Time by Age. Group by Age so that the teens are in one category, those in their twenties are in another category, and so on. For the same runners, and on the same sheet, create another pivot table and pivot chart of counts of these age groups. Comment on the results.

c. For all runners who finished in 3.5 hours or less, create a single pivot table of average of Time and of counts, broken down by Country. Then filter so that only the 10 countries with the 10 lowest average times appear. Finally, sort on average times so that the fastest countries rise to the top. Guess who the top two are! (Hint: Try the Value Filters for the Country variable.) Comment on the results.

60. The file P02_12.xlsx includes data on the 50 top graduate programs in the United States, according to a U.S. News & World Report survey.U.S. News & World Report survey.U.S. News & World Report a. Create a table of correlations between all of the

numerical variables. Discuss which variables are highly correlated with which others.

b. The Overall score is the score schools agonize about. Create a scatterplot and corresponding correlation of each of the other variables versus Overall, with Overall always on the Y axis. What do you learn from these scatterplots?

61. Recall from an example in the previous chapter that the file Supermarket Transactions.xlsx contains over 14,000 transactions made by supermarket customers over a period of approximately two years. Set up a single pivot table and corresponding pivot chart, with some instructions to a user (like the supermarket man- ager) in a text box, on how the user can get answers to any typical question about the data. For example, one possibility (of many) could be total revenue by product department and month, for any combination of gender, marital status, and homeowner. (The point is to get you to explain pivot table basics to a nontechni- cal user.)

62. The file P03_15.xlsx contains monthly data on the various components of the Consumer Price Index. a. Create differences for each of the variables. You

can do this quickly with StatTools, using the Difference item in the Data Utilities dropdown list, or you can create the differences with Excel formulas.

b. Create a times series graph for each CPI component, including the All Items component. Then create a time series graph for each difference

variable. Comment on any patterns or trends you see.

c. Create a table of correlations between the differences. Comment on any large correlations (or the lack of them).

d. Create a scatterplot for each difference variable versus the difference for All Items (Y axis). Comment on any patterns or outliers you see.

Level B 63. The file P03_63.xlsx contains financial data on 85

U.S. companies in the Computer and Electronic Product Manufacturing sector (NAICS code 334) with 2009 earnings before taxes of at least $10,000. Each of these companies listed R&D (research and devel- opment) expenses on its income statement. Create a table of correlations between all of the variables and use conditional formatting to color green all correla- tions involving R&D that are strongly positive or negative. (Use cutoff values of your choice to define “strongly.”) Then create scatterplots of R&D (Y axis) versus each of the other most highly correlated vari- ables. Comment on any patterns you see in these scat- terplots, including any obvious outliers, and explain why (or if) it makes sense that these variables are highly correlated with R&D. If there are highly corre- lated variables with R&D, can you tell which way the causality goes?

64. The file P03_64.xlsx lists monthly data since 1950 on the well-known Dow Jones Industrial Average (DJIA), as well as the less well-known Dow Jones Transportation Average (DJTA) and Dow Jones Utilities Average (DJUA). Each of these is an index based on 20 to 30 leading companies (which change over time). a. Create monthly differences in three new columns.

The Jan-50 values will be blank because there are no Dec-49 values. Then, for example, the Feb-50 difference is the Feb-50 value minus the Jan-50 value. (You can easily calculate these with Excel formulas, but you might want to try the StatTools Difference procedure from its Data Utilities dropdown list.)

b. Create a table of correlations of the three difference columns. Does it appear that the three Dow indexes tend to move together through time?

c. It is possible (and has been claimed) that one of the indexes is a “leading indicator” of another. For example, a change in the DJUA in September might predict a similar change in the DJIA in the following December. To check for such behavior, create “lags” of the difference variables. To do so, select Lag from the StatTools Data Utilities dropdown list, select one of the difference variables, and enter the number of lags you want.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

For this problem, try four lags. Then press OK and accept the StatTools warnings. Do this for each of the three difference variables. You should end up with 12 lag variables. Explain in words what these lag variables contain. For example, what is the Dec-50 lag3 of the DJIA difference?

d. Create a table of correlations of the three differences and the differences and the dif 12 lags. Use conditional formatting to color green all correlations greater than 0.5 (or any other cutoff you choose). Does it appear that any index is indeed a leading indicator of any other? Explain.

65. The file The file The f P03_65.xlsx lists a lot of data for each NBA team for the seasons 2004–2005 to 2008–2009. The variables are divided into groups: (1) Overall success, (2) Offensive, and (3) Defensive. The basic question all basketball fans (and coaches) ponder is what causes success or failure. a. Explore this question by creating a correlation

matrix with the variable Wins (the measure of success) and all of the variables in groups (2) and (3). Based on these correlations, which five variables appear to be the best predictors of success? (Keep in mind that negative correlations can also be important.)

b. Explore this question in a different way, using the Explore this question in a different way, using the Explore this question in a dif Playoff Team column as a measure of success. Here, it makes sense to proceed as in the Lasagna Triers example in Section 3-5, using the variables in groups (2) and (3) as the predictors. However, these predictors are all basically continuous, so grouping would be required for all of them in the pivot table, and grouping is always somewhat arbitrary. Instead, create a copy of the Data sheet. Then for each variable in groups (2) to (13), create a formula that returns 1, 2, 3, or 4, depending on which quarter of that variable the value falls in (1 if it is less than or equal to the first quartile, and so on). (This sounds like a lot of work, but a single copyable formula will work for the entire range.) Now use these discrete variables as predictors and proceed as in the Lasagna Triers example. List the five variables that appear to be the best (or at least good) predictors of making the playoffs.

66. The file The file The f P03_66.xlsx lists a lot of data for each NFL team for the years 2004 to 2009. The variables are divided into groups: (1) Overall success, (2) Team Offense, (3) Passing Offense, (4) Rushing Offense, (5) Turnovers Against, (6) Punt Returns, (7) Kick Returns, (8) Field Goals, (9) Punts, (10) Team Defense, (11) Passing Defense, (12) Rushing Defense, and (13) Turnovers Caused. The basic question all football fans (and coaches) ponder is what causes success or failure. Answer the same questions as in the previous problem for this football data, but use all of the variables in groups (2) to (13) as possible predictors.

67. The file The file The f P02_57.xlsx contains data on mortgage loans in 2008 for each state in the United States. The file is different from others in this chapter in that each state has its own sheet with the same data in the same format. Each state sheet breaks down all mortgage applications by loan purpose, applicant race, loan type, outcome, and denial reason (for those that were denied). The question is how a single data set for all states can be created for analysis. The Typical Data Set sheet indicates a simple way of doing this, using the powerful but little-known INDIRECT function. This sheet is basically a template for bringing in any pieces of data from the state sheets you would like to examine. a. Do whatever it takes to populate the Typical Data

Set sheet with information in the range B7:D11 and B14:D14 (18 variables in all) of each state sheet. Add appropriate labels in row 3, such as Asian Dollar Amount Applied For.

b. Create a table of correlations between these variables. Color yellow all correlations between a given applicant race, such as those between Asian Mortgage Application, Asian Dollar Amount Applied For, and Asian Average Income. Comment on the magnitudes of these. Are there any surprises?

c. Create scatterplots of White Dollar Amount Applied For (X axis) versus the similar variable for each of the other five applicant races. Comment on any patterns in these scatterplots, and identify any obvious outliers.

C A S E 3.1 CUSTOMER ARRIVALS AT BANK98

Bank98 operates a main location and three branch locations in a medium-size city. All four locations perform similar services, and customers typically do business at the location nearest them. The bank has recently had more congestion—longer waiting

lines—than it (or its customers) would like. As part of a study to learn the causes of these long lines and to suggest possible solutions, all locations have kept track of customer arrivals during one-hour intervals for the past 10 weeks. All branches are open Monday

Case 3.1 Customer Arrivals at Bank98 135 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 3.3 CHURN IN THE CELLULAR PHONE MARKET

The term churn is very important to managers in the cellular phone business. Churning occurs when a customer stops using one company’s service and switches to another company’s service. Obviously, managers try to keep churning to a minimum, not only by offering the best possible service, but by trying to identify conditions that lead to churning and taking steps to stop churning before it occurs. For example, if a company learns that customers tend to churn at the end of their two-year contract, they could offer customers an incentive to stay a month or two before the end of their two-year contract. The file C03_03.xlsx contains

data on over 2000 customers of a particular cellular phone company. Each row contains the activity of a particular customer for a given time period, and the last column indicates whether the customer churned during this time period. Use the tools in this chapter (and possibly the previous chapter) to learn (1) how these variables are distributed, (2) how the variables in columns B–R are related to each other, and (3) how the variables in columns B–R are related to the Churn variable in column S. Write a short report of your findings, including any recommendations you would make to the company to reduce churn.

C A S E 3.2 SAVING, SPENDING, AND SOCIAL CLIMBING

The best-selling book The Millionaire Next Doorby Thomas J. Stanley and William D. Danko (Longstreet Press, 1996) presents some very interesting data on the characteristics of millionaires. We tend to believe that people with expensive houses, expensive cars, expensive clothes, country club memberships, and other outward indications of wealth are the millionaires. The authors define wealth, however, in terms of savings and investments, not consumer items. In this sense, they argue that people with a lot of expensive things and even large incomes often have surprisingly little wealth. These people tend to spend much of what they make on consumer items, often trying to keep up with, or impress, their peers.

In contrast, the real millionaires, in terms of savings and investments, frequently come from “unglamorous” professions (particularly teaching),

own unpretentious homes and cars, dress in inexpensive clothes, and otherwise lead rather ordinary lives.

Consider the (fictional) data in the file C03_02.xlsx. For several hundred couples, it lists their education level, their annual combined salary, the market value of their home and cars, the amount of savings they have accumulated (in savings accounts, stocks, retirement accounts, and so on), and a self-reported “social climber index” on a scale of 1 to 10 (with 1 being very unconcerned about social status and material items and 10 being very concerned about these). Prepare a report based on these data, supported by relevant charts and/or tables, that could be used in a book such as The Millionaire Next Door. Your conclusions can either support or contradict those of Stanley and Danko.

through Friday from 9 A.M. until 5 P.M. and on Saturday from 9 A.M. until noon. For each location, the file C03_01.xlsx contains the number of customer C03_01.xlsx contains the number of customer C03_01.xlsx arrivals during each hour of a 10-week period. The manager of Bank98 has hired you to make some sense of these data. Specifically, your task is to present charts and/or tables that indicate how customer traffic into the bank locations varies by day of week and hour

of day. There is also interest in whether any daily or hourly patterns you observe are stable across weeks. Although you don’t have full information about the way the bank currently runs its operations—you know only its customer arrival pattern and the fact that it is currently experiencing long lines—you are encouraged to append any suggestions for improving operations, based on your analysis of the data.

136 Chapter 3 Finding Relationships among Variables Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Probability and Decision Making under Uncertainty CHAPTER 4 Probability and Probability Distributions

CHAPTER 5 Normal, Binomial, Poisson, and Exponential Distributions

CHAPTER 6 Decision Making under Uncertainty

PA RT

2

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

139

GAME AT MCDONALD’S

Several years ago, McDonald’s ran a campaign in which it gave game cards to its customers. These game cards made it possible for customers to win hamburgers, french fries, soft drinks, and other fast-food items, as well as cash prizes. Each card had 10 covered spots that could be uncovered by rubbing them with a coin. Beneath three of these spots were “zaps.” Beneath the other seven spots were names of prizes, two of which were identical. For example, one card might have two pictures of a hamburger, one picture of a Coke, one of french fries, one of a milk shake, one of $5, one of $1000, and three zaps. For this card the customer could win a hamburger. To win on any card, the To win on any card, the T customer had to uncover the two matching spots (which showed the potential prize for that card) before uncovering a zap; any card with a zap uncovered was automatically void. Assuming that the two matches and the three zaps were arranged randomly on the cards, what is the probability of a customer winning?

We label the two matching spots M1 and M2, and the three zaps Z1, Z2Z2Z , and Z3Z3Z . Then the probability of winning is the probability of uncovering M1 and M2 before uncovering Z1, Z2Z2Z , or Z3Z3Z . In this case the relevant set of outcomes is the set of all orderings of M1, M2, Z1, Z2Z2Z , and Z3Z3Z , shown in the order they are uncovered. As far as the outcome of the game is concerned, the other five spots on the card are irrelevant. Thus, an outcome such as M2, M1, Z3Z3Z , Z1, Z2Z2Z is a winner, whereas M2, Z2Z2Z , Z1, M1, Z3Z3Z is a loser. Actually, the first of these would be declared a winner as soon as M1 was uncovered, and the second would be declared a loser as soon as Z2Z2Z was uncovered. However, we show the whole sequence of Ms and ZsZsZ so that we can count outcomes correctly. We then find the probability of winning using an equally likely argu- ment. Specifically, we divide the number of outcomes that are winners by the total number of outcomes. It can be shown that the number of outcomes that are winners is 12, whereas the total number of outcomes is 120. Therefore, the probability of a winner is 12/120 = 0.1.

Probability and Probability Distributions

C H A P T E R

4

R o b

W a lls

/A la

m y

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

140 Chapter 4 Probability and Probability Distributions

This calculation, which shows that on average, 1 out of 10 cards could be winners, was obviously important for McDonald’s. Actually, this provides only an upper bound on the fraction of cards where a prize was awarded. Many customers threw their cards away without playing the game, and even some of the winners neglected to claim their prizes. So, for example, McDonald’s knew that if they made 50,000 cards where a milk shake was the winning prize, somewhat less than 5000 milk shakes would be given away. Knowing approximately what their expected “losses” would be from winning cards, McDonald’s was able to design the game (how many cards of each type to print) so that the expected extra revenue (from customers attracted to the game) would cover the expected losses. ■

4-1 INTRODUCTION A key aspect of solving real business problems is dealing appropriately with uncertainty. This involves recognizing explicitly that uncertainty exists and using quantitative methods to model uncertainty. If you want to develop realistic business models, you cannot simply act as if uncertainty doesn’t exist. For example, if you don’t know next month’s demand, you shouldn’t build a model that assumes next month’s demand is a sure 1500 units. This is only wishful thinking. You should instead incorporate demand uncertainty explicitly into your model. To do this, you need to know how to deal quantitatively with uncertainty. This involves probability and probability distributions. We introduce these topics in this chapter and then use them in a number of later chapters.

There are many sources of uncertainty. Demands for products are uncertain, times between arrivals to a supermarket are uncertain, stock price returns are uncertain, changes in interest rates are uncertain, and so on. In many situations, the uncertain quantity— demand, time between arrivals, stock price return, change in interest rate—is a numerical quantity. In the language of probability, it is called a random variable. More formally, a random variable associates a numerical value with each possible random outcome.

Associated with each random variable is a probability distribution that lists all of the possible values of the random variable and their corresponding probabilities. A probability distribution provides very useful information. It not only indicates the possible values of the random variable, but it also indicates how likely they are. For example, it is useful to know that the possible demands for a product are, say, 100, 200, 300, and 400, but it is even more useful to know that the probabilities of these four values are, say, 0.1, 0.2, 0.4, and 0.3. This implies, for example, that there is a 70% chance that demand will be at least 300.

It is often useful to summarize the information from a probability distribution with numerical summary measures. These include the mean, variance, and standard deviation. As their names imply, these summary measures are much like the corresponding summary measures in Chapters 2 and 3. However, they are not identical. The summary measures in not identical. The summary measures in not this chapter are based on probability distributions, not an observed data set. We will use numerical examples to explain the difference between the two—and how they are related.

The purpose of this chapter is to explain the basic concepts and tools necessary to work with probability distributions and their summary measures. We begin by brie�y discussing the basic rules of probability. We also introduce computer simulation, an extremely useful tool for illustrating important concepts in probability and statistics.

Modeling uncertainty, as we will be doing in the next few chapters and later in Chapters 15 and 16, is sometimes dif�cult, depending on the complexity of the model, and it is easy to get so caught up in the details that you lose sight of the big picture. For this reason, the �ow chart in Figure 4.1 is useful. (A colored version of this chart is available in the �le Modeling Uncertainty Flow Chart.xlsx.) Take a close look at the middle row of this chart. We begin with inputs, some of which are uncertain quantities, we use Excel®

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-1 Introduction 141

formulas to incorporate the logic of the model, and we end with probability distributions of important outputs. Finally, we use this information to make decisions. (The abbreviation EMV stands for expected monetary value. It is discussed extensively in Chapter 6.) The other boxes in the chart deal with implementation issues, particularly with the software you can use to perform the analysis. Study this chart carefully and return to it as you proceed through the next few chapters and Chapters 15 and 16.

Before proceeding, we discuss two terms you often hear in the business world: uncer- tainty and risk. They are sometimes used interchangeably, but they are not really the same. You typically have no control over uncertainty; it is something that simply exists. A good example is the uncertainty in exchange rates. You cannot be sure what the exchange rate between the U.S. dollar and the euro will be a year from now. All you can try to do is meas- ure this uncertainty with a probability distribution.

In contrast, risk depends on your position. Even though you don’t know what the exchange rate will be, it makes no difference to you—there is no risk to you—if you have no European investments, you aren’t planning a trip to Europe, and you don’t have to buy or sell anything in Europe. You have risk only when you stand to gain or lose money depending on the eventual exchange rate. Of course, the type of risk you face depends on your position. If you are holding euros in a money market account, you are hoping that euros gain value relative to the dollar. But if you are planning a European vacation, you are hoping that euros lose value relative to the dollar.

Uncertainty and risk are inherent in many of the examples in this book. By learning about probability, you will learn how to measure uncertainty, and you will also learn how to measure the risks involved in various decisions. One important topic you will not learn not learn not much about is risk mitigation by various types of hedging. For example, if you know you have to purchase a large quantity of some product from Europe a year from now, you face

For simulation models, this can be done “manually” with data tables and built-in functions like AVERAGE, STDEV, etc. But an add-in like @RISK takes care of these bookkeeping details automatically.

Use decision trees (made easier with an add-in like Precision Tree) if the number of possible decisions and the number of possible outcomes are not too large.

This is an overview of spreadsheet modeling with uncertainty. The main process is in blue. The dark shaded boxes deal with implementation issues.

Assess probability distributions of uncertain inputs:

1. If a lot of historical data is available, use software like @RISK to find the distribution that best fits the data.

2. Choose a probability distribution (normal? triangular?) that seems reasonable. Software like @RISK is helpful for exploring distributions.

3. Gather relevant information, ask experts, and do the best you can.

Decide which inputs are important for the model.

1. Which are known with certainty? 2. Which are uncertain?

Two fundamental approaches:

1. Build an exact probability model that incorporates the rules of probability. (Pros: It is exact and amenable to sensitivity analysis. Cons: It is often difficult mathematically, maybe not even possible.)

2. Build a simulation model. (Pros: It is typically much easier, especially with an add-in like @RISK, and extremely versatile. Cons: It is only approximate and runs can be time consuming for complex models).

For simulation models, random values for uncertain inputs are necessary.

1. They can sometimes be generated with built-in Excel functions. This often involves tricks and can be obscure.

2. Add-ins like @RISK provide functions (like RISKNORMAL, RISKTRIANG) that make it much easier.

Examine important outputs.

The result of these formulas should be probability distribution(s) of important output(s). Summarize these probability distributions with (1) Histograms (risk profiles), (2) Means and Standard deviations, (3) Percentiles, (4) Possibly others.

Model the problem.

Use Excel formulas to relate inputs to important outputs, i.e., enter the business logic.

Make decisions based on this information.

Criterion is usually EMV, but it could be something else, e.g., minimize the probability of losing money.

Figure 4.1 Flow Chart for Modeling Uncertainty

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

142 Chapter 4 Probability and Probability Distributions

the risk that the value of the euro could increase dramatically, thus costing you a lot of money. Fortunately, there are ways to hedge this risk, so that if the euro does increase rela- tive to the dollar, your hedge minimizes your losses. Hedging risk is an extremely important topic, and it is practiced daily in the real world, but it is beyond the scope of this book.

4-2 PROBABILITY ESSENTIALS We begin with a brief discussion of probability. The concept of probability is one that we all encounter in everyday life. When a weather forecaster states that the chance of rain is 70%, he or she is making a probability statement. When a sports commentator states that the odds against the Cleveland Cavaliers winning the NBA Championship are 3 to 1, he or she is also making a probability statement. The concept of probability is quite intuitive. concept of probability is quite intuitive. concept However, the rules of probability are not always as intuitive or easy to master. We examine the most important of these rules in this section.

As the examples in the preceding paragraph illustrate, probabilities are sometimes expressed as percentages or odds. However, these can easily be converted to probabilities on a 0-to-1 scale. If the chance of rain is 70%, then the probability of rain is 0.7. Similarly, if the odds against the Cavaliers winning are 3 to1, then the probability of the Cavaliers winning is 1/4 (or 0.25).

There are only a few probability rules you need to know, and they are discussed in the next few subsections. Surprisingly, these are the only rules you need to know. Probability is not an easy topic, and a more thorough discussion of it would lead to considerable math- ematical complexity, well beyond the level of this book. However, it is all based on the few relatively simple rules discussed next.

4-2a Rule of Complements

The simplest probability rule involves the complement of an event. If complement of an event. If complement A is any event, then the complement of A, denoted by A (or in some books by Ac), is the event that A does not occur. For not occur. For not example, if A is the event that the Dow Jones Industrial Average will �nish the year at or above the 18,000 mark, then the complement of A is that the Dow will �nish the year below 18,000.

If the probability of A is P(A(A( ), then the probability of its complement, P(A(A( ), is given by Equation (4.1). Equivalently, the probability of an event and the probability of its com- plement sum to 1. For example, if you believe that the probability of the Dow �nishing at or above 18,000 is 0.25, then the probability that it will �nish the year below 18,000 is 1 − 0.25 = 0.75.

4-2b Addition Rule

Events are mutually exclusive if at most one of them can occur. That is, if one of them occurs, then none of the others can occur. For example, consider the following three events involving a company’s annual revenue for the coming year: (1) revenue is less than $1 million, (2) revenue is at least $1 million but less than $2 million, and (3) revenue is at least

A probability is a number between 0 and 1 that measures the likelihood that some event will occur. An event with probability 0 cannot occur, whereas an event with probability 1 is certain to occur. An event with probability greater than 0 and less than 1 involves uncertainty. The closer its probability is to 1, the more likely it is to occur.

Rule of Complements P(A(A( ) = 1 − P(A(A( ) (4.1)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-2 Probability Essentials 143

$2 million. Clearly, only one of these events can occur. Therefore, they are mutually exclu- sive. They are also exhaustive events, which means that they exhaust all possibilities—one of these three events must occur. Let must occur. Let must A1 through An be any n events. Then the addition rule of probability involves the probability that at least one of these events will occur. In general, this probability is quite complex, but it simpli�es considerably when the events are mutually exclusive. In this case the probability that at least one of the events will occur is the sum of their individual probabilities, as shown in Equation (4.2). Of course, when the events are mutually exclusive, “at least one” is equivalent to “exactly one.” In addition, if the events A1 through An are exhaustive, then the probability is 1 because one of the events is certain to occur.

In a typical application, the events A1 through An are chosen to partition the set of all possible outcomes into a number of mutually exclusive events. For example, in terms of a company’s annual revenue, de�ne A1 as “revenue is less than $1 million,” A2 as “revenue is at least $1 million but less than $2 million,” and A3 as “revenue is at least $2 million.” Then these three events are mutually exclusive and exhaustive. Therefore, their probabilities must sum to 1. Suppose these probabilities are P(A(A( 1) = 0.5, P(A(A( 2) = 0.3, and P(A(A( 3) = 0.2. (Note that these probabilities do sum to 1.) Then the additive rule enables you to calculate other probabilities. For example, the event that revenue is at least $1 million is the event that either A2 or A3 occurs. From the addition rule, its probability is

P(revenue  is at least $1 million) = P(A(A( 2) + P(A(A( 3) = 0.5

Similarly,

P(revenue  is less  than  $2  million) = P(A(A( 1) + P(A(A( 2) = 0.8

and

P(revenue is less than $1 million or at least $2 million) = P(A(A( 1) + P(A(A( 3) = 0.7

Again, the addition rule works only for mutually exclusive events. If the events overlap, the situation is more complex. For example, suppose you are dealt a bridge hand (13 cards from a 52-card deck). Let H, D, C, and S, respectively, be the events that you get at least 5 hearts, at least 5 diamonds, at least 5 clubs, and at least 5 spades. What is the probability that at least one of these four events occurs? It is not the sum of their individual probabilities because they are not mutually exclusive. For example, you could get 5 hearts and 5 spades. Probabilities such as this one are actually quite dif�cult to calculate, and we will not pursue them here. Just be aware that the addition rule does not apply unless the events are mutually exclusive.

4-2c Conditional Probability and the Multiplication Rule

Probabilities are always assessed relative to the information currently available. As new information becomes available, probabilities can change. For example, if you read that LeBron James suffered a season-ending injury, your assessment of the probability that the Cavaliers will win the NBA Championship would obviously change. A formal way to revise probabilities on the basis of new information is to use conditional probabilities.

Let A and B be any events with probabilities P(A(A( ) and P(B). Typically, the probability P(A(A( ) is assessed without knowledge of whether B occurs. However, if you are told that told that told B has occurred, then the probability of A might change. The new probability of A is called

Addition Rule for Mutually Exclusive Events P(at  least one  of  A1 through An) = P(A(A( 1) + P(A(A( 2) + … + P(A(A( n) (4.2)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

144 Chapter 4 Probability and Probability Distributions

the conditional probability of A given B, and it is denoted by P(A(A( ∣B). Note that there is still uncertainty involving the event to the left of the vertical bar in this notation; you do not know whether it will occur. However, there is no uncertainty involving the event to the right of the vertical bar; you know that it has occurred. The conditional probability can be calculated with the following formula.

The numerator in this formula is the probability that both A and B occur. This prob- ability must be known to �nd P(A(A( ∣B). However, in some applications P(A(A( ∣B) and P(B) are known. Then you can multiply both sides of Equation (4.3) by P(B) to obtain the following multiplication rule for P(A(A( and B).

The conditional probability formula and the multiplication rule are both valid; in fact, they are equivalent. The one you use depends on which probabilities you know and which you want to calculate, as illustrated in Example 4.1.

Conditional Probability

P(A(A( ∣B) = P(A(A( and B) P(B)

(4.3)

Multiplication Rule P(A(A( and B) = P(A(A( ∣B) P(B) (4.4)

E X A M P L E 4.1 ASSESSING UNCERTAINTY AT BENDER COMPANY

Bender Company supplies contractors with materials for the construction of houses. The company currently has a contract with one of its customers to fill an order by the end of July. However, there is some uncertainty about whether this deadline can be met, due to uncertainty about whether Bender will receive the materials it needs from one of its suppliers by the middle of July. Right now it is July 1. How can the uncertainty in this situation be assessed?

Objective To apply probability rules to calculate the probability that Bender will meet its end-of-July deadline, given the information the company has at the beginning of July.

Solution Let A be the event that Bender meets its end-of-July deadline, and let B be the event that Bender receives the materials from its supplier by the middle of July. The probabilities Bender is best able to assess on July 1 are probably P(B) and P(A(A( ∣B). At the beginning of July, Bender might estimate that the chances of getting the materials on time from its supplier are 2 out of 3, so that P(B) = 2/3. Also, thinking ahead, Bender estimates that if it receives the required materials on time, the chances of meeting the end-of-July deadline are 3 out of 4. This is a conditional probability statement that P(A(A( ∣B) = 3/4. Then the mul- tiplication rule implies that

P(A(A( and B) = P(A(A( ∣B)P(B) = (3/4) (2/3) = 0.5 That is, there is a fifty-fifty chance that Bender will get its materials on time and meet its and meet its and end-of-July deadline.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-2 Probability Essentials 145

This uncertain situation is depicted graphically in the form of a probability tree in Figure 4.2. Note that Bender initially faces (at the leftmost branch of the tree) the uncer- tainty of whether event B or its complement will occur. Regardless of whether event B occurs, Bender must next confront the uncertainty regarding event A. This uncertainty is reflected in the set of two pairs of branches in the right half of the tree. Hence, there are four mutually exclusive outcomes regarding the two uncertain events, as listed to the right of the tree. Initially, Bender is interested in the first possible outcome, the joint occurrence of events A and B, the top probability in the figure. Another way to compute this probabil- ity is to multiply the probabilities associated with the branches leading to this outcome, that is, the probability of B times the probability of A given B. As the figure indicates, this is (3/4) (2/3), or 0.5.

Figure 4.2 Probability Tree for Bender Example

There are several other probabilities of interest in this example. First, let B be the complement of B; it is the event that the materials from the supplier do not arrive on time. not arrive on time. not We know that P(B) = 1 − P(B) = 1/3 from the rule of complements. However, we do not yet know the conditional probability P(A(A( ∣B), the probability that Bender will meet its end-of-July deadline, given that it does not receive the materials from the supplier on time. In particular, P(A(A( ∣B) is not equal to not equal to not 1 − P(A(A( ∣B). (Can you see why?) Suppose Bender esti- mates that the chances of meeting the end-of-July deadline are 1 out of 5 if the materials do not arrive on time, so that P(A(A( ∣B) = 1/5. Then a second use of the multiplication rule gives

P(A(A( and B) = P(A(A( ∣B)P(B) = (1/5) (1/3) = 0.0667 In words, there is only 1 chance out of 15 that the materials will not arrive on time and Bender will meet its end-of-July deadline. This is the third (from the top) probability listed at the right of the tree.

The bottom line for Bender is whether it will meet its end-of-July deadline. After mid- July, this probability is either P(A(A( ∣B) = 3/4 or P(A(A( ∣B) = 1/5 because by this time, Bender will know whether the materials arrived on time. But on July 1, the relevant probability is P(A(A( )—there is still uncertainty about whether B or B will occur. Fortunately, you can calculate P(A(A( ) from the probabilities you already know. The logic is that A consists of

P(A and B) = (3/4)(2/3)P(A and B) = (3/4)(2/3)P(A

P(A and B) = (1/4)(2/3)P(A and B) = (1/4)(2/3)P(A

P(A and B) = (1/5)(1/3)P(A and B) = (1/5)(1/3)P(A

P(A and B) = (4/5)(1/3)P(A and B) = (4/5)(1/3)P(A

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

146 Chapter 4 Probability and Probability Distributions

4-2d Probabilistic Independence

A concept that is closely tied to conditional probability is probabilistic independence. You just saw that the probability of an event A can depend on whether another event B has occurred. Typically, the probabilities P(A(A( ), P(A(A( ∣B), and P(A(A( ∣B) are all different, as in Example 4.1. However, there are situations where all of these probabilities are equal. In this case, A and B are probabilistically independent events. This does not mean they are not mean they are not mutually exclusive. Rather, probabilistic independence means that knowledge of one event is of no value when assessing the probability of the other.

When two events are probabilistically independent, the multiplication rule simpli�es to Equation (4.5). This follows by substituting P(A(A( ) for P(A(A( ∣B) in the multiplication rule, which is allowed because of independence. In words, the probability that both events occur is the product of their individual probabilities.

How can you tell whether events are probabilistically independent? Unfortunately, this issue usually cannot be settled with mathematical arguments. Typically, you need empirical data to decide whether independence is reasonable. As a simple example, let A be the event that a family’s �rst child is male, and let B be the event that its second child is male. Are A and B independent? You could argue that they aren’t independent if you believe, say, that a boy is more likely to be followed by another boy than by a girl. You could argue that they are independent if you believe the chances of the second child being a boy are the same, regardless of the gender of the �rst child. (Note that neither argument requires that boys and girls are equally likely.)

In any case, the only way to settle the argument is to observe many families with at least two children. If you observe, say, that 55% of all families with �rst child male also have the second child male, and only 45% of all families with �rst child female have the second child male, then you can make a good case that A and B are not independent.not independent.not

The concept of independence carries over to random variables. Two random variables, X and Y , are independent if any two events, one involving only X and the other involving only Y , are independent. The idea is that knowledge of X is of no help in predicting Y , and vice versa. For example, if X is the amount of rain in Seattle in March and X is the amount of rain in Seattle in March and X Y is the amount of rain in Seattle in June, it might be realistic to assume that X and Y are independent random variables. March weather probably doesn’t have much effect on June weather. On the other hand, if X and X and X Y are the changes in stock prices of two companies in the same industry from one day to the next, it might not be realistic to assume that X and X and X Y are inde- pendent. The reason is that they might both be subject to the same economic in�uences.

Note that the multiplication rule applies to events involving independent random variables. For example, if X and Y are independent, then P(X = 10 and Y = 15) equals the product P(X = 10)P(Y = 15).

the two mutually exclusive events (A(A( and B) and (A(A( and B). That is, if A is to occur, it must  occur with B or with B. Therefore, the addition rule for mutually exclusive events implies that

P(A(A( ) = P(A(A( and B) + P(A(A( and B) = 1/2 + 1/15 = 17/30 = 0.5667

The chances are 17 out of 30 that Bender will meet its end-of-July deadline, given the information it has at the beginning of July. ■

Multiplication Rule for Independent Events P(A(A( and B) = P(A(A( )P(B) (4.5)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-2 Probability Essentials 147

It is probably fair to say that most events in the real world are not truly independent. However, because of the simpli�ed multiplication rule for independent events, many math- ematical models assume that events are independent; the math is much easier with this assumption. The question then is whether the results from such a model are believable. This depends on how unrealistic the independence assumption really is.

4-2e Equally Likely Events

Much of what you know about probability is probably based on situations where outcomes are equally likely. These include �ipping coins, throwing dice, drawing balls from urns, and other random mechanisms that are often discussed in introductory probability books. For example, suppose an urn contains 20 red marbles and 10 blue marbles. You plan to randomly select �ve marbles from the urn, and you are interested, say, in the probability of selecting at least three red marbles. To �nd this probability, you argue that every possible set of �ve marbles is equally likely to be chosen. Then you count the number of sets of �ve marbles count the number of sets of �ve marbles count that contain at least three red marbles, you count the total number of sets of �ve marbles that could be selected, and you set the desired probability equal to the ratio of these two counts.

It is true that many probabilities, particularly in games of chance, can be calculated by using an equally likely argument. It is also true that probabilities calculated in this way sat- isfy all of the rules of probability, including the rules we have already discussed. However, many probabilities, especially those in business situations, cannot be calculated by equally cannot be calculated by equally cannot likely arguments for the simple reason that the possible outcomes are not equally likely. For example, just because you are able to identify �ve possible scenarios for a company’s future, there is probably no reason whatsoever to conclude that each scenario has probability 1/5.

The bottom line is that there is no need in this book to discuss complex counting rules for equally likely outcomes. If you dreaded learning about probability in terms of balls and urns, rest assured that you will not have to do so here.not have to do so here.not

4-2f Subjective Versus Objective Probabilities

We now ask a very basic question: Where do the probabilities in a probability distribution come from? A complete answer to this question could lead to a chapter by itself, so we only brie�y discuss the issues involved. There are essentially two distinct ways to assess prob- abilities, objectively and subjectively. Objective probabilities are those that can be esti- mated from long-run proportions, whereas subjective probabilities cannot be estimated from long-run proportions. Some examples will clarify this distinction.

Consider throwing two dice and observing the sum of the two sides that face up. What is the probability that the sum of these two sides is 7? You might argue as follows. Because there are 6 × 6 = 36 ways the two dice can fall, and because exactly 6 of these result in a sum of 7, the probability of a 7 is 6/36 = 1/6. This is the equally likely argument discussed previously. It reduces probability to counting.

What if the dice are weighted in some way? Then the equally likely argument is no longer valid. You can, however, toss the dice many times and record the proportion of tosses that result in a sum of 7. This proportion is called a relative frequency.

A famous result called the law of large numbers states that this relative frequency, in the long run, will get closer and closer to the “true” probability of a 7. This is exactly what we mean by an objective probability. It is a probability that can be estimated as the long-run proportion of times an event occurs in a sequence of many identical experiments.

The relative frequency of an event is the proportion of times the event occurs out of the number of times the random experiment is run.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

148 Chapter 4 Probability and Probability Distributions

If you are �ipping coins, throwing dice, or spinning roulette wheels, objective prob- abilities are certainly relevant. You don’t need a person’s opinion of the probability that a roulette wheel, say, will end up pointing to a red number; you can simply spin it many times and keep track of the proportion of times it points to a red number. However, there are many situations, particularly in business, that cannot be repeated many times—or even more than once—under identical conditions. In these situations objective probabilities make no sense (and equally likely arguments usually make no sense either), so you must use subjective probabilities. A subjective probability is one person’s assessment of the likelihood that a certain event will occur. We assume that the person making the assessment uses all of the information available to make the most rational assessment possible.

This de�nition of subjective probability implies that one person’s assessment of a probability can differ from another person’s assessment of the same probability. For exam- ple, consider the probability that the Denver Broncos will win the next Super Bowl. If you ask a casual football observer to assess this probability, you will get one answer, but if you ask a person with a lot of inside information about injuries, team cohesiveness, and so on, you might get a very different answer. Because these probabilities are subjective, people with different information typically assess probabilities in different ways.

Subjective probabilities are usually relevant for unique, one-time situations. However, most situations are not completely unique; you often have some history to guide you. That is, historical relative frequencies can be factored into subjective probabilities. For example, suppose a company is about to market a new product. This product might be different in some ways from any products the company has marketed before, but it might also share some features with the company’s previous products. If the company wants to assess the probability that the new product will be a success, it will certainly analyze the unique fea- tures of this product and the current state of the market to obtain a subjective assessment. However, the company will also look at its past successes and failures with reasonably similar products. If the proportion of successes with past products was 20%, say, then this value might be a starting point in the assessment of this product’s probability of success.

All of the “given” probabilities in this chapter and later chapters can be placed some- where on the objective-to-subjective continuum, usually closer to the subjective end. An important implication of this is that these probabilities are not cast in stone; they are usually only educated guesses. Therefore, it is always a good idea to run a sensitivity analy- sis (especially in Excel, where this is easy to do) to see how “bottom-line” results depend on the given probabilities. Sensitivity analysis is especially important in Chapter 6, when we study decision making under uncertainty.

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www .cengagebrain.com.

Level A 1. In a particular suburb, 30% of the households have

installed electronic security systems. a. If a household is chosen at random from this

suburb, what is the probability that this household has not installed an electronic security system?not installed an electronic security system?not

b. If two households are chosen at random from this suburb, what is the probability that neither has neither has neither installed an electronic security system?

2. Several major automobile producers are competing to have the largest market share for sport utility vehicles (SUVs) in the coming quarter. A professional automo- bile market analyst assesses that the odds of General Motors not being the market leader are not being the market leader are not 6 to 1. The odds against Toyota and Ford having the largest market share in the coming quarter are similarly assessed to be 12 to 5 and 8 to 3, respectively. a. Find the probability that General Motors will have

the largest market share for SUVs in the coming quarter.

b. Find the probability that Toyota will have the largest market share for SUVs in the coming quarter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-2 Probability Essentials 149

c. Find the probability that Ford will have the largest market share for SUVs in the coming quarter.

d. Find the probability that some other automobile manufacturer will have the largest market share for SUVs in the coming quarter.

3. The publisher of a popular financial periodical has decided to undertake a campaign in an effort to attract new subscribers. Market research analysts in this company believe that there is a 1 in 4 chance that the increase in the 4 chance that the increase in the 4 number of new subscriptions resulting from this campaign will be less than 3000, and there is a 1 in 3 chance that the increase in the number of new subscriptions resulting from this campaign will be between 3000 and 0 and 0 5000. What is the probability that the increase in the number of new subscriptions resulting from this campaign will be less than 3000 or more than or more than or 5000?

4. Suppose that 18% of the employees of a given corpora- tion engage in physical exercise activities during the lunch hour. Moreover, assume that 57% of all employees are male, and 12% of all employees are males who engage in physical exercise activities during the lunch hour. a. If you choose an employee at random from this

corporation, what is the probability that this person is a female who engages in physical exercise activities during the lunch hour?

b. If you choose an employee at random from this corporation, what is the probability that this person is a female who does not engage in physical exercise activities during the lunch hour?

5. In a study designed to gauge married women’s partici- pation in the workplace today, the data provided in the file P04_05.xlsx were obtained from a sample of 750 randomly selected married women. Consider a woman selected at random from this sample in answering the following questions. a. What is the probability that this woman has a job

outside the home? b. What is the probability that this woman has at least

one child? c. What is the probability that this woman has a full-

time job and no more than one child? d. What is the probability that this woman has a part-

time job or at least one child, but not both?

6. Suppose that you draw a single card from a standard deck of 52 playing cards. a. What is the probability that this card is a diamond

or club?or club?or b. What is the probability that this card is not a 4? c. Given that this card is a black card, what is the

probability that it is a spade? d. Let E1 be the event that this card is a black card.

Let E2 be the event that this card is a spade. Are E1 and E2 independent events? Why or why not?

e. Let E3 be the event that this card is a heart. Let E4E4E be the event that this card is a 3. Are E3 and E4E4E independent events? Why or why not?

Level B 7. In a large accounting firm, the proportion of

accountants with MBA degrees and at least five years of professional experience is 75% as large as the proportion of accountants with no MBA degree and less than five years of professional experience. Furthermore, 35% of the accountants in this firm have MBA degrees, and 45% have fewer than five years of professional experience. If one of the firm’s account- ants is selected at random, what is the probability that this accountant has an MBA degree or at least five years of professional experience, but not both?

8. A local beer producer sells two types of beer, a regular brand and a light brand with 30% fewer calories. The company’s marketing department wants to verify that its traditional approach of appealing to local white- collar workers with light beer commercials and appeal- ing to local blue-collar workers with regular beer commercials is indeed a good strategy. A randomly selected group of 400 local workers are questioned about their beer-drinking preferences, and the data in the file P04_08.xlsx are obtained. a. If a blue-collar worker is chosen at random

from this group, what is the probability that he/she prefers light beer (to regular beer or no beer at all)?

b. If a white-collar worker is chosen at random from this group, what is the probability that he/she prefers light beer (to regular beer or no beer at all)?

c. If you restrict your attention to workers who like to drink beer, what is the probability that a randomly selected blue-collar worker prefers to drink light beer?

d. If you restrict your attention to workers who like to drink beer, what is the probability that a randomly selected white-collar worker prefers to drink light beer?

e. Does the company’s marketing strategy appear to be appropriate? Explain why or why not.

9. Suppose that two dice are tossed. For each die, it is equally likely that 1, 2, 3, 4, 5, or 6 dots will turn up. Let S be the sum of the two dice. a. What is the probability that S will be 5 or 7? b. What is the probability that S will be some number

other than 4 or 8? c. Let E1 be the event that the first die shows a 3.

Let E2 be the event that S is 6. Are E1 and E2 independent events?

d. Again, let E1 be the event that the first die shows a 3. Let E3 be the event that S is 7. Are E1 and E3 independent events?

e. Given that S is 7, what is the probability that the first die showed 4 dots?

f. Given that the first die shows a 3, what is the probability that S is an even number?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

150 Chapter 4 Probability and Probability Distributions

4-3 PROBABILITY DISTRIBUTION OF A SINGLE RANDOM VARIABLE

We now discuss the topic of most interest in this chapter, probability distributions. In this section we examine the probability distribution of a single random variable.

There are really two types of random vari- ables: discrete and continuous. A discrete random variable has only a �nite number of possible values, whereas a continuous random variable has a con- tinuum of possible values.1 Usually a discrete dis- tribution results from a count, whereas a continuous distribution results from a measurement. For exam- ple, the number of children in a family is clearly discrete, whereas the amount of rain this year in San Francisco is clearly continuous.

This distinction between counts and measurements is not always clear-cut. For exam- ple, what about the demand for televisions at a particular store next month? The number of televisions demanded is clearly an integer (a count), but it probably has many possible values, such as all integers from 0 to 100. In some cases like this, we often approximate in one of two ways. First, we might use a discrete distribution with only a few possible val- ues, such as all multiples of 20 from 0 to 100. Second, we might approximate the possible demand as a continuum from 0 to 100. The reason for such approximations is to simplify the mathematics, and they are frequently used.

Mathematically, there is an important difference between discrete and continuous probability distributions. Speci�cally, a proper treatment of continuous distributions, anal- ogous to the treatment we provide in this chapter, requires calculus—which we do not presume for this book. Therefore, we discuss only discrete distributions in this chapter. In later chapters we often use continuous distributions, particularly the bell-shaped normal distribution, but we simply state their properties without deriving them mathematically.

The essential properties of a discrete random variable and its associated probability dis- tribution are quite simple. We discuss them in general and then analyze a numerical example.

Let X be a random variable. To specify the probability distribution of X be a random variable. To specify the probability distribution of X X, we need to specify its possible values and their probabilities. We assume that there are k possible values, denoted k possible values, denoted k x1, x2, . . . , xk. The probability of a typical value xi is denoted in one of two ways, either i is denoted in one of two ways, either i P(X = xi) or p(xi). The �rst is a reminder that this probability involves the random variable X, whereas the second is a shorthand notation. Probability distributions must satisfy two criteria: (1) the prob- abilities must be nonnegative, and (2) they must sum to 1. In symbols, we must have

ak i = 1

p(xi) = 1, p(xi) ≥ 0

This is basically all there is to it: a list of possible values and a list of associated prob- abilities that sum to 1. It is also sometimes useful to calculate cumulative probabilities. A cumulative probability is the probability that the random variable is less than or equal to some particular value. For example, assume that 10, 20, 30, and 40 are the possible values of a random variable X, with corresponding probabilities 0.15, 0.25, 0.35, and 0.25. Then a typical cumulative probability is P(X ≤ 30). From the addition rule it can be calculated as

P(X ≤ 30) = P(X = 10) + P(X = 20) + P(X = 30) = 0.75

1Actually, a more rigorous discussion allows a discrete random variable to have an in�nite number of possible values, such as all positive integers.

Concept of Probability Distribution A probability distribution describes the uncertainty of a numerical outcome. It is not based, at least not directly, not based, at least not directly, not on a data set of the type discussed in the previous two chapters. Instead, it is a list of all possible outcomes and their corresponding probabilities.

F u n da m e n ta l I n s i g h t

Usually, capital letters toward the end of the alphabet, such as X, Y, and Z, are used to denote random variables.

A discrete probability distribution is a set of possible values and a corresponding set of probabilities that sum to 1.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-3 Probability Distribution of a Single Random Variable 151

The point is that the cumulative probabilities are completely determined by the individual probabilities.

4-3a Summary Measures of a Probability Distribution

It is often convenient to summarize a probability distribution with two or three well-chosen numbers. The �rst of these is the mean, often denoted µ. It is also called the expected value of X and denoted E(X)X)X (for expected X). The mean is a weighted sum of the possible values, weighted by their probabilities, as shown in Equation (4.6). In much the same way that an average of a set of numbers indicates “central location,” the mean indicates the “center” of the probability distribution.

To measure the variability in a distribution, we calculate its variance or standard devia- tion. The variance, denoted by σ2 or Var(X)X)X , is a weighted sum of the squared deviations of the possible values from the mean, where the weights are again the probabilities. This is shown in Equation (4.7). As in Chapter 2, the variance is expressed in the square of the units of X, such as dollars squared. Therefore, a more natural measure of variability is the standard deviation, denoted by σ or Stdev(X)X)X . It is the square root of the variance, as indicated by Equation (4.8).

Equation (4.7) is useful for understanding variance as a weighted average of squared deviations from the mean. However, the following is an equivalent formula for variance and is somewhat easier to implement in Excel. (It can be derived with straightforward algebra.) In words, you �nd the weighted average of the squared values, weighted by their probabilities, and then subtract the square of the mean.

Mean of a Probability Distribution, �

� = E(X)X)X = ak i = 1

xi p(xi) (4.6)

Variance of a Probability Distribution, σ2

σ2 = VaVaV r(X)X)X = ak i

[xi − E(X)X)X ] 2 p(xi) (4.7)

Standard Deviation of a Probability Distribution, σ σ = Stdev(X)X)X = !V!V! ar(X)X)X! (4.8)

Variance (computing formula)

σ2 = ak i = 1

xi 2 p(xi) − �

2 (4.9)

We now consider a typical example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

152 Chapter 4 Probability and Probability Distributions

E X A M P L E 4.2 MARKET RETURN SCENARIOS FOR THE NATIONAL ECONOMY

An investor is concerned with the market return for the coming year, where the market return is defined as the percentage gain (or loss, if negative) over the year. The inves- tor believes there are five possible scenarios for the national economy in the coming year: rapid expansion, moderate expansion, no growth, moderate contraction, and serious con- traction. Furthermore, she has used all of the information available to her to estimate that the market returns for these scenarios are, respectively, 23%, 18%, 15%, 9%, and 3%. That is, the possible returns vary from a high of 23% to a low of 3%. Also, she has assessed that the probabilities of these outcomes are 0.12, 0.40, 0.25, 0.15, and 0.08. Use this informa- tion to describe the probability distribution of the market return.

Objective To compute the mean, variance, and standard deviation of the probability dis- tribution of the market return for the coming year.

Solution To make the connection between the general notation and this particular example, let X denote the market return for the coming year. Then each possible economic scenario leads to a possible value of X. For example, the first possible value is x1 = 23%, and its prob- ability is p(x1) = 0.12. These values and probabilities appear in columns B and C of Figure 4.3. (See the file Market Return.xlsx.) Note that the five probabilities sum to 1, as they should. This probability distribution implies, for example, that the probability of a market return at least as large as 18% is 0.12 + 0.40 = 0.52 because it could occur as a result of rapid or moderate expansion of the economy. Similarly, the probability that the market return is 9% or less is 0.15 + 0.08 = 0.23 because this could occur as a result of moderate or serious contraction of the economy.

In reality, there is a continuum of possible returns. The assumption of only five possible returns is clearly an approximation to reality, but such an assumption is often useful.

The summary measures of this probability distribution appear in the range B11:B13. They can be calculated with the following steps. (Note that the formulas make use of the range names listed in the figure.)

Procedure for Calculating Summary Measures

1. Mean return. Calculate the mean return in cell B11 with the formula

=SUMPRODUCT(Market_return,Probability)

Figure 4.3 Probability Distribution of Market Returns

1 2 3 4 5 6 7 8 9

10 11 12 13

A BA B C DC D E FE F G Mean, variance, and standard deviation of the market return Range names used

Market_return =$C$4:$C$8 Economic outcome Probability Market return Sq dev from mean Mean =$B$11 Rapid Expansion 0.005929 Probability =$B$4:$B$8 Moderate Expansion 0.000729

0.000009 Sq_dev_from_mean =$D$4:$D$8

No Growth Stdev Moderate Contraction 0.003969 Variance =$B$12

=$B$13

Serious Contrac�on

Summary measures of return Mean Variance 0.002811

15.3%

5.3% 0.002811 Quick alterna�ve formula

5.3%Stdev

e P

0.015129

0.12 0.23 0.40 0.18

0.150.25 0.15 0.09

0.030.08

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-3 Probability Distribution of a Single Random Variable 153

Excel Tip: Excel’s SUMPRODUCT Function Excel’s SUMPRODUCT function is a gem, and you should use it whenever possible. It takes (at least) two arguments, which must be ranges of exactly the same size and shape. It sums the products of the values in these ranges. For example, =SUMPRODUCT (A(A( 1:A3,B1:B3) is equivalent to the formula =A=A= 1*B1 + A2*B2 + A3*B3. If the ranges contain only a few cells, there isn’t much advantage to using SUMPRODUCT, but when the ranges are large, such as A1:A100 and B1:B100, SUMPRODUCT is the only viable 0, SUMPRODUCT is the only viable 0 choice.

This formula illustrates the general rule in Equation (4.6): The mean is the sum of products of possible values and probabilities.

2. Squared deviations. To get ready to compute the variance from Equation (4.7), calculate the squared deviations from the mean by entering the formula

=(C4-Mean)^2

in cell D4 and copying it down through cell D8.

3. Variance. Calculate the variance of the market return in cell B12 with the formula

=SUMPRODUCT(Sq_dev_from_mean,Probability)

This illustrates the general formula for variance in Equation (4.7). The variance is always a sum of products of squared deviations from the mean and probabilities. Alternatively, you can skip the calculation of the squared deviations from the mean and use Equation (4.9) directly. This is done in cell C12 with the formula

=SUMPRODUCT(Market_return,Market_return,Probability)-Mean^2

By entering the Market_return range twice in this SUMPRODUCT formula, you get the squares. From now on, we will use this simplified formula for variance and dis- pense with squared deviations from the mean. But regardless of how it is calculated, you should remember the essence of variance: It is a weighted average of squared deviations from the mean.

4. Standard deviation. Calculate the standard deviation of the market return in cell B13 with the formula

=SQRT(Variance)

You can see that the mean return is 15.3% and the standard deviation is 5.3%. What do these measures really mean? First, the mean, or expected, return does not imply that the most likely return is 15.3%, nor is this the value that the investor “expects” to occur. In fact, the value 15.3% is not even a possible market return (at least not according to the model). You can understand these measures better in terms of long-run averages. Specifically, if you could imagine the coming year being repeated many times, each time using the prob- ability distribution in columns B and C to generate a market return, then the average of these market returns would be close to 15.3%, and their standard deviation—calculated as in Chapter 2—would be close to 5.3%.

Before leaving this section, we emphasize a key point, a point that is easy to forget with all the details. The whole point of discussing probability and probability distributions, especially in the context of business problems, is that uncertainty is often a key factor, and you cannot simply ignore it. For instance, the mean return in this example is 15.3%. However, it would be far from realistic to treat the actual return as a sure 15.3%, with no uncertainty. If you did this, you would be ignoring the uncertainty completely, and it is often the uncertainty that makes business problems interesting—and adds risk. Therefore, to model such problems in a realistic way, you must deal with probability and probability distributions. ■

As always, range names are not required, but they make the Excel formulas easier to read. You can use them or omit them, as you wish.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

154 Chapter 4 Probability and Probability Distributions

4-3b Conditional Mean and Variance

There are many situations where the mean and variance of a random variable depend on some external event. In this case, you can condition on the outcome of the external event to �nd the overall mean and variance (or standard deviation) of the random variable.

It is best to motivate this with an example. Consider the random variable X, represent- ing the percentage change in the price of stock A from now to a year from now. This change is driven partly by circumstances speci�c to company A, but it is also driven partly by the economy as a whole. In this case, the outcome of the economy is the external event. Let’s assume that the economy in the coming year will be awful, stable, or great with probabili- ties 0.20, 0.50, and 0.30, respectively. In addition, we make the following assumptions.

■ Given that the economy is awful, the mean and standard deviation of X are X are X −20% and 30%.

■ Given that the economy is stable, the mean and standard deviation of X are X are X 5% and 20%.

■ Given that the economy is great, the mean and standard deviation of X are 25% and 15%.

Each of these statements is a statement about X, conditional upon the economy. What can we say about the unconditional mean and standard deviation of unconditional mean and standard deviation of unconditional X? That is, what are the mean and standard deviation of X before we learn the state of the economy? The answers come from Equations (4.10) and (4.11). In the context of the example, pi is the probabil- ity of economy state i, and Ei(X)X)X and Vari(X)X)X are the mean and variance of X, given that economy state i occurs.

Conditional Mean Formula

E(X)X)X = ak i = 1

Ei(X)X)X pi (4.10)

Conditional Variance Formula

VaVaV r (X)X)X = ak i = 1 5VaVaV ri(X)X)X + [Ei(X)X)X ]26p6p6 i − [E (X)X)X ]2 (4.11)

In the example, the mean percentage change in the price of stock A, from Equation (4.10), is

E(X)X)X = 0.2(−20%) + 0.5(5%) + 0.3(25%) = 6%

To calculate the standard deviation of X, �rst use Equation (4.11) to calculate the variance, and then take its square root. The variance is

VaVaV r(X)X)X = 50.2[(30%)2 + (−20%)2] + 0.5[(20%)2 + (5%)2] + 0.3[(15%)2 + (25%)2]6 − (6%)2 = 0.06915

Taking the square root gives

Stdev(X)X)X = !0!0! .06915! = 26.30% Of course, these calculations can be done easily in Excel. See the �le Stock Price and Economy.xlsx for details.

The point of this example is that it is often easier to assess the uncertainty of some random variable X by conditioning on every possible outcome of some external event like the economy. However, before that outcome is known, the relevant mean and standard

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-3 Probability Distribution of a Single Random Variable 155

deviation of X are those calculated from Equations (4.10) and (4.11). In this particular example, before you know the state of the economy, the relevant mean and standard devia- tion of the change in the price of stock A are 6% and 26.3%, respectively.

P R O B L E M S

Level A 10. A fair coin (i.e., heads and tails are equally likely)

is tossed three times. Let X be the number of heads observed in three tosses of this fair coin. a. Find the probability distribution of X. b. Find the probability that two or fewer heads are

observed in three tosses. c. Find the probability that at least one head is

observed in three tosses. d. Find the expected value of X. e. Find the standard deviation of X.

11. Consider a random variable with the following prob- ability distribution: P(X = 0) = 0.1, P(X = 1) = 0.2, P(X = 2) = 0.3, P(X = 3) = 0.3, and P(X = 4) = 0.1. a. Find P(X ≤ 2). b. Find P(1 < X ≤ 3). c. Find P(X > 0). d. Find P(X > 3|X > 2). e. Find the expected value of X. f. Find the standard deviation of X.

12. A study has shown that the probability distribution of X, the number of customers in line (including the one being served, if any) at a checkout counter in a department store, is given by P(X = 0) = 0.25, P(X = 1) = 0.25, P(X = 2) = 0.20, P(X = 3) = 0.20, and P( ≥ 4) = 0.10. Consider a newly arriving customer to the checkout line. a. What is the probability that this customer will not

have to wait behind anyone? b. What is the probability that this customer will have

to wait behind at least one customer? c. On average, the newly arriving customer will have

to wait behind how many other customers?

13. A construction company has to complete a project no later than three months from now or there will be significant cost overruns. The manager of the construction company believes that there are four possible values for the random variable X, the number of months from now it will take to complete this project: 2, 2.5, 3, and 3.5. The manager currently thinks that the probabilities of these four possibilities are in the ratio 1 to 2 to 4 to 2. That is, X = 2.5 is twice as likely as X = 2, X = 3 is twice as likely as X = 2.5, and X = 3.5 is half as likely as X = 3. a. Find the probability distribution of X. b. What is the probability that this project will be

completed in less than three months from now?

c. What is the probability that this project will not be not be not completed on time?

d. What is the expected completion time (in months) of this project from now?

e. How much variability (in months) exists around the expected value you found in part d?

14. Three areas of southern California are prime can- didates for forest fires each dry season. You believe (based on historical evidence) that each of these areas, independently of the others, has a 30% chance of having a major forest fire in the next dry season. a. Find the probability distribution of X, the number

of the three regions that have major forest fires in the next dry season.

b. What is the probability that none of the areas will have a major forest fire?

c. What is the probability that all of them will have a major forest fire?

d. What is expected number of regions with major forest fires?

e. Each major forest fire is expected to cause $20 million in damage and other expenses. What is the expected amount of damage and other expenses in these three regions in the next dry season?

Level B 15. The National Football League playoffs are just about

to begin. Because of their great record in the regular season, the Steelers get a bye in the first week of the playoffs. In the second week, they will play the winner of the game between the Ravens and the Patriots. A football expert estimates that the Ravens will beat the Patriots with probability 0.45. This same expert estimates that if the Steelers play the Ravens, the mean and standard deviation of the point spread (Steelers points minus Ravens points) will be 6.5 and 10.5, whereas if the Steelers play the Patriots, the mean and standard deviation of the point spread (Steelers points minus Patriots points) will be 3.5 and 12.5. Find the mean and standard deviation of the point spread (Steelers points minus their opponent’s points) in the Steelers game.

16. Because of tough economic times, the Indiana legislature is debating a bill that could have significant negative implications for public school funding. There are three possibilities for this bill: (1) it could be passed in essentially its current version; (2) it could be

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

156 Chapter 4 Probability and Probability Distributions

4-4 INTRODUCTION TO SIMULATION In the previous section, we asked you to imagine many repetitions of an event, with each repetition resulting in a different random outcome. Fortunately, you can do more than imagine; you can make it happen with computer simulation. Simulation is an extremely useful tool that can be used to incorporate uncertainty explicitly into spreadsheet models. A simulation model is the same as a regular spreadsheet model except that some cells con- tain random quantities. Each time the spreadsheet recalculates, new values of the random quantities are generated, and these typically lead to different bottom-line results. By forc- ing the spreadsheet to recalculate many times, a business manager is able to discover the results that are most likely to occur, those that are least likely to occur, and best-case and worst-case results. We use simulation several places in this book to help explain concepts in probability and statistics. We begin in this section by using simulation to explain the connection between summary measures of probability distributions and the corresponding summary measures from Chapter 2.

We continue to use the market return distribution in Figure 4.3. Because this is your �rst discussion of computer simulation in Excel, we proceed in some detail. Our goal is to simulate many returns (we arbitrarily choose 400) from this distribution and analyze the resulting returns. We want each simulated return to have probability 0.12 of being 23%, probability 0.40 of being 18%, and so on. Then, using the methods for summarizing data from Chapter 2, we calculate the average and standard deviation of the 400 simulated returns.

The method for simulating many market returns is straightforward once you know how to simulate a single market return. The key to this is Excel’s RAND function, which generates a random number between 0 and 1. The RAND function has no arguments, so every time you use it, you must enter =RAND(). (Although there is nothing inside the parentheses next to RAND, the parentheses cannot be omitted.) That is, to generate a ran- dom number between 0 and 1 in any cell, you enter the formula

=RAND() in that cell. The RAND function can also be used as part of another function. For example, you can simulate the result of a single �ip of a fair coin with the formula

=IF(RAND()<=0.5,"Heads","Tails") Random numbers generated with Excel’s RAND function are said to be uniformly

distributed between 0 and 1 because all decimal values between 0 and 1 are equally likely. These uniformly distributed random numbers can then be used to generate numbers from

passed but with amendments that make it less harsh on public school funding; or (3) it could be defeated. The probabilities of these three events are estimated to be 0.4, 0.25, and 0.35, respectively. The estimated effect on percentage changes in salaries next year at Indiana University are estimated as follows. If the bill is passed in its current version, the mean and standard deviation of salary percentage change will be 0% and 1%. If the bill is passed with amendments, the mean and standard deviation will be 1.5% and 3.5%. Finally, if the bill is defeated, the mean and standard deviation will be 3.5% and 6%. Find the mean and standard deviation of the percentage change in salaries next year at Indiana University.

17. The “house edge” in any game of chance is defined as

E(player’s loss on a bet)

Size of player’s loss on a bet

For example, if a player wins $10 with probability 0.48 and loses $10 with probability 0.52 on any bet, the house edge is

− [10(0.48) − 10(0.52)] 10

= 0.04

Give an interpretation to the house edge that relates to how much money the house is likely to win on average. Which do you think has a larger house edge: roulette or sports gambling? Why?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-4 Introduction to Simulation 157

any discrete distribution such as the market return distribution in Figure 4.3. To see how this is done, note �rst that there are �ve possible values in this distribution. Therefore, we divide the interval from 0 to 1 into �ve parts with lengths equal to the probabilities in the probability distribution. Then we see which of these parts the random number from RAND falls into and generate the associated market return. If the random number is between 0 and 0.12 (of length 0.12), we generate 23% as the market return; if the random number is between 0.12 and 0.52 (of length 0.40), we generate 18% as the market return; and so on. See Figure 4.4.

Figure 4.4 Associating RAND Values with Market Returns

This procedure is accomplished most easily in Excel through the use of a lookup table. A lookup table is useful when you want to compare a particular value to a set of values and, depending on where the particular value falls, assign the appropriate value from an associated list of values. In this case we want to compare a generated random number to values falling in each of the �ve intervals shown in Figure 4.4, and then report the cor- responding market return. This process is made relatively simple in Excel by applying the VLOOKUP function, as explained in the following steps.2 responding market return. This process is made relatively simple in Excel by applying the

2 responding market return. This process is made relatively simple in Excel by applying the

(Refer to Figure 4.5 and the Market Return.xlsx �le.)

2This could also be accomplished with nested IF functions, but the resulting formula would be much more complex.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

411 410

412

A BA B C DC D E FE F G Simulating market returns Range names used

LTable =$D$13:$E$17 =$B$13:$B$412Summary statistics from simulation below Simulated_market_return

Average return 0.154

0.153 0.053

0.052Stdev of returns

Stdev of returns

Exact values from previous sheet (for comparison)

Simulation

Average return

Lookup table Random # Simulated market return Cum Prob Return

0.23 0.18 0.15 0.09 0.03

0 0.12 0.52 0.77 0.92

0.18 0.18 0.18 0.18 0.18 0.18 0.15 0.18 0.03 0.15 0.15 0.15 0.15 0.15 0.09 0.15

0.208947 0.367329 0.487685 0.468929 0.448699 0.438947 0.693997 0.195948 0.997045 0.629185 0.746429 0.550897 0.568344 0.591658 0.785440 0.761271

20 21 22 23 24 25

Figure 4.5 Simulation of Market Returns

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

158 Chapter 4 Probability and Probability Distributions

Procedure for Generating Random Market Returns in Excel

1. Lookup table. Copy the possible returns to the range E13:E17. Then enter the cumu- lative probabilities next to them in the range D13:D17. To do this, enter the value 0 in cell D13. Then enter the formula

=D13+Market!B4 in cell D14 and copy it down through cell D17. (Note that the Market!B4 in this formula refers to cell B4 in the Market sheet, that is, cell B4 in Figure 4.3.) Each value in column D is the current probability plus the previous value. The table in this range, D13:E17, becomes the lookup range. For convenience, we have named this range LTable.

2. Random numbers. Enter random numbers in the range A13:A412. An easy way to do this is to select the range, then type the formula

=RAND() and finally press Ctrl+Enter. Note that these random numbers are “live.” That is, each time you do any calculation in Excel or press the recalculation F9 key, these random numbers change.

Excel Tip: Copying a Formula with Ctrl+Enter A quick way to enter a formula (or value) into a range of cells is to select the range, type the formula (or value), and press Ctrl+Enter (both keys at once). This is equivalent to entering the formula in the �rst cell of the range and then copying it to the rest of the range.

3. Market returns. Generate the random market returns by referring the random num- bers in column A to the lookup table. Specifically, enter the formula

=VLOOKUP(A13,LTable,2) in cell B13 and copy it down through cell B412. This formula compares the random number in cell A13 to the cumulative probabilities in the first column of the lookup table and sees where it “fits,” as illustrated in Figure 4.4. Then it returns the corre- sponding market return in the second column of the lookup table. (It uses the second column because the third argument of the VLOOKUP function is 2.)

Excel Tip: Excel’s VLOOKUP Function In general, the VLOOKUP function takes four arguments: (1) the value to be compared, (2) a table of lookup values, with the values to be compared against always in the left- most column, (3) the column number of the lookup table that contains the “answer,” and (4) whether you are looking for an approximate match or an exact match for the lookup value. When you are looking for an approximate match, as in this example, the fourth argument can be omitted.

4. Summary statistics. Summarize the 400 market returns by entering the formulas =AVERAGE(Simulated_market_return) and

=STDEV.S(Simulated_market_return) in cells B4 and B5. For comparison, copy the average and standard deviation from the Market sheet in Figure 4.3 to cells B8 and B9.

Now let’s step back and see what has been accomplished. The following points are relevant.

■ Simulations like this are very common, and we will continue to use them to illustrate concepts in probability and statistics.

■ The numbers you obtain will be different from the ones in Figure 4.5 because of the nature of simulation. The results depend on the particular random numbers that hap- pen to be generated.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-4 Introduction to Simulation 159

■ The way we entered cumulative probabilities and then used a lookup table is generally the best way to generate random numbers from a discrete probability distribution. However, there is an easier way if the @RISK simulation add-in is avail- able, as will be discussed in Chapter 15.

■ Each generated market return in the Simulated_market_return range is one of the �ve possible market returns. If you count the number of times each return appears and then divide by 400, the number of simulated values, you will see that the resulting fractions are approximately equal to the original probabilities. For example, the fraction of times the highest return 23% appears is about 0.12. This is the essence of what it means to simulate from a given probability distribution.

■ The average and standard deviation in cells B4 and B5, calculated from the formulas in Chapter 2, are very close to the mean and standard deviation of the probability distribution in cells B8 and B9. However, these measures are calculated in entirely different ways. Speci�cally, the average in cell B4 is a simple average of 400 numbers, whereas the mean in cell B8 is a weighted sum of the possible market returns, weighted by their probabilities.

This last point allows you to interpret the summary measures of a probability distribution. Speci�cally, the mean and standard deviation of a probability distribution are approxi- mately what you would obtain if you calculated the average and standard deviation, using the formulas from Chapter 2, of many simulated values from this distribution. In other simulated values from this distribution. In other simulated words, the mean is the long-run average of the simulated values. Similarly, the standard deviation measures their variability.

You might ask whether this long-run average interpretation of the mean is relevant if the situation is going to occur only once. For example, the market return in the example is for “the coming year,” and the coming year will occur only once. So what is the use of a long-run average? In this type of situation, the long-run average interpretation is not very relevant, but fortunately, there is another use of the expected value that we exploit in Chapter 6. Speci�cally, when a decision maker must choose among several actions that have uncertain outcomes, the preferred decision is often the one with the largest expected (monetary) value. This makes the expected value of a probability distribution extremely important in decision-making contexts.

Role of Simulation Spreadsheet simulation is one of the most important tools in an analyst’s arsenal. For this reason, it will be discussed in much more depth in later chapters, partic- ularly Chapters 15 and 16. Simulation doesn’t show you what will occur; instead, it shows you many of the poswill occur; instead, it shows you many of the poswill - sible scenarios that might occur. By seeing a variety of might occur. By seeing a variety of might scenarios, including those that are “typical” and those that are “extreme,” you understand the situation much better and can make more informed decisions relative to reward and risk.

F u n da m e n ta l I n s i g h t

P R O B L E M S

Level A 18. A quality inspector picks a sample of 15 items at ran-

dom from a manufacturing process known to produce 10% defective items. Let X be the number of defec- tive items found in the random sample of 15 items. Assume that the condition of each item is independent of that of each of the other items in the sample. The

probability distribution of X is provided in the file P04_18.xlsx. a. Use simulation to generate 500 values of this

random variable X. b. Calculate the mean and standard deviation of

the simulated values. How do they compare to the mean and standard deviation of the given probability distribution?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

160 Chapter 4 Probability and Probability Distributions

4-5 CONCLUSION This chapter has introduced some very important concepts, including the basic rules of probability, random variables, probability distributions, and summary measures of prob- ability distributions. We have also shown how computer simulation can be used to help explain some of these concepts. Many of the concepts presented in this chapter are used in later chapters, so it is important to learn them now. In particular, we rely heavily on probability distributions in Chapter 6 when we discuss decision making under uncertainty. There you will learn how the expected value of a probability distribution is the primary criterion for making decisions. We will also continue to use computer simulation in later chapters to help explain statistical concepts.

19. A personnel manager of a large manufacturing plant is investigating the number of reported on-the-job accidents at the facility over the past several years. Let X be the number of such accidents reported during a one-month period. Based on past records, the manager has established the probability distribution for X as X as X shown in the file P04_19.xlsx. a. Use simulation to generate 1000 values of this

random variable X. b. Is the simulated distribution indicative of the given

probability distribution? Explain why or why not.

20. Let X be the number of heads when a fair coin is X be the number of heads when a fair coin is X flipped four times. a. Find the distribution of X and then use simulation X and then use simulation X

to generate 1000 values of X. b. Is the simulated distribution indicative of the given

probability distribution? Explain why or why not. c. Calculate the mean and standard deviation of

the simulated values. How do they compare to the mean and standard deviation of the given probability distribution?

21. The probability distribution of X, the number of cus- tomers in line (including the one being served, if any) at a checkout counter in a department store, is given by P(X = 0) = 0.25, P(X = 1) = 0.25, P(X = 2) = 0.20, P(X = 3) = 0.20, and P(X = 4) = 0.10.

a. Use simulation to generate 500 values of this random variable X.

b. Is the simulated distribution indicative of the given probability distribution? Explain why or why not.

c. Calculate the mean and standard deviation of the simulated values. How do they compare to the mean and standard deviation of the given probability distribution?

d. Repeat parts a through c with 5000 simulated values rather than 500. Explain any differences you observe.

Level B 22. Suppose Michigan is favored by 17.5 points over

Indiana. If you bet a “unit” on Indiana and Indiana loses by 17 or less, you win $10. If Indiana loses by 18 or more points, you lose $11. Find the mean and standard deviation of your winnings on a single bet. Assume that there is a 0.5 probability that you will win your bet and a 0.5 probability that you will lose your bet. Also simulate 1600 “bets” to estimate the average loss per bet. (Note: Do not be too disappointed if you are off by up to 50 cents. It takes many, say 10,000, simulated bets to get a really good estimate of the mean loss per bet. This is because there is a lot of variability on each bet.)

Term Explanation Excel Page Equation

Random variable Associates a numerical value with each possible outcome in a situation involving uncertainty

140

Probability A number between 0 and 1 that measures the likelihood that some event will occur

142

Rule of complements The probability of any event and the probability of its complement sum to 1

Basic formulas

142 4.1

Mutually exclusive events

Events where only one of them can occur 142

Exhaustive events Events where at least one of them must occur 143

Summary of Key Terms

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

4-5 Conclusion 161

Term Explanation Excel Page Equation

Addition rule for mutually exclusive events

The probability that at least one of a set of mutually exclusive events will occur is the sum of their probabilities

Basic formulas

143 4.2

Conditional probability formula

Updates the probability of an event, given the knowledge that another event has occurred

Basic formulas

144 4.3

Multiplication rule Formula for the probability that two events both occur

Basic formulas

144 4.4

Probability tree A graphical representation of how events occur through time, useful for calculating probabilities of multiple events

145

Probabilistically independent events

Events where knowledge that one of them has occurred is of no value in assessing the probability that the other will occur

146 4.5

Relative frequency The proportion of times the event occurs out of the number of times a random experiment is performed

147

Cumulative probability “Less than or equal to” probabilities associated with a random variable

150

Mean (or expected value) of a probability distribution

A measure of central tendency—the weighted sum of the possible values, weighted by their probabilities

Basic formulas

151 4.6

Variance of a probability distribution

A measure of variability: the weighted sum of the squared deviations of the possible values from the mean, weighted by the probabilities

Basic formulas

151 4.7, 4.9

Standard deviation of a probability distribution

A measure of variability: the square root of the variance

Basic formulas

151 4.8

Simulation An extremely useful tool that can be used to incorporate uncertainty explicitly into spreadsheet models

156

Uniformly distributed random numbers

Random numbers such that all decimal values between 0 and 1 are equally likely

=RAND() 156

P R O B L E M S

Conceptual Questions C.1. Suppose that you want to find the probability that

event A or event B will occur. If these two events are not mutually exclusive, explain how you would not mutually exclusive, explain how you would not proceed.

C.2. “If two events are mutually exclusive, they must not be independent events.” Is this statement true or not be independent events.” Is this statement true or not false? Explain your choice.

C.3. Is the number of passengers who show up for a particular commercial airline flight a discrete or a continuous random variable? Is the time between flight arrivals at a major airport a discrete or a continuous random variable? Explain your answers.

C.4. Suppose that officials in the federal government are trying to determine the likelihood of a major small- pox epidemic in the United States within the next 12

months. Is this an example of an objective probability or a subjective probability? How might the officials assess this probability?

C.5. Consider the statement, “When there are a finite number of outcomes, then all probability is just a matter of counting. Specifically, if n of the outcomes are favorable to some event E, and there are N out- comes total, then the probability of E is n/N/N/ .” Is this statement always true? Is it always false?

C.6. If there is uncertainty about some monetary outcome and you are concerned about return and risk, then all you need to see are the mean and standard devia- tion. The entire distribution provides no extra useful information. Do you agree or disagree? Provide an example to back up your argument.

C.7. Choose at least one uncertain quantity of interest to you. For example, you might choose the highest price

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

162 Chapter 4 Probability and Probability Distributions

of gas between now and the end of the year, the high- est point the Dow Jones Industrial Average will reach between now and the end of the year, the number of majors Tiger Woods will win in his career, and so on. Using all of the information and insight you have, assess the probability distribution of this uncertain quantity. Is there one “right answer?”

C.8. Historically, the most popular measure of variability has been the standard deviation, the square root of the weighted sum of squared deviations from the squared deviations from the squared mean, weighted by their probabilities. Suppose analysts had always used an alternative measure of variability, the weighted sum of the absolute deviations from the mean, again weighted by their probabilities. Do you think this would have made a big difference in the theory and practice of probability and statistics?

C.9. Suppose a person flips a coin, but before you can see the result, the person puts her hand over the coin. At this point, does it make sense to talk about the probability that the result is heads? Is this any different from the probability of heads before the coin was flipped?

C.10. Consider an event that will either occur or not. For example, the event might be that California will experience a major earthquake in the next five years. You let p be the probability that the event will occur. Does it make any sense to have a probability distribu- tion of p? Why or why not? If so, what might this distribution look like? How would you interpret it?

C.11. Suppose a couple is planning to have two children. Let B1 be the event that the first child is a boy, and let B2 be the event that the second child is a boy. You and your friend get into an argument about whether B1 and B2 are independent events. You think they independent events. You think they independent are independent and your friend thinks they aren’t. Which of you is correct? How could you settle the argument?

Level A 23. A business manager who needs to make many phone

calls has estimated that when she calls a client, the probability that she will reach the client right away is 60%. If she does not reach the client on the first call, the probability that she will reach the client with a subsequent call in the next hour is 20%. a. Find the probability that the manager reaches her

client in two or fewer calls. b. Find the probability that the manager reaches her

client on the second call but not on the first call. c. Find the probability that the manager is

unsuccessful on two consecutive calls.

24. Suppose that a marketing research firm sends questionnaires to two different companies. Based on historical evidence, the marketing research firm

believes that each company, independently of the other, will return the questionnaire with probability 0.40. a. What is the probability that both questionnaires are

returned? b. What is the probability that neither of the neither of the neither

questionnaires is returned? c. Now, suppose that this marketing research firm

sends questionnaires to ten different companies. Assuming that each company, independently of the others, returns its completed questionnaire with probability 0.40, how do your answers to parts a and b change?

25. Based on past sales experience, an appliance store stocks five window air conditioner units for the coming week. No orders for additional air conditioners will be made until next week. The weekly consumer demand for this type of appliance has the probability distribution given in the file P04_25.xlsx. a. Let X be the number of window air conditioner units X be the number of window air conditioner units X

left at the end of the week (if any), and let Y be the Y be the Y number of special stockout orders required (if any), assuming that a special stockout order is required each time there is a demand and no unit is available in stock. Find the probability distributions of X and X and X Y.

b. Find the expected value of X and the expected value of Y.

c. Assume that this appliance store makes a $60 profit on each air conditioner sold from the weekly available stock, but the store loses $20 for each unit sold on a special stockout order basis. Let Z be Z be Z the profit that the store earns in the coming week from the sale of window air conditioners. Find the probability distribution of Z.

d. Find the expected value of Z.

26. Simulate 1000 weekly consumer demands for window air conditioner units with the probability distribution given in the file P04_25.xlsx. How does your simulated distribution compare to the given probability distribution? Explain any differences between these two distributions.

27. The probability distribution of the weekly demand for copier paper (in hundreds of reams) used in the duplicating center of a corporation is provided in the file P04_27.xlsx. a. Find the mean and standard deviation of this

distribution. b. Find the probability that weekly copier paper demand

is at least one standard deviation above the mean. c. Find the probability that weekly copier paper

demand is within one standard deviation of the mean.

28. Consider the probability distribution of the weekly demand for copier paper (in hundreds of reams) used in a corporation’s duplicating center, as shown in the file P04_27.xlsx.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

a. Use simulation to generate 500 values of this random variable.

b. Find the mean and standard deviation of the simulated values.

c. Use your simulated values to estimate the probability that weekly copier paper demand is within one standard deviation of the mean. Why is this only an estimate, not an exact value?

29. The probability distribution of the weekly demand for copier paper (in hundreds of reams) used in the dupli- cating center of a corporation is provided in the file P04_27.xlsx. Assuming that it costs the duplicating center $5 to purchase a ream of paper, find the mean and standard deviation of the weekly copier paper cost for this corporation.

30. A roulette wheel contains the numbers 0, 00, and 1 to 36. If you bet $1 on a single number coming up, you earn $35 if the number comes up and lose $1 otherwise. Find the mean and standard deviation of your winnings on a single bet. Then find the mean and standard deviation of your net winnings if you make 100 bets. You can assume (realistically) that the results of the 100 spins are independent. Finally, provide an interval such that you are 95% sure your net winnings from 100 bets will be inside this interval.

31. You are involved in a risky business venture where three outcomes are possible: (1) you will lose not only your initial investment ($5000) but an additional $3000; (2) you will just make back your initial investment (for a net gain of $0); or (3) you will make back your initial investment plus an extra $10,000. The probability of (1) is half as large as the probability of (2), and the probability of (3) is one-third as large as the probability of (2). a. Find the individual probabilities of (1), (2), and (3).

(They should sum to 1.) b. Find the expected value and standard deviation of

your net gain (or loss) from this venture.

Level B 32. Equation (4.7) for variance indicates exactly what

variance is: the weighted average of squared devia- tions from the mean, weighted by the probabilities. However, the computing formula for variance, Equation (4.9), is more convenient for spreadsheet calculations. Show algebraically that the two formulas are equivalent.

33. The basic game of craps works as follows. You throw two dice. If the sum of the two faces showing up is 7 or 11, you win and the game is over. If the sum is 2, 3, or 12, you lose and the game is over. If the sum is anything else (4, 5, 6, 8, 9, or 10), that value becomes your “point.” You then keep throwing the dice until the sum matches your point or equals 7. If your point occurs first, you win and the game is over. If 7 occurs

first, you lose and the game is over. What is the prob- ability that you win the game?

34. Consider an individual selected at random from a sample of 750 married women (see the data in the file P04_05.xlsx) in answering each of the following questions. a. What is the probability that this woman does not

work outside the home, given that she has at least one child?

b. What is the probability that this woman has no children, given that she works part time?

c. What is the probability that this woman has at least two children, given that she does not work full time?

35. Suppose that 8% of all managers in a given company are African American, 13% are women, and 17% have earned an MBA degree from a top-10 graduate business school. Let A, B, and C be, respectively, the events that C be, respectively, the events that C a randomly selected individual from this population is African American, is a woman, and has earned an MBA from a top-10 graduate business school. a. Do you believe that A, B, and C are independent

events? Explain why or why not. b. Assuming that A, B, and C are independent events,

find the probability that a randomly selected manager from this company is a white male and has earned an MBA degree from a top-10 graduate business school.

c. If A, B, and C are not independent events, can you not independent events, can you not calculate the probability requested in part b from the information given? What further information would you need?

36. Two gamblers play a version of roulette with a wheel as shown in the file P04_36.xlsx. Each gambler places four bets, but their strategies are different, as explained below. For each gambler, use the rules of probability to find the distribution of their net winnings after four bets. Then find the mean and standard deviation of their net winnings. The file gets you started. a. Player 1 always bets on red. On each bet, he either

wins or loses what he bets. His first bet is for $10. From then on, he bets $10 following a win, and he doubles his bet after a loss. (This is called a martin- gale strategy and is used frequently at casinos.) For example, if he spins red, red, not red, and not red, his bets are for $10, $10, $10, and $20, and he has a net loss of $10. Or if he spins not red, not red, not red, and red, then his bets are for $10, $20, $40, and $80, and he has a net gain of $10.

b. Player 2 always bets on black and green. On each bet, he places $10 on black and $2 on green. If red occurs, he loses all $12. If black occurs, he wins a net $8 ($10 gain on black, $2 loss on green). If green occurs, he wins a net $50 ($10 loss on black, $60 gain on green).

4-5 Conclusion 163 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

164 Chapter 4 Probability and Probability Distributions

37. Suppose the New York Yankees and Philadelphia Phillies (two Major League Baseball teams) are play- ing a best-of-three series. The first team to win two games is the winner of the series, and the series ends as soon as one team has won two games. The first game is played in New York, the second game is in Philadelphia, and if necessary the third game is in New York. The probability that the Yankees win a game in their home park is 0.55. The probability that the Phillies win a game in their home park is 0.53. You can assume that the outcomes of the games are proba- bilistically independent. a. Find the probability that the Yankees win the series. b. Suppose you are a Yankees fan, so you place a

bet on each game played where you win $100 if the Yankees win the game and you lose $105 if the Yankees lose the game. Find the distribution of your net winnings. Then find the mean and standard deviation of this distribution. Is this betting strategy favorable to you?

c. Repeat part a, but assume that the games are played in Philadelphia, then New York, then Philadelphia. How much does this “home field advantage” help the Phillies?

d. Repeat part a, but now assume that the series is a best-of-five series, where the first team that wins three games wins the series. Assume that games alternate between New York and Philadelphia, with the first game in New York.

38. The application at the beginning of this chapter describes the campaign McDonald’s used several years ago, where customers could win various prizes. a. Verify the figures that are given in the description.

That is, argue why there are 10 winning outcomes and 120 total outcomes.

b. Suppose McDonald’s had designed the cards so that each card had two zaps and three pictures of the winning prize (and again five pictures of other irrelevant prizes). The rules are the same as before: To win, the customer must uncover all three pictures of the winning prize before uncovering a zap. Would there be more or fewer winners with this design? Argue by calculating the probability that a card is a winner.

c. Going back to the original game (as in part a), suppose McDonald’s printed one million cards, each of which was eventually given to a customer. Assume that the (potential) winning prizes on these were: 500,000 Cokes worth $0.40 each, 250,000 french fries worth $0.50 each, 150,000 milk shakes worth $0.75 each, 75,000

hamburgers worth $1.50 each, 20,000 cards with $1 cash as the winning prize, 4000 cards with $10 cash as the winning prize, 800 cards with $100 cash as the winning prize, and 200 cards with $1000 cash as the winning prize. Find the expected amount (the dollar equivalent) that McDonald’s gave away in winning prizes, assuming everyone played the game and claimed the prize if they won. Also find the standard deviation of this amount.

39. A manufacturing company is trying to decide whether to sign a contract with the government to deliver an instrument to the government no later than eight weeks from now. Due to various uncertainties, the company isn’t sure when it will be able to deliver the instrument. Also, when the instrument is delivered, there is a chance that the government will judge it as being of inferior quality. The company estimates that the probability distribution of the time it takes to deliver the instrument is as given in the file P04_39.xlsx. Independently of this, it estimates that the probability of rejection due to inferior quality is 0.15. If the instrument is delivered at least a week ahead of time and the government judges the quality to be inferior, the company will have time to fix the problem (with certainty) and still meet the dead- line. However, if the delivery is late, or if it is exactly on time but of inferior quality, the government won’t pay up. The company expects its cost of manufacturing the instrument to be $45,000. This is a sunk cost that will be incurred regardless of timing or the quality of the instrument. The company also estimates that the cost to fix an inferior instrument depends on the number of weeks left to fix it: $7500 if there are three weeks left, $10,000 if there are two weeks left, and $15,000 if there is one week left. The government will pay $70,000 for an instrument of sufficient quality delivered on time, but it will pay nothing otherwise. Find the distribution of profit or loss to the company. Then find the mean and standard deviation of this distribution. Do you think the company should sign the contract?

40. Have you ever watched the odds at a horse race? You might hear that the odds against a given horse winning are 9 to 1, meaning that the horse has a probability 1/(1 + 9) = 1/10 of winning. However, these odds, after being converted to probabilities, typically add to something greater than one. Why is this? Suppose you place a bet of $10 on this horse. It seems that it is a fair bet if you lose your $10 if the horse loses, but you win $90 if the horse wins. However, argue why this isn’t really fair to you, that is, argue why your expected winnings are negative.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 4.1 SIMPSON’S PARADOX

The results we obtain with conditional probabilities can be quite counterintuitive, even paradoxical. This case is similar to one described in an article by Blyth (1972), and is usually referred to as Simpson’s paradox. [Two other examples of Simpson’s paradox are described in articles by Westbrooke (1998) and Appleton et al. (1996).] Essentially, Simpson’s paradox says that even if one treatment has a better effect than another on each of two separate subpopulations, it can have a worse effect on the population as a whole.

Suppose that the population is the set of managers in a large company. We categorize the managers as those with an MBA degree (the Bs) and those without an MBA degree (the Bs). These categories are the two “treatment” groups. We also categorize the managers as those who were hired directly out of school by this company (the Cs) and those who worked with another company first (the Cs). These two categories form the two “subpopulations.” Finally, we use as a measure of effectiveness those managers who have been promoted within the past year (the As).

Assume the following conditional probabilities are given:

P1A 0 B and C2 = 0.10, P1A 0 B and C 2 = 0.05 (4.12) P 1A 0 B and C C 2 = 0.35, P 1A 0 B and C C 2 = 0.20 (4.13) P1C 0 B2 = 0.90, P1C 0 B2 = 0.30 (4.14) Each of these can be interpreted as a proportion. For example, the probability P 1A|B and CA|B and C 2 implies that 10% of all managers who have an MBA degree and

were hired by the company directly out of school were promoted last year. Similar explanations hold for the other probabilities.

Joan Seymour, the head of personnel at this company, is trying to understand these figures. From the probabilities in Equation (4.12), she sees that among the subpopulation of workers hired directly out of school, those with an MBA degree are twice as likely to be promoted as those without an MBA degree. Similarly, from the probabilities in Equation (4.13), she sees that among the subpopulation of workers hired after working with another company, those with an MBA degree are almost twice as likely to be promoted as those almost twice as likely to be promoted as those almost without an MBA degree. The information provided by the probabilities in Equation (4.14) is somewhat different. From these, she sees that employees with MBA degrees are three times as likely as those without MBA degrees to have been hired directly out of school.

Joan can hardly believe it when a whiz-kid analyst uses these probabilities to show—correctly—that

P1A 0 B2 = 0.125, P1A 0 B2 = 0.155 (4.15)

In words, those employees without MBwithout MBwithout A degrees are more likely to be promoted than those with MBA degrees. This appears to go directly against the evidence in Equations (4.12) and (4.13), both of which imply that MBAs have an advantage in being promoted. Can you derive the probabilities in Equation (4.15)? Can you shed any light on this “paradox”?

Case 4.1 Simpson’s Paradox 165 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

166

CHALLENGING CLAIMS OF THE BELL CURVE

One of the most controversial books in recent years is The Bell Curve(The Free Press, 1994). The authors are the late Richard Herrnstein, a psychologist, and Charles Murray, an economist, both of whom had extensive training in statistics. The book is a scholarly treatment of differences in intelligence, measured by IQ, and their effect on socioeconomic status (SES). The authors argue, by appealing to many past studies and presenting many statistics and graphs, that there are significant differences in IQ among differ-statistics and graphs, that there are significant differences in IQ among differ-statistics and graphs, that there are significant differences in IQ among differ ent groups of people, and that these differences are at least partially respon- sible for differences in SES. Specifically, their basic claims are that (1) there is a quantity, intelligence, that can be measured by an IQ test; (2) the dis- tribution of IQ scores is essentially a symmetric bell-shaped curve; (3) IQ scores are highly correlated with various indicators of success; (4) IQ is determined predominantly by genetic factors and less so by environmental factors; and (5) African Americans score significantly lower—about 15 points lower—on IQ than whites.

Although the discussion of this latter point takes up a relatively small part of the book, it has generated by far the most controversy. Many criti- cisms of the authors’ racial thesis have been based on emotional arguments. However, it can also be criticized on entirely statistical grounds, as Barnett (1995) has done.1 However, it can also be criticized on entirely statistical grounds, as Barnett

1 However, it can also be criticized on entirely statistical grounds, as Barnett

Barnett never states that the analysis by Herrnstein and Murray is wrong. He merely states that (1) the assumptions behind some of the analysis are at best questionable, and (2) some of the crucial details are not made as explicit as they should have been. As he states, “The issue is not that The Bell Curve is demonstrably wrong, but that it falls so far short

1Arnold Barnett is a professor in operations research at MIT’s Sloan School of Management. He specializes in data analysis of health and safety issues.

Normal, Binomial, Poisson, and Exponential Distributions

C H A P T E R

5

M ila

n V

a si

c e k/

iS to

c kp

h o to

.c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-1 Introduction 167

of being demonstrably right. The book does not meet the burden of proof we might reasonably expect of it.”

For example, Barnett takes issue with the claim that the genetic component of IQ is, in the words of Herrnstein and Murray, “unlikely to be smaller than 40 percent or higher than 80 percent.” Barnett asks what it would mean if genetics made up, say, 60% of IQ. His only clue from the book is in an endnote, which implies this definition: If a large population of genetically identical newborns grew up in randomly chosen environ- ments, and their IQs were measured once they reached adulthood, then the variance of these IQs would be 60% less than the variance for the entire population. The key word is variance. As Barnett notes, however, this statement implies that the corresponding drop in standard deviation is only 37%. That is, even if all members of the population were exactly the same genetically, differing environments would create a standard deviation of IQs 63% as large as the standard deviation that exists today. If this is true, it is hard to argue, as Herrnstein and Murray have done, that environment plays a minor role in determining IQ.

Because the effects of different racial environments are so difficult to disentangle from genetic effects, Herrnstein and Murray try at one point to bypass environmen- tal influences on IQ by matching blacks and whites from similar environments. They report that blacks in the top decile of SES have an average IQ of 104, but that whites within that decile have an IQ one standard deviation higher. Even assuming that they have their facts straight, Barnett criticizes the vagueness of their claim. What standard deviation are they referring to: the standard deviation of the entire population or the standard deviation of only the people in the upper decile of SES? The latter is certainly much smaller than the former. Should we assume that the “top-decile blacks” are in the top decile of the black population or of the overall population? If the latter, then the matched comparison between blacks and whites is flawed because the wealthiest 10% of whites have far more wealth than the wealthiest 10% of blacks. Moreover, even if the reference is to the pooled national population, the matching is imperfect. It is pos- sible that the blacks in this pool could average around the ninth percentile, whereas the whites could average around the fourth percentile, with a significant difference in income between the two groups.

The problem is that Herrnstein and Murray never state these details explicitly. Therefore, we have no way of knowing—without collecting and analyzing all of the data ourselves—whether their results are essentially correct. As Barnett concludes his arti- cle, “I believe that The Bell Curve’s statements about race would have been better left unsaid even if they were definitely true. And they are surely better left unsaid when, as we have seen, their meaning and accuracy [are] in doubt.” ■

5-1 INTRODUCTION The previous chapter discussed probability distributions in general. This chapter investi- gates several speci�c distributions that commonly occur in a variety of business applica- tions. The �rst of these is a continuous distribution called the normal distribution. It is normal distribution. It is normal characterized by a symmetric bell-shaped curve and is the cornerstone of statistical theory. The second distribution is a discrete distribution called the binomial distribution. It is relbinomial distribution. It is relbinomial - evant when sampling from a population with only two types of members or when perform- ing a series of independent, identical experiments with only two possible outcomes. The other two distributions we will discuss brie�y are the Poisson and exponential distributions. exponential distributions. exponential These are often used when counting events of some type through time, such as arrivals to a bank. In this case, the Poisson distribution, which is discrete, describes the number

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

168 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

of arrivals in any period of time, and the exponential distribution, which is continuous, describes the times between arrivals.

The main goals in this chapter are to present the properties of these distributions, give some examples of when they apply, and show how to perform calculations involving them. Regarding this last objective, analysts have traditionally used special tables to �nd proba- bilities or values for the distributions in this chapter. However, these tasks have been simpli- �ed with the statistical functions available in Excel® bilities or values for the distributions in this chapter. However, these tasks have been simpli

® bilities or values for the distributions in this chapter. However, these tasks have been simpli

. Given the availability of these Excel functions, the traditional tables, which were always tricky to use, are no longer necessary.

We cannot overemphasize the importance of these distributions. Almost all of the sta- tistical results discussed in later chapters are based on either the normal distribution or the binomial distribution. The Poisson and exponential distributions play a less important role in this book, but they are nevertheless extremely important in many management science applications. Therefore, it is important for you to become familiar with these distributions before proceeding.

5-2 THE NORMAL DISTRIBUTION The single most important distribution in statistics is the normal distribution. It is a con- tinuous distribution and is the basis of the familiar symmetric bell-shaped curve. Any par- ticular normal distribution is speci�ed by its mean and standard deviation. By changing the mean, the normal curve shifts to the right or left. By changing the standard deviation, the curve becomes more or less spread out. Therefore, there are really many normal distribu- tions, not just a single one. We say that the normal distribution is a two-parameter family, where the two parameters are the mean and the standard deviation.

5-2a Continuous Distributions and Density Functions

We �rst take a moment to discuss continuous probability distributions in general. In the previous chapter we discussed discrete distributions, characterized by a list of possible values and their probabilities. The same basic idea holds for continuous distributions such as the normal distribution, but the mathematics is more complex. Now instead of a list of possible values, there is a continuum of possible values, such as all values between 0 and 100 or all values greater than 0. Instead of assigning probabilities to each individual value in the continuum, the total probability of 1 is spread over this continuum. The key to this spreading is called a density function, which acts like a histogram. The higher the value of the density function, the more likely this region of the continuum is.

A density function, usually denoted by f(f(f x), specifies the probability distribution of a continuous random variable X. The higher f(f(f x) is, the more likely x is. Also, the total area between the graph of f(f(f x) and the horizontal axis, which represents the total probability, is equal to 1. Finally, f(f(f x) is nonnegative for all possible values of X.

As an example, consider the density function shown in Figure 5.1. (This is not a nornot a nornot - mal density function.) It indicates that all values in the continuum from 25 to 100 are pos- sible, but that the values near 70 are most likely. (This density function might correspond to scores on an exam.) More speci�cally, because the height of the density at 70 is approxi- mately twice the height of the curve at 84 or 53, a value near 70 is approximately twice as likely as a value near 84 or a value near 53. In this sense, the height of the density function indicates relative likelihoods.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-2 The Normal Distribution 169

Probabilities are found from a density function as areas under the curve. For example, the area of the designated region in Figure 5.2 represents the probability of a score between 65 and 75. Also, the area under the entire curve is 1 because the total probability of all possible values is always 1. Unfortunately, this is about as much as we can say without calculus. Integral calculus is required to �nd areas under curves. Fortunately, statistical tables have been constructed to �nd such areas for a number of well-known density functions, including the normal. Even better, Excel functions have been developed to �nd these areas—without the need for bulky tables. We take advantage of these Excel functions in the rest of this chap- ter and in later chapters.

For continuous distribu- tions, probabilities are areas under the density function. These prob- abilities can often be calculated with Excel functions.

As in the previous chapter, the mean is a measure of central tendency of the distribu- tion, and the standard deviation (or variance) measures the variability of the distribution. Again, however, calculus is generally required to calculate these quantities. We will simply list their values (which were obtained through calculus) for the normal distribution and any other continuous distributions where we need them. By the way, the mean for the (nonnormal) density in Figure 5.1 is slightly less than 70—it is always to the left of the peak for a left-skewed distribution and to the right of the peak for a right-skewed distribution— and the standard deviation is approximately 15.

5-2b The Normal Density

The normal distribution is a continuous distribution with possible values ranging over the entire number line—from “minus in�nity” to “plus in�nity.” However, only a relatively

Figure 5.1 A Skewed Density Function

© C

e n g

a g

e L

e a rn

in g

Figure 5.2 Probability as the Area Under the Density

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

170 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

small range has much chance of occurring. The normal density function is actually quite complex, in spite of its “nice” bell-shaped appearance. For the sake of completeness, we list the formula for the normal density function in Equation (5.1). Here, μ and σ are the mean and standard deviation of the distribution.

Normal Density Function

f(f(f x) = 1 !2!2! π! σ

e− (x − �) 2/(2σ 2) for − ∞ < x < + ∞ (5.1)

Why the Normal Distribution? The normal density in Equation (5.1) is certainly not very intuitive, so why is the normal distribu- tion the basis for so much of statistical theory? One reason is practical. Many histograms based on real data resemble the bell-shaped normal curve to a remarkable extent. Granted, not all histograms are

symmetric and bell-shaped, but a surprising number are. Another reason is theoretical. In spite of the complexity of Equation (5.1), the normal distribu- tion has many appealing properties that have ena- bled researchers to build the rich statistical theory that finds widespread use in business, the sciences, and other fields.

F u n da m e n ta l I n s i g h t

The curves in Figure 5.3 illustrate several normal density functions for different values of μ and σ. The mean μ can be any number: negative, positive, or zero. As you can see, the effect of increasing or decreasing the mean μ is to shift the curve to the right or the left. On the other hand, the standard deviation σ must be a positive number. It controls the spread of the normal curve. When σ is small, the curve is more peaked; when σ is large, the curve is more spread out. For shorthand, we use the notation N( μ, σ) to refer to the normal distri- bution with mean μ and standard deviation σ. For example, N(−2, 1) refers to the normal distribution with mean −2 and standard deviation 1.

5-2c Standardizing: Z-Values

There are in�nitely many normal distributions, one for each pair μ and σ. We single out one of these for special attention, the standard normal distribution. The standard normal distribution. The standard standard normal distribution has mean 0 and standard deviation 1, so we denote it by N(0, 1). It is also commonly referred to as the Z distribution. Suppose the random variable Z distribution. Suppose the random variable Z X is normally distributed with mean μ and standard deviation σ. We de�ne the random variable Z by

Figure 5.3 Several Normal Density Functions

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-2 The Normal Distribution 171

Equation (5.2). This operation is called standardizing. That is, to standardize a variable, you subtract its mean and then divide the difference by the standard deviation. When X is X is X normally distributed, the standardized variable is N(0, 1).

E X A M P L E 5.1 STANDARDIZING RETURNS FROM MUTUAL FUNDS

The annual returns for 30 mutual funds appear in Figure 5.4. (See the file Standardizing.xlsx.) Find and interpret the Z-values of these returns. Objective To use Excel to standardize annual returns of various mutual funds.To use Excel to standardize annual returns of various mutual funds.T

Standardizing a Normal Random Variable

Z = X − μ

σ (5.2)

One reason for standardizing is to measure variables with different means and/or standard deviations on a single scale. For example, suppose several sections of a college course are taught by different instructors. Because of differences in teaching methods and grad- ing procedures, the distributions of scores in these sections might differ, possibly by a wide margin. However, if each instructor calculates his or her mean and standard deviation and then calculates a Z-value for each student, the distributions of the Z-values should be approximately the same in each section.

It is easy to interpret a Z-value. It is the number of standard deviations to the right or the left of the mean. If Z is positive, the original value (in this case, the original score) is to the right of the mean; if right of the mean; if right Z is negative, the original score is to the left of the mean. For examleft of the mean. For examleft - ple, if the Z-value for some student is 2, then this student’s score is two standard deviations above the mean. If the Z-value for another student is −0.5, then this student’s score is half a standard deviation below the mean. We illustrate Z-values in Example 5.1.

Figure 5.4 Mutual Fund Returns and Z-Values

1

2

3

4

5

6

7

8

9

A BA BA B C DC DC DC D E FE FE F G HG HG H

Standardizing mutual fund returns

Summary sta�s�cs from returns below

Mean

Stdev

Fund Ad Annual return

Annual_return

Z value

0.091

0.047

0.007

0.080

0.082

0.123

0.022

0.054

0.078

0.066

–1.8047

–0.2363 Mean

Stdev

=$B$8:$B$37

=$B$4

=$B$5–0.1934

0.6875

–1.4824

–0.7949

–0.2793

–0.5371

Z value Range names used

–1.8047

–0.2363

–0.1934

0.6875

–1.4824

–0.7949

–0.2793

–0.5371

10

11

12

13

36

37

1

2

3

4

5

6

29

30

Calculated two different ways � the second with the Standardize func�on

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

172 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Solution The 30 annual returns appear in column B of Figure 5.4. Their mean and standard devia- tion are calculated in cells B4 and B5 with the AVERAGE and STDEV.S functions. The corresponding Z-values are calculated in column C by entering the formula

=(B8-Mean)/Stdev

in cell C8 and copying it down column C. (Note that Mean and Stdev are range names for cells B4 and B5.)

There is an equivalent way to calculate these Z-values in Excel. This is done in column D by using Excel’s STANDARDIZE function directly. To use this function, enter the formula

=STANDARDIZE(B8,Mean,Stdev)

in cell D8 and copy it down column D. The Z-values in Figure 5.4 range from a low of −1.80 to a high of 2.19. Specifically,

the return for stock 1 is about 1.80 standard deviations below the mean, whereas the return for fund 17 is about 2.19 standard deviations above the mean. As you will see shortly, these values are typical: Z-values are usually in the range from −2 to +2 and values beyond −3 or +3 are very uncommon. (Recall the empirical rules for interpreting standard deviation first discussed in Chapter 2.) Also, the Z-values automatically have mean 0 and standard deviation 1, as you can see in cells C5 and C6 by using the AVERAGE and STDEV.S func- tions on the Z-values in column C (or D). ■

5-2d Normal Tables and Z-Values 2

A common use for Z-values and the standard normal distribution is in calculating probabili- ties and percentiles by the traditional method. This method is based on a table of the standard normal distribution found in many statistics textbooks. Such a table is given in Figure 5.5. The body of the table contains probabilities. (The entire body of this table was generated by the single copyable formula shown.) The left and top margins contain possible values. Speci�cally, suppose you want to �nd the probability that a standard normal random variable is less than 1.35. You locate 1.3 along the left and 0.05—the second decimal in 1.35—along the top, and then read into the table to �nd the probability 0.9115. In words, the probability is about 0.91 that a standard normal random variable is less than 1.35.

Alternatively, if you are given a probability, you can use the table to �nd the value with this much probability to the left of it under the standard normal curve. This is called a per- centile calculation. For example, if the probability is 0.75, you can �nd the 75th percentile by locating the probability in the table closest to 0.75 and then reading to the left and up. With interpolation, the required value is approximately 0.675. In words, the probability of being to the left of 0.675 under the standard normal curve is approximately 0.75.

You can perform the same kind of calculations for any normal distribution if you �rst standardize. As an example, suppose that X is normally distributed with mean 100 and standard deviation 10. We will �nd the probability that X is less than 115 and the 85th percentile of this normal distribution. To �nd the probability that X is less than X is less than X 115, �rst standardize the value 115. The corresponding Z-value is

Z = (115 − 100)/10 = 1.5

Now look up 1.5 in the table (1.5 row, 0.00 column) to obtain the probability 0.9332. For the percentile question, �rst �nd the 85th percentile of the standard normal distribution. Interpolating, a value of approximately 1.037 is obtained. Then set this value equal to a standardized value:

Z = 1.037 = (X − 100)/10

2If you intend to rely on Excel functions for normal calculations (and we hope you do!), you can skip this subsection.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-2 The Normal Distribution 173

Finally, solve for X to obtain 110.37. In words, the probability of being to the left of 110.37 in the N(100,10) distribution is about 0.85.

There are some obvious drawbacks to using the standard normal table for probability calculations. The �rst is that there are holes in the table—interpolation is often necessary. A second drawback is that the standard normal table takes different forms in different textbooks. These differences are rather minor, but they can easily cause confusion. Finally, the table requires you to perform calculations. For example, you often need to standardize. More importantly, you often have to use the symmetry of the normal distribution to �nd probabilities that are not in the table. As an example, to �nd the probability that Z is less than −1.5, you must go through some mental gymnastics. First, by symmetry this is the same as the probability that Z is greater than 1.5. Then, because only left-tail (“less than”)

z 0.00 0.01 0.02 0.03 0.05 0.06 0.07 0.08 0.09 0.0 0.5000 0.5040 0.5080 0.5120 0.5160 0.5199 0.5239 0.5279 0.5319 0.5359 0.1 0.5398 0.5438 0.5478 0.5517 0.5557 0.5596 0.5636 0.5675 0.5714 0.5753 0.2 0.5793 0.5832 0.5871 0.5910 0.5948 0.5987 0.6026 0.6064 0.6103 0.6141 0.3 0.6179 0.6217 0.6255 0.6293 0.6331 0.6368 0.6406 0.6443 0.6480 0.6517 0.4 0.6554 0.6591 0.6628 0.6664 0.6700 0.6736 0.6772 0.6808 0.6844 0.6879 0.5 0.6915 0.6950 0.6985 0.7019 0.7054 0.7088 0.7123 0.7157 0.7190 0.7224 0.6 0.7257 0.7291 0.7324 0.7357 0.7389 0.7422 0.7454 0.7486 0.7517 0.7549 0.7 0.7580 0.7611 0.7642 0.7673 0.7704 0.7734 0.7764 0.7794 0.7823 0.7852 0.8 0.7881 0.7910 0.7939 0.7967 0.7995 0.8023 0.8051 0.8078 0.8106 0.8133

0.8159 0.8186 0.8212 0.8238 0.8365 0.8389 1.0 0.8413 0.8438 0.8461 0.8485 0.8508 0.8531 0.8554 0.8577 0.8599 0.8621 1.1 0.8643 0.8665 0.8686 0.8708 0.8729 0.8749 0.8770 0.8790 0.8810 0.8830 1.2 0.8849 0.8869 0.8888 0.8907 0.8925 0.8944 0.8962 0.8980 0.8997 0.9015 1.3 0.9032 0.9049 0.9066 0.9082 0.9099 0.9115 0.9131 0.9147 0.9162 0.9177 1.4 0.9192 0.9207 0.9222 0.9236 0.9251 0.9265 0.9279 0.9292 0.9306 0.9319 1.5 0.9332 0.9345 0.9357 0.9370 0.9382 0.9394 0.9406 0.9418 0.9429 0.9441 1.6 0.9452 0.9463 0.9474 0.9484 0.9495 0.9505 0.9515 0.9525 0.9535 0.9545 1.7 0.9554 0.9564 0.9573 0.9582 0.9591 0.9599 0.9608 0.9616 0.9625 0.9633 1.8 0.9641 0.9649 0.9656 0.9664 0.9671 0.9678 0.9686 0.9693 0.9699 0.9706 1.9 0.9713 0.9719 0.9726 0.9732 0.9738 0.9744 0.9750 0.9756 0.9761 0.9767 2.0 0.9772 0.9778 0.9783 0.9788 0.9793 0.9798 0.9803 0.9808 0.9812 0.9817 2.1 0.9821 0.9826 0.9830 0.9834 0.9838 0.9842 0.9846 0.9850 0.9854 0.9857 2.2 0.9861 0.9864 0.9868 0.9871 0.9875 0.9878 0.9881 0.9884 0.9887 0.9890 2.3 0.9893 0.9896 0.9898 0.9901 0.9904 0.9906 0.9909 0.9911 0.9913 0.9916 2.4 0.9918 0.9920 0.9922 0.9925 0.9927 0.9929 0.9931 0.9932 0.9934 0.9936 2.5 0.9938 0.9940 0.9941 0.9943 0.9945 0.9946 0.9948 0.9949 0.9951 0.9952 2.6 0.9953 0.9955 0.9956 0.9957 0.9959 0.9960 0.9961 0.9962 0.9963 0.9964 2.7 0.9965 0.9966 0.9967 0.9968 0.9969 0.9970 0.9971 0.9972 0.9973 0.9974 2.8 0.9974 0.9975 0.9976 0.9977 0.9977 0.9978 0.9979 0.9979 0.9980 0.9981 2.9 0.9981 0.9982 0.9982 0.9983 0.9984 0.9984 0.9985 0.9985 0.9986 0.9986 3.0 0.9987 0.9987 0.9987 0.9988 0.9988 0.9989 0.9989 0.9989 0.9990 0.9990 3.1 0.9990 0.9991 0.9991 0.9991 0.9992 0.9992 0.9992 0.9992 0.9993 0.9993 3.2 0.9993 0.9993 0.9994 0.9994 0.9994 0.9994 0.9994 0.9995 0.9995 0.9995 3.3 0.9995 0.9995 0.9995 0.9996 0.9996 0.9996 0.9996 0.9996 0.9996 0.9997 3.4 0.9997 0.9997 0.9997 0.9997 0.9997 0.9997 0.9997 0.9997 0.9997 0.9998

z 0 0 0 1 0 2 0 5 0 6 0 0 0 8 0 3 0 9 0 4 0 5 0 7 0 0 0 1 0

3 0 3 0 9 0 2 0 2 0 2 0 2 0 4 0 1 0 3 0 2 0 1 0 1 0 3 0 8 0 8 0 3 0 5 0 4 0 1 0 7 0 0 0 3 0 5 0 7 0

0 0 8 0 2 0 7 0 1 0 0 0 1 0 1 0 0 0

8 0 5 0 9 0 9 0 7 0 5 0 3 0 4 0 9 0 9 0 8 0 6 0 4 0 6 0 0 0 0 0 5 0 6 0 5 0 2 0 7 0 1 0 3 0 5 0 7 0

0 0 8 0 1 0 5 0 8 0 5 0 4 0 2 0 9 0

1 0 6 0 8 0 6 0 2 0 7 0 4 0 3 0 6 0 6 0 3 0 0 0 8 0 8 0 2 0 1 0 6 0 7 0 6 0 2 0 7 0 1 0 4 0 5 0 7 0

0 0 7 0 0 0 3 0 4 0 9 0 7 0 3 0 7 0

5 0 8 0 7 0 2 0 6 0 0 0 4 0 2 0 4 0 2 0 8 0 4 0 1 0 1 0 5 0 3 0 7 0 8 0 7 0 3 0 8 0 1 0 4 0 6 0 7 0

0 0 7 0 8 0 1 0 0 0 4 0 9 0 4 0 5 0

8 0 9 0 5 0 9 0 1 0 2 0 5 0 1 0 1 0 8 0 3 0 8 0 5 0 4 0 7 0 5 0 9 0 9 0 7 0 4 0 8 0 2 0 4 0 6 0 7 0

9 0 6 0 7 0 8 0 6 0 8 0 2 0 4 0 3 0

1 0 9 0 4 0 5 0 5 0 4 0 5 0 9 0 8 0 4 0 8 0 2 0 8 0 6 0 9 0 6 0 0 0 0 0 8 0 4 0 9 0 2 0 4 0 6 0 7 0

9 0 6 0 6 0 6 0 2 0 3 0 4 0 4 0 1 0

4 0 0 0 2 0 1 0 9 0 6 0 5 0 8 0 6 0 0 0 3 0 6 0 1 0 9 0 1 0 8 0 1 0 1 0 9 0 5 0 9 0 2 0 4 0 6 0 7 0

9 0 5 0 4 0 3 0 8 0 7 0 6 0 4 0 8 0

7 0 0 0 0 0 7 0 2 0 8 0 5 0 6 0 3 0 6 0 8 0 0 0 4 0 1 0 2 0 9 0 2 0 2 0 9 0 5 0 9 0 2 0 5 0 6 0 7 0

9 0 4 0 3 0 0 0 4 0 0 0 7 0 3 0 6 0

9 0 0 0 7 0 2 0 6 0 9 0 5 0 5 0 9 0 1 0 2 0 4 0 7 0 3 0 4 0 1 0 3 0 3 0 0 0 6 0 0 0 3 0 5 0 6 0 7 0

A BA B C DC D E GE GE GE G H IH I J KJ K

0.9

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

=NORM.S.DIST($A11+F$1, TRUE) NORM.S.DIST(z, cumula�ve)

0.04 F

Figure 5.5 Table of Normal Probabilities

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

174 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

probabilities are tabulated, you must �nd the probability that Z is less than 1.5 and subtract this probability from 1. The chain of reasoning is

P(Z < −1.5) = P(Z > 1.5) =1 − P(Z < 1.5) = 1 − 0.9332 = 0.0668

This is not too dif�cult, given a bit of practice, but it is easy to make a mistake. Excel func- tions make the whole procedure much easier and less error-prone.

5-2e Normal Calculations in Excel

Two types of calculations are typically made with normal distributions: �nding probabilities and �nding percentiles. Excel makes each of these fairly simple. The functions used for normal probability calculations are NORM.DIST and NORM.S.DIST. The main difference between these is that the one with the “S” (for standardized) applies only to N(0, 1) calcula- tions, whereas NORM.DIST applies to any normal distribution. On the other hand, percentile calculations that take a probability and return a value are often called inverse calculations. Therefore, the Excel functions for these are named NORM.INV and NORM.S.INV. Again, the “S” in the second of these indicates that it applies to the standard normal distribution.

The NORM.DIST and NORM.S.DIST functions return left-tail probabilities, such as the probability that a normally distributed variable is less than 35. The syntax for these functions is

=NORM.DIST(x,μ,σ,TRUE)

and

=NORM.S.DIST (x ,TRUE)

Here, x is a number you supply, and x is a number you supply, and x μ and σ are the mean and standard deviation of the normal distribution. The last argument in the NORM.DIST function, TRUE (or 1), is used to obtain the cumulative normal probability, the type usually required. (This TRUE/FALSE argument is a nuisance to remember, but it is necessary. If the last argument is FALSE, or 0, the func- tion returns the height of the density at x, which is not usually what you want.) Note that NORM.S.DIST takes only two arguments (because μ and σ are known to be 0 and 1), so it is easier to use—when it applies. (Note that the “old” NORMSDIST function doesn’t require the last TRUE/FALSE argument, but the newer NORM.S.DIST function does.)

The NORM.INV and NORM.S.INV functions return values for user-supplied prob- abilities. For example, if you supply the probability 0.95, these functions return the 95th percentile. Their syntax is

=NORM.INV(p,μ,σ)

and

=NORM.S.INV(p)

where p is a probability you supply. These are analogous to the NORM.DIST and NORM.S.DIST functions (except there is no �nal TRUE/FALSE argument in the “INV” functions).

CHANGES IN EXCEL 2010

Many of the statistical functions were revamped in Excel 2010, as we will point out throughout the next few chapters. Microsoft wanted a more consistent naming convention that would make functions better match the ways they are used in statistical inference. All of the old functions, including the normal functions discussed here, are still available for compatibility, but Microsoft is hoping that users will switch to the new functions, as we have done in this edition of the book. The new normal functions are NORM. DIST, NORM.S.DIST, NORM.INV, and NORM.S.INV. These work exactly like the old normal functions except that NORM.S.DIST takes the same last “cumulative” argument, as was explained above for NORMDIST. The new and old functions are both shown in the file for the next example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-2 The Normal Distribution 175

We illustrate these Excel functions in Example 5.2.3

3Actually, we already illustrated the NORM.S.DIST function; it was used to create the body of Figure 5.5. In other words, you can use it to build your own normal probability table.

Probability and Percentile Calculations There are two basic types of calculations involving probability distributions, normal or otherwise. In a probability calculation, you provide a possible value, and you ask for the probability of being less than or equal to this value. In a percentile calculation, you

provide a probability, and you ask for the value that has this probability to the left of it. Excel’s statistical functions, especially with the new names introduced in Excel 2010, use DIST in functions that perform probability calculations and INV (for inverse) in func- tions that perform percentile calculations.

F u n da m e n ta l I n s i g h t

E X A M P L E 5.2 NORMAL CALCULATIONS IN EXCEL

Use Excel to calculate the following probabilities and percentiles for the standard normal distribution: (a) P(Z < − 2), (b) P(Z > 1), (c) P(−0.4 < Z < 1.6), (d) the 5th percentile, (e) the 75th percentile, and (f) the 99th percentile. Then for the N(75, 8) distribution, find the following probabilities and percentiles: (a) P(X < 70), (b) P(X > 73), (c) P(75 < X < 85), (d) the 5th percentile, (e) the 60th percentile, and (f) the 97th percentile.

Objective To calculate probabilities and percentiles for standard normal and general normal distributions in Excel.

Solution The solution appears in Figure 5.6. (See the file Normal Calculations.xlsx.) The N(0, 1) calculations are in rows 7 through 14; the N(75, 8) calculations are in rows 23 through 30. For your convenience, the formulas used in column B are spelled out in column D (as labels). Note that the standard normal calculations use the normal functions with the “S” in the middle; the rest use the normal functions without the “S”—and require more arguments.

Note the following for normal probability calculations:

■ For “less than” probabilities, use NORM.DIST or NORM.S.DIST directly. (See rows 7 and 23.)

■ For “greater than” probabilities, subtract the NORM.DIST or NORM.S.DIST function from 1. (See rows 8 and 24.)

■ For “between” probabilities, subtract the two NORM.DIST or NORM.S.DIST functions. For example, in row 9 the probability of being between −0.4 and 1.6 is the probability of being less than 1.6 minus the probability of being less than −0.4.

The percentile calculations are even more straightforward. In most percentile problems you want to find the value with a certain probability to the left of it. In this case you use the left of it. In this case you use the left NORM.INV or NORM.S.INV function with the specified probability as the first argument. See rows 12 through 14 and 28 through 30.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

176 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Figure 5.6 Normal Calculations with Excel Functions

Note that when you are doing probability calculations on any continuous distribution, including the normal distribution, there is no need to distinguish between “less than” and “less than or equal to” events, or between “greater than” and “greater than or equal to” events. The reason is that there is no positive probability of being equal to any particular value. However, as you will see when we discuss the binomial distribution, this is not true of discrete distributions. ■

There are a couple of variations of percentile calculations. First, suppose you want the value with probability 0.05 to the right of it. This is the same as the value with probability right of it. This is the same as the value with probability right 0.95 to the left of it, so you use NORM.INV or NORM.S.INV with probability argument 0.95. For example, the value with probability 0.4 to the right of it in the N(75, 8) distribu- tion is 77.027. (See cell B29 in Figure 5.6.)

As a second variation, suppose you want to �nd an interval of the form −x to x, for some positive number x, with (1) probability 0.025 to the left of −x, (2) probability 0.025 to the right of x, and (3) probability 0.95 between −x and x. This is a very common prob- lem in statistical inference. In general, you want a probability (such as 0.95) to be in the middle of the interval so that half of the remaining probability (0.025) is in each of the tails. (See Figure 5.7.) Then the required x can be found with NORM.INV or NORM.S.INV, using probability argument 0.975, because there must be a total probability of 0.975 to the left of x.

For example, if the relevant distribution is the standard normal, the required value of x is 1.96, found with the function NORM.S.INV (0.975). Similarly, if you want probability 0.90 in the middle and probability 0.05 in each tail, the required x is 1.645, found with the function NORM.S.INV (0.95). Remember these two numbers, 1.96 and 1.645. They occur frequently in statistical applications.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

A BA B C DC D E FE F G HG H I

Range Probability Formula using “new” functions (Excel 2010 or later) Less than –2 0.0228 =NORM.S.DIST(–2,TRUE) Greater than 1 0.1587 =1-NORM.S.DIST(1,TRUE) Between –.4 and 1.6 0.6006 =NORM.S.DIST(1.6,TRUE)-NORM.S.DIST(–0.4,TRUE)

5th –1.645 =NORM.S.INV(0.05)

=NORM.S.INV(0.99) =NORM.S.INV(0.75)0.67475th

2.32699th

Range names used: Mean75Mean Stdev8Stdev

Range Probability Formula using “new” functions (Excel 2010 or later) Less than 70 0.2660 =NORM.DIST(70,Mean,Stdev,Tev,Tev RUE) Greater than 73 0.5987 =1-NORM.DIST(73,Mean,Stdev,Tev,Tev RUE) Between 75 and 85 0.3944 =NORM.DIST(85,Mean,Stdev,Tev,Tev RUE)-NORM.DIST(75,Mean,Stdev,Tev,Tev RUE)

Normal probability calculations

Examples with standard normal

Probability calculations

Percentiles

Examples with nonstandard normal

Probability calculations

Percentiles

61.841 77.027 90.046

5th 60th 97th

e P

1 0 6 0

h –

7 = 6 =

5 =

J K L M N O

e P

7 = 6 =

5 =

Formula using “new” functions (Excel 2010 or later)

= $B$18

=NORM.INV(0.05,Mean,Stdev) =NORM.INV(0.6,Mean,Stdev) =NORM.INV(0.97,Mean,Stdev)

= $B$19

Formula using “old” functions (which still work)

=NORMSDIST(–2) =1-NORMSDIST(1) =NORMSDIST(1.6)-NORMSDIST(–0.4)

=NORMSINV(0.05)

=NORMSINV(0.99) =NORMSINV(0.75)

Formula using “old” functions (which still work) =NORMDIST(70,Mean,Stdev,1ev,1ev ) =1-NORMDIST(73,Mean,Stdev,1ev,1ev ) =NORMDIST(85,Mean,Stdev,1)-NORMDIST(75,Mean,Stdevev,1)-NORMDIST(75,Mean,Stdevev ,1,1)-NORMDIST(75,Mean,Stdev,1,1)-NORMDIST(75,Mean,Stdev )

=NORMINV(0.05,Mean,Stdev) =NORMINV(0.6,Mean,Stdev) =NORMINV(0.97,Mean,Stdev) ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-2 The Normal Distribution 177

The normal distribu- tion is the basis for the empirical rules introduced in Chapter 2.

5-2f Empirical Rules Revisited

We introduced three empirical rules in Chapter 2 that apply to many data sets. Namely, about 68% of the data fall within one standard deviation of the mean, about 95% fall within two standard deviations of the mean, and almost all fall within three standard deviations of the mean. For these rules to hold with real data, the distribution of the data must be at least approximately symmetric and bell-shaped. Let’s look at these rules more closely.

Let X be normally distributed with mean μ and standard deviation σ. To perform a probability calculation on X, we can �rst standardize X and then perform the calculation on the standardized variable Z. Speci�cally, we will �nd the probability that X is within k standard deviations of its mean for k = 1, k = 2, and k = 3. In general, this probability is P(μ − kσ < X < μ + kσ). But by standardizing the values μ − kσ and μ + kσ, we obtain the equivalent probability P(−k < Z < k), where Z has a N(0, 1) distribution. This latter probability can be calculated in Excel with the formula

= NORM.S.DIST(k,TRUE)−NORM.S.DIST(−k,TRUE)

By substituting the values 1, 2, and 3 for k, we �nd the following probabilities:

P(−1 < Z < 1) = 0.6827

P(−2 < Z < 2) = 0.9545

P(−3 < Z < 3) = 0.9973

As you can see, there is virtually no chance of being beyond three standard deviations from the mean, the chances are about 19 out of 20 of being within two standard deviations of the mean, and the chances are about 2 out of 3 of being within one standard deviation of the mean. These probabilities are the basis for the empirical rules in Chapter 2. These rules more closely approximate reality as the histograms of observed data become more bell-shaped.

5-2g Weighted Sums of Normal Random Variables

One very attractive property of the normal distribution is that if you create a weighted sum of normally distributed random variables, the weighted sum is also normally distributed. In fact, this is true even if the random variables are not independent.not independent.not

Figure 5.7 Typical Normal Probabilities

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

178 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Speci�cally, if X1 through XnXnX are n independent and normally distributed random vari- ables with common mean μ and common standard deviation σ, then the sum X1 + ⋯ + XnXnX is normally distributed with mean nμ (sum of the means), variance nσ2 (sum of the vari- ances), and standard deviation !n!n!! σ (square root of the variance). More generally, if a1 through an are any constants, then the weighted sum a1X1 + · · · + an XnXnX is normally dis- tributed with mean a1�1 + · · · + an �n and variance a12σ 12σ2σ + · · · + a2n σ2σ2σnσnσ . You will need this fact to solve a few of the problems in this chapter. (Actually, this is the correct mean even if the X’s are not independent, but in that case, the variance of the weighted sum also not independent, but in that case, the variance of the weighted sum also not includes covariance terms and is not shown here.)

5-3 APPLICATIONS OF THE NORMAL DISTRIBUTION In this section we apply the normal distribution to a variety of business problems.

E X A M P L E 5.3 PERSONNEL TESTING AT ZTEL

The personnel department of ZTel, a large communications company, is reconsidering its hiring policy. Each applicant for a job must take a standard exam, and the hire or no-hire decision depends at least in part on the result of the exam. The scores of all appli- cants have been examined closely. They are approximately normally distributed with mean 525 and standard deviation 55.

The current hiring policy occurs in two phases. The first phase separates all appli- cants into three categories: automatic accepts, automatic rejects, and maybes. The auto- matic accepts are those whose test scores are 600 or above. The automatic rejects are those whose test scores are 425 or below. All other applicants (the maybes) are passed on to a second phase where their previous job experience, special talents, and other factors are used as hiring criteria. The personnel manager at ZTel wants to calculate the percentage of applicants who are automatic accepts or rejects, given the current standards. She also wants to know how to change the standards to automatically reject 10% of all applicants and automatically accept 15% of all applicants.

Objective To determine test scores that can be used to accept or reject job applicants at ZTel.

Solution Let X be the test score of a typical applicant. Then historical data suggest that the distribuX be the test score of a typical applicant. Then historical data suggest that the distribuX - tion of X is X is X N(525, 55). A probability such as P(X ≤ 425) can be interpreted as the proba- bility that a typical applicant is an automatic reject, or it can be interpreted as the percentage of all applicants who are automatic rejects. Given this observation, the solution to ZTel’s all applicants who are automatic rejects. Given this observation, the solution to ZTel’s all problem appears in Figure 5.8. (See the file Personnel Decisions.xlsx.) The probability that a typical applicant is automatically accepted is 0.0863, found in cell B10 with the formula

=1–NORM.DIST(B7,Mean,Stdev,TRUE)

Similarly, the probability that a typical applicant is automatically rejected is 0.0345, found in cell B11 with the formula

=NORM.DIST(B8,Mean,Stdev,TRUE)

Therefore, ZTel automatically accepts about 8.6% and rejects about 3.5% of all applicants under the current policy.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 179

To find new cutoff values that reject 10% and accept 15% of the applicants, we need the  10th and 85th percentiles of the N(525, 55) distribution. These are 455 and 582 (rounded to the nearest integer), respectively, found in cells B17 and B18 with the formulas

=NORM.INV(1–B14,Mean,Stdev)

and

=NORM.INV(B15,Mean,Stdev)

To accomplish its objective, ZTel needs to raise the automatic rejection point from 425 to 455 and lower the automatic acceptance point from 600 to 582. ■

E X A M P L E 5.4 QUALITY CONTROL AT PAPERSTOCK

PaperStock Company runs a manufacturing facility that produces a paper product. The fiber content of this product is supposed to be 20 pounds per 1000 square feet. (This is typical for the type of paper used in grocery bags, for example.) Because of random variations in the inputs to the process, however, the fiber content of a typical 1000-square-foot roll varies according to a N(μ, σ) distribution. The mean fiber content (μ) can be controlled—that is, it can be set to any desired level by adjusting an instrument on the machine. The variability in fiber content, as measured by the standard deviation σ, is 0.10 pound when the process is “good,” but it sometimes increases to 0.15 pound when the machine goes “bad.” A given roll of this product must be rejected if its actual fiber

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

A BA B C DC D E FE F

Personnel Decisions

Range names used:

Mean of test scores 525 Mean =$B$3

Stdev of test scores 55 Stdev =$B$4

Current Policy

Automa�c accept point

Automa�c reject point

600

425

Percent accepted

Percent rejected

8.63% =1-NORM.DIST(B7,Mean,Stdev,Tev,Tev RUE)

3.45% =NORM.DIST(B8,Mean,Stdev,Tev,Tev RUE)

New Policy

Percent accepted

Percent rejected

15%

10%

Automa�c accept point 582 =NORM.INV(1-B14,Mean,Stdev)

Automa�c reject point 455 =NORM.INV(B15,Mean,Stdev)

Figure 5.8 Calculations for Personnel Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

180 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

To form this data table, enter the formula = B12 in cell B17, highlight the range B17:H25, and create a data table with row input cell B4 and column input cell B3.

content is less than 19.8 pounds or greater than 20.3 pounds. Calculate the probability that a given roll is rejected, for a setting of μ = 20, when the machine is “good” and when it is “bad.”

Objective To determine the machine settings that result in paper of acceptable quality at PaperStock Company.

Solution Let X be the fiber content of a typical roll. The distribution of X will be either N(20, 0.10) or N(20, 0.15), depending on the status of the machine. In either case, the probability that the roll must be rejected can be calculated as shown in Figure 5.9. (See the file Paper Machine Settings.xlsx.) The formula for rejection in the “good” case appears in cell B12 and is spelled out to its right.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

A BA B C DC D E FE F G HG H I JI J K Paper Machine Se�ngs Range names used:

Mean =$B$3 $B$5=

Stdev_good 20Mean

Stdev in good case 0.1 Stdev_bad

=$B$4 Stdev in bad case 0.15

Reject region Lower limit 19.8 Upper limit 20.3

Probability of reject in good case 0.024 =NORM.DIST(B8,Mean,Stdev_good,TRUE)+(1-NORM.DIST(B9,Mean,Stdev_good,TRUE)) in bad case 0.114 =NORM.DIST(B8,Mean,Stdev_bad,TRUE)+(1-NORM.DIST(B9,Mean,Stdev_bad,TRUE))

Data table of rejec�on probability as a func�on of the mean and good standard devia�on Standard devia�on

0.024 0.1 0.11 0.12 0.13 0.14 0.15 19.7 0.841 0.818 0.798 0.779 0.762 0.748 19.8 0.500 0.500 0.500 0.500 0.500 0.500 19.9 0.159 0.182 0.203 0.222 0.240 0.256

Mean 20 0.024 0.038 0.054 0.072 0.093 0.114 20.1 0.024 0.038 0.054 0.072 0.093 0.114 20.2 0.159 0.182 0.203 0.222 0.240 0.256 20.3 0.500 0.500 0.500 0.500 0.500 0.500 20.4 0.841 0.818 0.798 0.779 0.762 0.748

n 2

The point of this example is that the probability of a reject, i.e., falling outside the allowed limits, can vary greatly, not only when the mean is off target, but also when the standard devia�on increases. The illustrates the famous line that “variability is the enemy.”

Figure 5.9 Calculations for Paper Quality Example

© C

e n g

a g

e L

e a rn

in g

This is the sum of two probabilities: the probability of being to the left of the lower limit and the probability of being to the right of the upper limit. A similar formula for the “bad” case appears in cell B13, using Stdev_bad in place of Stdev_good.

You can see that the probability of a rejected roll in the “good” case is 0.024; in the “bad” case it is 0.114. That is, when the standard deviation increases by 50% from 0.10 to 0.15, the percentage of rolls rejected more than quadruples, from 2.4% to 11.4%.

It is certainly possible that the true process mean and “good” standard deviation will not always be equal to the values in cells B3 and B4. Therefore, it is useful to see how sensitive the rejection probability is to these two parameters. You can do this with a two-way data table, as shown in Figure 5.9. The tabulated values show that the probability of rejection varies

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 181

E X A M P L E 5.5 ANALYZING AN INVESTOR’S AFTER-TAX PROFIT

Howard Davis invests $10,000 in a certain stock on January 1. By examining past movements of this stock and consulting with his broker, Howard estimates that the annual return from this stock, X, is normally distributed with mean 5% and standard devia- tion 14%. Here X (when expressed as a decimal) is the profit Howard receives per dollar invested. It means that on December 31, his $10,000 will have grown to 10,000 (1 + X)X)X dollars. Because Howard is in the 33% tax bracket, he will then have to pay the Internal Revenue Service 33% of his profit, if he makes a profit. However, he doesn’t have to pay any tax if he loses money. Calculate the probability that Howard will have to pay the IRS at least $400, and calculate the probability that he won’t have to pay any tax. Also, calculate the dollar amount such that Howard’s after-tax profit is 90% certain to be less than this amount; that is, calculate the 90th percentile of his after-tax profit.

Objective To determine the after-tax profit Howard Davis can be 90% certain of earning.

Solution Howard’s before-tax profit is 10,000X0X0 dollars, so the amount he pays the IRS is X dollars, so the amount he pays the IRS is X 0.33(10,000X0X0 )X)X , or 3300X0X0 dollars. We want the probability that this is at least $400. Because 3300X0X0 > 400 is the same as X > 4/33, the probability of this outcome can be found as in Figure 5.11. (See the file Tax on Stock Return.xlsx.) It is calculated in cell B8 with the formula spelled out to its right. As you can see, Howard has about a 30% chance of paying at least $400 in taxes.

The probability that he doesn’t have to pay any tax is easier. It is the probability the return on the stock is negative. This is 0.36, found in cell B9 with the formula shown to its right.

To answer the last question, note that the after-tax profit (when X is positive) is 67% of the before-tax profit, or 6700X0X0 dollars, and we want its 90th percentile. If this percentile is x,

Figure 5.10 Rejection Regions for Paper Quality Example

© C

e n g

a g

e L

e a rn

in g

greatly even for small changes in the key inputs. In particular, a combination of a badly cen- tered mean and a large standard deviation can make the probability of rejection quite large. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

182 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

then we know that P(6700X0X0 < x) = 0.90, which is the same as P(X < x/x/x 6700) = 0.90. In words, we want the 90th percentile of the X distribution to be X distribution to be X x/x/x 6700. From cell B11 of Figure 5.11, the 90th percentile is 22.94%, so the required value of x is x is x $1,537. ■

It is sometimes tempting to model every continuous random variable with a normal distribution. This can be dangerous for at least two reasons. First, not all random variables have a symmetric distribution. Some are skewed to the left or the right, and for these the normal distribution can be a poor approximation to reality. The second problem is that many random variables in real applications must be nonnegative, and the normal distribu- tion allows the possibility of negative values. The following example shows how a normal assumption can get you into trouble if you aren’t careful.

E X A M P L E 5.6 PREDICTING DEMAND FOR MICROWAVE OVENS

Highland Company is a retailer that sells microwave ovens. The company wants to model its demand for microwaves over the next 12 years. Using historical data as a guide, it assumes that demand in year 1 is normally distributed with mean 5000 and standard deviation 1500. It assumes that demand in each subsequent year is normally distributed with mean equal to the actual demand from the previous year and standard deviation actual demand from the previous year and standard deviation actual 1500. For example, if demand in year 1 is 4500, then the mean demand in year 2 is 4500. This assump- tion is plausible because it leads to correlated demands. For example, if demand is high one year, it will tend to be high the next year. Investigate the ramifications of this model, and suggest models that might be more realistic.

Objective To construct and analyze a spreadsheet model for microwave oven demand over the next 12 years using Excel’s NORM.INV function, and to show how models using the normal distribution can lead to nonsensical outcomes unless they are modified appropriately.

Solution The best way to analyze this model is with simulation, much as in Chapter 4. To do this, you must be able to simulate normally distributed random numbers in Excel. You can do this with the NORM.INV function. Specifically, to generate a normally distributed number with mean μ and standard deviation σ, use the formula

=NORM.INV(RAND(),μ,σ)

To generate a random number from a normal distribution, use NORM.INV with three arguments: RAND(), the mean, and the standard deviation.

1 2 3 4 5 6 7 8 9

10 11 12

IHGFEDCBA Tax on Stock ReturnTax on Stock ReturnT

Range names used: Amount $B$3=detsevni_tnuomA000,01$detsevni

$B$4=naeM%5naeM $B$5=vedtS%14vedtS

Tax $B$6=etar_xaT%33etar

Probability Probability of no tax

he pays at least $400 in taxes 0.305 0.360

=1-NORM.DIST(400/(Amount_invested*Tax_rvested*Tax_rvested*T ate),Mean,Stdev,ate),Mean,Stdev,ate),Mean,Stdev TRUE) =NORM.DIST(0,Mean,Stdev,ev,ev TRUE)

90th percen�le of stock return 22.94% =NORM.INV(0.9,Mean,Stdev) 90th percen�le of a�er-tax return $1,537 =(1-Tax_r-Tax_r-T ate)*Amount_invested*B10

Figure 5.11 Calculations for Taxable Returns Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 183

Because this formula uses the RAND function, it generates a different random number different random number different each time it is used—and each time the spreadsheet recalculates.4

different 4 different

The spreadsheet in Figure 5.12 shows a simulation of yearly demands over a 12-year period. (See the file Oven Demand Simulation.xlsx.) To simulate the demands in row 15, enter the formula

=NORM.INV(RAND(),B6,B7)

in cell B15. Then enter the formula

=NORM.INV(RAND(),B15,$B$11)

in cell C15 and copy it across row 15. (Note how the mean demand in any year is the simulated demand from the previous year.) As the accompanying time series graph of these simulated demand from the previous year.) As the accompanying time series graph of these simulated demands indicates, the model seems to be performing well.

4To see why this formula makes sense, note that the RAND function in the �rst argument generates a uniformly distributed random value between 0 and 1. Therefore, the effect of the formula is to generate a random percentile from the normal distribution.

However, the simulated demands in Figure 5.12 are only one set of possible demands. Remember that each time the spreadsheet recalculates, all of the random numbers change. Figure 5.13 shows a different set of random numbers generated by the same formulas. Clearly, the model is not working well in this case—some demands are negative, which

1 A BA B C DC D E FE F G HG H I JI J K LK L M

Normal model for mul�period demand 2

3

4

5

6

7

8

9

Assump�ons of a tenta�ve model

Demand in year 1 (normally distributed) Mean 5n 5000 Stdev 1v 1500

Demand in other years (normally distributed)

11

10

12

13

14

15

16

17

18

Mean Stdev 1v 1500

actual demand in previous year

Simulated demands YearYearY 1 2 3 4 5 6 7 8 9 10 11 12 Demand 4821 6208 7988 6623 8979 11405 11186 9557 6061 4949 3681 6626

1 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 8 5 1

1 2 3 4 5 6 7 8 9 10 11 11 2 3 4 5 6 7 81 2 3 4 5 6 7 8

19

20

21

22

23

24

25

26

27

28

v 1v 1

Time series of demand

Year

0

2000

4000

6000

8000

10000

12000

1 2 3 4 5 6 7 8 9 10 11 12

Figure 5.12 One Set of Demands for Model 1 in the Microwave Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

184 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

makes no sense. The problem is that if the actual demand is low in one year, there is a fairly good chance that the next normally distributed demand will be negative. You can check (by recalculating many times) that the demand sequence is usually all positive, but every now and then a nonsense sequence as in Figure 5.13 appears. We need a new model!

One way to modify the model is to let the standard deviation and mean move together. That is, if the mean is low, then the standard deviation will also be low. This minimizes the chance that the next random demand will be negative. Besides, this type of model is probably more next random demand will be negative. Besides, this type of model is probably more next realistic. If demand in one year is low, there could be less variability in next year’s demand. Figure 5.14 illustrates one way (but not the only way) to model this changing standard deviation.

We let the standard deviation of demand in any year (after year 1) be the original standard deviation, 1500, multiplied by the ratio of the expected demand for this year to the expected demand in year 1. For example, if demand in some year is 500, the expected demand next year is 500, and the standard deviation of next year’s demand is reduced to 1500(500/5000) = 150. The only change to the spreadsheet model is in row 15, where cell C15 contains the formula

=NORM.INV(RAND(),B15,$B$7*B15/$B$6)

and is copied across row 15. Now the chance of a negative demand is practically negligible because this would require a value more than three standard deviations below the mean.

Unfortunately, the model in Figure 5.14 is still not foolproof. By recalculating many times, negative demands still appear occasionally. To be even safer, it is possible to truncate the demand distribution at some nonnegative value such as 250, as shown in Figure 5.15. Now a random demand is generated as in the previous model, but if this randomly gener- ated value is below 250, it is replaced by 250. This is done with the formulas

=MAX(NORM.INV(RAND(),B8,B9),D5)

and

=MAX(NORM.INV(RAND(),B17,$B$9*B17/$B$8),$D$5)

in cells B17 and C17 and copying this latter formula across row 17. Whether this is the way the demand process works for Highland’s microwaves is an open question,

A BA B C DC D E FE F G HG H I JI J K LK L M 13

14

15

16

17

18

Simulated demands Year 1 2 3 4 5 6 7 8 9 10 11 12 Demand 5732 7750 6331 4884 2519 3516 2600 391 820 581 479 147

1 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 8 9 10 11 1 9 1

1 2 3 4 5 6 7 81 2 3 4 5 6 7 8

19

20

21

22

23

24

25

26

27

28

Time series of demand

YearYearY

–2000

0

2000

4000

6000

8000

10000

1 2 3 4 5 6 7 8 9 10 11 12

Figure 5.13 Another Set of Demands for Model 1 in the Microwave Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 185

but at least it prevents demands from becoming negative—or even falling below 250. Moreover, this type of truncation is a common way of modeling when you want to use a normal distribution but for physical reasons cannot allow the random quantities to become negative.

Before leaving this example, we challenge your intuition. In the final model in Figure 5.15, the demand in any year (say, year 6) is, aside from the truncation, normally distributed with a mean and standard deviation that depend on the previous year’s demand. Does this mean that if you recalculate many times and keep track of the year 6 demand each time, the resulting histogram of these year 6 demands will be normally distributed? Perhaps surprisingly, the answer is a clear no. Evidence of this appears in Figures 5.16 and 5.17. In Figure 5.16 we use a data table to obtain 400 replications of demand in year 6 (in column B). Then we create a histogram of these simulated demands in Figure 5.17. It is clearly skewed to the right and nonnormal.

What causes this distribution to be nonnormal? It is not the truncation. Truncation has not the truncation. Truncation has not a relatively minor effect because most of the demands don’t need to be truncated. The real reason is that the distribution of year 6 demand is only normal conditional on the demand conditional on the demand conditional in year 5. That is, if we fix the demand in year 5 at any level and then replicate year 6 demand many times, the resulting histogram is normally shaped. But the year 5 demand is not fixed. It varies from replication to replication, and this variation causes the skewness in not fixed. It varies from replication to replication, and this variation causes the skewness in not Figure 5.17. Admittedly, the reason for this skewness is not intuitively obvious, but simula- tion makes it easy to demonstrate. ■

1 A BA B C DC D E FE F G HG H I JI J K LK L M

Normal model for mul�period demand 2

3

4

5

6

7

8

9

Assump�ons of a "safer" model

Demand in year 1 (normally distributed) Mean 5000 Stdev 1500

Demand in other years (normally distributed) 10

11

12

13

14

15

16

17

18

Mean actual demand in previous year Stdev 1500 �mes ra�o of previous year's actual demand to year 1's mean demand

Simulated demands YearYearY 1 2 3 4 5 6 7 8 9 10 11 12 Demand 7642 7061 7767 6841 8242 6231 9162 7619 8524 9670 10236 7575

1 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 8 9 10 11 11 2 3 4 5 6 7 81 2 3 4 5 6 7 8

19

20

21

22

23

24

25

26

2727272727

28

Time series of demand

YearYearY

0

2000

4000

6000

8000

10000

12000

1 2 3 4 5 6 7 8 9 10 11 12

Figure 5.14 Generated Demands for Model 2 in Microwave Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

186 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

1 A BA B C DC D E FE F G HG H I JI J K LK L M

Normal model for mul�period demand 2

3

4

5

6

7

8

9

10

Assump�ons of an even "safer" modelAssump�ons of an even "safer" modelAssump�ons of an even "saf

Minimum demand in any year 250

Demand in year 1 (truncated normal) Mean 5000 Stdev 1500

11

12

13

14

15

16

17

18

19

Demand in other years (truncated normal) Mean actual demand in previous year Stdv 1500 �mes ra�o of previous year's actual demand to year 1's mean demand

Simulated demands Year 1 2 3 4 5 6 7 8 9 10 11 12 Demand 3384 3607 3237 3684 3889 5309 5069 3375 1069 673 725 1063

n a

3 4 5 6 7 83 4 5 6 7 83 4 5 6 7 83 4 5 6 7 83 4 5 6 7 8 9 10 11 11 2

20

21

22

23

24

25

26

27

28

29

30

31

32

Time series of demand

YearYearY

0

1000

2000

3000

4000

5000

6000

1 2 3 4 5 6 7 8 9 10 11 12

Figure 5.15 Generated Demands for a Truncated Model in Microwave Example

© C

e n g

a g

e L

e a rn

in g

Figure 5.16 Replication of Demand in Year 6

A BA B C DC D E

36

37

34

35

38

39

40

41

42

Replica�on

Simula�ng the demand in year 6 with a data table

Demand 1775 1027 8651 6212 2769 3813 3506

548 1108 2099

Average 5236 1 S10271 S1027 tdev 45351 S1 S1 S

434

435

436

437

2 3 4 5

397 398 399 400

1 S

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 187

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www .cengagebrain.com.

Level A 1. The grades on the midterm examination given in a

large managerial statistics class are normally dis- tributed with mean 75 and standard deviation 9. The instructor of this class wants to assign an A grade to the top 10% of the scores, a B grade to the next 10% of the scores, a C grade to the next 10% of the scores, a D grade to the next 10% of the scores, and an F grade to all scores below the 60th percentile of this distribu- tion. For each possible letter grade, find the lowest acceptable score within the established range. For example, the lowest acceptable score for an A is the score at the 90th percentile of this normal distribution.

2. Suppose it is known that the distribution of purchase amounts by customers entering a popular retail store is approximately normal with mean $75 and standard deviation $20. a. What is the probability that a randomly selected

customer spends less than $85 at this store? b. What is the probability that a randomly selected

customer spends between $65 and $85 at this store?

c. What is the probability that a randomly selected customer spends more than $45 at this store?

d. Find the dollar amount such that 75% of all customers spend no more than this amount.

e. Find the dollar amount such that 80% of all customers spend at least this amount.

f. Find two dollar amounts, equidistant from the mean, such that 90% of all customer purchases are between these values.

3. A machine used to regulate the amount of a certain chemical dispensed in the production of a particular type of cough syrup can be set so that it discharges an average of μ milliliters (ml) of the chemi- cal in each bottle of cough syrup. The amount of chemical placed into each bottle of cough syrup is known to have a normal distribution with a standard deviation of 0.250 ml. If this machine discharges more than 2 ml of the chemical when preparing a given bottle of this cough syrup, the bottle is con- sidered to be unacceptable by industry standards. Determine the setting for μ so that no more than 1% of the bottles of cough syrup prepared by this machine will be rejected.

Model 3 Histogram

[25 3,2

05 3]

[20 53

,38 53

]

[38 53

,56 53

]

[56 53

,74 53

]

[74 53

,92 53

]

[92 53

,11 05

3]

[11 05

3,1 28

53 ]

[14 65

3,1 64

53 ]

[12 85

3,1 46

53 ]

[16 45

3,1 82

53 ]

[18 25

3,2 00

53 ]

[20 05

3,2 18

53 ]

[21 85

3,2 36

53 ]

[23 65

3,2 54

53 ]

[25 45

3,2 72

53 ]

120

100

80

60

40

20

0

Figure 5.17 Histogram of Year 6 Demands

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

188 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

4. Assume that the monthly sales for Toyota passenger cars follow a normal distribution with mean 5000 cars and standard deviation 1400 cars. a. There is a 1% chance that Toyota will sell

more than what number of passenger cars during the next year? (You can assume that sales in different months are probabilistically independent.)

b. What is the probability that Toyota will sell between 55,000 and 65,000 passenger cars during the next year?

5. An investor has invested in nine different investments. The dollar returns on the different investments are probabilistically independent, and each return follows a normal distribution with mean $50,000 and standard deviation $10,000. a. There is a 1% chance that the total return on the

nine investments is less than what value? b. What is the probability that the investor’s total

return is between $400,000 and $520,000?

6. Scores on an exam appear to follow a normal distribu- tion with μ = 60 and σ = 20. The instructor wishes to give a grade of D to students scoring between the 10th and 30th percentiles on the exam. For what range of scores should a D be given? What percentage of the students will get a D?

7. Suppose that the weight of a typical American male follows a normal distribution with μ = 180 lb and σ = 30 lb. Also, suppose 91.92% of all American males weigh more than I weigh. a. What fraction of American males weigh more than

225 pounds? b. How much do I weigh? c. If I weighed 20 pounds more than I do, what

percentile would I be in?

8. Assume that the length of a typical televised baseball game, including all the commercial time- outs, is normally distributed with mean 2.45 hours and standard deviation 0.37 hour. Consider a tel- evised baseball game that begins at 2:00 in the afternoon. The next regularly scheduled broadcast is at 5:00. a. What is the probability that the game will cut into

the next show, that is, go past 5:00? b. If the game is over before 4:30, another half-hour

show can be inserted into the 4:30–5:00 slot. What is the probability of this occurring?

9. The amount of a soft drink that goes into a typical 12-ounce can varies from can to can. It is normally distributed with an adjustable mean μ and a fixed standard deviation of 0.05 ounce. (The adjustment is made to the filling machine.) a. If regulations require that cans have at least 11.9

ounces, what is the smallest mean μ that can be

used so that at least 99.5% of all cans meet the regulation?

b. If the mean setting from part a is used, what is the probability that a typical can has at least 12 ounces?

10. Suppose that the demands for a company’s product in weeks 1, 2, and 3 are each normally distributed. The means are 50, 45, and 65. The standard deviations are 10, 5, and 15. Assume that these three demands are probabilistically independent. a. Suppose that the company currently has 180 units

in stock, and it will not be receiving any more shipments from its supplier for at least three weeks. What is the probability that stock will run out during this three-week period?

b. How many units should the company currently have in stock so that it can be 98% certain of not running out during this three-week period? Again, assume that it won’t receive any more shipments during this period.

Level B 11. Matthew’s Bakery prepares peanut butter cookies for

sale every morning. It costs the bakery $0.50 to bake each peanut butter cookie, and each cookie is sold for $1.25. At the end of the day, leftover cookies are discounted and sold the following day at $0.40 per cookie. The daily demand (in dozens) for peanut butter cookies at this bakery is known to be normally distrib- uted with mean 200 and standard deviation 60. The manager of Matthew’s Bakery is trying to determine how many dozen peanut butter cookies to make each morning to maximize the product’s contribution to bakery profits. Use simulation to find a very good, if not optimal, production plan.

12. The manufacturer of a particular bicycle model has the following costs associated with the management of this product’s inventory. In particular, the company currently maintains an inventory of 1000 units of this bicycle model at the beginning of each year. If X units X units X are demanded each year and X is less than X is less than X 1000, the excess supply, 1000 − X units, must be stored until next X units, must be stored until next X year at a cost of $50 per unit. If X is greater than X is greater than X 1000 units, the excess demand, X − 1000 units, must be pro- duced separately at an extra cost of $80 per unit. Assume that the annual demand (X) for this bicycle model is normally distributed with mean 1000 and standard deviation 75. a. Find the expected annual cost associated with

managing potential shortages or surpluses of this product. (Hint: Use simulation to approximate the answer. An exact solution using probability arguments is beyond the level of this book.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-3 Applications of the Normal Distribution 189

b. Find two annual total cost levels, equidistant from the expected value found in part a, such that 95% of all costs associated with managing potential shortages or surpluses of this product are between these values. (Continue to use simulation.)

c. Comment on this manufacturer’s annual production policy for this bicycle model in light of your findings in part b.

13. Suppose that a particular production process fills detergent in boxes of a given size. Specifically, this process fills the boxes with an amount of detergent (in ounces) that is normally distributed with mean 50 and standard deviation 0.5. a. Simulate this production process for the filling

of 500 boxes of detergent. Find the mean and standard deviation of your simulated sample weights. How do your sample statistics compare to the theoretical population parameters in this case? How well do the empirical rules apply in describing the variation in the weights in your simulated detergent boxes?

b. A box of detergent is rejected by quality control personnel if it is found to contain less than 49 ounces or more than 51 ounces of detergent. Given these quality standards, what proportion of all boxes are rejected? What step(s) could the supervisor of this production process take to reduce this proportion to 1%?

14. It is widely known that many drivers on interstate high- ways in the United States do not observe the posted speed limit. Assume that the actual rates of speed driven by U.S. motorists are normally distributed with mean μ mph and standard deviation 5 mph. Given this information, answer each of the following independent questions. (Hint: Use Goal Seek in parts a and b, and use the Solver add-in with no objective in part c. Solver is usually used to optimize, but it can also be used to solve equations with multiple unknowns.) a. If 40% of all U.S. drivers are observed traveling at

65 mph or more, what is the mean μ? b. If 25% of all U.S. drivers are observed traveling at

50 mph or less, what is the mean μ? c. Suppose now that the mean μ and standard deviation μ and standard deviation μ σ

of this distribution are both unknown. Furthermore, it is observed that 40% of all U.S. drivers travel at less than 55 mph and 10% of all U.S. drivers travel at more than 70 mph. What must 0 mph. What must 0 μ and μ and μ σ be?

15. The lifetime of a certain manufacturer’s wash- ing machine is normally distributed with mean 4 years. Only 15% of all these washing machines last at least 5 years. What is the standard deviation of the lifetime of a washing machine made by this manufacturer?

16. You have been told that the distribution of regular unleaded gasoline prices over all gas stations in Indiana is normally distributed with mean $3.25 and standard deviation $0.075, and you have been asked to find two dollar values such that 95% of all gas stations charge somewhere between these two values. Why is each of the following an acceptable answer: between $3.076 and $3.381, or between $3.103 and $3.397? Can you find any other accept- able answers? Which of the many possible answers would you give if you are asked to obtain the short- est interval?est interval?est

17. A fast-food restaurant sells hamburgers and chicken sandwiches. On a typical weekday the demand for hamburgers is normally distributed with mean 313 and standard deviation 57; the demand for chicken sandwiches is normally distributed with mean 93 and standard deviation 22. a. How many hamburgers must the restaurant

stock to be 98% sure of not running out on a given day?

b. Answer part a for chicken sandwiches. c. If the restaurant stocks 400 hamburgers and 150

chicken sandwiches for a given day, what is the probability that it will run out of hamburgers or chicken sandwiches (or both) that day? Assume that the demand for hamburgers and the demand for chicken sandwiches are probabilistically independent.

d. Why is the independence assumption in part c probably not realistic? Using a more realistic assumption, do you think the probability requested in part c would increase or decrease?

18. Referring to the box plots introduced in Chapter 2, the sides of the “box” are at the first and third quartiles, and the difference between these (the length of the box) is called the interquartile range (IQR). A mild outlier is an observation that is mild outlier is an observation that is mild between 1.5 and 3 IQRs from the box, and an extreme outlier is an observation that is more than 3 IQRs from the box. a. If the data are normally distributed, what

percentage of values will be mild outliers? What percentage will be extreme outliers? Why don’t the answers depend on the mean and/or standard deviation of the distribution?

b. Check your answers in part a with simulation. Simulate a large number of normal random numbers (you can choose any mean and standard deviation), and count the number of mild and extreme outliers with appropriate formulas. Do these match, at least approximately, your answers to part a?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

190 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

5-4 THE BINOMIAL DISTRIBUTION The normal distribution is undoubtedly the most important probability distribution in sta- tistics. Not far behind, however, is the binomial distribution. The binomial distribution. The binomial binomial distribution is a discrete distribution that can occur in two situations: (1) when sampling from a popu- lation with only two types of members (males and females, for example), and (2) when performing a sequence of identical experiments, each of which has only two possible outcomes.

Imagine any experiment that can be repeated many times under identical conditions. It is common to refer to each repetition of the experiment as a trial. We assume that the outcomes of successive trials are probabilistically independent of one another and that each trial has only two possible outcomes. We label these two possibilities generically as success and failure. In any particular application the out- comes might be Democrat/Republican, defective/ nondefective, went bankrupt/remained solvent, and so on. We label the probability of a success on each trial as p, and the probability of a failure as 1 − p. We let n be the number of trials.

For example, the binomial distribution with parameters 100 and 0.3 is the distribu- tion of the number of successes in 100 trials when the probability of success is 0.3 on each trial. A simple example that you can keep in mind throughout this section is the number of heads you would see if you �ipped a coin n times. Assuming the coin is well balanced, the relevant distribution is binomial with parameters n and p = 0.5. This coin- �ipping example is often used to illustrate the binomial distribution because of its simplic- ity, but you will see that the binomial distribution also applies to many important business situations.

To understand how the binomial distribution works, consider the coin-�ipping example with n = 3. If X represents the number of heads in three �ips of the coin, then the possible X represents the number of heads in three �ips of the coin, then the possible X values of X are X are X 0, 1, 2, and 3. You can �nd the probabilities of these values by considering the eight possible outcomes of the three �ips: (T,T,T), (T,T,H), (T,H,T), (H,T,T), (T,H,H), (H,T,H), (H,H,T), and (H,H,H). Because of symmetry (the well-balanced property of the coin), each of these eight possible outcomes must have the same probability, so each must have probability  1/8. Next, note that one of the outcomes has X = 0, three outcomes have X = 1, three outcomes have X = 2, and one outcome has X = 3. Therefore, the probability distribution of X isX isX

P(X = 0) = 1/8, P(X = 1) = 3/8, P(X = 2) = 3/8, P(X = 3) = 1/8

What the Binomial Distribution Describes Unlike the normal distribution, which can describe many types of random phenomena, the binomial dis- tribution is relevant for a very common and specific situation: the number of successes in a fixed number of trials, where the trials are probabilistically independent and the probability of success remains constant across trials. Whenever this situation occurs, the binomial dis- tribution is the relevant distribution for the number of successes.

Fundamental Insight

Consider a situation where there are n independent, identical trials, where the probability of a success on each trial is p and the probability of a failure is 1 − p. Define X to be the random number of successes in the X to be the random number of successes in the X n trials. Then X has a binomial distribution with parameters n and p.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-4 The Binomial Distribution 191

This is a special case of the binomial distribution, with n = 3 and p = 0.5. In general, where n can be any positive integer and p can be any probability between 0 and 1, there is a rather complex formula for calculating P (X = k) for any integer k from k from k 0 to n. Instead of presenting this formula, we will discuss how to calculate binomial probabilities in Excel. You do this with the BINOM.DIST function. The general form of this function is

= BINOM.DIST(k, n, p,cum)

The middle two arguments are the number of trials n and the probability of success p on each trial. The �rst parameter k is an integer number of successes that you specify. The last parameter, cum, is either TRUE or FALSE. It is TRUE (or 1) if you want the probability of less than or equal to k successes, and it is FALSE (or 0) if you want the probability of exactly k successes. We illustrate typical binomial calculations in Example 5.7.

CHANGES IN EXCEL 2010

As with the new normal functions, new binomial functions were introduced in Excel 2010. The BINOMDIST and CRITBINOM functions in the following example have been replaced by BINOM.DIST and BINOM.INV, but the old functions still work fine. Both versions are indicated in the file for the following example.

E X A M P L E 5.7 BINOMIAL CALCULATIONS IN EXCEL

Suppose that 100 identical batteries are inserted in identical flashlights. Each flashlight takes a single battery. After eight hours of continuous use, a given battery is still operating with probability 0.6 or has failed with probability 0.4. Let X be the number of successes in these 100 trials, where a success means that the battery is still functioning. Find the probabilities of the following events: (a) exactly 58 successes, (b) no more than 65 successes, (c) less than 70 successes, (d) at least 59 successes, (e) greater than 65 successes, (f) between 55 and 65 successes (inclusive), (g) exactly 40 failures, (h) at least 35 failures, and (i) less than 42 failures. Then find the 95th percentile of the distribution of X.

Objective To use Excel’s BINOM.DIST and BINOM.INV functions for calculating binomial probabilities and percentiles.

Solution Figure 5.18 shows the solution to all of these problems. (See the file Binomial Calculations. xlsx.) The probabilities requested in parts (a) through (f) all involve the number of successes X. The key to these is the wording of phrases such as “no more than,” “greater than,” and so on. In particular, you have to be careful to distinguish between probabilities such as P(X < k) and P(X ≤ k). The latter includes the possibility of having X = k and the former does not.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

192 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

With this in mind, the probabilities requested in (a) through (f) become:

a. P(X = 58) b. P(X ≤ 65) c. P(X < 70) = P(X ≤ 69) d. P(X ≥ 59) = 1 − P(X < 59) = 1 − P(X ≤ 58) e. P(X > 65) = 1 − P(X ≤ 65) f. P(55 ≤ X ≤ 65) = P(X ≤ 65) − P(X < 55) = P(X ≤ 65) − P(X ≤ 54)

Note how we have manipulated each of these so that it includes only terms of the form P(X = k) or P(X ≤ k) for suitable values of k. These are the types of probabilities that can be handled directly by the BINOM.DIST function. The answers appear in the range B7:B12, and the corresponding formulas are shown (as labels) to their right.

The probabilities requested in (g) through (i) involve failures rather than successes. But because each trial results in either a success or a failure, the number of failures is also binomially distributed, with parameters n and 1 − p = 0.4. So in rows 14 through 16 the requested probabilities are calculated in exactly the same way, except that 1-p-p- is substituted for p in the third argument of the BINOM.DIST function.

Finally, to calculate the 95th percentile of the distribution of X, you can proceed by trial and error. For each value k from 65 to 70, the probability P(X ≤ k) is cal- culated in column B with the BINOM.DIST function. Note that there is no value k such that P(X ≤ k) = 0.95 exactly. Specifically, P(X ≤ 67) is slightly less than 0.95 and P(X ≤ 68) is slightly greater than 0.95. Therefore, the meaning of the “95th percentile” is somewhat ambiguous. If you want the largest value k such that P(X ≤ k) ≤ 0.95, then this k is 67. If instead you want the smallest value k such that P(X ≤ k) ≥ 0.95, then this value is 68. The latter interpretation is the one usually accepted for binomial percentiles.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

JIHGFEDCBA Binomial Probability Calcula�ons

Range names used: n =$B$3 p =$B$4

Formula using “new” func�ons (Excel 2010 or later) =BINOM.DIST(58,n,p, FALSE) =BINOM.DIST(65,n,p,TRUE) =BINOM.DIST(69,n,p,TRUE) =1-BINOM.DIST(58,n,p,TRUE) =1-BINOM.DIST(65,n,p,TRUE) =BINOM.DIST(65,n,p,TRUE)-BINOM.DIST(54,n,p,TRUE)

=BINOM.DIST(40,n,1-p,FALSE=BINOM.DIST(40,n,1-p,FALSE=BINOM.DIST(40,n,1-p,F ) =1-BINOM.DIST(34,n,1-p,TRUE) =BINOM.DIST(41,n,1-p,TRUE)

=BINOM.DIST(A20,n,p,TRUE) (Copy down)

Formula in cell A27: =BINOM.INV(n,p,B27)

Formula using “old” func�ons (which s�ll work) =BINOMDIST(58,n,p,FALSE) =BINOMDIST(65,n,p,TRUE) =BINOMDIST(69,n,p,TRUE) =1-BINOMDIST(58,n,p,TRUE) =1-BINOMDIST(65,n,p,TRUE) =BINOMDIST(65,n,p,TRUE)-BINOMDIST(54,n,p,TRUE)

=BINOMDIST(40,n,1-p, FALSE) =1-BINOMDIST(34,n,1-p,TRUE) =BINOMDIST(41,n,1-p,TRUE)

=BINOMDIST(A20,n,p,TRUE) (Copy down)

Formula in cell A27: =CRITBINOM(n,p,B27)

Number of 001slairt Probability of success on each trial 0l 0.6

ytilibaborPtnevE Exactly 58 28 248 28 278 28 208 28 2.8 28 208 28 2s8 28 2e8 28 2s8 28 2s8 28 2e8 28 2c8 28 2c8 28 2u8 28 2s8 2 No more than 65 7968.0sesseccus Less than 70 2579.0sesseccus At least 59 59 529 59 529 59 569 59 5.9 59 509 59 5s9 59 5e9 59 5s9 59 5s9 59 5e9 59 5c9 59 5c9 59 5u9 59 5s9 5 Greater than 65 3031.0sesseccus Between 55 and 65 successes (inclusive) 0.7386

Exactly 40 20 210 20 280 20 200 20 2.0 20 200 20 2s0 20 2e0 20 2r0 20 2u0 2l0 2l0 2i0 2i0 20 2a0 2f0 2f0 2 At least 35 795 795 765 765 785 785 75 7.5 705 705 75 7s5 75 7e5 75 7r5 75 7u5 7l5 7l5 7i5 7i5 75 7a5 7f5 7f5 7 Less than 42 5226.0seruliaf

Finding the 95th percen�le (trial and error) Trial values CumProb

65 0.8697 66 0.9087 67 0.9385 68 0.9602 69 0.9752 70 0.9852

68 0.95

n =$B$3 p =$B$4

8 2

9 5

0 2 5 7

K L M

Figure 5.18 Typical Binomial Calculations

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-4 The Binomial Distribution 193

The formula for the mean is quite intuitive. For example, if you observe 100 trials, each with probability of success 0.6, your best guess for the number of successes is 100(0.6) = 60. The standard deviation is less obvious but still very useful. It indicates how far the actual number of successes is likely to deviate from the mean. In this case the standard deviation is !100(0.6) (0.4)! = 4.90.

Fortunately, the empirical rules discussed in Chapter 2 also apply, at least approxi- mately, to the binomial distribution. That is, there is about a 95% chance that the actual number of successes will be within two standard deviations of the mean, and there is almost no chance that the number of successes will be more than three standard deviations from the mean. So for this example, it is very likely that the number of successes will be in the range of approximately 50 to 70, and it is very unlikely that there will be fewer than 45 or more than 75 successes.

This reasoning is extremely useful. It provides a rough estimate of the number of successes you are likely to observe. Suppose 1000 parts are sampled randomly from an assembly line and, based on historical performance, the percentage of parts with some type of defect is about 5%. Translated into a binomial model, each of the 1000 parts, indepen- dently of the others, has some type of defect with probability 0.05. Would it be surprising to see, say, 75 parts with a defect? The mean is 1000(0.05) = 50 and the standard deviation is !1000(0.05) (0.95)! = 6.89. Therefore, the number of parts with defects is approximately 95% certain to be within 50 ± 2(6.89), or approximately from 36 to 64. Because 75 is slightly beyond three standard deviations from the mean, it is highly unlikely that there would be 75 (or more) defective parts.

5-4b The Binomial Distribution in the Context of Sampling

We now discuss how the binomial distribution applies to sampling from a population with two types of members. Let’s say these two types are men and women, although in applica- tions they might be Democrats and Republicans, users of our product and nonusers, and

5-4a Mean and Standard Deviation of the Binomial Distribution

It can be shown that the mean and standard deviation of a binomial distribution with param- eters n and p are given by the following equations.

Mean and Standard Deviation of the Binomial Distribution E(X)X)X = npnpn (5.3)

Stdev(X)X)X = !n!n! pnpn (1 − p)! (5.4)

In fact, Excel has another built-in function, BINOM.INV (or the old CRITBINOM function) for finding this value of k. This function is illustrated in row 27 of Figure 5.18. in cell A27. This BINOM.INV function returns 68, the smallest value k such that P(X ≤ k) ≥ 0.95 for this binomial distribution. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

194 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

so on. We assume that the population has N members, of whom N members, of whom N NMNMN are men and NWNWN are women (where NMNMN + NWNWN = N). If you sample n of these randomly, you are typically inter- ested in the composition of the sample. You might expect the number of men in the sample to be binomially distributed with parameters n and p = NMNMN /N/N/ , the fraction of men in the population. However, this depends on how the sampling is performed.

If sampling is done without replacement, each member of the population can be sampled only once. That is, once a person is sampled, his or her name is struck from the list and cannot be sampled again. If sampling is done with replacement, then it is possible, although maybe not likely, to select a given member of the population more than once. Most real-world sampling is performed without replacement. There is no without replacement. There is no without point in obtaining information from the same person more than once. However, the binomial model applies only to sampling with replacement. Because the composition of the remaining population keeps changing as the sampling progresses, the binomial model provides only an approximation if sampling is done without replacement. If there is no replacement, the value of  p, the proportion of men in this case, does not stay constant, a requirement of the binomial model. The appropriate distribution for sampling without replacement is called the hypergeometric distribution, a distribution we will not discuss here.5 sampling without replacement is called the

5 sampling without replacement is called the

If n is small relative to N, however, the binomial distribution is a very good approxi- mation to the hypergeometric distribution and can be used even if sampling is performed without replacement. A rule of thumb is that if n is no greater than 10% of N, that is, no more than 10% of the population is sampled, then the binomial model can be used safely. Of course, most national polls sample considerably less than 10% of the population. In fact, they often sample only about a thousand people from the hundreds of millions in the entire population. The bottom line is that in most real-world sampling contexts, the binomial model is perfectly adequate.

5-4c The Normal Approximation to the Binomial

If you graph the binomial probabilities, you will see an interesting phenomenon— namely, the graph begins to look symmetric and bell-shaped when n is fairly large and p is not too close to 0 or 1. An example is illustrated in Figure 5.19 with the parameters n = 30 and p = 0.4. Generally, if npnpn > 5 and n(1–p–p– ) > 5, the binomial distribution can be approximated well by a normal distribution with mean npnpn and standard deviation !n!n! pnpn (1 − p)! .

One practical consequence of the normal approximation to the binomial is that the empirical rules can be applied. That is, when the binomial distribution is approximately symmetric and bell-shaped, there is about a 68% chance that the number of successes will be within one standard deviation of the mean. Similarly, there is about a 95% chance that the number of successes will be within two standard deviations of the mean, and the num- ber of successes will almost surely be within three standard deviations of the mean. Here, the mean is npnpn and the standard deviation is !n!n! pnpn (1 − p)! . Excel Tip: Continuity Correction Because the normal distribution is continuous and the binomial distribution is discrete, the nor- mal approximation to the binomial can be improved slightly with a continuity correction. If you want to approximate a binomial probability such as P(36 ≤ X ≤ 45), expand the interval by

If n is large and p is not too close to 0 or 1, the binomial distribution is bell-shaped and can be approximated well by the normal distribution.

5Excel has a function HYPGEOM.DIST for sampling without replacement that works much like the BINOM. DIST function. You can look it up under the Statistical category of Excel functions.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 195

0.5 on each end in the normal approximation. That is, approximate with the normal probability P(35.5 ≤ X ≤ 45.5). Similarly, approximate binomial P(X(X( ≤ 45) with normal P(X(X( ≤ 45.5), or binomial P(X(X( ≥ 36) with normal P(X(X( ≥ 35.5). Admittedly, this continuity correction is mostly of historical interest. With Excel’s Binomial functions, there is no need to resort to a normal approximation.

5-5 APPLICATIONS OF THE BINOMIAL DISTRIBUTION The binomial distribution �nds many applications in the business world and elsewhere. We discuss a few typical applications in this section.

E X A M P L E 5.8 IS THIS MUTUAL FUND REALLY A WINNER?

An investment broker at the Michaels & Dodson Company claims that he has found a real winner. He has tracked a mutual fund that has beaten a standard market index in 37 of the past 52 weeks. Could this be due to chance, or has he really found a winner?

Objective To determine the probability of a mutual fund outperforming a standard mar- ket index at least 37 out of 52 weeks.

Relationship Between Normal and Binomial Distributions If you look at a graph of a binomial distribution when n is fairly large and p is not too close to 0 or 1, you will see that the distribution is bell-shaped. This is no accident. It can be proven mathematically that the nor-accident. It can be proven mathematically that the nor-accident. It can be proven mathematically that the nor mal distribution provides a very good approximation very good approximation very

to the binomial under these conditions (n large, p not too close to 0 or 1). One implication is that the empir-). One implication is that the empir-). One implication is that the empir ical rules from Chapter 2 apply very well to binomial distributions, using the mean and standard deviation in Equations (5.3) and (5.4). For example, there is about a 95% chance that the number of successes will be within two standard deviations of the mean.

F u n da m e n ta l I n s i g h t

Figure 5.19 Bell-shaped Binomial Distribution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

196 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Solution The broker is no doubt tracking a lot of mutual funds, and he is probably reporting only the best of these. Therefore, we will check whether the best of many mutual funds could do at least this well purely by chance. To do this, we first specify what we mean by “purely by chance.” This means that each week, a given fund has a fifty-fifty chance of beat- ing the market index, independently of performance in other weeks. In other words, the number of weeks where a given fund outperforms the market index is binomially dis- tributed with n = 52 and p = 0.5. With this in mind, cell B6 of Figure 5.20 shows the probability that a given fund does at least as well—beats the market index at least 37 out of 52 weeks—as the reported fund. (See the Beating the Market.xlsx file.) Because P(X ≥ 37) = 1 − P(X ≤ 36), the relevant formula is

=1–BINOM.DIST(B3−1,B4,0.5,TRUE)

Obviously, this probability, 0.00159, is quite small. A single fund isn’t likely to beat the market this often purely by chance.

However, the probability that the best of many mutual funds does at least this well is best of many mutual funds does at least this well is best much larger. To calculate this probability, assume that 400 funds are being tracked, and let Y be the number of these that beat the market at least Y be the number of these that beat the market at least Y 37 of 52 weeks. Then Y is also bino- mially distributed, with parameters n = 400 and p = 0.00159, the probability calculated previously. To see whether any of the 400 funds beats the market at least 37 of 52 weeks, calculate P(Y ≥ 1) = 1 – P(Y = 0) in cell B9 with the formula

=1–BINOM.DIST(0,B8,B7,TRUE)

1 2 3 4 5

6 7 8

9 10 11 12 13 14 15 16 17 18

A BA B C DC D E FE F G Bea�ng the market

Weeks bea�ng market index 3x 37 Total number of weeks 5s 52

Probability of doing at least this well by chance 0.00159 =1-BINOM.DIST(B3-1,B4,0.5,TRUE)

Number of mutual funds 400 Probability of at least one doing at least this well 0.471 =1-BINOM.DIST(0,B8,B6,TRUE)

Two-way data table of the probability in B9 as a func�on of values in B3 and B8 Number of weeks bea�ng the market index

0.471 36 37 38 39 40 Number of mutual funds 200 0.542 0.273 0.113 0.040 0.013

300 0.690 0.380 0.164 0.060 0.019 400 0.790 0.471 0.213 0.079 0.025 500 0.858 0.549 0.258 0.097 0.031 600 0.904 0.616 0.301 0.116 0.038

Figure 5.20 Binomial Calculations for Investment Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 197

E X A M P L E 5.9 DAILY SALES AT A SUPERMARKET

Customers at a supermarket spend varying amounts. Historical data indicate that the amount spent per customer is normally distributed with mean $85 and standard devia- tion $30. If 500 customers shop in a given day, calculate the mean and standard deviation of the number who spend at least $100. Then calculate the probability that at least 30% of all customers spend at least $100.

Objective To use the normal and binomial distributions to calculate the typical number and binomial distributions to calculate the typical number and of customers who spend at least $100 per day and the probability that at least 30% of all 500 daily customers spend at least $100.

Solution Both questions involve the number of customers who spend at least $100. Because the amounts spent are normally distributed, the probability that a typical customer spends at least $100 is found with the NORMDIST function. This probability, 0.309, appears in cell B7 of Figure 5.21. (See the file Supermarket Spending.xlsx.) It is calculated with the formula

=1-NORM.DIST(100,B4,B5,TRUE)

This probability is then used as the parameter p in a binomial model. The mean and stand- ard deviation of the number who spend at least $100 are calculated in cells B13 and B14 as npnpn and !n!n! pnpn (1 − p)! using n = 500, the number of shoppers, and p = 0.309. The expected number who spend at least $100 is slightly greater than 154, and the standard deviation of this number is slightly greater than 10.

To answer the second question, note that 30% of 500 customers is 150 customers. Then the probability that at least 30% of the customers spend at least $100 is the probabil- ity that a binomially distributed random variable, with n = 500 and p = 0.309, is at least 150. This binomial probability, which turns out to be about 2/3, is calculated in cell B16 with the formula

=1-BINOM.DIST(0.3*B10-1,B10,B7,TRUE)

Note that the first argument evaluates to 149. This is because the probability of at least 150 customers is one minus the probability of less than or equal to 149 customers. ■

(Can you see why the fourth argument could be TRUE or FALSE?) The resulting probabil- ity is nearly 0.5—that is, there is nearly a fifty-fifty chance that at least one of 400 funds will do as well as the reported fund. This certainly casts doubt on the broker’s claim that he has found a real winner. It is more likely that his star fund just got lucky and will perform no better than average in succeeding weeks.

To see how the probability in cell B9 depends on the level of success of the reported fund (the value in cell B3) and the number of mutual funds being tracked (in cell B8), a two-way data table has been created in the range B13:G18. (The formula in cell B13 is =B9, the row input cell is B3, and the column input cell is B8.) As you saw, beating the market 37 times out of 52 is no big deal with 400 funds, but beating it 40 times out of 52, even with 600 funds, is something worth reporting. The probability of this happening purely by chance is only 0.038, or less than 1 out of 25. ■

Example 5.9 requires a normal calculation to �nd a probability p, which is then used in a binomial calculation.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

198 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

E X A M P L E 5.10 OVERBOOKING BY AIRLINES

This example presents a simplified version of calculations used by airlines when they overbook flights. They realize that a certain percentage of ticketed passengers will cancel at the last minute. Therefore, to avoid empty seats, they sell more tickets than there are seats, hoping that just about the right number of passengers show up. We assume that the no-show rate is 10%. In binomial terms, we assume that each ticketed passenger, independently of the others, shows up with probability 0.90 and cancels with probability 0.10.

For a flight with 200 seats, the airline wants to see how sensitive various probabilities are to the number of tickets it issues. In particular, it wants to calculate (a) the probability that more than 205 passengers show up, (b) the probability that more than 200 passengers show up, (c) the probability that at least 195 seats are filled, and (d) the probability that at least 190 seats are filled. The first two of these are “bad” events from the airline’s perspec- tive; they mean that some customers will be bumped from the flight. The last two events are “good” in the sense that the airline wants most of the seats to be occupied.

Objective To assess the benefits and drawbacks of airline overbooking.

Solution To solve the airline’s problem, we use the BINOMDIST function and a data table. The solution appears in Figure 5.22. (See the file Airline Overbooking.xlsx.) For any number of tickets issued in cell B6, the required probabilities are calculated in row 10. For exam- ple, the formulas in cells B10 and D10 are

=1-BINOM.DIST(205,NTickets,1-PNoShow,TRUE)

and

=1-BINOM.DIST(194,NTickets,1-PNoShow,TRUE)

Figure 5.21 Calculations for Supermarket Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

FEDCBA

Supermarket spending

Amount spent per customer (normally distributed) $85Mean $30StDev

Probability that a customer spends at least $100 0.309 =1-NORM.DIST(100,B4,B5,TRUE)

Number of customers 0s 0s 00s 0s 05s 0

Mean and stdev of number who spend at least $100 =B10*B7154.27Mean =SQRT(B10*B7*(1-B7))10.33StDev

Probability at least 30% spend at least $100 0.676 =1-BINOM.DIST(0.3*B10-1,B10,B7,TRUE)

9 =

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 199

Note that the condition “more than” requires a slightly different calculation from “at  least.” The probability of more than 205 is one minus the probability of less than or equal to 205, whereas the probability of at least 195 is one minus the probability of less than or equal to 194. Also, note that a passenger who shows up is called a success. Therefore, the third argument of each BINOM.DIST function is one minus the no-show probability.

To see how sensitive these probabilities are to the number of tickets issued, a one-way data table was created at the bottom of the spreadsheet. It is one-way because there is only one input, the number of tickets issued, even though four output probabilities are tabulated. (To create the data table, list several possible numbers of tickets issued along the side in column A and create links in row 14 to the probabilities in row 10. That is, enter the for- mula =B10 in cell B14 and copy it across row 14. Then form a data table using the range A14:E24, no row input cell, and column input cell B6.)

The results are as expected. As the airline issues more tickets, there is a larger chance of having to bump passengers from the flight, but there is also a larger chance of filling most seats. In reality, the airline has to make a trade-off between these two, taking its vari- ous costs and prices into account. ■

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

A BA B C DC D E Airline overbooking Range names used:

NTickets =$B$6 Number of seats PNoShow002 =2 =PNoSho2 =PNoShow2 =w02 =002 =0 $B$4 Probability of no-show 0.1

Number of �ckets issued 215

Required probabili es More than 200

show up More than

205 show up At least 190

seats filled At least 195

seats filled

0.001 0.050 0.421 0.820

Data table showing sensi vity of probabili es to number of ckets issued

Number of �ckets issued More than

205 show up More than 200

show up At least 195

seats filled At least 190

seats filled 0.001 0.050 0.421 0.820

0.384

0.370 0.607

206 0.000 0.000 0.012 0.171 209 0.000 0.001 0.064 212 0.000 0.009 0.201 0.628 215 0.001 0.050 0.421 0.820 218 0.013 0.166 0.659 0.931 221 0.064 224 0.194 227 0.406 0.802 0.981 0.999 230 0.639 0.920 0.995 1.000 233 0.822 0.974 0.999 1.000

2 =2 =

6 0 9 0 2 0 5 0 8 0 1 0 4 0 7 0 0 0 3 0

0.9950.939 0.9780.839

Figure 5.22 Binomial Calculations for Overbooking Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

200 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

The following is another simpli�ed example of a real problem that occurs every time you watch election returns on TV. This problem is of particular interest in light of the highly unusual events that took place during election night television coverage of the U.S. presidential election in 2000, where the networks declared Al Gore an early winner in at least one state that he eventually lost. The basic question is how soon the networks can declare one of the candidates the winner, based on early voting returns. Our example is somewhat unrealistic because it ignores the possibility that early tabulations can be biased one way or the other. For example, the earliest reporting precincts might be known to be more heavily in favor of the Democrat than the population in general. Nevertheless, the example indicates, at least approximately, why the networks are able to make early conclu- sions based on such seemingly small amounts of data.

E X A M P L E 5.11 PROJECTING ELECTION WINNERS FROM EARLY RETURNS

We assume that there are We assume that there are W N voters in the population, of whom N voters in the population, of whom N NRNRN will vote for the Republican R will vote for the Republican Rand NDNDN will vote for the Democrat. The eventual winner will be the Republican if NRNRN > NDNDN and will be the Democrat otherwise, but we won’t know which until all of the votes are tabulated. (To simplify the example, we assume there are only two candidates and that the elec- tion will not end in a tie.) Let’s suppose that a small percentage of the votes have been counted not end in a tie.) Let’s suppose that a small percentage of the votes have been counted not and the Republican is currently ahead 540 to 0 to 0 460. On what basis can the networks declare the Republican the winner, especially if there are millions of voters in the population?

Objective To use a binomial model to determine whether early returns reflect the even- tual winner of an election between two candidates.

Solution Let n = 1000 be the total number of votes that have been tabulated. If X is the number of X is the number of X Republican votes so far, we are given that X = 540. Now we pose the following question. If the Democrat were going to be the eventual winner, that is, NDNDN > NRNRN , and we randomly sampled 1000 voters from the population, how likely is it that at least 540 of these vot- ers would be in favor of the Republican? If this is very unlikely, then the only reasonable conclusion is that the Democrat will not be the eventual winner. This is the reasoning the not be the eventual winner. This is the reasoning the not networks might use to declare the Republican the winner so early in the tabulation.

We use a binomial model to see how unlikely the event “at least 540 out of 1000 ” is, assuming that the Democrat will be the eventual winner. We need a value for p, the prob- ability that a typical vote is for the Republican. This probability should be the proportion of voters in the entire population who favor the Republican. All we know is that this prob- ability is less than 0.5, because we have assumed that the Democrat will eventually win. In assumed that the Democrat will eventually win. In assumed Figure 5.23, we show how the probability of at least 540 out of 1000 varies with values of p less than, but close to, 0.5. (See the file Election Returns.xlsx.)

We enter a trial value of 0.49 for p in cell B3 and then calculate the required probabil- ity in cell B9 with the formula

=1-BINOM.DIST(B6-1,B5,B3,TRUE)

Then we use this to create the data table at the bottom of the spreadsheet. This data table tabulates the probability of the given lead (at least 540 out of 1000) for various values of p less than 0.5. As shown in the last few rows, even if the eventual outcome were going to be a virtual tie—with the Democrat slightly ahead—there would still be very little chance of the Republican being at least 80 votes ahead so far. But because the Republican is cur- rently ahead by 80 votes, the networks feel safe in declaring the Republican the winner. Admittedly, the probability model they use is more complex than our simple binomial model, but the idea is the same. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 201

The �nal example in this section challenges the two assumptions of the binomial model. So far, we have assumed that the outcomes of successive trials have the same prob- ability p of success and are probabilistically independent. There are many situations where either or both of these assumptions are questionable. For example, consider successive items from a production line, where each item either meets speci�cations (a success) or doesn’t (a failure). If the process deteriorates over time, at least until it receives mainte- nance, the probability p of success will slowly decrease. But even if p remains constant, defective items could come in bunches (because of momentary inattentiveness on the part of a worker, say), which would invalidate the independence assumption.

If you believe that the binomial assumptions are invalid, then you must specify an alternative model that re�ects reality more closely. This is not easy—all kinds of nonbino- mial assumptions can be imagined. Furthermore, when you make such assumptions, there mial assumptions can be imagined. Furthermore, when you make such assumptions, there mial are probably no simple formulas to use, such as the BINOM.DIST formulas we have been using. Simulation might be the only (simple) alternative, as illustrated in Example 5.12.

E X A M P L E 5.12 SHOOTING STREAKS IN BASKETBALL

Do basketball players shoot in streaks? This question has been debated by thousands of basketball fans, and it has been studied statistically by academic researchers. Most fans believe the answer is yes, arguing that players clearly alternate between hot streaks where they can’t miss and cold streaks where they can’t hit the broad side of a barn. This situation does not fit a binomial model where, say, a “450 shooter” has a 0.450 probability of making each shot and a 0.550 probability of missing, independently of other shots. If the binomial model does not apply, what model is appropriate, and how could it be used

Figure 5.23 Binomial Calculations for Voting Example

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

FEDCBA Elec�on returns

Popula�on propor�on for Republican 0.49

Votes tabulated so far 1000 Votes for Republican so farepublican so farepublican so f 540

P(at least this many R votes) - binomial 0.0009 =1-BINOM.DIST(B6-1,B5,B3,TRUE)

Data table showing sensi�vity of this probability to popula�on propor�on for Republican Popula�on propor�on for Republican

0.0009 0.490 0.0009 0.492 0.0013 0.494 0.0020 0.496 0.0030 0.498 0.0043 0.499 0.0052

Probability

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

202 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

to calculate a typical probability such as the probability of making at least 13 shots out of 25 attempts?6 to calculate a typical probability such as the probability of making at least

6 to calculate a typical probability such as the probability of making at least

Objective To formulate a nonbinomial model of basketball shooting, and to use it to find the probability of a “450 shooter” making at least 13 out of 25 shots.

Solution This example is quite open-ended. There are numerous alternatives to the binomial model that could capture the “streakiness” most fans believe in, and the one we suggest here is by no means the only possibility. We challenge you to develop others.

The model we propose assumes that this shooter makes 45% of his shots in the long run. The probability that he makes his first shot in a game is 0.45. In general, consider his nth shot. If he has made his last k shots, we assume the probability of making shot k shots, we assume the probability of making shot k n is 0.45 + kdkdk 1. On the other hand, if he has missed his last k shots, we assume the probability k shots, we assume the probability k of making shot n is 0.45 – kd

2 kd

2 kd . Here, d

1 and d

2 d

2 d are small values (0.01 and 0.02, for exam-

ple) that indicate how much the shooter’s probability of success increases or decreases depending on his current streak. The model implies that the shooter gets better the more shots he makes and worse the more he misses.

To implement this model, we use simulation as shown in Figure 5.24 (with many hidden rows). (See the file Basketball Simulation.xlsx.) Actually, we first do a baseline binomial calculation in cell B9, using the parameters n = 25 and p = 0.450. The formula in cell B9 is

=1-BINOM.DIST(12,B7,B3,TRUE)

If the player makes each shot with probability 0.45, independently of the other shots, then the probability that he will make over half of his 25 shots is 0.306—about a 30% chance. (Remember that this is a binomial calculation for a situation where we are assuming the binomial distribution probably does not apply.) The simulation in the range A17:D41 shows the results of 25 random shots according to the nonbinomial model we have assumed. nonbinomial model we have assumed. nonbinomial Column B indicates the length of the current streak, where a negative value indicates a streak of misses and a positive value indicates a streak of makes. Column C indicates the probability of a make on the current shot, and column D contains a 1 for a make and a 0 for a miss. Here are step-by-step instructions for developing this model.

1. First shot. Enter the formulas

=B3

and

=IF(RAND()<C17,1,0)

in cells C17 and D17 to determine the outcome of the first shot.

2. Second shot. Enter the formulas

=IF(D17=0,-1,1)

=IF(B18<0,$B$3+B18*$B$5,$B$4+B18*$B$5)

and

=IF(RAND()C18,1,0)

6There are obviously a lot of extenuating circumstances surrounding any shot: the type of shot (layup versus jump shot), the type of defense, the score, the time left in the game, and so on. For this example, we focus on a pure jump shooter who is unaffected by the various circumstances in the game.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 203

in cells B18, C18, and D18. The first of these indicates that by the second shot, the shooter will have a streak of one make or one miss. The second formula is the impor- tant one. It indicates how the probability of a make changes depending on the current streak. The third formula simulates a make or a miss, using the probability in cell C18.

3. Length of streak on third shot. Enter the formula

=IF(AND(B18<0,D18=0),B18-1,IF(AND(B18<0,D18=1),1,

IF(ANDB18>0,D18=0),−1,B18+1)))

in cell B19 and copy it down column B. This nested IF formula checks for all four combinations of the previous streak (negative or positive, indicated in cell B18) and the most recent shot (make or miss, indicated in cell D18) to see whether the current streak continues by 1 or a new streak starts.

4. Results of remaining shots. The logic for the formulas in columns C and D is the same for the remaining shots as for shot 2, so copy the formulas in cells C18 and D18 down their respective columns.

Figure 5.24 Simulation of Basketball Shooting Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

37

38

39

40

41

42

43

265

266

267

A BA B C DC D E FE F G HG H I Basketball shoo�ng simula�on

Long-run average 0e 0.45 Increment d1 a er a make 0e 0.015 Increment d2 a er a miss 0s 0.015

Number of shots 25

P (at least 13 of 25) - binomial 0.306

Summary sta­s­cs from simula­on below Frac­on of reps with at least 13 from table below Number of makes 0.2969 At least 13 makes ? 0

Simula­on of makes and misses using nonbinomial model Shot Streak P(make) Make? Rep At least 13?

010.45AN1 2 1

3 23

4

21 22

24 25

0.465 1 1 0 0.48 1 2 0

0.495 1 3 0 5 045 04 .51 0 4 0

–11 0.285 0 20 0 –12 0.27 0 21 0

23 –13 0.255 0 22 0 –14 0.24 1 23 0

1 0.465 0 24 0 25 0 26 1

248 0 249 0 250 0

w F

t S k P p A

2 1 1 1 1 2 1 3

5 0 1 0 4 0 1 0 0 20 0 2 0 7 0 3 0 0 22 0 4 0 4 1 1 0 0 24 0

8 0 9 0 0 0

Compare these

Data table to replicate 25 shots many ­mes

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

204 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

5. Summary of 25 shots. Enter the formulas

=SUM(D17:D41)

and

=IF(B12>=13,1,0)

in cells B12 and B13 to summarize the results of the 25 simulated shots. In particular, the value in cell B13 is 1 only if at least 13 of the shots are successes.

What about the probability of making at least 13 shots with this nonbinomial model? So far, we have simulated one set of 25 shots and have reported whether at least 13 of the shots are successes. We need to replicate this simulation many times and report the fraction of the replications where at least 13 of the shots are successes. We do this with a data table in columns F and G.

To create this table, enter the replication numbers 1 through 250 (you could use any number of replications) in column F. Then put a link to B13 in cell G17 by entering the formula = B13 in this cell. Essentially, we are recalculating this value 250 times, each with different random numbers. To do this, highlight the range F17:G267, and create a data table with no row input cell and any blank cell (such as F17) as the column input cell. any blank cell (such as F17) as the column input cell. any blank cell This causes Excel to recalculate the basic simulation 250 times, each time with different random numbers. (This trick of using a blank column input cell will be discussed in more detail in Chapter 15.) Finally, enter the formula

=AVERAGE(G18:G267)

in cell F12 to calculate the fraction of the replications with at least 13 makes out of 25 shots. After finishing all of this, note that the spreadsheet is “live” in the sense that if you

press the F9 recalculation key, all of the simulated quantities change with new random numbers. In particular, the estimate in cell F12 of the probability of at least 13 makes out of 25 shots changes. It is sometimes less than the binomial probability in cell B9 and sometimes greater. In general, the two probabilities are roughly the same. The bottom line? Even if the world doesn’t behave exactly as the binomial model indicates, probabilities of various events can often be approximated fairly well by binomial probabilities—which saves you the trouble of developing and working with more complex models. ■

P R O B L E M S

Level A 19. In a typical month, an insurance agent presents life

insurance plans to 40 potential customers. Historically, one in four such customers chooses to buy life insur- ance from this agent. Based on the relevant binomial distribution, answer the following questions about X, the number of customers who will buy life insurance from this agent in the coming month: a. What is the probability X is exactly X is exactly X 5? b. What is the probability that X is no more than 10? c. What is the probability that X is at least 20? d. Determine the mean and standard deviation of X. e. What is the probability that X will be within two

standard deviations of the mean? f. What is the probability that X will be within three

standard deviations of the mean?

20. Continuing the previous exercise, use the normal approximation to the binomial to answer each of the questions posed in parts a through f. How well does the normal approximation perform in this case? Explain.

21. Many vehicles used in space travel are constructed with redundant systems to protect flight crews and their valuable equipment. In other words, backup sys- tems are included within many vehicle components so that if one or more systems fail, backup systems will assure the safe operation of the given component and thus the entire vehicle. For example, consider one par- ticular component of the U.S. space shuttle that has n duplicated systems (i.e., one original system and n − 1 backup systems). Each of these systems functions, independently of the others, with probability 0.98. This

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-5 Applications of the Binomial Distribution 205

shuttle component functions successfully provided that at least one of the at least one of the at least n systems functions properly. a. Find the probability that this shuttle component

functions successfully if n = 2. b. Find the probability that this shuttle component

functions successfully if n = 4. c. What is the minimum number n of duplicated

systems that must be incorporated into this shuttle component to ensure at least a 0.9999 probability of successful operation?

22. Suppose that a popular hotel for vacationers in Orlando, Florida, has a total of 300 identical rooms. As many major airline companies do, this hotel has adopted an overbooking policy in an effort to maximize the usage of its available lodging capacity. Assume that each potential hotel customer holding a room reservation, independently of other customers, cancels the reservation or simply does not show up at the hotel on a given night with probability 0.15. a. Find the largest number of room reservations that

this hotel can book and still be at least 95% sure that everyone who shows up at the hotel will have a room on a given night.

b. Given that the hotel books the number of reservations found in part a, find the probability that at least 90% of the available rooms will be occupied on a given night.

c. Given that the hotel books the number of reservations found in part a, find the probability that at most 80% of the available rooms will be occupied on a given night.

d. How does your answer to part a change as the required assurance rate increases from 95% to 97%? How does your answer to part a change as the required assurance rate increases from 95% to 99%?

e. How does your answer to part a change as the cancellation rate varies between 5% and 25% (in increments of 5%)? Assume now that the required assurance rate remains at 95%.

23. A production process manufactures items with weights that are normally distributed with mean 15 pounds and standard deviation 0.1 pound. An item is considered to be defective if its weight is less than 14.8 pounds or greater than 15.2 pounds. Suppose that these items are currently produced in batches of 1000 units. a. Find the probability that at most 5% of the items in

a given batch will be defective. b. Find the probability that at least 90% of the items

in a given batch will be acceptable. c. How many items would have to be produced in a

batch to guarantee that a batch consists of no more than 1% defective items?

24. Past experience indicates that 30% of all individuals entering a certain store decide to make a purchase. Using (a) the binomial distribution and (b) the normal

approximation to the binomial, find that probability that 10 or more of the 30 individuals entering the store in a given hour will decide to make a purchase. Compare the results obtained using the two different approaches. Under what conditions will the normal approximation to this binomial probability become even more accurate?

25. Suppose that the number of ounces of soda put into a soft-drink can is normally distributed with μ = 12.05 ounces and σ = 0.03 ounce. a. Legally, a can must contain at least 12 ounces of

soda. What fraction of cans will contain at least 12 ounces of soda?

b. What fraction of cans will contain less than 11.9 ounces of soda?

c. What fraction of cans will contain between 12 and 12.08 ounces of soda?

d. One percent of all cans will weigh more than what value?

e. Ten percent of all cans will weigh less than what value?

f. The soft-drink company controls the mean weight in a can by setting a timer. For what mean should the timer be set so that only 1 in 1000 cans will be underweight?

g. Every day the company produces 10,000 cans. The government inspects 10 randomly chosen cans each day. If at least two are underweight, the company is fined $10,000. Given that μ = 12.05 ounces and σ = 0.03 ounce, what is the probability that the company will be fined on a given day?

26. Suppose that 53% of all registered voters prefer presidential candidate Smith to presidential candidate Jones. (You can substitute the names of the most recent presidential candidates.) a. In a random sample of 100 voters, what is the

probability that the sample will indicate that Smith will win the election (that is, there will be more votes in the sample for Smith)?

b. In a random sample of 100 voters, what is the probability that the sample will indicate that Jones will win the election?

c. In a random sample of 100 voters, what is the probability that the sample will indicate a dead heat (fifty-fifty)?

d. In a random sample of 100 voters, what is the probability that between 40 and 60 (inclusive) voters will prefer Smith?

27. Assume that, on average, 95% of all ticket holders show up for a flight. If a plane seats 200 people, how many tickets should be sold to make the chance of an overbooked flight as close as possible to 5%?

28. Suppose that 55% of all people prefer Coke to Pepsi. We randomly choose 500 people and ask them if they prefer Coke to Pepsi. What is the probability that our

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

206 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

survey will (erroneously) indicate that Pepsi is pre- ferred by more people than Coke? Does this probabil- ity increase or decrease as we take larger and larger samples? Why?

29. A firm’s office contains 150 PCs. The probability that a given PC will not work on a given day is 0.05. a. On a given day what is the probability that exactly

one computer will not be working? b. On a given day what is the probability that at least

two computers will not be working? c. What assumptions do your answers in parts a

and b require? Do you think they are reasonable? Explain.

30. Suppose that 4% of all tax returns are audited. In a group of n tax returns, consider the probability that at most two returns are audited. How large must n be before this probability is less than 0.01?

31. Suppose that the height of a typical American female is normally distributed with μ = 64 inches and σ = 4 inches. We observe the height of 500 American females. a. What is the probability that fewer than 35 of the

500 women will be less than 58 inches tall? b. Let X be the number of the X be the number of the X 500 women who are

less than 58 inches tall. Find the mean and standard deviation of X.

32. In basketball, a player who is fouled in the act of shooting gets to shoot two free throws. Suppose we hear that one player is an “85% free throw shooter.” If this player is fouled 25 times in the act of shooting (maybe over a period of several games), find the distri- bution of occasions where he makes both free throws. That is, if X is the number of times he makes both free X is the number of times he makes both free X throws, find P(X = k) for each k from k from k 0 to 25. How likely is it that he will make both free throws on at least 20 of the 25 occasions?

Level B 33. Many firms utilize sampling plans to control the quality

of manufactured items ready for shipment. To illustrate the use of a sampling plan, suppose that a particular company produces and ships electronic computer chips in lots, each lot consisting of 1000 chips. This com- pany’s sampling plan specifies that quality control per- sonnel should randomly sample 50 chips from each lot and accept the lot for shipping if the number of defec- tive chips is four or fewer. The lot will be rejected if the number of defective chips is five or more. a. Find the probability of accepting a lot as a function

of the actual fraction of defective chips. In particular, let the actual fraction of defective chips in a given lot equal any of 0.02, 0.04, 0.06, 0.08, 0.10, 0.12, 0.14, 0.16, 0.18. Then compute the lot acceptance probability for each of these lot defective fractions.

b. Construct a graph showing the probability of lot acceptance for each of the lot defective fractions, and interpret your graph.

c. Repeat parts a and b under a revised sampling plan that calls for accepting a given lot if the number of defective chips found in the random sample of 50 chips is five or fewer. Summarize any notable differences between the two graphs.

34. Suppose you play a game at a casino where your prob- ability of winning each game is 0.49. On each game, you bet $10, which you either win or lose. Let P(n) be the probability that you are ahead by at least $50 after n games. Graph this probability versus n for n equal to multiples of 50 up to 1000. Discuss the behavior of this function and why it behaves as it does.

35. Comdell Computer receives computer chips from Chipco. Each batch sent by Chipco is inspected as fol- lows: 35 chips are tested and the batch passes inspec- tion if at most one defective chip is found in the set of 35 tested chips. Past history indicates an average of 1% of all chips produced by Chipco are defective. Comdell has received 10 batches this week. What is the probability that at least nine of the batches will pass inspection?

36. A standardized test consists entirely of multiple-choice questions, each with five possible choices. You want to ensure that a student who randomly guesses on each question will obtain an expected score of zero. How can you accomplish this?

37. In the current tax year, suppose that 5% of the millions of individual tax returns are fraudulent. That is, they contain errors that were purposely made to cheat the government. a. Although these errors are often well concealed,

let’s suppose that a thorough IRS audit will uncover them. If a random 250 tax returns are audited, what is the probability that the IRS will uncover at least 15 fraudulent returns?

b. Answer the same question as in part a, but this time assume there is only a 90% chance that a given fraudulent return will be spotted as such if it is audited.

38. Suppose you work for a survey research company. In a typical survey, you mail questionnaires to 150 companies. Of course, some of these companies might decide not to respond. Assume that the nonresponse rate is 45%; that is, each company’s probability of not responding, independently of the others, is 0.45. a. If your company requires at least 90 responses for

a valid survey, find the probability that it will get this many. Use a data table to see how your answer varies as a function of the nonresponse rate (for a reasonable range of response rates surrounding 45%).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-6 The Poisson and Exponential Distributions 207

b. Suppose your company does this survey in two “waves.” It mails the 150 questionnaires and waits a certain period for the responses. As before, assume that the nonresponse rate is 45%. However, after this initial period, your company follows up (by telephone, say) on the nonrespondents, asking them to please respond. Suppose that the nonresponse rate on this second wave is 70%; that is, each original nonrespondent now responds with probability 0.3, independently of the others. Your company now wants to find the probability of obtaining at least 110 responses total. It turns out that this is a difficult probability to calculate directly. So instead, approximate it with simulation.

39. Suppose you are sampling from a large population, and you ask the respondents whether they believe men should be allowed to take paid paternity leave from their jobs when they have a new child. Each person you sample is equally likely to be male or female. The population proportion of females who believe males should be granted paid paternity leave is 56%, and the

population proportion of males who favor it is 48%. If you sample 200 people and count the number who believe males should be granted paternity leave, is this number binomially distributed? Explain why or why not. Would your answer change if you knew your sample was going to consist of exactly 100 males and 100 females?

40. A woman claims that she is a fortune-teller. Specifically, she claims that she can predict the direction of the change (up or down) in the Dow Jones Industrial Average for the next 10 days. For example, one possible prediction might be U, U, D, U, D, U, U, D, D, D. (You can assume that she makes all 10 predictions right now, although that does not affect your answer to the question.) Obviously, you are skeptical, thinking that she is just guessing, so you would be surprised if her predictions are accurate. Which would surprise you more: (1) she predicts at least 8 out of 10 correctly, or (2) she predicts at least 6 out of 10 correctly on each of four separate occasions? Answer by assuming that (1) she is really guessing and (2) each day the Dow is equally likely to go up or down.

5-6 THE POISSON AND EXPONENTIAL DISTRIBUTIONS The �nal two distributions in this chapter are called the Poisson and exponential distribu- tions. In most statistical applications, including those in the rest of this book, these distribu- tions play a much less important role than the normal and binomial distributions. For this reason, we will not analyze them in much detail. However, in many applied management science models, the Poisson and exponential distributions are key distributions. For exam- ple, much of the study of probabilistic inventory models, queueing models, and reliability models relies heavily on these two distributions.

5-6a The Poisson Distribution

The Poisson distribution is a discrete distribution. It usually applies to the number of number of number events occurring within a speci�ed period of time or space. Its possible values are all of the nonnegative integers: 0, 1, 2, and so on—there is no upper limit. Even though there is an in�nite number of possible values, this causes no real problems because the probabilities of all suf�ciently large values are essentially 0.

The Poisson distribution is characterized by a single parameter, usually labeled λ (Greek lambda), which must be positive. By adjusting the value of λ, we are able to produce dif-, we are able to produce dif-, we are able to produce dif ferent Poisson distributions, all of which have the same basic shape as in Figure 5.25. That is, they �rst increase and then decrease. It turns out that λ is easy to interpret. It is both the mean and the variance of the Poisson distribution. Therefore, the standard deviation is !λ!λ!! . Typical Examples of the Poisson Distribution

■ A bank manager is studying the arrival pattern to the bank. The events are customer arrivals, the number of arrivals in an hour is Poisson distributed, and λ represents the expected number of arrivals per hour.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

208 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

■ An engineer is interested in the lifetime of a type of battery. A device that uses this type of battery is operated continuously. When the �rst battery fails, it is replaced by a second; when the second fails, it is replaced by a third, and so on. The events are battery failures, the number of failures that occur in a month is Poisson distributed, and λ represents the expected number of failures per month.

■ A retailer is interested in the number of customers who order a particular product in a week. Then the events are customer orders for the product, the number of customer orders in a week is Poisson distributed, and λ is the expected number of orders per week.λ is the expected number of orders per week.λ

■ In a quality control setting, the Poisson distribution is often relevant for describing the number of defects in some unit of space. For example, when paint is applied to the body of a new car, any minor blemish is considered a defect. Then the number of defects on the hood, say, might be Poisson distributed. In this case, λ is the expected number of defects per hood.

These examples are representative of the many situations where the Poisson distribution has been applied. The parameter λ is often called a rate—arrivals per hour, failures per month, and so on. If the unit of time (or space) is changed, the rate must be modified accordingly. For example, if the number of arrivals to a bank in a single hour is Poisson distributed with rate λ = 30, then the number of arrivals in a half-hour period is Poisson distributed with rate λ = 15.

We can use Excel to calculate Poisson probabilities much as we did with binomial probabilities. The relevant function is the POISSON function. It takes the form

=POISSON.DIST (k,λ,cum)

The third argument cum works exactly as in the binomial case. If it is FALSE (or 0), the function returns P(X = k); if it is TRUE (or 1), the function returns P(X ≤ k). As exam- ples, if λ = 5 =POISSON.DIST(7,5,FALSE) returns the probability of exactly 7, =POISSON.DIST(7,5,TRUE) returns the probability of less than or equal to 7, and =1-POISSON.DIST(3,5,TRUE) returns the probability of greater than 3.

CHANGES IN EXCEL 2010

The POISSON function was replaced in Excel 2010 by POISSON.DIST. Either version can be used, and they work exactly the same way. We use the new version in the following example. (Curiously, there is still no POISSON.INV function.)

Example 5.13 shows how a manager or consultant could use the Poisson distribution.

E X A M P L E 5.13 MANAGING TV INVENTORY AT KRIEGLAND

Kriegland is a department store that sells various brands of plasma screen TVs. One of the manager’s biggest problems is to decide on an appropriate inventory policy for stocking TVs. He wants to have enough in stock so that customers receive their requests right away, but he does not want to tie up too much money in inventory that sits on the storeroom floor.

Most of the difficulty results from the unpredictability of customer demand. If this demand were constant and known, the manager could decide on an appropriate inven- tory policy fairly easily. But the demand varies widely from month to month in a ran- dom manner. All the manager knows is that the historical average demand per month is

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-6 The Poisson and Exponential Distributions 209

Figure 5.25 Typical Poisson Distribution

approximately 17. Therefore, he decides to call in a consultant. The consultant immedi- ately suggests using a probability model. Specifically, she attempts to find the probability distribution of demand in a typical month. How might she proceed?

Objective To model the probability distribution of monthly demand for plasma screen TVs with a particular Poisson distribution.

Solution Let X be the demand in a typical month. The consultant knows that there are many possi- ble values of X. For example, if historical records show that monthly demands have always been between 0 and 40, the consultant knows that almost all of the probability should be assigned to the values 0 through 40. However, she does not relish the thought of finding 41 probabilities, P(X = 0) through P(X = 40), that sum to 1 and reflect historical frequen- cies. Instead, she discovers from the manager that the histogram of demands from previous months is shaped much like the graph in Figure 5.25. That is, it rises to some peak and then falls.

Knowing that a Poisson distribution has this same basic shape, the consultant decides to model the monthly demand with a Poisson distribution. To choose a particular Poisson distribution, all she has to do is choose a value of λ, the mean demand per month. Because the historical average is approximately 17, she chooses λ = 17. Now she can test the Poisson model by calculating probabilities of various events and asking the manager whether these probabilities are reasonable approximations to reality.

For example, the Poisson probability that monthly demand is less than or equal to 20, P(X ≤ 20), is 0.805 [using the Excel function POISSON.DIST(20,17,TRUE)], and the probability that demand is between 10 and 15 inclusive, P(10 ≤ X ≤ 15), is 0.345 [using POISSON.DIST(15,17,TRUE)-POISSON.DIST(9,17,TRUE)]. Figure 5.26 illustrates various probability calculations and shows the graph of the individual Poisson probabili- ties. (See the file Poisson Demand Distribution.xlsx.)

If the manager believes that these probabilities and other similar probabilities are rea- sonable, then the statistical part of the consultant’s job is finished. Otherwise, she must statistical part of the consultant’s job is finished. Otherwise, she must statistical try a different Poisson distribution—a different value of λ—or perhaps a different type of distribution altogether. ■

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

210 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

5-6b The Exponential Distribution

Suppose that a bank manager is studying the pattern of customer arrivals at her branch location. As indicated previously in this section, the number of arrivals in an hour at a facility such as a bank is often well described by a Poisson distribution with parameter λ, where λ represents the expected number of arrivals per hour. An alternative way to view the uncertainty in the arrival process is to consider the times between customer arrivals. The most common probability distribution used to model these times, often called interarrival times, is the exponential distribution.exponential distribution.exponential

In general, the continuous random variable X has an X has an X exponential distribution with parameter λ (with λ > 0) if the density function of X has the form f(f(f x) = λe–λxλxλ for x for x x > 0. This density function has the shape shown in Figure 5.27. Because this density function decreases continuously from left to right, its most likely value is x = 0. Alternatively, if you collect many observations from an exponential distribution and draw a histogram of the observed values, you should expect it to resemble the smooth curve shown in Figure 5.27, with the tallest bars to the left. The mean and standard deviation of this distribution are easy to remember. They are both equal to the reciprocal of the parameter reciprocal of the parameter reciprocal λ. For example, an exponential distribution with parameter λ = 0.1 has mean and standard deviation both equal to 10.

10 Value

8 0 00719191919 8888 0 00 00 00 007070707

17 96

1 KJIHGFEDCBA

Poisson distribu�on for monthly demand 2

3

4

5

6

7

8

9

10101010

Range name used: Mean monthly demand 17 Mean =$B$3

Representa�ve probability calcula�ons Less than or equal to 20 0.805 =POISSON.DIST(20,Mean,TRUE) Between 10 and 15 (inclusive) 0.345 =5 =5 =POISSON.DIST(15,Mean,TRUE)-POISSON.DIST(9,Mean,TRUE)

Individual probabili�es ValueValueValueValue Probability

11

12

13

14

15

16

17

18

0 0.000 =0 =0 =POISSON.DIST(A11,Mean,FALSE)

7 0.003

20

21

22

23

24

25

26

27

0 0.0 0

10 0.023

28282828

29

30

31

1 0.000 copy down 2 0.000 3 0.000 4 0.000 5 0.000 6 0.001

9 0.014

11 0.036 12 0.050 13 0.066 14 0.080 15 0.091 16 0.096 17171717 0.0960 00.0960 0960.09696 18 0.091 19 0.081 20 0.069

Poisson Distribution with Mean 17

0.120

0.100

0.080

0.060

0.040

0.020

0.000 0 2 4 6 8 10 12 14 16 18 20 22 24 26 28 30 32 34 36 38 40

Figure 5.26 Poisson Calculations for TV Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

5-6 The Poisson and Exponential Distributions 211

As with the normal distribution, you usually want probabilities to the left or right of a given value. For any exponential distribution, the probability to the left of a given value x > 0 can be calculated with Excel’s EXPON.DIST function. This function takes the form

=EXPON.DIST(x,λ,TRUE)

For example, if x = 0.5 and λ = 5 (so that the mean equals 1/5 = 0.2), the probability of being less than 0.5 can be found with the formula

=EXPON.DIST(0.5,5,TRUE)

This returns the probability 0.918. Of course, the probability of being greater than 0.5 is then 1 − 0.918 = 0.082.

Returning to the bank manager’s analysis of customer arrival data, when the times between arrivals are exponentially distributed, you sometimes hear that “arrivals occur according to a Poisson process.” This is because there is a close relationship between the exponential distribution, which measures times between events such as arrivals, and  the Poisson distribution, which counts the number of events in a certain length of time. number of events in a certain length of time. number The  details of this relationship are beyond the level of this book, so we will not explore the topic further. But if you hear, for example, that customers arrive at a facility according to a Poisson process at the rate of six per hour, then the corresponding times between arrivals are exponentially distributed with mean 1/6 hour.

Figure 5.27 Exponential Density Function

CHANGES IN EXCEL 2010

The EXPONDIST function was replaced in Excel 2010 by EXPON.DIST. Either version can be used, and they work exactly the same way. (As with the Poisson distribution, there is no EXPON.INV function.)

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

212 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Level A 41. The annual number of industrial accidents occurring in

a particular manufacturing plant is known to follow a Poisson distribution with mean 12. a. What is the probability of observing exactly 12

accidents during the coming year? b. What is the probability of observing no more than

12 accidents during the coming year? c. What is the probability of observing at least 15

accidents during the coming year? d. What is the probability of observing between 10 and

15 accidents (inclusive) during the coming year? e. Find the smallest integer k such that we can be at

least 99% sure that the annual number of accidents occurring will be less than k.

42. Suppose that X, the number of customers arriving each hour at the only checkout counter in a local pharmacy, is approximately Poisson distributed with an expected arrival rate of 20 customers per hour. a. Find the probability that X is exactly X is exactly X 10. b. Find the probability that X is at least 5.X is at least 5.X c. Find the probability that X is no more than X is no more than X 25. d. Find the probability that X is between X is between X 10 and 30

(inclusive). e. Find the largest integer k such that we can be at k such that we can be at k

least 95% sure that X will be greater than k. f. Recalling the relationship between the Poisson and

exponential distributions, find the probability that the time between two successive customer arrivals is more than four minutes. Find the probability that it is less than two minutes.

43. Suppose the number of baskets scored by the Indiana University basketball team in one minute follows a Poisson distribution with � = 1.5. In a 10-minute span of time, what is the probability that Indiana University scores exactly 20 baskets; at most 20 baskets?

(Use the fact that if the rate per minute is �, then the rate in t minutes is �t.)

44. Suppose that the times between arrivals at a bank during the peak period of the day are exponentially distributed with a mean of 45 seconds. If you just observed an arrival, what is the probability that you will need to wait for more than a minute before observing the next arrival? What is the probability you will need to wait at least two minutes?

Level B 45. Consider a Poisson random variable X with parameter X with parameter X

� = 2. a. Find the probability that X is within one standard X is within one standard X

deviation of its mean. b. Find the probability that X is within two standard X is within two standard X

deviations of its mean. c. Find the probability that X is within three standard X is within three standard X

deviations of its mean. d. Do the empirical rules we learned previously

seem to be applicable in working with the Poisson distribution where � = 2? Explain why or why not.

e. Repeat parts a through d for the case of a Poisson random variable where � = 20.

46. Based on historical data, the probability that a major league pitcher pitches a no-hitter in a game is about 1/1300. a. Use the binomial distribution to determine the

probability that in 650 games 0, 1, 2, or 3 no-hitters will be pitched. (Find the separate probabilities of these four events.)

b. Repeat part a using the Poisson approximation to the binomial. This approximation says that if n is large and p is small, a binomial distribution with parameters n and p is approximately the same as a Poisson distribution with � = npnpn .

P R O B L E M S

5-7 CONCLUSION We have covered a lot of ground in this chapter, and much of the material, especially that on the normal distribution, will be used in later chapters. The normal distribution is the cor- nerstone for much of statistical theory. As you will see in later chapters on statistical infer- ence and regression, an assumption of normality is behind most of the procedures we use. Therefore, it is important for you to understand the properties of the normal distribution and how to work with it in Excel. The binomial, Poisson, and exponential distributions, although not used as frequently as the normal distribution in this book, are also extremely

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

important. The examples we have discussed indicate how these distributions can be used in a variety of business situations.

Although we have attempted to stress concepts in this chapter, we have also described the details necessary to work with these distributions in Excel. Fortunately, these details are not too dif�cult to master once you understand Excel’s built-in functions, especially NORM.DIST, NORM.INV, and BINOM.DIST. Figures 5.6 and 5.18 provide typical exam- ples of these functions. We suggest that you keep a copy of these �gures handy.

Term Explanation Excel Page Equation

Density function Specifies the probability distribution of a continuous random variable

168

Normal distribution A continuous distribution with possible values ranging over the entire number line; its density function is a symmetric bell-shaped curve

169 5.1

Standardizing a normal random variable

Transforms any normal distribution with mean  μ and standard deviation σ to the standard normal distribution with mean 0 and standard deviation 1

STANDARDIZE 170 5.2

Normal calculations in Excel

Useful for finding probabilities and percentiles for nonstandard and standard normal distributions

NORM.DIST, NORM.S.DIST, NORM.INV, NORM.S.INV

175

Empirical rules for normal distribution

About 68% of the data fall within one standard deviation of the mean, about 95% of the data fall within two standard deviations of the mean, and almost all fall within three standard deviations of the mean

177

Binomial distribution The distribution of the number of successes in n independent, identical trials, where each trial has probability p of success

BINOM.DIST BINOM.INV

190

Mean and standard deviation of a binomial distribution

The mean and standard deviation of a binomial distribution with parameters n and p are npnpn and !n!n! pnpn (1 − p)! , respectively

193 5.3, 5.4

Sampling without replacement

Sampling where no member of the population can be sampled more than once

194

Sampling with replacement

Sampling where any member of the population can be sampled more than once

194

Normal approximation to the binomial distribution

If npnpn > 5 and n(1 − p) > 5, the binomial distribution can be approximated well by a normal distribution with mean npnpn and standard deviation !n!n! pnpn (1 − p)!

194

Poisson distribution A discrete probability distribution that often describes the number of events occurring within a specified period of time or space; mean and variance both equal the parameter λ

POISSON.DIST 207

Exponential distribution A continuous probability distribution useful for measuring times between events, such as customer arrivals to a service facility; mean and standard deviation both equal the reciprocal of the parameter

EXPON.DIST 210

Summary of Key Terms

5-7 Conclusion 213 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

214 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions

Conceptual Questions C.1. For each of the following uncertain quantities,

discuss whether it is reasonable to assume that the probability distribution of the quantity is normal. If the answer isn’t obvious, discuss how you could discover whether a normal distribution is reasonable. a. The change in the Dow Jones Industrial Average

between now and a year from now b. The length of time (in hours) a battery that is in

continuous use lasts c. The time between two successive arrivals to a bank d. The time it takes a bank teller to service a random

customer e. The length (in yards) of a typical drive on a par 5

by Phil Michelson f. The amount of snowfall (in inches) in a typical

winter in Minneapolis g. The average height (in inches) of all boys in a

randomly selected seventh-grade middle school class h. Your bonus from finishing a project, where your

bonus is $1000 per day under the deadline if the project is completed before the deadline, your bonus is $500 if the project is completed right on the deadline, and your bonus is $0 if the project is completed after the deadline

i. Your gain on a call option on a stock, where you gain nothing if the price of the stock a month from now is less than or equal to $50 and you gain (P–50) dollars if the price P a month from now is greater than $50

C.2. For each of the following uncertain quantities, discuss whether it is reasonable to assume that the probability distribution of the quantity is binomial. If you think it is, what are the parameters n and p? If you think it isn’t, explain your reasoning. a. The number of wins the Boston Red Sox baseball

team has next year in its 81 home games b. The number of free throws Kobe Bryant misses in

his next 250 attempts c. The number of free throws it takes Kobe Bryant

to achieve 100 successes d. The number out of 1000 randomly selected customers

in a supermarket who have a bill of at least $150 e. The number of trading days in a typical year

where Microsoft’s stock price increases f. The number of spades you get in a 13-card hand

from a well-shuffled 52-card deck g. The number of adjacent 15-minute segments

during a typical Friday where at least 10 customers enter a McDonald’s restaurant

h. The number of pages in a 500-page book with at least one misprint on the page

C.3. The Poisson distribution is often appropriate in the “binomial” situation of n independent and identical trials, where each trial has probability p of success, but n is very large and p is very small. In this case, the Poisson distribution is relevant for the number of successes, and its parameter (its mean) is npnpn . Discuss some situations where such a Poisson model might be appropriate. How would you measure n and p, or would you measure only their product npnpn ? Here is one to get you started: the number of traffic accidents at a particular intersection in a given year.

C.4. One disadvantage of a normal distribution is that there is always some probability that a quantity is negative, even when this makes no sense for the uncertain quantity. For example, the time a light bulb lasts cannot be negative. In any particular situation, how would you decide whether you could ignore this disadvantage for all practical purposes?

C.5. Explain why probabilities such as P(X < x) and P(X ≤ x) are equal for a continuous random variable.

C.6. State the major similarities and differences between the binomial distribution and the binomial distribution and the binomial Poisson distribution.

C.7. You have a bowl with 100 pieces of paper inside, each with a person’s name written on it. It turns out that 50 of the names correspond to males and the other 50 to females. You reach inside and grab five pieces of paper. If X is the random number of male names you X is the random number of male names you X choose, is X binomially distributed? Why or why not?X binomially distributed? Why or why not?X

C.8. A distribution we didn’t discuss is the Bernoulli distribution. It is a binomial distribution with n = 1. In other words, it is the number of successes (0 or 1) in a single trial when the probability of success is p. What are the mean and standard deviation of a Bernoulli distribution? Discuss how a binomial random variable can be expressed in terms of n independent Bernoulli random variables, each with the same parameter p.

C.9. For real applications, the normal distribution has two potential drawbacks: (1) it can be negative, and (2) it isn’t symmetric. Choose some continuous random numeric outcomes of interest to you. Are either poten- tial drawbacks really drawbacks for your random outcomes? If so, which is the more serious drawback?

C.10. Many basketball players and fans believe strongly in the “hot hand.” That is, they believe that players tend to shoot in streaks, either makes or misses. If this is the case, why does the binomial distribution not apply, at least not exactly, to the number of makes in a given number of shots? Which assumption of the binomial model is violated, the independence of suc- cessive shots or the constant probability of success on each shot? Or can you tell?

P R O B L E M S

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C.11. Suppose the demands in successive weeks for your product are normally distributed with mean 100 and standard deviation 20, and suppose your lead time for receiving a placed order is three weeks. A quantity of interest to managers is the lead-time demand, the total demanded over three weeks. Why does the for- mula for the standard deviation of lead-time demand include a square root of 3? What assumptions are behind this?

Level A 47. Suppose the annual return on XYZ stock follows

a normal distribution with mean 12% and standard deviation 30%. a. What is the probability that XYZ’s value will

decrease during a year? b. What is the probability that the return on XYZ

during a year will be at least 20%? c. What is the probability that the return on XYZ

during a year will be between −6% and 9%? d. There is a 5% chance that the return on XYZ

during a year will be greater than what value? e. There is a 1% chance that the return on XYZ

during a year will be less than what value? f. There is a 95% chance that the return on XYZ

during a year will be between which two values (equidistant from the mean)?

48. Assume the annual mean return on ABC stock is around 15% and the annual standard deviation is around 25%. Assume the annual and daily returns on ABC stock are normally distributed. a. What is the probability that ABC will lose money

during a year? b. There is a 5% chance that ABC will earn a return

of at least what value during a year? c. There is a 10% chance that ABC will earn a return

of less than or equal to what value during a year? d. What is the probability that ABC will earn at least

35% during a year? e. Assume there are 252 trading days in a year. What

is the probability that ABC will lose money on a given day? (Hint: Let Y be the annual return on ABC and XiXiX be the return on ABC on day i. Then [approximately] Y = X1 + X2X2X + … + X2X2X 52.)

49. Suppose Comdell Computer receives its hard drives from Diskco. On average, 4% of all hard disk drives received by Comdell are defective. a. Comdell has adopted the following policy. It

samples 50 hard drives in each shipment and accepts the shipment if all hard drives in the sample are nondefective. What fraction of shipments will Comdell accept?

b. Suppose instead that the shipment is accepted if at most one hard drive in the sample is defective. What fraction of shipments will Comdell accept?

c. What is the probability that a sample of size 50 will contain at least 10 defectives?

50. A family is considering a move from a midwestern city to a city in California. The distribution of housing costs where the family currently lives is normal, with mean $105,000 and standard deviation $18,200. The distribution of housing costs in the California city is normal with mean $235,000 and standard deviation $30,400. The family’s current house is valued at $110,000. a. What percentage of houses in the family’s current

city cost less than theirs? b. If the family buys a $200,000 house in the new

city, what percentage of houses there will cost less than theirs?

c. What price house will the family need to buy to be in the same percentile (of housing costs) in the new city as they are in the current city?

51. The number of traffic fatalities in a typical month in a given state has a normal distribution with mean 125 and standard deviation 31. a. If a person in the highway department claims that

there will be at least m fatalities in the next month with probability 0.95, what value of m makes this claim true?

b. If the claim is that there will be no more than n fatalities in the next month with probability 0.98, what value of n makes this claim true?

52. It can be shown that a sum of normally distributed random variables is also normally distributed. Do all functions of normal random variables lead to all functions of normal random variables lead to all normal random variables? Consider the following. SuperDrugs is a chain of drugstores with three similar- size stores in a given city. The sales in a given week for any of these stores is normally distributed with mean $15,000 and standard deviation $3000. At the end of each week, the sales figure for the store with the largest sales among the three stores is recorded. Is this maximum value normally distributed? To answer this question, simulate a weekly sales figure at each of the three stores and calculate the maximum. Then replicate this maximum 500 times and create a histo- gram of the 500 maximum values. Does it appear to be normally shaped? Whatever this distribution looks like, use your simulated values to estimate the mean and standard deviation of the maximum.

53. In the game of baseball, every time a player bats, he is either successful (gets on base) or he fails (doesn’t get on base). (This is all you need to know about baseball for this problem!) His on-base percentage, usually expressed as a decimal, is the percentage of times he is successful. Let’s consider a player who is theoretically a 0.375 on-base batter. Specifically, assume that each time he bats, he is successful with probability 0.375 and unsuccessful with probability 0.625. Also, assume that

5-7 Conclusion 215 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

he bats 600 times in a season. What can you say about his on-base percentage, (# of successes)/600, for the season? (Hint: Each on-base percentage is equivalent to a number of successes. For example, 0.380 is equivalent to 228 successes because 0.380*600 = 228.) a. What is the probability that his on-base percentage

will be less than 0.360? b. What is the probability that his on-base percentage

will be greater than 0.370? c. What is the probability that his on-base percentage

will be less than or equal to 0.400?

54. In the financial world, there are many types of com- plex instruments called derivatives that derive their value from the value of an underlying asset. Consider the following simple derivative. A stock’s current price is $80 per share. You purchase a derivative whose value to you becomes known a month from now. Specifically, let P be the price of the stock in a month. If P is between $75 and $85, the derivative is worth nothing to you. If P is less than $75, the derivative results in a loss of 100*(75–P–P– ) dollars to you. (The factor of 100 is because many derivatives involve 100 shares.) If P is greater than $85, the derivative results in a gain of 100*(P–85) dollars to you. Assume that the distribution of the change in the stock price from now to a month from now is normally distributed with mean $1 and standard deviation $8. Let P (big loss) be the probability that you lose at least $1000 (that is, the price falls below $65), and let P (big gain) be the probability that you gain at least $1000 (that is, the price rises above $95). Find these two probabilities. How do they compare to one another?

Level B 55. When you sum 30 or more independent random

variables, the sum of the random variables will usually be approximately normally distributed, even if each individual random variable is not normally distributed. Use this fact to estimate the probability that a casino will be behind after 90,000 roulette bets, given that it wins $1 or loses $35 on each bet with probabilities 37/38 and 1/38.

56. The daily demand for six-packs of Coke at Mr. D’s supermarket follows a normal distribution with mean 120 and standard deviation 30. Every Monday the Coke delivery driver delivers Coke to Mr. D’s. If Mr. D’s wants to have only a 1% chance of running out of Coke by the end of the week, how many should Mr. D’s order for the week? Assume orders are placed on Sunday at midnight. Also assume that demands on different days are probabilistically independent.

57. Many companies use sampling to determine whether a batch should be accepted. An (n, c) sampling plan consists of inspecting n randomly chosen items from a batch and accepting the batch if c or fewer sampled

items are defective. Suppose a company uses a 1100, 52 sampling plan to determine whether a batch of 10,000 computer chips is acceptable. a. The “producer’s risk” of a sampling plan is

the probability that an acceptable batch will be rejected by the sampling plan. Suppose the customer considers a batch with 3% defectives acceptable. What is the producer’s risk for this sampling plan?

b. The “consumer’s risk” of a sampling plan is the probability that an unacceptable batch will be accepted by the sampling plan. Our customer says that a batch with 9% defectives is unacceptable. What is the consumer’s risk for this sampling plan?

58. Suppose that if a presidential election were held today, 53% of all voters would vote for candidate Smith over candidate Jones. (You can substitute the names of the most recent presidential candidates.) This problem shows that even if there are 100 million voters, a sample of several thousand is enough to determine the outcome, even in a fairly close election. a. If 1500 voters are sampled randomly, what is the

probability that the sample will indicate (correctly) that Smith is preferred to Jones?

b. If 6000 voters are sampled randomly, what is the probability that the sample will indicate (correctly) that Smith is preferred to Jones?

59. A soft-drink factory fills bottles of soda by setting a timer on a filling machine. It has generally been observed that the distribution of the number of ounces the machine puts into a bottle is normal, with standard deviation 0.05 ounce. The company wants 99.9% of all its bottles to have at least 16 ounces of soda. To what value should the mean amount put in each bottle be set? (Of course, the company does not want to fill any more than is necessary.)

60. The time it takes you to swim 100 yards in a race is normally distributed with mean 62 seconds and stand- ard deviation 2 seconds. In your next five races, what is the probability that you will swim under a minute exactly twice?

61. A company assembles a large part by joining two smaller parts together. Assume that the smaller parts are normally distributed with a mean length of 1 inch and a standard deviation of 0.01 inch. a. What fraction of the larger parts are longer than

2.05 inches? b. What fraction of the larger parts are between 1.96

inches and 2.02 inches long?

62. (Suggested by Sam Kaufmann, Indiana University MBA, who has run Harrah’s Lake Tahoe Casino.) A high roller has come to the casino to play 300 games of craps. For each game of craps played there is a 0.493 probability that the high roller will win $1 and a 0.507 probability that the high roller will lose $1.

216 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

After 300 games of craps, what is the probability that the casino will be behind more than $10?

63. (Suggested by Sam Kaufmann, Indiana University MBA, who has run Harrah’s Lake Tahoe Casino.) A high roller comes to the casino intending to play 500 hands of blackjack for $1 a hand. On each hand, the high roller will win $1 with probability 0.48 and lose $1 with probability 0.52. After the 500 hands, what is the probability that the casino has lost more than $40?

64. A soft-drink company produces 100,000 12-ounce bot- tles of soda per year. By adjusting a dial, the company can set the mean number of ounces placed in a bottle. Regardless of the mean, the standard deviation of the number of ounces in a bottle is 0.05 ounce. The soda costs 5 cents per ounce. Any bottle weighing less than 12 ounces will incur a $10 fine for being underweight. Determine a setting for the mean number of ounces per bottle of soda that minimizes the expected cost per year of producing soda. Your answer should be accu- rate within 0.001 ounce. Does the number of bottles produced per year influence your answer?

65. The weekly demand for TVs at Lowland Appliance is normally distributed with mean 400 and standard deviation 100. Each time an order for TVs is placed, it arrives exactly four weeks later. That is, TV orders have a four-week lead time. Lowland doesn’t want to run out of TVs during any more than 1% of all lead times. How low should Lowland let its TV inventory drop before it places an order for more TVs? (Hint: How many standard deviations above the mean lead- time demand must the reorder point be for there to be a 1% chance of a stockout during the lead time?)

66. An elevator rail is assumed to meet specifications if its diameter is between 0.98 and 1.01 inches. Each year a company produces 100, 000 elevator rails. For a cost of $10/σ2 per year the company can rent a machine that produces elevator rails whose diameters have a stand- ard deviation of σ. (The idea is that the company must pay more for a smaller variance.) Each such machine will produce rails having a mean diameter of one inch. Any rail that does not meet specifications must be reworked at a cost of $12. Assume that the diameter of an elevator rail follows a normal distribution. a. What standard deviation (within 0.001 inch)

minimizes the annual cost of producing elevator rails? You do not need to try standard deviations in excess of 0.02 inch.

b. For your answer in part a, one elevator rail in 1000 will be at least how many inches in diameter?

67. A 50-question true–false examination is given. Each correct answer is worth 10 points. Consider an unpre- pared student who randomly guesses on each question. a. If no points are deducted for incorrect answers,

what is the probability that the student will score at least 350 points?

b. If 5 points are deducted for each incorrect answer, what is the probability that the student will score at least 200 points?

c. If 10 points are deducted for each incorrect answer, what is the probability that the student will receive a negative score?

68. What caused the crash of TWA Flight 800 in 1996? Physics professors Hailey and Helfand of Columbia University believe there is a reasonable possibility that a meteor hit Flight 800. They reason as follows. On a given day, 3000 meteors of a size large enough to destroy an airplane hit the earth’s atmosphere. Approximately 50,000 flights per day, averaging two hours in length, have been flown from 1950 to 1996. This means that at any given point in time, planes in flight cover approximately two-billionths of the world’s atmosphere. Determine the probability that at least one plane in the last 47 years has been downed by a meteor. (Hint: Use the Poisson approximation to the binomial. This approximation says that if n is large and p is small, a binomial distribution with parameters n and p is approximately Poisson distributed with λ = npnpn .)

69. In the decade 1982 through 1991, 10 employees work- ing at the Amoco Company chemical research center were stricken with brain tumors. The average employ- ment at the center was 2000 employees. Nationwide, the average incidence of brain tumors in a single year is 20 per 100,000 people. If the incidence of brain tumors at the Amoco chemical research center were the same as the nationwide incidence, what is the probability that at least 10 brain tumors would have been observed among Amoco workers during the decade 1982 through 1991? What do you conclude from your analysis? (Source: AP wire service report, March 12, 1994)

70. Claims arrive at random times to an insurance company. The daily amount of claims is normally distributed with mean $1570 and standard deviation $450. Total claims on different days each have this distribution, and they are probabilistically independent of one another. a. Find the probability that the amount of total claims

over a period of 100 days is at least $150,000. b. If the company receives premiums totaling

$165,000, find the probability that the company will net at least $10,000 for the 100-day period.

71. A popular model for stock prices is the following. If p0 is the current stock price, then the price k periods from now, pk, (where a period could be a day, week, or any other convenient unit of time, and k is any positive k is any positive k integer) is given by

pk = p0exp((� − 0.5σ 2)k + sZ!k!k!! )

Here, exp is the exponential function (EXP in Excel), μ is the mean percentage growth rate per period of the stock, σ is the standard deviation of the growth rate per

5-7 Conclusion 217 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

period, and Z is a standard normal random variable. Z is a standard normal random variable. Z Both μ and σ are typically estimated from actual stock price data, and they are typically expressed in decimal form, such as μ = 0.01 for a 1% mean growth rate. a. Suppose a period is defined as a month, the current

price of the stock (as of the end of December 2012) is $75, μ = 0.006, and σ = 0.028. Use simulation to obtain 500 possible stock price changes from the end of December 2012 to the end of December 2015. Each simulated change will be the price at the end of 2015 minus the price at the end of 2012. (Note that you can simulate a given change in one line and then copy it down.) Create a histogram of these changes to see whether the stock price change is at least approximately normally distributed. Also, use the simulated data to estimate the mean price change and the standard deviation of the change.

b. Use simulation to generate the ending stock prices for each month in 2013. (Use k = 1 to get January’s price from December’s, use k = 1 again to get February’s price from January’s, and so on.) Then use a data table to replicate the ending December 2013 stock price 500 times. Create a histogram of these 500 values. Do they appear to resemble a normal distribution?

72. Your company is running an audit on Sleaze Company. Because Sleaze has a bad habit of overcharging its customers, the focus of your audit is on checking whether the billing amounts on its invoices are correct. Assume that each invoice is for too high an amount with probability 0.06 and for too low an amount with probability 0.01 (so that the probability of a correct billing is 0.93). Also, assume that the outcome for any invoice is probabilistically independent of the out- comes for other invoices. a. If you randomly sample 200 of Sleaze’s invoices,

what is the probability that you will find at least 15 invoices that overcharge the customer? What is the probability you won’t find any that undercharge the customer?

b. Find an integer k such that the probability is at k such that the probability is at k least 0.99 that you will find at least k invoices that overcharge the customer. (Hint: Use trial and error with the BINOMDIST function to find k.)

73. Continuing the previous problem, suppose that when Sleaze overcharges a customer, the distribution of the amount overcharged (expressed as a percentage of the correct billing amount) is normally distributed with mean 15% and standard deviation 4%. a. What percentage of overbilled customers are

charged at least 10% more than they should pay? b. What percentage of all customers are charged at all customers are charged at all

least 10% more than they should pay? c. If your auditing company samples 200 randomly

chosen invoices, what is the probability that it

will find at least five where the customer was overcharged by at least 10%?

74. Your manufacturing process makes parts such that each part meets specifications with probability 0.98. You need a batch of 250 parts that meet specifications. How many parts must you produce to be at least 99% certain of producing at least 250 parts that meet specifications?

75. Let X be normally distributed with a given mean and standard deviation. Sometimes you want to find two values a and b such that P(a < X < b) is equal to some specific probability such as 0.90 or 0.95. There are many answers to this problem, depending on how much probability you put in each of the two tails. For this question, assume the mean and standard deviation are μ = 100 and σ = 10, and that you want to find a and b such that P(a < X < b) = 0.90. a. Find a and b so that there is probability 0.05 in

each tail. b. Find a and b so that there is probability 0.025 in

the left tail and 0.075 in the right tail. c. The usual answer to the general problem is the

answer from part a, that is, where you put equal probability in the two tails. It turns out that this is the answer that minimizes the length of the interval from a to b. That is, if you solve the following problem: minimize (b − a), subject to P(a < X < b) = 0.90, you will get the same answer as in part a. Verify this by using Excel’s Solver add-in.

76. As any credit-granting agency knows, there are always some customers who default on credit charges. Typically, customers are grouped into relatively homogeneous categories, so that customers within any category have approximately the same chance of defaulting on their credit charges. Here we will look at one particular group of customers. We assume each of these customers has (1) probability 0.07 of defaulting on his or her current credit charges, and (2) total credit charges that are normally distributed with mean $350 and standard deviation $100. We also assume that if a customer defaults, 20% of his or her charges can be recovered. The other 80% are written off as bad debt. a. What is the probability that a typical customer in

this group will default and produce a write-off of more than $250 in bad debt?

b. If there are 500 customers in this group, what are the mean and standard deviation of the number of customers who will meet the description in part a?

c. Again assuming there are 500 customers in this group, what is the probability that at least 25 of them will meet the description in part a?

d. Suppose now that nothing is recovered from a default—the whole amount is written off as bad debt. Show how to simulate the total amount of bad debt from 500 customers in just two cells, one with a binomial calculation, the other with a normal calculation.

218 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

77. The Excel functions discussed in this chapter are use- ful for solving a lot of probability problems, but there are other problems that, even though they are similar to normal or binomial problems, cannot be solved with these functions. In cases like this, simulation can often be used. Here are a couple of such problems for you to simulate. For each example, simulate 500 replications of the experiment. a. You observe a sequence of parts from a You observe a sequence of parts from a Y

manufacturing line. These parts use a component that is supplied by one of two suppliers. Each part made with a component from supplier 1 works properly with probability 0.95, and each part made with a component from supplier 2 works properly with probability 0.98. Assuming that 100 of these parts are made, 60 from supplier 1 and 40 from supplier 2, you want the probability that at least 97 of them work properly.

b. Here we look at a more generic example such as coin flipping. There is a sequence of trials where each trial is a success with probability p and a failure with probability 1 − p. A run is a sequence of consecutive successes or failures. For most of us, intuition says that there should not be long runs. Test this by finding the probability that there is at least one run of length at least six in a sequence of 15 trials. (The run could be of 0s or 1s.) You can use any value of p you like—or try different values of p.

78. You have a device that uses a single battery, and you You have a device that uses a single battery, and you Y operate this device continuously, never turning it off. Whenever a battery fails, you replace it with a brand new one immediately. Suppose the lifetime of a typical battery has an exponential distribution with mean 205 minutes. Suppose you operate the device continuously for three days, making battery changes when necessary. Find the probability that you will observe at least 25 failures. (Hint: The number of failures is Poisson distributed.)

79. In the previous problem, we ran the experiment for a certain number of days and then asked about the

number of failures. In this problem, we take a different point of view. Suppose you operate the device, starting with a new battery, until you have observed 25 battery failures. What is the probability that at least failures. What is the probability that at least f 15 of these 25 batteries lived at least 3.5 hours? (Hint: Each lifetime is exponentially distributed.)

80. In the game of soccer, players are sometimes awarded a penalty kick. The player who kicks places the ball 12 yards from the 24-foot-wide goal and attempts to kick it past the goalie into the net. (The goalie is the only defender.) The question is where the player should aim. Make the following assumptions. (1) The player’s kick is off target from where he aims, left or right, by a normally distributed amount with mean 0 and some standard deviation. (2) The goalie typi- cally guesses left or right and dives in that direction at the moment the player kicks. If the goalie guesses wrong, he won’t block the kick, but if he guesses correctly, he will be able to block a kick that would have gone into the net as long as the kick is within a distance d from the middle of the goal. The goalie is equally likely to guess left or right. (3) The player never misses high, but he can miss to the right of the goal (if he aims to the right) or to the left (if he aims to the left). For reasonable values of the standard deviation and d, find the probability that the player makes a goal if he aims at a point t feet inside the goal. (By symmetry, you can assume he aims to the right, although the goalie doesn’t know this.) What value of t seems to maximize the probability of making a goal?

81. In the 2012 Major League Baseball season, the Baltimore Orioles were ahead after the 7th inning in 74 games, and they won all 74 games. Use an appro- priate model to explore how unusual such a streak is. Would you place it in the same category as the famous 56-game hitting streak (at least one hit per game) by Joe DiMaggio in 1941? Discuss the differences, including those that are caused by pressure.

C A S E 5.1 EUROWATCH COMPANY

EuroWatch Company assembles expensive wristwatches and then sells them to retailers throughout Europe. The watches are assembled at a plant with two assembly lines. These lines are intended to be identical, but line 1 uses somewhat older equipment than line 2 and is typically less

reliable. Historical data have shown that each watch coming off line 1, independently of the others, is free of defects with probability 0.98. The similar probability for line 2 is 0.99. Each line produces 500 watches per hour. The production manager has asked you to answer the following questions.

Case 5.1 EuroWatch Company 219 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

1. She wants to know how many defect-free watches each line is likely to produce in a given hour. Specifically, find the smallest integer k (for each line separately) such that you can be 99% sure that the line will not produce more than k defective watches in a given hour.

2. EuroWatch currently has an order for 500 watches from an important customer. The company plans to fill this order by packing slightly more than 500 watches, all from line 2, and sending this package off to the customer. Obviously, EuroWatch wants to send as few watches as possible, but it wants to be 99% sure that when the customer opens the package, there are at least 500 defect-free watches. How many watches should be packed?

3. EuroWatch has another order for 1000 watches. Now it plans to fill this order by packing slightly more than one hour’s production from each line. This package will contain the same number of watches from each line. As in the previous ques- tion, EuroWatch wants to send as few watches as possible, but it again wants to be 99% sure that when the customer opens the package, there are at least 1000 defect-free watches. The question of how many watches to pack is unfortunately quite difficult because the total number of defect-free watches is defect-free watches is def not binomially not binomially not distributed. (Why not?) Therefore, the manager asks you to solve the problem with simulation (and some trial and error). (Hint: It turns out that it is much faster to simulate small numbers than large numbers, so simulate the number of watches with defects, not the number without defects.)

4. Finally, EuroWatch has a third order for 100 watches. The customer has agreed to pay

$50,000 for the order—that is, $500 per watch. If EuroWatch sends more than 100 watches to the customer, its revenue doesn’t increase; it can never exceed $50,000. Its unit cost of produc- ing a watch is $450, regardless of which line it is assembled on. The order will be filled entirely from a single line, and EuroWatch plans to send slightly more than 100 watches to the customer.

If the customer opens the shipment and finds that there are fewer than 100 defect-free watches (which we assume the customer has the ability to do), then he will pay only for the defect-free watches—EuroWatch’s revenue will decrease by $500 per watch short of the 100 required—and on top of this, EuroWatch will be required to make up the difference at an expedited cost of $1000 per watch. The customer won’t pay a dime for these expedited watches. (If expediting is required, EuroWatch will make sure that the expedited watches are defect-free. It doesn’t want to lose this customer entirely.)

You have been asked to develop a spreadsheet model to find EuroWatch’s expected profit for any number of watches it sends to the customer. You should develop it so that it responds correctly, regardless of which assembly line is used to fill the order and what the shipment quantity is. (Hints: Use the BINOM.DIST function, with last argument 0, to fill up a column of probabilities for each possible number of defective watches. Next to each of these, calculate EuroWatch’s profit. Then use a SUMPRODUCT to obtain the expected profit. Finally, you can assume that EuroWatch will never send more than 110 watches. It turns out that this large a shipment is not even close to optimal.)

C A S E 5.2 CASHING IN ON THE LOTTERY

Many states supplement their tax revenues with state-sponsored lotteries. Most of them do so with a game called lotto. Although there are various versions of this game, they are all basically as follows. People purchase tickets that contain r distinct r distinct r numbers from 1 to m, where r is generally 5 or 6 and m is generally around 50. For example, in Virginia, the state discussed in this case, r = 6 and m = 44. Each

ticket costs $1, about 39 cents of which is allocated to the total jackpot.7 There is eventually a drawing of r = 6 distinct numbers from the m = 44 possible

7Of the remaining 61 cents, the state takes about 50 cents. The other 11 cents is used to pay off lesser prize winners whose tickets match some, but not all, of the winning 6 numbers. To keep this case relatively simple, however, we ignore these lesser prizes and concentrate only on the jackpot.

220 Chapter 5 Normal, Binomial, Poisson, and Exponential Distributions Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

221221

numbers. Any ticket that matches these 6 numbers wins the jackpot.

There are two interesting aspects of this game. First, the current jackpot includes not only the revenue from this round of ticket purchases but also any jackpots carried over from previous drawings because of no winning tickets. Therefore, the jackpot can build from one drawing to the next, and in celebrated cases it has become huge. Second, if there is more than one winning ticket—a distinct possibility—the winners share the jackpot equally. (This is called parimutuel betting.) So, for example, if parimutuel betting.) So, for example, if parimutuel the current jackpot is $9 million and there are three winning tickets, then each winner receives $3 million.

It can be shown that for Virginia’s choice of r and r and r m, there are approximately 7 million possible tickets 7 million possible tickets 7 (7,059,052 to be exact). Therefore, any ticket has about one chance out of 7 million of being a winner. 7 million of being a winner. 7 That is, the probability of winning with a single ticket is p = 1/7,059,052—not very good odds. If n people purchase tickets, then the number of winners is binomially distributed with parameters n and p. Because n is typically very large and p is small, the number of winners has approximately a Poisson distribution with rate λ = np. (This makes ensuing calculations somewhat easier.) For example, if 1 million tickets are purchased, then the number of winning tickets is approximately Poisson distributed with λ = 1/7.

In 1992, an Australian syndicate purchased a huge number of tickets in the Virginia lottery in an attempt to assure itself of purchasing a winner. It worked! Although the syndicate wasn’t able to purchase all 7 million possible tickets (it was about 1.5 million shy of this), it did purchase a winning ticket, and there were no other winners. Therefore, the syndicate won a 20-year income stream worth approximately $27 million, with a net present value of approximately $14 million. This made the syndicate a big profit over the cost of the tickets it purchased. Two questions come to mind: (1) Is this hogging of tickets unfair to the rest of the public? (2) Is it a wise strategy on the part of the syndicate (or did it just get lucky)?

To answer the first question, consider how the lottery changes for the general public with the addition of the syndicate. To be specific, suppose the syndicate can invest $7 million and obtain all of the possible tickets, making itself a sure winner. Also, suppose n people from the general public

purchase tickets, each of which has 1 chance out of 7 million of being a winner. Finally, let R be the jackpot carried over from any previous lotteries. Then the total jackpot on this round will be [R + 0.39 (7,000,000 + n)] because 39 cents from every ticket goes toward the jackpot. The number of winning tickets for the public will be Poisson distributed with λ = n/7,000,000. However, any member of the public who wins will necessarily have necessarily have necessarily to share the jackpot with the syndicate, which is a sure winner. Use this information to calculate the expected amount the public will win. Then do the same calculation when the syndicate does not play. not play. not (In this case the jackpot will be smaller, but the public won’t have to share any winnings with the syndicate.) For values of n and R that you can select, is the public better off with or without the syndicate? Would you, as a general member of the public, support a move to outlaw syndicates from hogging the tickets?

The second question is whether the syndicate is wise to buy so many tickets. Again assume that the syndicate can spend $7 million and purchase each possible ticket. (Would this be possible in reality?) Also, assume that n members of the general public purchase tickets, and that the carryover from the previous jackpot is R. The syndicate is thus assured of having a winning ticket, but is it assured of covering its costs? Calculate the expected net benefit (in terms of net present value) to the syndicate, using any reasonable values of n and R, to see whether the syndicate can expect to come out ahead.

Actually, the analysis suggested in the previous paragraph is not complete. There are at least two complications to consider. The first is the effect of taxes. Fortunately for the Australian syndicate, it did not have to pay federal or state taxes on its winnings, but a U.S. syndicate wouldn’t be so lucky. Second, the jackpot from a $20 million jackpot, say, is actually paid in 20 annual $1 million payments. The Lottery Commission pays the winner $1 million immediately and then purchases 19 “strips” (bonds with the interest not included) maturing at 1-year intervals with face value of $1 million each. Unfortunately, the lottery prize does not offer the liquidity of the Treasury issues that back up the payments. This lack of liquidity could make the lottery less attractive to the syndicate.

Case 5.2 Cashing in on the Lottery 221 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

222 Chapter 6 Decision Making Under Uncertainty

DECIDING WHETHER TO DEVELOP NEW DRUGS AT BAYER

The formal decision-making process discussed in this chapter is often used to make difficult decisions in the face of much uncertainty, large monetary Tto make difficult decisions in the face of much uncertainty, large monetary T values, and long-term consequences. Stonebraker (2002) chronicles one such decision-making process he performed for Bayer Pharmaceuticals in 1999. The development of a new drug is a time-consuming and expensive process that is filled with risks along the way. A pharmaceutical company must first get the proposed drug through preclinical trials, where the drug is tested on animals. Assuming this stage is successful (and only about half are), the company can then file an application with the Food and Drug Administration (FDA) to conduct clini- cal trials on humans. These clinical trials have three phases. Phase 1 is designed to test the safety of the drug on a small sample of healthy patients. Phase 2 is de- signed to identify the optimal dose of the new drug on patients with the disease. Phase 3 is a statistically designed study to prove the efficacy and safety of the new drug on a larger sample of patients with the disease. Failure at any one of these phases means that further testing stops and the drug is never brought to market.

© R

e ic

a d

e n

/s h

u tt e

rs to

c k.

c o

m

C H A P T E R

6 Decision Making Under Uncertainty

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-1 Introduction 223

Of course, this means that all costs up to the failure point are lost. If the drug makes it through the clinical tests (and only about 25% of all drugs do so), the company can then apply to the FDA for permission to manufacture and market its drug in the United States. Assuming that the FDA approves, the company is then free to launch the drug in the marketplace.

The study involved the evaluation of a new drug for busting blood clots called BAY 57-9602, and it commenced at a time just prior to the first decision point: whether to con- duct preclinical tests. This was the company’s first formal use of decision making for evaluat- ing a new drug, so to convince the company of the worth of such a study, Stonebraker did exactly what a successful management scientist should do. He formulated the problem and its objectives; he identified risks, costs, and benefits; he involved key people in the organization to help provide the data needed for the decision analysis; and, because much of the resulting data consisted of educated guesses at best, he performed a thorough sensitivity analysis on the inputs. Although we are not told in the article how everything turned out, the analysis did persuade Bayer management to proceed in January 2000 with preclinical testing of the drug.

The article provides a fascinating look at how such a study should proceed. Because there is so much uncertainty, the key is determining probabilities and probability distribu- tions for the various inputs. First, there are uncertainties in the various phases of testing. Each of these can be modeled with a probability of success. For example, the chance of making it through preclinical testing was assessed to be about 65% for BAY 57-9602, although management preferred to use the more conservative benchmark of 50% (based on historical data on other drugs) for the decision analysis. Many of the other uncertain quantities, such as the eventual market share, are continuous random variables. Because the decision tree approach discussed in this chapter requires discrete random variables, usually with only a few possible values, Stonebraker used a popular three-point approximation for all continuous quantities. He asked experts to assess the 10th percentile, the 50th percen- tile, and the 90th percentile, and he assigned probabilities 0.3, 0.4, and 0.3 to these three values. [The validity of such an approximation is discussed in Keefer and Bodily (1983).]

After getting all such estimates of uncertain quantities from the company experts, the author examined the expected net present value (NPV) of all costs and benefits from developing the new drug. To see which of the various uncertain quantities affected the expected NPV most, he varied each such quantity, one at a time, from its 10th percentile to its 90th percentile, leaving the other inputs at their base 50th percentile values. This identified several quantities that the expected NPV was most sensitive to, including the peak product share, the price per treatment in the United States, and the annual growth rate. The expected NPV was not nearly as sensitive to other uncertain inputs, including the product launch date and the production process yield. Therefore, in the final decision analysis, Stonebraker treated the sensitive inputs as uncertain and the less sensitive inputs as certain at their base values. He also calculated the risk profile from developing the drug. This indicates the probability distribution of NPV, taking all sources of uncertainty into account. Although this risk profile was not exactly optimistic (90% chance of losing money using the conservative probabilities of success, 67% chance of losing money with the more optimistic product-specific probabilities of success), this risk profile compared favorably with Bayer’s other potential projects. This evaluation, plus the rigor and defensibility of the study, led Bayer management to give the go-ahead on preclinical testing. ■

6-1 INTRODUCTION This chapter provides a formal framework for analyzing decision problems that involve uncertainty. Our discussion includes the following:

■ criteria for choosing among alternative decisions

■ how probabilities are used in the decision-making process

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

224 Chapter 6 Decision Making Under Uncertainty

■ how early decisions affect decisions made at a later stage

■ how a decision maker can quantify the value of information

■ how attitudes toward risk can affect the analysis

Throughout, we employ a powerful graphical tool—a decision tree—to guide the analysis. A decision tree enables a decision maker to view all important aspects of the problem at once: the decision alternatives, the uncertain outcomes and their probabilities, the economic consequences, and the chronological order of events. Although decision trees have been used for years, often created with paper and pencil, we show how they can be implemented in Excel with a very powerful and flexible add-in from Palisade called PrecisionTree.

Many examples of decision making under uncertainty exist in the business world, including the following:

■ Companies routinely place bids for contracts to complete a certain project within a fixed time frame. Often these are sealed bids, where each company presents a bid for complet- ing the project in a sealed envelope. Then the envelopes are opened, and the low bidder is awarded the bid amount to complete the project. Any particular company in the bid- ding competition must deal with the uncertainty of the other companies’ bids, as well as possible uncertainty regarding their cost to complete the project if they win the bid. The trade-off is between bidding low to win the bid and bidding high to make a larger profit.

■ Whenever a company contemplates introducing a new product into the market, there are a number of uncertainties that affect the decision, probably the most important being the customers’ reaction to this product. If the product generates high customer demand, the company will make a large profit. But if demand is low—and, after all, the vast majority of new products do poorly—the company could fail to recoup its development costs. Because the level of customer demand is critical, the com- pany might try to gauge this level by test marketing the product in one region of the country. If this test market is a success, the company can then be more optimistic that a full-scale national marketing of the product will also be successful. But if the test market is a failure, the company can cut its losses by abandoning the product.

■ Whenever manufacturing companies make capacity expansion decisions, they face uncertain consequences. First, they must decide whether to build new plants. If they don’t expand and demand for their products is higher than expected, they will lose revenue because of insufficient capacity. If they do expand and demand for their products is lower than expected, they will be stuck with expensive underutilized capacity. Of course, in today’s global economy, companies also need to decide where to build new plants. This decision involves a whole new set of uncertainties, including exchange rates, labor availability, social stability, competition from local businesses, and others.

■ Banks must continually make decisions on whether to grant loans to businesses or individuals. As we all know, many banks made many very poor decisions, espe- cially on mortgage loans, during the years leading up to the financial crisis in 2008. They fooled themselves into thinking that housing prices would only increase, never decrease. When the bottom fell out of the housing market, banks were stuck with loans that could never be repaid.

■ Utility companies must make many decisions that have significant environmental and economic consequences. For these companies it is not necessarily enough to conform to federal or state environmental regulations. Recent court decisions have found companies liable—for huge settlements—when accidents occurred, even though the companies fol- lowed all existing regulations. Therefore, when utility companies decide, say, whether to replace equipment or mitigate the effects of environmental pollution, they must take into account the possible environmental consequences (such as injuries to people) as

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-2 Elements of Decision Analysis 225

well as economic consequences (such as lawsuits). An aspect of these situations that makes decision analysis particularly difficult is that the potential “disasters” are often extremely unlikely; hence, their probabilities are difficult to assess accurately.

■ Sports teams continually make decisions under uncertainty. Sometimes these deci- sions involve long-run consequences, such as whether to trade for a promising but as yet untested pitcher in baseball. Other times these decisions involve short-run conse- quences, such as whether to go for a fourth down or kick a field goal late in a close football game. You might be surprised at the level of quantitative sophistication in professional sports these days. Management and coaches typically do not make im- portant decisions by gut feeling. They employ many of the tools in this chapter and in other chapters of this book.

Although the focus of this chapter is on business decisions, the approach discussed in this chapter can also be used in important personal decisions you have to make. As an example, if you are just finishing an undergraduate degree, should you go immediately into a graduate program, or should you work for several years and then decide whether to pursue a graduate degree? As another example, if you currently have a decent job but you have the option to take another possibly more promising job that would require you (and your family) to move to another part of the country, should you stay or move?

You might not have to make too many life-changing decisions like these, but you will undoubtedly have to make a few. How will you make them? You will probably not use all of the formal methods discussed in this chapter, but the discussion provided here should at least motivate you to think in a structured way before making your final decisions.

6-2 ELEMENTS OF DECISION ANALYSIS Although decision making under uncertainty occurs in a wide variety of contexts, the problems we discuss in this chapter are alike in the following ways:

1. A problem has been identified that requires a solution.

2. A number of possible decisions have been identified.

3. Each decision leads to a number of possible outcomes.

4. There is uncertainty about which outcome will occur, and probabilities of the pos- sible outcomes are assessed.

5. For each decision and each possible outcome, a payoff is received or a cost is incurred.

6. A “best” decision must be chosen using an appropriate decision criterion.

We now discuss these elements in some generality.1

6-2a Identifying the Problem

This is the same issue that was discussed in Section 1.4 of Chapter 1. When something triggers the need to solve a problem, you should think carefully about the problem that needs to be solved before diving in. Perhaps you are just finishing your undergraduate degree (the trigger), and you want to choose the Business School where you should get your MBA degree. You have then framed the problem as “Which MBA program?”, but maybe you should frame it more generally as “What should I do next, now that I have my

1For a wonderful discussion of decision making at a very nontechnical level, we highly recommend the book by Hammond et al. (1999).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

226 Chapter 6 Decision Making Under Uncertainty

2There are several equivalent ways to express probabilities. As an example, you can state that the probability of your team winning a basketball game is 0.6. Alternatively, you can say that the probability of them winning is 60%, or that the odds of them winning are 3 to 2. These are all equivalent. We will generally express probabilities as decimal numbers between 0 and 1, but we will also quote percentages from time to time.

undergraduate degree?”. You don’t necessarily have to enter an MBA program right away. You could get a job and then get an MBA degree later, or you could enter a graduate pro- gram in some area other than Business. Maybe you could even open your own business and forget about graduate school. The point is that by changing the problem from “Which MBA program?” to “What do I do next?”, you change the decision problem in a funda- mental way.

6-2b Possible Decisions

The possible decisions depend on the previous step: how the problem is specified. But after the problem identification, all possible decisions for this problem should be listed. Keep in mind that if a potential decision isn’t in this list, it won’t have a chance of being chosen as the best decision later, so this list should be as comprehensive as possible. Note some problems are of a multistage nature, as discussed in Section 6.5. In such problems, a first-stage decision is made, then an uncertain outcome is observed, then a second-stage decision is made, then a second uncertain outcome is observed, and so on. (Often there are only two stages, but there could be more.) In this case, a “decision” is really a “strategy” or “contingency plan” that prescribes what to do at each stage, depending on prior decisions and observed outcomes. These ideas are clarified in Section 6.5.

6-2c Possible Outcomes

One of the main reasons why decision making under uncertainty is difficult is that deci- sions have to be made before uncertain outcomes are revealed. For example, you must place your bet at a roulette wheel before the wheel is spun. Or you must decide what type of auto insurance to purchase before you find out whether you will be in an accident. However, before you make a decision, you must at least list the possible outcomes that might occur. In some cases, the outcomes will be a small set of discrete possibilities, such as the 11 possible sums (2 through 12) of the roll of two dice. In other cases, the outcomes will be a continuum of possibilities, such as the possible damage amounts to a car in an accident. In this chapter, we generally allow only a small discrete set of possible outcomes. If the actual set of outcomes is a continuum, then we typically choose a small set of repre- sentative outcomes from this continuum.

6-2d Probabilities of Outcomes

A list of all possible outcomes is not enough. As a decision maker, you must also assess the likelihoods of these outcomes with probabilities. Note that these outcomes are gener- ally not equally likely. For example, if there are only two possible outcomes, rain or no not equally likely. For example, if there are only two possible outcomes, rain or no not rain, when you are deciding whether to carry an umbrella to work, there is no generally no reason to assume that each of these outcomes has a 50-50 chance of occurring. Depending on the weather report, they might be 80-20, 30-70, or any of many other possibilities.

There is no easy way to assess the probabilities of the possible outcomes. Sometimes they will be determined at least partly by historical data. For example, if demand for your product is uncertain, with possible outcomes “low,” “medium,” and “high,” you might assess their probabilities as 0.5, 0.3, and 0.2 because past demands have been low about 50% of the time, medium about 30% of the time, and high about 20% of the time.2 However,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-2 Elements of Decision Analysis 227

this product might be a totally new product, unlike any of your previous products. Then data on past demands will probably not be relevant, and your probability assessments for demand of the new product will necessarily contain a heavy subjective component—your best guesses based on your experience and possibly the inputs of the marketing experts in your company. In fact, we would venture to say that the probabilities in most real business decision-making problems are of the subjective variety, so managers must make the prob- ability assessments most in line with the data available and their gut feeling.

To complicate matters, probabilities sometimes change as more information becomes available. For example, suppose you assess the probability that the Cleveland Cavaliers will win the NBA championship this year. Will this assessment change if you hear later that LeBron James has suffered a season-ending injury? It almost surely will, probably quite a lot. Sometimes, as in this basketball example, you will change your probabilities in an informal way when you get new information. However, in Section 6.5, we show how informal way when you get new information. However, in Section 6.5, we show how informal probabilities can be updated in a formal way by using an important law of probabilities formal way by using an important law of probabilities formal called Bayes’ rule.

6-2e Payoffs and Costs

Decisions and outcomes have consequences, either good or bad. These must be assessed before intelligent decisions can be made. In our problems, these will be monetary payoffs or costs, but in many real-world decision problems, they can be nonmonetary, such as environmental damage or loss of life. Obviously, nonmonetary consequences can be very difficult to quantify, but an attempt must be made to do so. Otherwise, it is impossible to make meaningful trade-offs.

6-2f Decision Criterion

Once all of these elements of a decision problem have been specified, it is time to make some difficult trade-offs. For example, would you rather take a chance at receiving $1 million, with the risk of losing $2 million, or would you rather play it safer? Of course, the answer depends on the probabilities of these two outcomes, but as you will see later in the chapter, if very large amounts of money are at stake (relative to your wealth), your attitude toward risk can also play a key role in the decision-making process.

In any case, for each possible decision, you face a number of uncertain outcomes with given probabilities, and each of these leads to a payoff or a cost. The result is a probability distribution of payoffs and costs. For example, one decision might lead to the following: a payoff of $50,000 with probability 0.1, a payoff of $10,000 with probability 0.2, and a cost of $5000 with probability 0.7. (The three outcomes are mutually exclusive; their probabilities sum to 1.) Another decision might lead to the following: a payoff of $5000 with probability 0.6 and a cost of $1000 with probability 0.4. Which of these two decisions do you favor? The choice is not obvious. The first decision has more upside potential but more downside risk, whereas the second decision is safer.

In situations like this—the same situations faced throughout this chapter—you need a decision criterion for choosing between two or more probability distributions of payoff/ cost outcomes. Several methods have been proposed:

■ Look at the worst possible outcome for each decision and choose the decision that has the best (or least bad) of these. This is relevant for an extreme pessimist.

■ Look at the 5th percentile of the distribution of outcomes for each decision and choose the decision that has the best of these. This is also relevant for a pessimist— or a company that wants to limit its losses. (Actually, any percentile, not just the 5th, could be chosen.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

228 Chapter 6 Decision Making Under Uncertainty

■ Look at the best possible outcome for each decision and choose the decision that has the best of these. This is relevant for an extreme optimist.

■ Look at the variance (or standard deviation) of the distribution of outcomes for each decision and choose the decision that has the smallest of these. This is relevant for minimizing risk but, unfortunately, it treats upside risk and downside risk in the same way.

■ Look at the downside risk (however you want to define it) of the distribution of out- comes for each decision and choose the decision with the smallest of these. Again, this is relevant for minimizing risk, but now it minimizes only the part of the risk you really want to avoid.

The point here is that a probability distribution of payoffs and costs has many summary measures that could be used a decision criterion, and you could make an argument for any of the measures just listed. However, the measure that has been used most often, and the one that will be used for most of this chapter, is the mean of the probability distribution, also called its expected value. Because we are dealing with monetary outcomes, this cri- terion is generally known as the expected monetary value, or EMV, criterion. The EMV criterion has a long-standing tradition in decision-making analysis, both at a theoretical level (hundreds of scholarly journal articles) and at a practical level (used by many busi- nesses). It provides a rational way of making decisions, at least when the monetary payoffs and costs are of “moderate” size relative to the decision maker’s wealth. (Section 6.6 will present another decision criterion when the monetary values are not “moderate.”)

The expected monetary value, or EMV, for any decision is a weighted average of the possible payoffs for this decision, weighted by the probabilities of the outcomes. Using the EMV criterion, you choose the decision with the largest EMV. This is sometimes called “playing the averages.”

The EMV criterion is also easy to operationalize. For each decision, you take a weighted sum of the possible monetary outcomes, weighted by their probabilities, to find the EMV. Then you identify the largest of these EMVs. For the two decisions listed earlier, their EMVs are as follows:

■ Decision 1: EMV 5 50000(0.1) 1 10000(0.3) 1 (25000)(0.6) 5 $3500

■ Decision 2: EMV 5 5000(0.6) 1 (21000)(0.4) 5 $2600

Therefore, according to the EMV criterion, you should choose decision 1.

6-2g More about the EMV Criterion

Because the EMV criterion plays such a crucial role in decision making under uncertainty, it is worth exploring in more detail.

First, if you are acting according to the EMV criterion, you value a decision with a given EMV the same as a sure monetary outcome with the same EMV. To see how this works, suppose there is a third decision in addition to the previous two. If you choose this decision, there is no risk at all; you receive a sure $3000. Should you make this decision, presumably to avoid risk? According to the EMV criterion, the answer is no. Decision 1, with an EMV of $3500, is equivalent (for an EMV maximizer) to a sure $3500 payoff. Hence, it is favored over the new riskless decision. (Read this paragraph several times and think about its consequences. It is sometimes difficult to accept this logic in real decision- making problems, which is why not everyone uses the EMV criterion in every situation.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-2 Elements of Decision Analysis 229

Of course, the advantage to calculating EMVs in a spreadsheet is that you can easily perform sensitivity analysis on any of the inputs. For example, Figure 6.2 shows what hap- pens when the good outcome for decision 2 becomes more probable (and the bad outcome becomes less probable). Now the EMV for decision 2 is the largest of the three EMVs, so it is the best decision.

Second, the EMV criterion doesn’t guarantee good outcomes. Indeed, no criterion can guarantee good outcomes. If you make decision 1, for example, you might get lucky and make $50,000, but there is a 70% chance that you will lose $5000. This is the very nature of decision making under uncertainty: you make a decision and then you wait to see the consequences. They might be good and they might be bad, but at least by using the EMV criterion, you know that you have proceeded rationally.

Third, the EMV criterion is easy to operationalize in a spreadsheet. This is shown in Figure 6.1. (See the file Simple Decision Problem.xlsx.) For any decision, you list the possible payoff/cost values and their probabilities. Then you calculate the EMV with a SUMPRODUCT function. For example, the formula in cell B7 is

=SUMPRODUCT(A3:A5,B3:B5)

1 2 3 4 5 6 7

A BA B C DC D E FE F G HG H Decision 1 Payoff/Cost

$50,000 $10,000 –$5,000

EMV $3,500 EMV$2,6000 E$2,6000 E0 EEM0 E0 EV0 E $3,000

0.1 $5,000 −$1,000

0.6 $3,000 1 0.40.2

0.7

Probability Payoff/Cost Probability Payoff/Cost Probability Decision 2 Decision 3

1 $

0 E

1 $

0 E0 E

2 D

0 E

2 D

0 E

2 D t P

V $

Usually, the most important informa- tion from a sensitivity analysis is whether the best decision continues to be best as one or more inputs change.

Finally, you might still be wondering why we choose the EMV criterion in the first place. One way of answering this is that EMV represents a long-run average. If—and this is a big if—the decision could be repeated many times, all with the same monetary values and probabilities, the EMV is the long-run average of the outcomes you would observe. For example, by making decision 1, you would gain $50,000 about 10% of the time, you would gain $10,000 about 20% of the time, and you would lose $5000 about 70% of the time. In the long run, your average net gain would be about $3500.

This argument might or might not be relevant. For a company that routinely makes many decisions of this type (although they might not be identical), long-term averages make sense. Sometimes they win, and sometimes they lose, but it makes sense for them to be concerned only with long-term averages. However, a particular decision problem is often a “one-shot deal.” It won’t be repeated many times in the future; in fact, it

Figure 6.1 EMV Calculations in Excel

1 2 3 4 5 6 7

A BA B C DC D E FE F G HG H Decision 1 Payoff/Cost

$50,000 $10,000 –$5,000

EMV $3,500 EMV$3,800EMV $3,000

0.1 $5,000 –$1,000

0.8 $3,000 1 0.20.2

0.7

Probability Payoff/Cost Probability Payoff/Cost Probability Decision 2 Decision 3

t P 2 D2 D2 D

t P

Figure 6.2 EMV Calculations with Different Inputs

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

230 Chapter 6 Decision Making Under Uncertainty

This decision tree was actually created in Excel by using its built-in shape tools on a blank worksheet, but you could just as well draw it on a piece of paper. Alternatively, you could use the Palisade PrecisionTree add-in that we discuss later in the chapter. The important thing for now is how you interpret this decision tree. First, it is important to real- ize that decision trees such as this one have been used for over 50 years. They all use the following basic conventions:

won’t be repeated at all. In this case, you might argue that a long-term average criterion makes no sense and that some other criterion should be used instead. This has been debated by decision analysts, including many academics, for years, and the arguments continue. Nevertheless, most analysts agree that when “moderate” amounts of money are at stake, the EMV criterion provides a rational way to make good decisions, even for one-shot deals. Therefore, we use this criterion in most of this chapter.

6-2h Decision Trees

A decision problem evolves through time. A deci- sion is made, then an uncertain outcome is observed, then another decision might need to be made, then another uncertain outcome might be observed, and so on. All the while, payoffs are being received or costs are being incurred. It is useful to show all of these elements of the decision problem, includ-

ing the timing, in a type of graph called a decision tree. A decision tree not only allows everyone involved to see the elements of the decision problem in an intui- tive format,but it also provides a straightforward way of making the necessary EMV calculations.

The decision tree for the simple decision problem discussed earlier appears in Figure 6.3.

What It Means to Be an EMV Maximizer

An EMV maximizer, by definition, is indifferent when faced with the choice between entering a gamble that has a certain EMV and receiving a sure dollar amount in the amount of the EMV. For example, consider a gamble where you flip a fair coin and win $0 or $1000 depending on whether you get a head or a tail. If you are an EMV maximizer, you are indif-MV maximizer, you are indif-MV maximizer, you are indif ferent between entering this gamble, which has EMV $500, and receiving $500 for sure. Similarly, if the gamble is between losing $1000 and winning $500, based on the flip of the coin, and you are an EMV maximizer, you are indifferent between entering this gamble, which has EMV 2$250, and paying a sure $250 to avoid the gamble. (This latter scenario is the basis of insurance.)

F u n d a m e n t a l I n s i g h t

Figure 6.3 Simple Decision Tree 3500

50000

10000

�5000

5000

�1000

0.4

0.6

0.7

0.2

0.1

26003500

Decision 1

Decision 2

Decision 3

3000

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-2 Elements of Decision Analysis 231

The decision tree in Figure 6.3 follows these conventions. The decision node comes first (to the left) because you must make a decision before observing any uncertain outcomes. The probability nodes then follow the decision branches, and the probabilities appear above their branches. (Actually, there is no need for a probability node after decision 3 branch because its monetary value is a sure $3000.) The ultimate payoffs or costs appear next to the end nodes, to the right of the probability branches. The EMVs above the probability nodes are for the various decisions. For example, the EMV for the decision 1 branch is $3500. The maxi- mum of the EMVs corresponds to the decision 1 branch, and this maximum is written above the decision node. Because it corresponds to decision 1, we put a notch on the decision  1 branch to indicate that this decision is best.

This decision tree is almost a direct translation of the spreadsheet model in Figure 6.1. Indeed, the decision tree is overkill for such a simple problem; the spreadsheet model provides all of the required information. However, as you will see later, especially in Section 6.5, decision trees provide a useful view of more complex problems. In addition, decision trees provides a framework for doing all of the EMV calculations. Specifically, they allow you to use the following folding-back procedure to find the EMVs and the best decision.

Decision Tree Conventions

1. Decision trees are composed of nodes (circles, squares, and triangles) and branches (lines).

2. The nodes represent points in time. A decision node (a square) represents a time when you make a decision. A probability node (a circle) represents a time when the result of an uncertain outcome becomes known. An end node (a triangle) indicates that the problem is completed—all decisions have been made, all uncertainty has been resolved, and all payoffs and costs have been incurred. (When people draw decision trees by hand, they often omit the actual triangles, as we have done in Figure 6.3. However, we still refer to the right-hand tips of the branches as the end nodes.)

3. Time proceeds from left to right. This means that any branches leading into a node (from the left) have already occurred. Any branches leading out of a node (to the right) have not yet occurred.

4. Branches leading out of a decision node represent the possible decisions; you get to choose the preferred branch. Branches leading out of probability nodes repre- sent the possible uncertain outcomes; you have no control over which of these will occur.

5. Probabilities are listed on probability branches. These probabilities are conditional on the events that have already been observed (those to the left). Also, the probabilities on branches leading out of any probability node must sum to 1.

6. Monetary values are shown to the right of the end nodes. (As we discuss shortly, some monetary values can also be placed under the branches where they occur in time.)

7. EMVs are calculated through a “folding-back” process, discussed next. They are shown above the various nodes. It is then customary to mark the optimal decision branch(es) in some way. We have marked ours with a small notch.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

232 Chapter 6 Decision Making Under Uncertainty

This is exactly what we did in Figure 6.3. At each probability node, we calculated EMVs in the usual way (sums of products) and wrote them above the nodes. Then at the decision node, we took the maximum of the three EMVs and wrote it above this node. Although this procedure requires more work for more complex decision trees, the same two steps—taking EMVs at probability nodes and taking maximums at decision nodes— are the only arithmetic operations required. In addition, the PrecisionTree add-in discussed later in the chapter performs the folding-back calculations for you.

The folding-back process is a systematic way of calculating EMVs in a decision tree and thereby identifying the best decision strategy.

Folding-Back Procedure

Starting from the right of the decision tree and working back to the left:

1. At each probability node, calculate an EMV—a sum of products of monetary values and probabilities.

2. At each decision node, take a maximum of EMVs to identify the optimal decision.

Level A 1. Several decision criteria besides EMV are suggested

in the section. For each of the following criteria, rank all three decisions in Figure 6.1 from best to worst. a. Look only at the worst possible outcome for each

decision. b. Look only at the best possible outcome for each

decision. c. Look at the variance of the distribution of out-

comes for each decision, which you want to be small. (The variance of a probability distribution is the weighted sum of squared differences from the mean, weighted by the probabilities.)

2. For the decision problem in Figure 6.1, use data tables to perform the following sensitivity analyses. The goal in each is to see whether decision 1 continues to have the largest EMV. In each part, provide a brief explana- tion of the results. a. Let the payoff from the best outcome, the value in

cell A3, vary from $30,000 to $50,000 in incre- ments of $2500.

b. Let the probability of the worst outcome for the first decision, the value in cell B5, vary from

0.7 to 0.9 in increments of 0.025, and use formulas in cells B3 and B4 to ensure that they remain in the ratio 1 to 2 and the three probabilities for decision 1 continue to sum to 1.

c. Use a two-way data table to let the inputs in parts a and b vary simultaneously over the indicated ranges.

Level B 3. Some decision makers prefer decisions with low risk,

but this depends on how risk is measured. As we men- tioned in this section, variance (see the definition in problem 1) is one measure of risk, but it includes both upside and downside risk. That is, an outcome with a large positive payoff contributes to variance, but this type of “risk” is good. Consider a decision with some possible payoffs and some possible costs, with given probabilities. How might you develop a measure of downside risk for such a decision? With your down- side measure of risk, which decision in Figure 6.1 do you prefer, decision 1 or decision 2? (There is no single correct answer.)

P R O B L E M S

6-3 ONE-STAGE DECISION PROBLEMS Many decision problems are similar to the simple decision problem discussed in the previ- ous section. You make a decision, then you wait to see an uncertain outcome, and a payoff is received or a cost is incurred. We refer to these as single-stage decision problems because you make only one decision, the one right now. They all unfold in essentially the same way, as indicated by the spreadsheet model in Figure 6.1 or the decision tree in

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-3 One-Stage Decision Problems 233

3To keep the model simple, we ignore taxes and the time value of money.

E X A M P L E 6.1 NEW PRODUCT DECISIONS AT ACME

The Acme Company is trying to decide whether to market a new product. As in many new-product situations, there is considerable uncertainty about the eventual success of the product. The product is currently part way through the development process, and some fixed development costs have already been incurred. If the company decides to continue development and then market the product, there will be additional fixed costs, and they are estimated to be $6 million. If the product is marketed, its unit margin (sell- ing price minus variable cost) will be $18. Acme classifies the possible market results as “great,” “fair,” and “awful,” and it estimates the probabilities of these outcomes to be 0.45, 0.35, and 0.20, respectively. Finally, the company estimates that the corre- sponding sales volumes (in thousands of units sold) of these three outcomes are 600, 300, and 90, respectively. Assuming that Acme is an EMV maximizer, should it finish development and then market the product, or should it stop development at this point and abandon the product?3

Objective To use the EMV criterion to help Acme decide whether to go ahead with the product.

Where Do the Numbers Come From? Acme’s cost accountants should be able to estimate the monetary inputs: the fixed costs and the unit margin. (Of course, any fixed costs already incurred are sunk and therefore have no relevance to the current decision.) The uncertain sales volume is really a continu- ous variable but, as in many decision problems, Acme has replaced the continuum by three representative possibilities. The assessment of the probabilities and the sales volumes for these three possibilities might be based partly on historical data and market research, but they almost surely have a subjective component.

Solution The elements of the decision problem appear in Figure 6.4. (See the file New Product Decisions - Single-Stage.xlsx.) If the company decides to stop development and abandon the product, there are no payoffs, costs, or uncertainties; the EMV is $0. (Actually, this isn’t really an expected value; it is a sure $0.) On the other hand, if the company proceeds expected value; it is a sure $0.) On the other hand, if the company proceeds expected with the product, it incurs the fixed cost and receives $18 for every unit it sells. The prob- ability distribution of sales volume given in the problem statement appears in columns A to C, and each sales volume is multiplied by the unit margin to obtain the net revenues in column D. Finally, the formula for the EMV in cell B12 is

=SUMPRODUCT(D8:D10,B8:B10)-B4

Because this EMV is positive, slightly over $1 million, the company is better off market- ing the product than abandoning it.

Figure 6.3. The following example is typical of one-stage decision problems. This example is used as a starting point for more complex examples in later sections.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

234 Chapter 6 Decision Making Under Uncertainty

As before, a decision tree is probably overkill for this problem, but it is shown in Figure 6.5. This tree indicates one of at least two equivalent ways to show the EMV cal- culations. The values at the end nodes ignore the fixed cost, which is instead shown under the decision branch as a negative number. Therefore, the 7074 value above the probability node is the expected net revenue, not including the fixed cost. Then the fixed cost is sub- tracted from this to obtain the 1074 value above the decision node.

3 4 5 6 7 8 9

10 11 12 13 14 15 16

A BA B C DC D E FE F G HG H I Decision 1: Con�nue development and market the new product Fixed cost Unit margin

Market Great Fair Awful

EMV

$6,000 $18

Probability 0.45 0.35 0.20

$1,074

$0

Sales volume 600 300

90

Net revenue $10,800

$5,400 $1,620

Decision 2: Stop development and abandon product No payoffs, no costs, no uncertainty EMV

All monetary values (except the unit margin in cell B5) are in $1000s, and all sales volumes are in 1000s of units.

Figure 6.4 Spreadsheet Model for Single-Stage New Product Decision

7074

600(18) = 10800

300(18) = 5400

90(18) = 1620

Awful 0.20

Fair 0.35

Great 0.45

1074

Market product –6000

Abandon product

0

Figure 6.5 Decision Tree for New Product Model

Figure 6.6 shows an equivalent tree, where the fixed cost is still shown under the decision branch but is subtracted from each end node. Now the EMV above the prob- ability node is after subtraction of the fixed cost. Either tree is perfectly acceptable. However, this second tree provides the insight that two of the three outcomes result in a net loss to Acme, even though the weighted average, the EMV, is well in the posi- tive range. (Besides, as you will see in the next section, the second tree is the way the PrecisionTree add-in does it.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-3 One-Stage Decision Problems 235

Given the spreadsheet model in Figure 6.4, it is easy to perform a sensitivity analysis. Usually, the main purpose of such an analysis is to see whether the best decision changes as one or more inputs change. As an example, we will see whether the best decision con- tinues to be “proceed with marketing” if the total market decreases. Specifically, we let each of the potential sales volumes decrease by the same percentage and we keep track of the EMV from marketing the product. The results appear in Figure 6.7. For any percentage decrease in cell K3, the EMV from marketing is calculated in cell K4 with the formula

=(1-K3)*SUMPRODUCT(D8:D10,B8:B10)-B4

Then a data table is used in the usual way, with cell K3 as the column input cell, to calcu- late the EMV for various percentage decreases. As you can see, the EMV stays positive, so that marketing remains best, for decreases up to 15%. But if the decrease is 20%, the EMV becomes negative, meaning that the best decision is to abandon the product. In this case, the possible gains from marketing are not large enough to offset the fixed cost.

Figure 6.6 Equivalent Decision Tree 1074

600(18) – 6000 = 4800

300(18) – 6000 = –600

90(18) – 6000 = –4380

Awful 0.20

Fair 0.35

Great 0.45

1074

Market product

Abandon product

0

–6000

Figure 6.7 Sensitivity Analysis

3 4 5 6 7 8 9

10 11 12

J KJ K L ML M % decrease in all sales volumes

Sensitivity analysis to percentage decrease in all sales volumes

EMV for decision 1

% decrease

0% $1,074

$1,074 $720 $367

$13 –$341

5% 10% 15% 20%

EMV for decision 1

. . . . . . . . . . . . ■

The Acme problem is a prototype for all single-stage decision problems. When only a single decision needs to be made, and all of the elements of the decision problem have been specified, it is easy to calculate the required EMVs for the possible decisions and hence determine the EMV-maximizing decision in a spreadsheet model. The problem and the calculations can also be shown in a decision tree, although this doesn’t really provide any new information except possibly to give everyone involved a better “picture”

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

236 Chapter 6 Decision Making Under Uncertainty

Level A 4. The fixed cost of $6 million in the Acme problem is

evidently not large enough to make Acme abandon the product at the current time. How large would the fixed cost need to be to make the abandon option the best option? Explain how the decision tree, especially the version in Figure 6.5, answers this question easily.

5. Perform a sensitivity analysis on the probability of a great market. To do this, enter formulas in cells B9 and B10 (see Figure 6.4) to ensure that the probabili- ties of “fair” and “awful” remain in the same ratio, 35 to 20, and that all three probabilities continue to sum to 1. Then let the probability of “great” vary from 0.25 to 0.50 in increments of 0.05. Is it ever best to abandon the product in this range?

6. Sometimes it is possible for a company to influ- ence the uncertain outcomes in a favorable direction. Suppose Acme could, by an early marketing blitz, change the probabilities of “great,” “fair,” and “awful” from their current values to 0.75, 0.15, and 0.10. In terms of EMV, how much would the company be willing to pay for such a blitz?

Level B 7. Sometimes a “single-stage” decision can be broken

down into a sequence of decisions, with no uncertainty resolved between these decisions. Similarly, uncer- tainty can sometimes be broken down into a sequence of uncertain outcomes. Here is a typical example. A company has a chance to bid on a government project. The company first decides whether to place a bid, and then if it decides to place a bid, it decides how much to bid. Once these decisions have been made, the uncer- tainty is resolved. First, the company observes whether there are any competing bids. Second, if there is at least one competing bid, the company observes the lowest competing bid. The lowest of all bids wins the contract. Draw a decision tree that reflects this sequence. There should be two “stages” of decision nodes, followed by two “stages” of probability nodes. Then label the tree with some reasonable monetary values and probabili- ties, and perform the folding back process to find the company’s best strategy. Note that if the company wins the contract, its payoff is its bid amount minus its cost of completing the project minus its cost of preparing the bid, where these costs are assumed to be known.

P R O B L E M S

of the decision problem. In the next section, we examine a multistage version of the Acme problem, and then the real power of decision trees will become evident.

6-4 THE PRECISIONTREE ADD-IN Decision trees present a challenge for Excel. The challenge is to take advantage of Excel’s calculation capabilities (to calculate EMVs, for example) and its graphical capabilities (to depict the decision tree). Fortunately, Palisade has developed a powerful add-in to Excel called PrecisionTree that makes the process relatively straightforward. This add-in not only enables you to draw and label a decision tree, but it also performs the folding-back procedure automatically and then allows you to perform sensitivity analysis on key input parameters.

The first thing you must do to use PrecisionTree is to “add it in.” We assume you have already installed the Palisade DecisionTools Suite. Then to run PrecisionTree, you have two options:

■ If Excel is not currently running, you can open Excel and PrecisionTree by selecting PrecisionTree from the Palisade group in the list of programs on your computer.

■ If Excel is currently running, the first option will open PrecisionTree on top of Excel.

In either case, you will see the Welcome screen in Figure 6.8. Note the Quick Start link. We will come back to this shortly.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-4 The PrecisionTree Add-In 237

Figure 6.8 PrecisionTree Welcome Screen

Figure 6.9 PrecisionTree Ribbon

Once you click OK to dismiss the Welcome screen, you will know that PrecisionTree is loaded because of the new PrecisionTree tab and associated ribbon shown in Figure 6.9.

Although PrecisionTree is quite easy to use once you are familiar with it, you have to learn the basics. The easiest way to do this is to run a series of Quick Start videos (developed by Albright). To do this, you can bring up the Welcome screen in Figure 6.8 at any time through the PrecisionTree Help dropdown list. Then you can click the Quick Start link on the Welcome screen. This opens an example file shown in Figure 6.10. The five buttons on the left each launch a video that explains the basic features of PrecisionTree. Rather than repeat this information here, we urge you to watch the vid- eos and practice the steps—as often as you like. From here on, we assume that you have done so.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

238 Chapter 6 Decision Making Under Uncertainty

Figure 6.10 PrecisionTree Quick Start Buttons

1 2 3 4

$7,500 $150,000

75%

20% 40% 30% 10%

5 6 7 8 9

10 11 12 13 14 15

18 19

17 16

A BA B C DC D E FE F G HG H I J Bidding for a government contract

Known inputs Cost of placing a bid Cost of completing project Probability of any competing bid(s

Probability distribution of low competitor bid (if any) Assuming at least one competitor bid... Value Probability Our bid

$160,000 $170,000 $180,000

80% 40% 10%

Probability of winning Less than $160,000 Between $160,000 and $170,000 Between $170,000 and $180,000 Greater than $180,000

click the following buttons in the order shown to see videos of the steps in the analysis:

Step 2 Build Skeleton

of Tree

Step 3 Enter Values and

Probabilities

Step 4 Examine Optimal

Strategy

Step 5 Perform Sensitivity

Analysis

More PrecisionTree Examples

Read PDF Instructions

Step 1 Plan Decision Tree

Model

It is instructive to examine PrecisionTree’s decision tree for Acme’s single stage prob- lem. The completed tree appears in Figure 6.11. (See the file New Product Decisions - Single-Stage with PrecisionTree.xlsx.) It is essentially a mixture of the trees in Figures 6.4 and 6.5, but it is completely equivalent to each of them. As in Figure 6.4, the fixed cost is entered as a negative number below the decision branch, and the net revenues are entered below the probability branches. Then PrecisionTree calculates the net value—the sum of the monetary values on any path through the tree—to the right of the corresponding trian- gle end nodes. For the folding back process, it uses these net values. Specifically, the 1074 value to the right of the probability node is calculated (automatically) as (4800)(0.45) 1 (2600)(0.35) 1 (24380)(0.20).4 Then the 1074 value to the right of the decision node is calculated as the maximum of 1074 and 0.

In other words, PrecisionTree draws essentially the same tree and makes the same calculations that you could do by hand. Its advantages are that (1) it generates a nice-looking tree with all of the relevant inputs displayed, (2) it does the folding-back calculations automatically, and (3) it permits quick sensitivity analyses on any of the model inputs. Besides, as discussed in Quick Start video, you can easily identify the best decisions by following the TRUE branches. We will continue to use PrecisionTree in the rest of the chapter for trees that are considerably more complex than the one in Figure 6.11.

PrecisionTree Tip: Formatting Numbers If you are fussy about formatting numbers in Excel, you might spend a lot of time format- ting all of the numbers in a decision tree just the way you like them. However, there is a much quicker way in PrecisionTree. From the Settings dropdown on the PrecisionTree ribbon, select Model Settings and then the Format tab. By entering the formats you prefer here, the entire tree is formatted appropriately.

We finish this section with one important reminder discussed in the Quick Start videos. PrecisionTree reserves the cells with colored font (green, red, and blue) for its special formulas, so you should not change these cells. Your entries—probabilities and monetary

4PrecisionTree refers to the “probability” nodes and branches as “chance” nodes and branches. Either term is fine; they mean the same thing.

single-stage_decision_tree video.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 239

1 Acme single-stage new product decision

Inputs

Fixed cost $6,000

$18

A BA B C DC D E

Unit margin

Market Probability

0.45

0.35

0.20

Sales volume

600

300

90

Net revenue

$10,800

$5,400

$1,620

45.0%

$4,800

35.0%

–$600

$0

–$4,380

Great

Fair

Awful

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

20

21 New Product Decision

Continue with product?

$1,074

–$6,000

TRUE Sales volume $1,074

45.0%

$10,800

35.0%

$5,400

20.0%

$1,620

FALSE

0

0.0%

$0

19

18

23

22

All monetary values (except the unit margin in cell B5) are in $1000s, and all sales volumes are in 1000s of units.

Great

Fair

Awful

Yes

No

Figure 6.11 Decision Tree from PrecisionTree

Level A 8. Explain in some detail how the PrecisionTree calcula-

tions in Figure 6.11 for the Acme problem are exactly the same as those for the hand-drawn decision tree in Figure 6.6. In other words, explain exactly how PrecisionTree gets the monetary values in the colored cells in Figure 6.11.

9. Use PrecisionTree’s Sensitivity Analysis tools to perform the sensitivity analysis requested in problem 5 of the previous section. (Watch the Step 5 video in Figure 6.10 if necessary.)

Level B 10. Use PrecisionTree to solve problem 7 of the previous

section.

P R O B L E M S

values—should all be in the cells with black font, and it is a good practice to cell reference these inputs whenever possible. For example, we didn’t enter 45% in cell C12; we entered a link to cell B8.

6-5 MULTISTAGE DECISION PROBLEMS Many real-world decision problems evolve through time in stages. A company first makes a decision. Then it observes an uncertain outcome that provides some infor- mation. Based on this information, the company then makes another decision. Then it observes another uncertain outcome. This process could continue for more stages, but

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

240 Chapter 6 Decision Making Under Uncertainty

we will limit the number of stages to two: a first decision, a first uncertain outcome, a second decision, and a second uncertain outcome. As time unfolds, payoffs are received and costs are incurred, depending on the decisions made and the uncertain outcomes observed. The objective is again to maximize EMV, but now we are searching for an EMV-maximizing strategy, often called a contingency plan, that specifies which deci- sion to make at each stage.

As you will see shortly, a contingency plan tells the company which decision to make at the first stage, but the company won’t know which decision to make at the second stage until the information from the first uncertain outcome is known. For example, if the infor- mation is bad news about a product, then the company might decide at the second stage to abandon the product, but if the news is good, then the company might decide to continue with the product. This is the essence of a contingency plan: it tells you what do for each possible uncertain outcome.

An important aspect of multistage decision problems is that probabilities can change through time. Specifically, after you receive the information from the first-stage uncertain outcome, you might need to reassess the probabilities of future uncertain outcomes. As an example, if a new product is observed to do very poorly in a regional test market, your assessment of the probability that it will do well in a national market will almost surely change; the probability will decrease. Sometimes this reassessment of probabilities can be done in an informal subjective manner. But whenever possible, it should be done with a powerful probability law called Bayes’ rule. This rule provides a mathematical way of updating probabilities as new information becomes available, and we will explain how it works in this section.

Another important aspect of multistage decision problems is the value of informa- tion. Sometimes the first-stage decision is to buy information that will help in making the second-stage decision. The question then is how much this information is worth. If you knew what the information would be, there would be no point in buying it. However, you virtually never know what the information will be; you can only assess the probabilities of various information outcomes. In such cases, the goal is to calculate the expected value of the information—how much better you would be with the information than without it—and then compare this to the actual cost of buying the information to see whether it is worth buying. Again, we explain how this works in this section.

We now show one way the Acme decision problem can be extended to two stages. Later in this section, we examine another multistage version of Acme’s problem.

EXAMPLE 6.2 NEW PRODUCT DECISIONS AT ACME WITH TECHNOLOGICAL UNCERTAINTY

In this version of the example, we assume as before that the new product is still in the development stage. However, we now assume that there is a chance that the product will be a failure for technological reasons, such as a new drug that fails to meet FDA approval. At this point in the development process, Acme assesses the probability of technologi- cal failure to be 0.2. The $6 million fixed cost from before is now broken down into two components: $4 million for addition development costs and $2 million for fixed costs of marketing, the latter to be incurred only if the product is a technological success and the company decides to market it. The unit margin and the probability distribution of the prod- uct’s sales volume if it is marketed are the same as before. How should Acme proceed?

Objective To use a decision tree to find Acme’s EMV-maximizing strategy for this two- stage decision problem.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 241

Where Do the Numbers Come From? The probability of technological failure might be based partly on historical data—the tech- nological failure rate of similar products in the past—but it is probably partly subjective, based on how the product’s development has proceeded so far. The probability distribution of sales volume is a more difficult issue. When Acme makes its first decision, right now, it must look ahead to see how the market might look in the future, after the development stage, which could be quite a while from now. (The same issue is relevant in Example 6.1, although we didn’t discuss it there.) This a difficult assessment, and it is an obvious candi- date for an eventual sensitivity analysis.5

Solution The reason this is a two-stage decision problem is that Acme can decide right away to stop development and abandon the product, thus saving further fixed costs of development. However, if Acme decides to continue development and the product turns out to be a tech- nological success, a second decision on whether to market the product must still be made.

A spreadsheet model such as in Figure 6.1 for the single-stage problem could be devel- oped to calculate the relevant EMVs, but this isn’t as easy as it sounds. A much better way is to use a decision tree, using the PrecisionTree add-in. The finished tree appears in Figure 6.12. (See the file New Product Decisions - Technological Uncertainty.xlsx.) The first decision is whether to continue development. If “Yes,” the fixed development cost is incurred, so it is entered on this branch. Then there is a probability node for the technological success or fail- ure. If it’s a failure, there are no further costs, but the fixed development cost is lost. If it’s a success, Acme must decide whether to market the product. From this point, the tree is exactly like the single-stage tree, except that the fixed development cost is gone.

5We have purposely avoided the use of Bayes’ rule for now. It will be used in the next version of the Acme problem.

A 1 2 3 Inputs

Acme multistage new product decisions with technological uncertainty

Probability of failure Fixed development cost Fixed marketing cost Unit margin

Market Pt Probability Sales volume Net revenue $10,800

$5,400 $1,620

600 300

90

0.45

0.2 $4,000 $2,000

$18

0.35 0.20

Great Fair Awful

4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

FALSE

TRUE

�$4,000�$4,000�$4,000�$4,000 $59.2$59.$59.$59.222

0.0%

$0.0

20.0%

0

80.0%80.080.080.0%%%

0

20.0%

�$4,000.0

Market product?

Sales volumeSales vSales vSales volumolumolumeee

$1,074.0$1,074.$1,074.$1,074.000

45.0%

$10,800

35.0%

$5,400

$1,620

20.0%

$4,800.0

�$600.0

16.0%

�$4,380.0

0.0%

�$4,000.0

36.0%

28.0%

FALSE

0

TRUE

�$2,000�$2,000�$2,000�$2,000

31 32 33

B CB C D ED ED E F

All monetary values (except the unit margin in cell B7) are in $1000s, and all sales volumes are in 1000s of units.

No

No

No

Continue development?

Technological success?TeTeTechnological success?chnological success?chnological success?

$59.2

0

Yes

Yes

Yes

$1,074.0

New Product Decisions

Fair

Great

Awful

Figure 6.12 Decision Tree with Possible Techno- logical Failure

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

242 Chapter 6 Decision Making Under Uncertainty

Chart Data

Optimal Path

Value –$4,380.0#1

#2

#3

#4

16.0000%

20.0000%

28.0000%

36.0000%

–$4,000.0

–$600.0

$4,800.0

Probability

Probabilities for Decision Tree ‘New Product Decisions’ Optimal Path of Entire Decision Tree

40%

35%

30%

25%

20%

15% +

+

+

+

10%

5%

0%

–$ 5,

00 0.

0

P ro

b ab

ili ty

–$ 4,

00 0.

0

–$ 3,

00 0.

0

–$ 2,

00 0.

0

–$ 1,

00 0.

0

$1 ,0

00 .0

$2 ,0

00 .0

$4 ,0

00 .0

$5 ,0

00 .0

$3 ,0

00 .0

$0 .0

Figure 6.13 Risk Profile from Best Strategy

By following the TRUE branches, you can see Acme’s best strategy. The company should continue development, and if the product is a technological success, it should be marketed. The EMV, again the weighted average of all possible monetary outcomes with this strategy, is $59,200. However, this is only the expected value, or mean, of the prob- ability distribution of monetary outcomes. You can see the full probability distribution by requesting a risk profile from PrecisionTree (through the Decision Analysis dropdown). This appears, both in graphical and tabular form, in Figure 6.13. Note that Acme has a 64% chance of incurring a net loss with this strategy, including a possible loss of $4.38 million. This doesn’t sound good. However, the company has a 36% of a net gain of $4.8 million and, in an expected value sense, this more than offsets the possible losses.

PrecisionTree Tip: Placement of Results When you request a risk profile or other PrecisionTree reports, they are placed in a new workbook by default. If you would rather have them placed in the same workbook as your decision tree, select Application Settings from the Utilities dropdown list on the PrecisionTree ribbon, and change the “Place Reports In” setting to Active Workbook. You only have to do this once. (The @RISK add-in discussed in the next two chapters has this same setting.)

We won’t perform any systematic sensitivity analyses on this model (we ask you to do some in the problems), but it is easy to show that the best strategy is quite sensitive to the probability of technological failure. If you change this probability from 0.2 to 0.25 in

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 243

14 A BA B C DC D E FE F

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

New Product Decisions

FALSE

�$4,000

Technological success?

�$194.5

25.0%

0

0

75.0% Market product?

$1,074.0

FALSE

0

TRUE Sales volume

$1,074.0

45.0%

$10,800

35.0%

$5,400

20.0%

$1,620

�$2,000

0.0%

$4,800.0

0.0%

�$600.0

0.0%

�$4,380.0

0.0%

�$4,000.0

0.0%

�$4,000.0

100.0%

$0.00

TRUE

$0.0

Continue development?

Yes

Yes

Yes

Great

Fair

Awful

No

No

No

Figure 6.14 Decision Tree with Larger Probability of Failure

EXAMPLE 6.3 NEW PRODUCT DECISIONS AT ACME WITH AN OPTION TO BUY INFORMATION

Suppose now that Acme has just about finished the development process on the new prod- uct, so that fixed development costs are no longer an issue, and technological failure is no longer a possibility. The only question is whether Acme should market the product, given the uncertainty about the eventual sales volume. If the company decides to market

cell B4, the tree automatically recalculates, with the results in Figure 6.14. With just this small change, the best decision changes completely. Now the company should discontinue development and abandon the product. There is evidently not a large enough chance of recovering the fixed development cost.

Modeling Issues We return to the probability distribution of eventual sales volume. The interpretation here is that at the time of the first decision, Acme has assessed what the market might look like after the development stage, which could be quite a while from now. Again, this is a dif-after the development stage, which could be quite a while from now. Again, this is a dif-after the development stage, which could be quite a while from now. Again, this is a dif ficult assessment. Acme could instead break this assessment into parts. It could first assess a probability distribution for how the general market for such products might change—up, down, or no change, for example—by the time development is completed. Then for each of these general markets, it could assess a probability distribution for the sales volume of its new product. By breaking it up in this way, Acme might be able to make a more accu- rate assessment, but the decision tree would be somewhat more complex. We ask you to explore this in one of the problems. ■

The next example illustrates another possible multistage extension of the Acme deci- sion problem. This example provides an opportunity to introduce two important topics discussed earlier: Bayes’ rule for updating probabilities and the value of information.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

244 Chapter 6 Decision Making Under Uncertainty

the product, it will incur fixed marketing costs of $2 million. To keep the model simple, we now assume that there are only two possible market outcomes, good or bad. The sales volumes for these two possible outcomes are 600,000 units and 100,000 units, and Acme assesses that their probabilities are 0.4 and 0.6. However, before making the ultimate deci- sion, Acme has the option to hire a well-respected marketing research firm for $150,000. If Acme decides to use this option, the result will be a prediction of good or bad. That is, the marketing research firm will predict that either “We think the market for this product will be good” or “We think the market for this product will be bad.” Acme has used this firm before, so it has a sense of the prediction accuracy, as indicated in Table 6.1. Each row in this table indicates the actual market outcome, and each column indicates the prediction. So if the actual market is good, the prediction will be good with probability 0.8 and bad with probability 0.2. If the actual market is bad, the prediction will be bad with probability 0.7 and good with probability 0.3. What should Acme do to maximize its EMV?

Table 6.1 Prediction Accuracy of Marketing Research Firm Actual/Predicted Good Bad

Good 0.8 0.2 Bad 0.3 0.7

Objective To use a decision tree to see whether the marketing research firm is worth its cost and whether the product should be marketed.

Where Do the Numbers Come From? The main question here concerns the probabilities. Acme’s assessment of the probabilities of good or bad markets, 0.4 and 0.6, would be assessed as in earlier examples, probably subjectively. The probabilities in Table 6.1 are probably based partly on historical deal- ings with the marketing research firm—perhaps they have been right in about 75% of their predictions, give or take a bit—and some subjectivity. In any case, all of these probabilities are prime candidates for sensitivity analysis.

Solution Acme must first decide whether to hire the marketing research firm. If it decides not to, it can then immediately decide whether to market the product. On the other hand, if it decides to hire the firm, it must then wait for the firm’s prediction. After the prediction is received, Acme can then make the ultimate decision on whether to market the product. However, when making this ultimate decision, Acme should definitely take the firm’s prediction into account.

A “skeleton” for the appropriate decision tree, without any of the correct probabilities or monetary values, appears in Figure 6.15. For now, just focus on the structure of the tree, and how time flows from left to right. Note how the tree is not symmetric. If Acme doesn’t hire the firm, this “No” decision branch is followed immediately by another decision node for whether to market the product. However, if Acme does hire the firm, this “Yes” deci- sion branch is followed by a probability node for the firm’s prediction. Then after a good or a bad prediction, there is a decision node for whether to market the product.

Now it is time to label the tree with probabilities and monetary values. The monetary values present no problems, as will be seen shortly. However, the probabilities require a digression so that we can discuss Bayes’ rule. The problem is that the given probabilities in Table 6.1 are not the probabilities required in the tree. After we discuss Bayes’ rule, we will return to Acme’s decision problem.

multistage_decision_tree video.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 245

Bayes’ Rule: Frequency Approach Bayes’ rule, named after the Reverend Thomas Bayes from the 1700s, is a formal mathemati- cal mechanism for updating probabilities as new information becomes available. The general idea is simple, as illustrated in Figure 6.16. The original probabilities are called prior proba- bilities. Then information is observed and Bayes’ rule is used to update the prior probabilities to posterior probabilities. As the diagram indicates, the terms prior and posterior are relative. If later information is observed, the posterior probabilities in the middle play the role of priors. They are used, along with Bayes’ rule, to calculate new posterior probabilities.

17 A BA B C DC D E FE F

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

New Product Decisions

50.0%

50.0%

0

50.0%

0

0

50.0%

$0

50.0%

$0

Bad

0

50.0%

0

0

0

0

Yes

0

50.0%

0

0

50.0%

0

25.0%

0

25.0%

0

0.0%

0

0.0%

0

0.0%

0

0.0%

0

25.0%

0

25.0%

0

0.0%

0

0

Market product?

0

0

Prediction

Sales volume

0

Sales volume

0

Sales volume

0

0

Bad

No

Good

Yes

No

No

Yes

Good

No

Yes

Good

Bad

Good

Bad

TRUE

FALSE

Hire firm?

0

FALSE

FALSE

Market product?

0

TRUE

Market product?

0

TRUE

FALSE

TRUE

Figure 6.15 Skeleton of Decision Tree with Option to Buy Information

Figure 6.16 Bayesian Updating Process

Prior probabilities Information

observed Bayes’ rule Bayes’ rule

Posterior probabilities (which become priors for later information)

Later information observed

New posterior probabilities

The actual updating mechanism can be done in two ways: with frequencies (counts) or with probabilities. We (and our students) believe that the frequency approach is much easier to understand, so we will present it first. But because the probability approach is useful for spreadsheet calculations, we will present it as well.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

246 Chapter 6 Decision Making Under Uncertainty

Consider the following situation. During a routine physical exam, a middle-aged man named Joe tests positive for a certain disease. There were previously no indications that Joe had this disease, but the positive test sends him into a panic. He “knows” now that he has the disease. Or does he? Suppose that only 1% of all undiagnosed middle-aged men have this disease. Also, suppose the test Joe took is not entirely accurate. For middle-aged men who don’t have the disease, there is a 10% chance they will test positive. For middle- aged men who have the disease, there is a 5% chance they will test negative. So with a positive test result, what are the chances that Joe has the disease?

A frequency approach starts with a large number, say 10,000, of middle-aged men and follows them according to the stated percentages. A diagram of this appears in Figure 6.17. The percentages on the links are the given percentages, and the number in each box is the percentage times the number in the box above it. We know that Joe’s status is in one of the two lightly shaded boxes because he tested positive. Therefore, the probability that he has the disease, that is, the probability that his status is in the leftmost box, is 95/(951990), or about 8.75%.

We suspect that you are quite surprised by this low posterior probability. If so, you’re not alone. Highly trained physicians, when posed with this same problem, have given widely ranging answers—almost the entire range from 0% to 100%. Essentially, they might as well be throwing darts. The problem is that we humans don’t have very good intuition about probabilities. However, there are two simple reasons why Joe’s posterior probability of having the disease is as low as it is. First, not many men in his age group, only 1%, have the disease. Therefore, we tend to believe that Joe doesn’t have the disease unless we see convincing evidence to the contrary. The second reason is that this test has fairly large error rates, 10% false positives and 5% false negatives. Therefore, the evidence from the test is not entirely convincing.

What if Joe tested negative? Then using the same numbers in the diagram, his posterior probability of having the disease would drop quite a lot from the prior of 1%. Specifically, it would be 5/(518910), or about 0.06%. We were fairly sure he didn’t have the disease before the test (because only 1% of his age group has it), and a negative test result con- vinces us even more that he doesn’t have the disease.

Figure 6.17 Frequency Approach for Updating Probabilities

10,000 middle-aged men

9,900 without disease

8910 test negative

95 test positive

100 with disease

5 test negative

95 %

10 %

90%

990 test positive

5%

1% 99%

Joe’s chance of having the disease, given a positive test = 95/(95+990) = 8.75% Joe’s chance of having the disease, given a negative test = 5/(5+8910) = 0.056%

Joe’s chance of testing positive = (95+990)/10000 = 10.9%

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 247

One final calculation that will become useful in Acme’s problem appears at the bot- tom of Figure 6.17. This is the probability that Joe tests positive in the first place. (In gen- eral, it is the probability of any potential piece of information.) Of the 10,000 men, 95+990 test positive, so this probability is (951990)/10000, or about 10.9%. As you can see, most of these are false positives.

As you can see, this frequency approach is quite straightforward, even though it often yields surprising and unintuitive results. You are asked to apply it to several other sce- narios in the problems. For now, we apply it to Acme’s problem in Example 6.3. The prior probabilities of good or bad markets are 40% and 60%. The probabilities for the accuracy of the predictions are given in Table 6.1. From these, we can follow 1000 similar products and predictions, exactly as we did with Joe’s disease. (We use 1000 rather than 10,000 for variety. The number chosen doesn’t influence the results at all.) The diagram appears in Figure 6.18. As you can see, the probability of a good market increases from 40% to 64% with a good prediction, and it decreases to 16% with a bad prediction. Also, the probability that the prediction will be good is 50%.

Figure 6.18 Frequencies for Updating Probabilities in Acme Problem

1000 new products

600 with bad market

420 with bad prediction

320 with good prediction

400 with good market

80 with bad prediction

80 %

30 %

70%

180 with good prediction

20%

40% 60%

Chance of a good market, given a good prediction = 320/(320+180) = 64% Chance of a good market, given a bad prediction = 80/(80+420) = 16%

Chance of a good prediction = (320+180)/1000 = 50%

You should be aware that three complementary probabilities are implied by the proba- bilities shown. For example, after a good prediction, the market will be either good or bad, so the posterior probability of a bad market is 36%. Similarly, the posterior probability of a bad market after a bad prediction is 84%, and the probability of a bad prediction is 50%.

If you like this frequency approach for updating probabilities, you can keep using it. It is a perfectly acceptable way to update probabilities as information is received, and it is equivalent to a more formal use of Bayes’ rule, which we now present.

Bayes’ Rule: Probability Approach First, we need some notation. For any possible outcome O, we let P(O) be the probability of O. This implicitly indicates the probability of O occurring, given all the information currently available. If we want to indicate that new information, I, is available, we write the probability as P(O|I). This is called a I). This is called a I conditional probability. The vertical bar is read “given that,” so this is the probability of O, given that we have information I.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

248 Chapter 6 Decision Making Under Uncertainty

The typical situation is that there are several outcomes such as “good market” and “bad market.” In general, denote these outcomes as O1 to On, assuming there are n pos- sibilities. Then we start with prior probabilities P(O1) to P(On), n probabilities that sum to 1. Next, we observe new information, I, such as a market prediction, and we want the posterior probabilities P(O1|I) to I) to I P(On|I), an updated set of I), an updated set of I n probabilities that sum to 1. We assume that the “opposite” conditional probabilities, P(I|O1) to P(I|On), are given. In Bayesian terminology, these are called likelihoods. These likelihoods are the accuracy probabilities in Table 6.1. For example, one of these is the probability of seeing a good prediction, given that the market will be good.

Unfortunately, these likelihoods are not what we need in the decision tree. Because time goes from left to right, we first need the (unconditional) probabilities of possible predictions and then we need the posterior probabilities of market outcomes, given the predictions (see Figure 6.15). So Bayes’ rule is a formal rule for turning these conditional probabilities around. It is given in Equation (6.1).

Bayes’ Rule

P1Oi ∣ I2 = P1I ∣ Oi2P1Oi2

P1I ∣ O12P1O12 + ⋯ + P1I ∣ On2P1On2 (6.1)

Denominator of Bayes’ Rule (Law of Total Probability)

P1I2 = P1I ∣ O12P1O12 + ⋯ + P1I|On2P1On2 (6.2)

This formula is important in its own right. For I to occur, it must occur along with one I to occur, it must occur along with one I of the O’s. Equation (6.2) simply decomposes the probability of I into all of these possiI into all of these possiI - bilities. It is sometimes called the law of total probability.

In the case where there are only two O’s, labeled as O and Not O, Bayes’ rule takes the following form:

In words, Bayes’ rule says that the posterior is the likelihood times the prior, divided by a sum of likelihoods times priors. As a side benefit, the denominator in Bayes’ rule is also useful in multistage decision trees. It is the probability P(I) of the information outI) of the information outI - come.

Bayes’ Rule for Two Outcomes

P1O ∣ I2 = P1I ∣ O2P1O2 P1I ∣ O2P1O2 + P1I ∣ Not O2P1Not O2

(6.3)

Implementing Bayes’ Rule for Acme These formulas are actually fairly easy to implement in Excel, as shown in Figure 6.19 for the Acme problem. (See the file New Product Decisions – Information Option.xlsx.) First, it is important to be consistent in the use of rows and columns for the outcomes (the O’s) and the predictions (the I’s). If you examine Figure 6.19 closely, we have always put the Good/Bad labels for market outcomes down columns, and we have always put the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 249

Good/Bad labels for predictions across rows. You could just as well do it in the opposite way, but you should be consistent. This allows you to copy formulas. Note that the given probabilities, the priors and the likelihoods, are in the left section, columns B and C. The Bayes’ rule calculations are in the right section, columns G and H.

Acme multistage new product decisions with an option to buy information

Inputs Cost of market research

Probabilities that indicate the accuracy of the predictions

Fixed marketing cost Unit margin

Market Good

$150 $2,000

$18

Prior probability 0.40 0.60

0.8 0.3

Sales volume Net revenue $10,800

$1,800 600 100

1

3

5 6 7 8

10 9

11 12 13 14 15

4

2

A BA B C DC D E FE F G HG H I

Bad

All monetary values (except the unit margin in cell B6) are in $1000s, and all sales volumes are in 1000s of units.

Bayes’ rule calculations Probabilities of predictions

Posterior probabilities, given predictions Actual\Predicted Gd Good

GoodActual\Predicted Good Bad

0.2 0.7

Bad 1 1

Sum check

Bad

Good

Good Bad Sum check

0.64 0.16 0.36 0.84

11

0.5 Bad Sum check

10.5

Figure 6.19 Bayes’ Rule Calculations for Acme Problem

We first implement Equation (6.2) in cells G7 and H7. The formula in cell G7, a sum of likelihoods times priors, is

=SUMPRODUCT(B14:B15,$B$9:$B$10)

and this can be copied to cell H7. Next, we implement Equation (6.3) in the range G11:H12 to calculate the posteriors. Each is a likelihood times a prior, divided by one of the sums in row 7. The formula in cell G11 is

=B14*$B9/G$7

and because of the careful use of relative/absolute addresses, this can be copied to the range G11:H12. Note that the “Sum checks” indicate which probabilities should sum to 1. Fortunately, this procedure is perfectly general. If you always enter outcomes down columns and information across rows, the same essential formulas given here will always work. Of course, you can check that these Bayes’ rule calculations give the same results as the frequency approach in Figure 6.18.

Completing the Acme Decision Tree Now that we have the required probabilities, we can label Acme’s decision tree from Figure  6.15 with monetary values and probabilities. The completed tree appears in Figure  6.20. You should examine this tree carefully. The cost of hiring the marketing research firm is entered when the hiring takes place, in cell B28, the fixed cost of mar- keting the product is entered when the decision to market occurs, in cells D20, D32, and C44, and the net revenues are enter in the branches to the right as before. As for probabilities, the priors are entered in the bottom section of the tree, the part where the marketing research firm is not hired. Then the probabilities of the predictions are entered in column C (they just happen to be 50-50), and the posterior probabilities are entered in column E. Of course, all of these entries are cell references to the inputs and calculations in Figure 6.19.

As before, once all of the monetary values and probabilities are entered in the tree, PrecisionTree automatically performs all of the folding-back calculations, as you can see in Figure 6.20. Then you can follow the TRUEs. In this case, the marketing research

bayesian_revision video.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

250 Chapter 6 Decision Making Under Uncertainty

firm is evidently too expensive for the level of accuracy it provides, so according to EMV, Acme should not hire the firm. Instead, it should market the product immediately. The EMV from this strategy is $3.4 million. On the other hand, if Acme were forced to hire the marketing research firm, its best strategy would be to market the product regard- less of the firm’s prediction. (Follow the TRUEs in column D.) The EMV from this strat- egy would be only $3.25 million. This discussion leads naturally to another digression on the value of information.

Figure 6.20 Completed Decision Tree for Acme Problem

A B C D E FA B C D E F 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

Good

Bad

Good

Bad

Good

Bad

Good

Bad

Yes

No

Yes

No

Yes

No

Yes

No

New Product Decisions

0.0%

0

0.0%

8650

0.0%

350

36.0%

1800

64.0%

10800

0.0%

350

84.0%

1800

0.0%

8650

16.0%

10800

150

0

2000

50.0%

50.0%

0

0

40.0%

$10,800 8800

40.0%

150

0.0%

150

0.0%

200

60.0%60.0%

$1,800

0

Sales volume

3250

Prediction

5410

Sales volume

1090

Sales volume

3400

0

0

2000

Hire firm?

3400

Market product?

5410

Market product?

1090

Market product?

FALSE

3400

TRUE

FALSE

TRUE

TRUE

FALSE

FALSE

TRUE

2000

F u n d a m e n t a l I n s i g h t

Making Sequential Decisions

Whenever you have a chance to make several sequential decisions and you will learn useful information between decision points, the decision you make initially depends on the decisions you plan to make in the future, and these depend on the information you will learn in the meantime. In

other words, when you decide what to do initially, you should look ahead to see what your future options will be, and what your decision will be under each option. Such a contingency plan is typi- cally superior to a myopic (short-sighted) plan that doesn’t take into account future options in the initial decision making.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 251

The Value of Information In a decision-making context, information is usually bought to reduce the uncertainty about some outcome. The information always comes with a price tag, in this case $150,000, and the question is whether the information is worth this much. Alternatively, the question is how much you would be willing to pay for the information. In some situations, as in the Acme problem with the given inputs, the answer is clear. This marketing research is worth nothing to Acme. It is not even worth $1, let alone $150,000. Do you see why? The key is that Acme will make the same decision, market the product, regardless of the prediction the marketing research firm makes. Essentially, Acme will ignore the firm’s prediction, so it makes no sense for Acme to pay for a prediction it intends to ignore.

The reason the marketing research firm’s prediction is worthless is partly because it’s inaccurate and partly because marketing continues to be better than not marketing even when the probability of a bad market is high. In other words, it would take a really bad market prediction to persuade to Acme not to market.

However, to indicate what could happen, we will double the fixed marketing cost from $2 million to $4 million. As shown in Figure 6.21, this changes everything. Now the fixed cost more than offsets the possible gain from a good market unless the probability of a good market is fairly high—64% and 40% are high enough, but 16% isn’t. In this case, the marketing research firm should be hired for $150,000, and then Acme should market the product only if it hears a good prediction.

17 A BA B C DC D E FE F

18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50

New Product Decisions

50.0%

16.0% 0.0%

6650

0.0%

2350

0.0%

6800

0.0%

2200

10800

84.0%

1800

50.0%

0 150

40.0%

$10,800

60.0%

$1,800

Bad

4000

50.0%

0

0.0%

00

0

4000

Yes

4000

64.0% 32.0%

6650

18.0%

2350

10800

0

0.0%

36.0%

1800

150

0

150

Prediction

Sales volume

910

Sales volume

1400

Sales volume

3410

1630

Bad

No

Good

Yes

No

No

Yes

Good

No

Yes

Good

Bad

Good

Bad

TRUE

TRUE

Hire firm?

1630

FALSE

FALSE

Market product?

1400

TRUE

Market product?

150

FALSE

Market product?

FALSE

TRUE

3410

Figure 6.21 Completed Tree with a Larger Fixed Marketing Cost

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

252 Chapter 6 Decision Making Under Uncertainty

In this case, we know that the marketing research firm is worth its $150,000 price, but how much would Acme be willing to pay to hire the firm. This amount is called the expected value of information, or EVI, and it is given by Equation (6.4).6

6The traditional term is EVSI, where S stands for “sample,” meaning “imperfect.” We think “sample” has too much of a statistical connotation, so we omit it.

The EVI is the most you would be willing to pay for the sample information.

Equation for EVI

EVI 5 EMV with (free) information – EMV without information (6.4)

The calculation of EVI is quite easy, given the completed decision tree in Figure 6.21. The 1630 value in cell C28 (really $1.63 million) is Acme’s net EMV after paying $150,000 to the firm. If Acme could get this information for free, its EMV would be 1630 1 150, or $1.78 million. On the other hand, the bottom section of the tree shows that Acme’s EMV with no information is $1.4 million. Therefore, according to Equation (6.4), EVI is

EVI 5 1.78 2 1.4 5 $380,000

In other words, the marketing research firm could charge up to $380,000, and Acme would still be willing to hire them. You can prove this to yourself. With the fixed market- ing cost still at $4 million, change the cost of the hiring the firm to $379,000. The decision tree should still have a TRUE for the hiring decision. Then change the cost to $381,000. Now there should be a FALSE for the hiring decision.

Although the calculation of EVI is straightforward once the decision tree has been cre- ated, the decision tree itself requires a lot of probability assessments and Bayes’ rule calcu- lations. These can be difficult, depending on the type of information available. Therefore, it is sometimes useful to ask how much any information could be worth, regardless of its form or accuracy. The result is called the expected value of perfect information, or EVPI, and it is given by Equation (6.5).

Equation for EVPI

EVPI 5 EMV with (free) perfect information – EMV without information (6.5)

To calculate EVPI for the Acme problem, forget about the marketing research firm and its possible prediction. All we have is the bottom of the tree, which uses Acme’s prior probabilities of market outcomes. (We will continue to assume that the fixed marketing cost is $4 million, so Figure 6.21 is appropriate.) So Acme’s EMV with no information is $1.4 million. To find the EMV with free perfect information, imagine that Acme will be told, truthfully, whether the market will be good or bad before the marketing decision has to be made. With probability 0.4, the prior probability, it will be told “good,” and with probability 0.6, it will be told “bad.” If it knows the market will be good, it should market the product because the net payoff is 10,800 from sales minus 4000 for the fixed cost, or $6.8 million, a positive value. On the other hand, if it knows the market will be bad, it should not market the product because this would lead to a net payoff of 1800 from sales

The EVPI is the most you would be willing to pay for perfect information.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 253

minus 4000 for the fixed cost, which is less than the 0 value it could get from not market- ing the product. Therefore, according to Equation (6.5), EVPI is

EVPI 5 (0.4)(6.8) 1 (0.6)(0) 2 1.4 5 $1.32 million

In words, no information, regardless of its form or accuracy, could be worth more than $1.32 million to Acme. This calculation is often performed because it is easy and it provides an upper limit on the value of any information. As we saw, however, some infor- mation, such as the marketing research firm’s prediction, can be worth considerably less than $1.32 million. This is because the firm’s predictions are not perfect.

Let’s make the EVPI calculation once more, for the original problem where the fixed marketing cost is $2 million. In this case, the value of the market research firm was 0, but will EVPI also be 0? The answer is no. Referring to the bottom section of Figure 6.20, the calculation is

EVPI 5 (0.4)*Max(10.8-2,0) 1 (0.6)*Max(1.8-2,0) 2 3.4 5 (0.4)(8.8) 1 (0.6)(0) 2 3.4 5 $0.12 million

Each “Max” in this equation indicates the best of marketing and not marketing, and the second max is 0 because the fixed marketing cost is greater than the sales revenue if the market is bad.

In this case, Acme shouldn’t pay anything for the marketing research firm’s infor- mation, but other types of information could be worth up to $0.12 million. The intuition here is the following. The marketing research firm’s information is worthless because Acme will ignore it, marketing the product regardless of the information. But perfect infor- mation is worth something because Acme will act one way, market the product, if the information is good, and it will act another way, don’t market the product, if the informa- tion is bad. Presumably, other types of imperfect information could have the same effect and hence be worth something, but they can’t be worth more than $0.12 million.

F u n d a m e n t a l I n s i g h t

The Value of Information

The amount you should be willing to spend for infor- mation is the expected increase in EMV you can obtain from having the information. If the actual price of the information is less than or equal to this amount, you

should purchase it; otherwise, the information is not worth its price. In addition, information that never affects your decision is worthless, and it should not be purchased at any price. Finally, the value of any infor- mation can never be greater than the value of perfect information that would eliminate all uncertainty.

Sensitivity Analysis We have already performed one sensitivity analysis, simply by changing the fixed market- ing cost in cell B5 from $2 million to $4 million and seeing how the tree changes. You can perform any number of similar “ad hoc” sensitivity analyses in this way, provided that the entries in the tree are linked to the input section of your worksheet. But you might also like to perform a more formal sensitivity analysis with PrecisionTree’s powerful tools. We will show the results of several such sensitivity analyses, each with the fixed marketing cost set to $4 million. (We won’t provide the step-by-step details of how to perform these in PrecisionTree, but if you need help, you can watch the Quick Start step 5 video we ref-in PrecisionTree, but if you need help, you can watch the Quick Start step 5 video we ref-in PrecisionTree, but if you need help, you can watch the Quick Start step 5 video we ref erenced earlier.)

The first sensitivity analysis is on the prior probability, currently 0.4, of a good mar- ket. To do this, you should first change the value in cell B10 so that it is a formula, =1−B9.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

254 Chapter 6 Decision Making Under Uncertainty

(See Figure 6.22.) The reason is that as the probability in cell B9 varies, we want probabil- ity in cell B10 to vary accordingly. (In general, if you want to perform a sensitivity analy- sis on a probability, you should use formulas to guarantee that the relevant probabilities continue to sum to 1. In the file for this example, you will see that there are also formulas in cells C14 and C15 for this same purpose.)

3 Inputs Cost of market research Fixed marketing cost

$150 $4,000$4,000

$18

Prior probability 0.40

=1-B9

Unit margin

Market Good Bad

4 5 6 7 8 9

10

A B Figure 6.22 Linking One Probability to the Other

The strategy region graph in Figure 6.23 shows how Acme’s EMVs from hiring and not hiring the firm vary as the prior probability of a good market varies from 0.2 to 0.6. Acme wants the largest EMV, which corresponds to the Yes line for small probabilities (up to about 0.48) and the No line for large probabilities. Why would Acme hire the firm only when the prior probability of a good market is small? The reason is that this is when the firm’s predictions are most helpful. On the right side of the graph, Acme is already fairly sure that the market is good, so the marketing research firm’s predictions in this case are less useful. Of course, the value of a sensitivity analysis such as this is that your intuition might not be so good. It tells you what you might not have been able to figure out on your own.

Figure 6.23 Sensitivity Analysis on Prior Probability of Good Market

2000

1500

500

1000

2500

3500

3000

Strategy Region of Decision Tree ‘New Product Decisions’ Expected Value of Node ‘Hire firm?’ (B40)

With Variation of Good (B9)

0

0. 15

0. 65

0. 60

0. 55

0. 50

0. 40

0. 45

0. 35

0. 30

0. 25

0. 20

Ex pe

ct ed

V al

ue

Good (B9)

–500

Yes No

When you fill out PrecisionTree’s Sensitivity Analysis dialog box, you can choose a “starting node” other than the “Entire Model.” We repeated the analysis by choosing cell D36 as the starting node. (See Figure 6.21.) The idea here is that Acme has already decided to hire the firm and has then seen a bad prediction. The strategy region graph in Figure  6.24 shows the EMVs from marketing and not marketing the product, from this point on, as the prior probability of a good market varies as before.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-5 Multistage Decision Problems 255

As you can see, Acme should not market the product after a bad prediction unless the prior probability of a good market is approximately 0.55 or higher. Of course, this makes intuitive sense.

In one final sensitivity analysis, a two-way analysis, we let the prior probability of a good market vary as before, and we let the fixed marketing cost vary from 25% below to 25% above its current value of $4 million. Also, we choose “Entire Model” as the starting node. The results are shown in Figure 6.25. The blue diamonds correspond to input values where Acme should hire the firm, and the red triangles correspond to input values where Acme

–1000

–500

500

0

Strategy Region of Decision Tree ‘New Product Decisions’ Expected Value of Node ‘Market product?’ (D36)

With Variation of Good (B9)

–1500

0. 15

0. 65

0. 60

0. 55

0. 50

0. 40

0. 45

0. 35

0. 30

0. 25

0. 20

Ex pe

ct ed

V al

ue

Good (B9)

–2000

Yes No

Figure 6.24 Sensitivity Analysis for Marketing Decision after a Bad Prediction

Figure 6.25 Two-Way Sensitivity Analysis

No

Yes

Strategy Region for Node ‘Hire firm?’

Good (B9)

$3,000

$5,000

$4,800

$4,600

$4,400

$4,200

$4,000

$3,800

$3,600

$3,400

$3,200

Fi xe

d m

ar ke

ti n

g co

st (

B 5)

0. 20

0. 25

0. 30

0. 35

0. 40

0. 45

0. 50

0. 55

0. 60

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

256 Chapter 6 Decision Making Under Uncertainty

shouldn’t hire the firm. The pattern indicates that hiring is best only when the fixed market- ing cost is high and/or the prior probability of a good market is low. For example, if the prior probability of a good market is 0.5, the Acme should hire the firm only if its fixed marketing cost is $4.2 million or above. As another example, if Acme’s fixed marketing cost is $3.8 mil- lion, it should hire the firm only if the prior probability of a good market is 0.4 or below.

One of the most important benefits of using PrecisionTree is that once you have built the decision tree, you can quickly run any number of sensitivity analyses such as the ones shown. They often provide important insights that help you better understand the deci- sion problem. You are asked to perform other sensitivity analyses on this example (and Example 6.2) in the problems. ■

Level A 11. In Example 6.2, Acme’s probability of technological

success, 0.8, is evidently large enough to make “con- tinue development” the best decision. How low would this probability have to be to make the opposite deci- sion best?

12. In Example 6.2, the fixed costs are split $4 million for development and $2 million for marketing. Perform a sensitivity analysis where the sum of these two fixed costs remains at $6 million but the split changes. Specifically, let the fixed cost of development vary from $1 million to $5 million in increments of $0.5 million. Does Acme’s best strategy change in this range? Use either a data table or PrecisionTree’s Sensitivity Analysis tools to answer this question.

13. In Example 6.2, use a two-way PrecisionTree sensitiv- ity analysis to examine the changes in both of the two previous problems simultaneously. Let the probability of technological success vary from 0.6 to 0.9 in incre- ments of 0.05, and let the fixed cost of development vary as indicated in the previous problem. Explain in a short memo exactly what the results of the sensitivity analysis imply about Acme’s best strategy.

14. In the file Bayes Rule for Disease.xlsx, explain why the probabilities in cells B9 and B10 (or those in cells C9 and C10) do not necessarily sum to 1, but why the probabilities in cells B9 and C9 (or those in cells B10 and C10) do necessarily sum to 1.

15. In using Bayes’ rule for the presence of a disease (see Figure 6.17 and the file Bayes Rule for Disease.xlsx), we assumed that there are only two test results, posi- tive or negative. Suppose there is another possible test result, “maybe.” The 2 3 2 range B9:C10 in the file should now be replaced by a 2 3 3 range, B9:D10, for positive, maybe, and negative (in that order). Let the corresponding probabilities in row 9 be 0.85, 0.10, and 0.05, and let those in row 10 be 0.05, 0.15, and 0.80. Redo the Bayes’ rule calculations with both the frequency approach and the probability approach.

16. The finished version of the file for Example 6.3 con- tains two “Strategy B9” sheets. Explain what each of them indicates and how they differ.

17. Starting with the finished version of the file for Example 6.3, change the fixed cost in cell B5 to $4000. Then get back into PrecisionTree’s One-Way Sensitivity Analysis dialog box and add three more inputs. (These will be in addition to the two inputs already there, cells B9 and B5.) The first should be the unit margin in cell B6, varied from $15 to $21 in increments of $1, the second should be the sales volume from a good market in cell C9, varied from 400 to 700 in increments of 50, and the third should be the probability of a good prediction, given a good market, in cell B14, varied from 0.7 to 0.9 in incre- ments of 0.05. Make sure the analysis type is one-way, all five of the inputs are checked, and the starting node is “Entire Model.” In the “Include Results” section, check the Strategy Region, Tornado Graph, and Spider Graph options, and then run the analysis. Interpret the resulting outputs. Specifically, what do the tornado and spider graphs indicate?

18. Starting with the finished version of the file for Example 6.3, change the fixed cost in cell B5 to $4000. Change the probabilities in cells B9 (make it smaller), B14 (make it larger), and B15 (make it smaller) in some systematic way (you can choose the details) and, for each combination, calculate the EVI. Does EVI change in the way you’d expect? Why?

19. Suppose you are a heterosexual white male and are going to be tested to see if you are HIV positive. Assume that if you are HIV positive, your test will always come back positive. Assume that if you are not HIV positive, there is still a 0.001 chance that your test will indicate that you are HIV positive. In reality, 1 of 10,000 heterosexual white males is HIV positive. Your doctor calls and says that you have tested HIV positive. He is sorry but there is a 99.9% (120.001) chance that you have HIV. Is he correct? What is the actual probability that you are HIV positive?

P R O B L E M S

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-6 The Role of Risk Aversion 257

Level B 20. If you examine the decision tree in Figure 6.12 (or

any other decision trees from PrecisionTree), you will see two numbers (in blue font) to the right of each end node. The bottom number is the combined monetary value from following the corresponding path through the tree. The top number is the probability that this path will be followed, given that the best strategy is used. With this in mind, explain (1) how the positive probabilities following the end nodes are calculated, (2) why some of the probabilities following the end nodes are 0, and (3) why the sum of the probabilities following the end nodes is necessarily 1.

21. In Example 6.2, a technological failure implies that the game is over—the product must be abandoned. Change the problem so that there are two levels of technological failure, each with probability 0.1. In the first level, Acme can pay a further development cost D to fix the product and make it a technological success. Then it can decide whether to market the product. In the second level, the product must be abandoned. Modify the decision tree as necessary. Then answer the following questions. a. For which values of D should Acme fix the product

and then market it, given that the first level of technological failure occurs?

b. For which values of D is Acme’s best first decision still to “continue development”?

c. Explain why these two questions are asking differ- ent things and can have different answers.

22. The model in Example 6.3 has only two market outcomes, good and bad, and two corresponding predictions, good and bad. Modify the decision tree by allowing three outcomes and three predictions, good, fair, and bad. You can change the inputs to the model

(monetary values and probabilities) in any reasonable way you like. Then you will also have to modify the Bayes’ rule calculations. You can decide whether it is easier to modify the existing tree or start from scratch with a new tree.

23. The terms prior and prior and prior posterior are relative. Assume posterior are relative. Assume posterior that the test in Figure 6.17 (and in the file Bayes Rule for Disease.xlsx) has been performed, and the outcome is positive, which leads to the posterior prob- abilities shown. Now assume there is a second test, second test, second independent of the first, that can be used as a follow- up. Assume that its false-positive and false-negative rates are 0.02 and 0.06. a. Use the posterior probabilities as prior probabili-prior probabili-prior

ties in a second Bayes’ rule calculation. (Now prior means prior to the second test.) If Joe also tests positive in this second test, what is the posterior probability that he has the disease?

b. We assumed that the two tests are independent. Why might this not be realistic? If they are not independent, what kind of additional information would you need about the likelihoods of the test results?

24. In the OJ Simpson trial it was accepted that OJ had battered his wife. OJ’s lawyer tried to negate the impact of this information by stating that in a one- year period, only 1 out of 2500 battered women are murdered, so the fact that OJ battered his wife does not give much evidence that he was the murderer. The prosecution (foolishly!) let this go unchallenged. Here are the relevant statistics: In a typical year 6.25 million women are battered, 2500 are battered and murdered, and 2250 of the women who were bat- tered and murdered were killed by the batterer. How should the prosecution have refuted the defense’s argument?

6-6 THE ROLE OF RISK AVERSION Rational decision makers are sometimes willing to violate the EMV maximization cri- terion when large amounts of money are at stake. These decision makers are willing to sacrifice some EMV to reduce risk. Are you ever willing to do so personally? Consider the following scenarios.

■ You have a chance to enter a lottery where you will win $100,000 with probability 0.1 or win nothing with probability 0.9. Alternatively, you can receive $5000 for certain. Would you take the certain $5000, even though the EMV of the lottery is $10,000? Or change the $100,000 to $1,000,000 and the $5000 to $50,000 and ask yourself whether you’d prefer the sure $50,000.

■ You can buy collision insurance on your expensive new car or not buy it. The insur- ance costs a certain premium and carries some deductible provision. If you decide to pay the premium, then you are essentially paying a certain amount to avoid a gamble: the possibility of wrecking your car and not having it insured. You can be sure that the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

258 Chapter 6 Decision Making Under Uncertainty

premium is greater than the expected cost of damage; otherwise, the insurance com- pany would not stay in business. Therefore, from an EMV standpoint you should not purchase the insurance. But would you drive without this type of insurance?

These examples, the second of which is certainly realistic, illustrate situations where ratio- nal people do not behave as EMV maximizers. Then how do they act? This question has been studied extensively by many researchers, both mathematically and behaviorally. Although there is still not perfect agreement, most researchers believe that if certain basic behavioral assumptions hold, people are expected utility maximizers—that is, they choose the alter- native with the largest expected utility. Although we will not go deeply into the subject of expected utility maximization, the discussion in this section presents the main ideas.

F u n d a m e n t a l I n s i g h t

Risk Aversion

When large amounts of money are at stake, most of us are risk averse, at least to some extent. We are willing to sacrifice some EMV to avoid risk. The exact way this is done, using utility functions and expected utility, can be difficult to implement in real situations, but the idea is simple. If you are an EMV maximizer,

you are indifferent between a gamble with a given EMV and a sure dollar amount equal to the EMV of the gamble. However, if you are risk averse, you prefer the sure dollar amount to the gamble. That is, you are willing to accept a sure dollar amount that is somewhat less than the EMV of the gamble, just to avoid risk. The more EMV you are willing to give up, the more risk averse you are.

6-6a Utility Functions

We begin by discussing an individual’s utility function. This is a mathematical function that transforms monetary values—payoffs and costs—into utility values. Essentially, an individual’s utility function specifies the individual’s preferences for various monetary payoffs and costs and, in doing so, it automatically encodes the individual’s attitudes toward risk. Most individuals are risk averse, which means intuitively that they are willing to sacrifice some EMV to avoid risky gambles. In terms of the utility function, this means that every extra dollar of payoff is worth slightly less to the individual than the previous dollar, and every extra dollar of cost is considered slightly more costly (in terms of util- ity) than the previous dollar. The resulting utility functions are shaped as in Figure 6.26. Mathematically, these functions are said to be increasing and concave. The increasing part means that they go uphill—everyone prefers more money to less money. The concave part means that they increase at a decreasing rate. This is the risk-averse behavior.

–7 –6 –5 –4 –3 –2 –1

00 $5,000$0

Utility values (vertical axis) for $ amountsalues (vertical axis) for $ amountsalues (vertical axis) f

(horizontal axis)

1 2

–$5,000–$5,000 $10,000–$10,000

Figure 6.26 Risk-Averse Utility Function

There are two aspects of implementing expected utility maximization in a real deciexpected utility maximization in a real deciexpected utility maximization - sion analysis. First, an individual’s (or company’s) utility function must be assessed. This is a

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-6 The Role of Risk Aversion 259

time-consuming task that typically involves many trade-offs. It is usually carried out by experts in the field, and we do not discuss the details of the process here. Second, the resulting utility function is used to find the best decision. This second step is relatively straightforward. You substitute utility values for monetary values in the decision tree and then fold back as usual. That is, you calculate expected utilities at probability branches and take maximums of expected utilities at decision branches. We will look at a numerical example later in this section.

6-6b Exponential Utility

As we have indicated, utility assessment is tedious. Even in the best of circumstances, when a trained consultant attempts to assess the utility function of a single person, the process requires the person to make a series of choices between hypothetical alternatives involving uncertain outcomes. Unless the person has some training in probability, these choices will probably be difficult to understand, let alone make, and it is unlikely that the person will answer consistently as the questioning proceeds. The process is even more difficult when a company’s utility function is being assessed. Because different company executives typically have different attitudes toward risk, it can be difficult for these people to reach a consensus on a common utility function.

For these reasons, classes of ready-made utility functions are available. One impor- tant class is called exponential utility and has been used in many financial investment decisions. An exponential utility function has only one adjustable numerical parameter, called the risk tolerance, and there are straightforward ways to discover an appropriate value of this parameter for a particular individual or company. So the advantage of using an exponential utility function is that it is relatively easy to assess. The drawback is that exponential utility functions do not capture all types of attitudes toward risk. Nevertheless, their ease of use has made them popular.

An exponential utility function has the following form:

Exponential utility

U1x2 = 1 − e−x/x/x R/R/ (6.6)

Here x is a monetary value (a payoff if positive, a cost if negative), x is a monetary value (a payoff if positive, a cost if negative), x U(x) is the util- ity of this value, and R . 0 is the risk tolerance. As the name suggests, the risk tolerance measures how much risk the decision maker will accept. The larger the value of R, the less risk averse the decision maker is. That is, a person with a large value of R is more willing to take risks than a person with a small value of R. In the limit, a person with an extremely large value of R is an EMV maximizer.

The risk tolerance for an exponential utility function is a single number that specifies an individual’s aversion to risk. The higher the risk tolerance, the less risk averse the individual is.

To assess a person’s (or company’s) exponential utility function, only one number, the value of R, needs to be assessed. There are a couple of tips for doing this. First, it has been shown that the risk tolerance is approximately equal to the dollar amount R such that the decision maker is indifferent between the following two options:

■ Option 1: Receive no payoff at all.

■ Option 2: Receive a payoff of R dollars or incur a cost of R/2 dollars, depending on the flip of a fair coin.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

260 Chapter 6 Decision Making Under Uncertainty

For example, if you are indifferent between a bet where you win $1000 or lose $500, with probability 0.5 each, and not betting at all, your R is approximately $1000. From this criterion it certainly makes intuitive sense that a wealthier person (or company) ought to have a larger value of R. This has been found in practice.

A second tip for finding R is based on empirical evidence found by Ronald Howard, a prominent decision analyst. Through his consulting experience with large companies, he discovered tentative relationships between risk tolerance and several financial variables: net sales, net income, and equity. [See Howard (1988).] Specifically, he found that R was approximately 6.4% of net sales, 124% of net income, and 15.7% of equity for the compa- nies he studied. For example, according to this prescription, a company with net sales of $30 million should have a risk tolerance of approximately $1.92 million. Howard admits that these percentages are only guidelines. However, they do indicate that larger and more profitable companies tend to have larger values of R, which means that they are more will- ing to take risks involving large dollar amounts.

We illustrate the use of the expected utility criterion, and exponential utility in par- ticular, in the following version of the Acme decision problem.

Finding the appropriate risk tolerance value for any company or indi- vidual is not necessarily easy, but it is easier than assessing an entire utility function.

E X A M P L E 6.4 NEW PRODUCT DECISIONS WITH RISK AVERSION

This example is the same as Acme’s single-stage decision problem in Example 6.1, but we now assume that Acme is risk averse and that it assesses its utility function as exponential with risk tolerance $5 million. How does this risk aversion affect its decision- making progress?

Objective To see how risk aversion affects Acme’s decision-making process.

Where Do the Numbers Come From? The only new number is the risk tolerance. According to the earlier discussion, this value implies that Acme is indifferent between entering a gamble where it could win $5 million or lose $2.5 million on the flip of a fair coin, or not enter the gamble at all. This risk tolerance is a difficult number to assess, so it is a good candidate for a sensitiv- ity analysis.

Solution Starting with the decision tree from the previous example (see Figure 6.11), there are only two changes to make. First, it is useful to add the risk tolerance as a new input, as shown in cell B12 of Figure 6.27. Second, you must tell PrecisionTree that you want to use expected utility. To do so, select Model Settings from the PrecisionTree Settings dropdown list, select the Utility Function tab, and fill it in as shown in Figure 6.28. The most important part is to check the “Use Utility Function” option. Then you can choose any of three dis- play options. If you choose Expected Value, you will see EMVs on the tree (in the colored cells), but expected utility will actually be maximized in the background. This is useful if you want to see how much EMV you are sacrificing by being risk-averse. Alternatively, if you choose Expected Utility, as is done here, you will see utility values rather than mon- etary values. The Certainty Equivalent option will be discussed shortly.

The resulting tree that displays expected utilities appears in Figure 6.29. If you com- pare this tree to the EMV tree in Figure 6.11, you will see that Acme’s best strategy

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-6 The Role of Risk Aversion 261

has been reversed. As an EMV maximizer, Acme should market the product. As a risk- averse expected utility maximizer, it should not market the product. The expected utility from marketing the product is negative, −0.0472, and the utility from not marketing the product is 0. (We formatted these as decimal numbers in the tree. They are not expressed in dollars.) Neither of these expected utilities is meaningful in an absolute sense; only their relative values are important. The larger corresponds to the best decision.

Figure 6.27 Risk Tolerance as an Extra Input

1 Acme single-stage new product decision with risk aversion

Inputs $6,000

$18

0.45 600 $10,800 $5,400 $1,620

300 90

0.35 0.20

$5,000

Probability Sales volume Net revenue

Unit margin Fixed cost

Market Great Fair Awful

Risk tolerance

2 3 4 5 6 7 8 9

10 11 12

A BA B C DC D E

All monetary values (except the unit margin in cell B5) are in $1000s, and all sales volumes are in 1000s of units.

Figure 6.28 PrecisionTree Utility Function Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

262 Chapter 6 Decision Making Under Uncertainty

PrecisionTree Tip: Calculations with UtilitiesUtilitiesU The PrecisionTree utility calculations are not as mysterious as they might seem. PrecisionTree takes the (blue) monetary values that originally follow the end nodes and transforms them to utility values by using Equation (6.6). Then it folds back in the usual way, except that it uses utility values, not monetary values, in the folding-back calculations.

6-6c Certainty Equivalents

The reversal in Acme’s decision can be understood better by looking at certainty equiva- lents. For a risk-averse person, the certainty equivalent of a gamble is the sure dollar amount the person would accept to avoid the gamble. In other words, the person is indif-amount the person would accept to avoid the gamble. In other words, the person is indif-amount the person would accept to avoid the gamble. In other words, the person is indif ferent between taking this sure amount and taking the gamble. By selecting Certainty Equivalent in Figure 6.28, you can see the certainty equivalents in the tree, as shown in Figure 6.30. (We formatted the certainty equivalents as currencies because that’s what they really are.)

Recall from Figure 6.11 that the EMV for marketing the product is $1.074 million. However, this is not how the risk-averse Acme sees the decision to market the product. Acme now sees this gamble as equivalent to a loss of approximately $230,000. In other words, Acme would pay up to $230,000 to avoid this gamble. Of course, it doesn’t have to pay anything. The company can simply decide to abandon the product and receive a sure payoff of $0; hence, the TRUE on the bottom branch.

Again, risk aversion is all about giving up some EMV to avoid a gamble. In this case, Acme is able to obtain an EMV of $1.074 million by marketing the product, but the com- pany is willing to trade this for a sure $0 payoff because of its aversion to risk.

What happens if Acme is less risk-averse, with a larger risk tolerance? You can check, for example, that if the company’s risk tolerance doubles from $5 million to $10 million, the best decision reverts back to the original “market the product” decision, and the cer- tainty equivalent of this decision increases to about $408,000. Only when the company’s risk tolerance becomes huge will the certainty equivalent be near the original EMV of $1.074 million.

Figure 6.29 Decision Tree Displaying Expected Utilities

Risk tolerance $5,000

FALSE –$6,000

45.0% 0.0%

0.0%35.0%

20.0%

$5,400

$1,620

$10,800 0.6171

–0.1275

–1.4013 $0

12

13 14

15

16

17 18

19

20

21

22

23

A BA B C

Sales volume –0.0472

100.0% 0.0000

D

New Product Decision

Yes

No

0.0000

TRUE 0

Continue with product?

Great

Awful

Fair

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-6 The Role of Risk Aversion 263

6-6d Is Expected Utility Maximization Used?

The previous discussion indicates that expected utility maximization is a somewhat involved task. The question, then, is whether the effort is justified. Theoretically, expected utility maximization might be interesting to researchers, but is it really used in the business world? The answer appears to be: not very often. For example, one article on the practice of decision making [see Kirkwood (1992)] quotes Ronald Howard—the same person we quoted previously—as having found risk aversion to be of practical concern in only 5% to 10% of business decision analyses. This same article quotes the president of a Fortune 500 company as saying, “Most of the decisions we analyze are for a few million dollars. It is adequate to use expected value (EMV) for these.”

Level A 25. Explain what it means in general when we say a

risk-averse decision maker is willing to give up some EMV to avoid risk? How is this apparent in certainty equivalents of gambles?

26. Using the finished version of the file for Example 6.4, use a data table to perform a sensitivity analysis on the risk tolerance. Specifically, let the risk tolerance in cell B12 vary from $10,000 to $100,000 and keep track of two outputs in the data table, the TRUE/ FALSE value in cell B14 and the certainty equivalent in cell C15. Interpret the results.

27. You saw in Example 6.4 how Acme prefers to aban- don the product when the risk tolerance in cell B12 is $5000 (really $5 million). This is despite the fact that the EMV from continuing with the product is well

above 0. Using this same risk tolerance, experiment with the sales volume from a great market in cell C8 to see approximately how large it has to be for Acme to prefer the “continue with product” decision. (One way to do this is with a data table, using the TRUE/ FALSE value in cell B14 as the single output.) With this sales volume, what is the certainty equivalent of the “continue with product” decision? How does it compare to the decision’s EMV? Explain the differ- ence between the two.

Level B 28. Starting with the finished version of Example 6.2,

change the decision criterion to “maximize expected utility,” using an exponential utility function with risk tolerance $5000 (really $5 million). Display certainty equivalents on the tree.

P R O B L E M S

Figure 6.30 Decision Tree Displaying Certainty Equivalents

12

13 14

15

16

17 18

19

20

Risk tolerance $5,000

FALSE –$6,000

45.0% 0.0%

0.0%35.0%

20.0%

$5,400

$1,620

$10,800 $4,800.00

–$600.00

–$4,380.00 $0

21

22

23

A BA B C

Sales volume –$230.51

100.0% 0.00

D

New Product Decision

Yes

No

$0.00

TRUE 0

Continue with product?

Great

Awful

Fair

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

264 Chapter 6 Decision Making Under Uncertainty

a. Keep doubling the risk tolerance until the company’s best strategy is the same as with the EMV criterion— continue with development and then market if suc- cessful. Comment on the implications of this.

b. With this final risk tolerance, explain exactly what the certainty equivalents in cells B31, C27, D23, and E17 (that is, those to the right of the various nodes) really mean. You might phrase these explanations something like, “If Acme were at the point where …, they would be willing to trade … for …”.

29. Starting with the finished version of Example 6.3, change the fixed marketing cost to $4000 (really $4 million) in cell B5, and change the decision criterion to “maximize expected utility,” using an exponential utility function with risk tolerance $5000 (really $5 million). Display certainty equivalents on the tree. Is the company’s best strategy the same as with the EMV criterion? What is the EVI? (Hint: EVI is still the most Acme would be willing to pay in dollars for the market- ing research firm’s predictions, and it can be calculated from certainty equivalents.)

6-7 CONCLUSION In this chapter we have discussed methods that can be used in decision-making problems where uncertainty is a key element. Perhaps the most important skill you can gain from this chapter is the ability to approach decision problems with uncertainty in a systematic manner. This systematic approach requires you to list all possible decisions or strategies, list all possible uncertain outcomes, assess the probabilities of these outcomes (possibly with the aid of Bayes’ rule), calculate all necessary monetary values, and finally do the necessary calculations to obtain the best decision. If large dollar amounts are at stake, you might also need to perform a utility analysis, where the decision maker’s attitudes toward risk are taken into account. Once the basic analysis has been completed, using best guesses for the various parameters of the problem, you should perform a sensitivity analysis to see whether the best decision continues to be best within a range of input parameters.

(continued)

Summary of Key Terms

Term Explanation Excel Page Equation Expected monetary The weighted average of the possible 228 value (EMV) payoffs from a decision, weighted by

their probabilities

EMV criterion Choose the decision with the 228 maximum EMV

Decision tree A graphical device for illustrating all 230 of the aspects of the decision problem and for finding the optimal decision (or decision strategy)

Folding-back Calculation method for decision tree; 231 procedure starting at the right, take EMVs at

probability nodes, maximums of EMVs at decision nodes

PrecisionTree Useful Excel add-in developed Has its 236 by Palisade for building and own ribbon analyzing decision trees in Excel

Contingency plan A decision strategy where later decisions 240 depend on earlier decisions and outcomes observed in the meantime

Risk profile Chart that represents the probability 242 distribution of monetary outcomes for any decision

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-7 Conclusion 265

Bayes’ rule Formula for updating probabilities 248 6.1 as new information becomes available; prior probabilities are transformed into posterior probabilities

Law of total The denominator in Bayes’ rule, 248 6.2 probability for calculating the (unconditional)

probability of an information outcome

Expected value of The most the (imperfect) information 252 6.4 information (EVI) (such as the results of a test market) would

be worth

Expected value of The most perfect information on some 252 6.5 perfect information uncertain outcome would be worth; (EVPI) represents an upper bound on any EVI

PrecisionTree Useful for seeing how the optimal Use PrecisionTree 254 strategy region graph decision changes as selected Sensitivity

inputs vary Analysis button

PrecisionTree Useful for seeing which inputs Use PrecisionTree 256 tornado and affect a selected EMV Sensitivity Analysis spider graphs the most button

Expected utility Choosing the decision that maximizes the 258 maximization expected utility; typically sacrifices

EMV to avoid risk when large monetary amounts are at stake

Utility function A mathematical function that encodes an 258 individual’s (or company’s) attitudes toward risk

Exponential utility A popular class of utility functions, 259 6.6 function, risk where only a single parameter, the risk tolerance tolerance, has to be specified

Certainty equivalent The sure dollar value equivalent to the 262 expected utility of a gamble

P R O B L E M S

Conceptual Questions C.1. Your company needs to make an important decision

that involves large monetary consequences. You have listed all of the possible outcomes and the monetary payoffs and costs from all outcomes and all potential decisions. You want to use the EMV criterion, but you realize that this requires probabilities and you see no way to find the required probabilities. What can you do?

C.2. If your company makes a particular decision in the face of uncertainty, you estimate that it will either gain $10,000, gain $1000, or lose $5000, with probabilities 0.40, 0.30, and 0.30, respectively. You

(correctly) calculate the EMV as $2800. However, you distrust the use of this EMV for decision-making purposes. After all, you reason that you will never receive $2800; you will receive $10,000, $1000, or lose $5000. Discuss this reasoning.

C.3. In the previous question, suppose you have the option of receiving a check for $2700 instead of making the risky decision described. Would you make the risky decision, where you could lose $5000, or would you take the sure $2700? What would influence your decision?

C.4. In a classic oil-drilling example, you are trying to decide whether to drill for oil on a field that might

Summary of Key Terms (Continued)

Term Explanation Excel Page Equation

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

266 Chapter 6 Decision Making Under Uncertainty

or might not contain any oil. Before making this decision, you have the option of hiring a geolo- gist to perform some seismic tests and then predict whether there is any oil or not. You assess that if there is actually oil, the geologist will predict there is oil with probability 0.85. You also assess that if there is no oil, the geologist will predict there is no oil with probability 0.90. Why will these two probabilities not appear on the decision tree? Which probabilities will be on the decision tree?

C.5. Your company has signed a contract with a good customer to ship the customer an order no later than 20 days from now. The contract indicates that the customer will accept the order even if it is late, but instead of paying the full price of $10,000, it will be allowed to pay 10% less, $9000, due to lateness. You estimate that it will take anywhere from 17 to 22 days to ship the order, and each of these is equally likely. You believe you are in good shape, reasoning that the expected days to ship is the aver- age of 17 through 22, or 19.5 days. Because this is less than 20, you will get your full $10,000. What is wrong with your reasoning?

C.6. You must make one of two decisions, each with possible gains and possible losses. One of these decisions is much riskier than the other, having much larger possible gains but also much larger possible losses, and it has a larger EMV than the safer decision. Because you are risk averse and the monetary values are large relative to your wealth, you base your decision on expected utility, and it indicates that you should make the safer decision. It also indicates that the certainty equivalent for the risky decision is $210,000, whereas its EMV is $540,000. What do these two numbers mean? What do you know about the certainty equivalent of the safer decision?

C.7. A potentially huge hurricane is forming in the Caribbean, and there is some chance that it might make a direct hit on Hilton Head Island, South Carolina, where you are in charge of emergency preparedness. You have made plans for evacuating everyone from the island, but such an evacuation is obviously costly and upsetting for all involved, so the decision to evacuate shouldn’t be made lightly. Dis- cuss how you would make such a decision. Is EMV a relevant concept in this situation? How would you evaluate the consequences of uncertain outcomes?

C.8. It seems obvious that if you can purchase infor- mation before making an ultimate decision, this information should generally be worth something, but explain exactly why (and when) it is sometimes worth nothing.

C.9. Insurance companies wouldn’t exist unless custom- ers were willing to pay the price of the insurance and the insurance companies were making a profit. So explain how insurance is a win-win proposition for customers and the company.

C.10. You often hear about the trade-off between risk and reward. Is this trade-off part of decision making under uncertainty when the decision maker uses the EMV criterion? For example, how does this work in investment decisions?

C.11. Can you ever use the material in this chapter to help you make your own real-life decisions? Consider the following. You are about to take an important and difficult exam in one of your MBA courses, and you see an opportunity to cheat. Obviously, from an ethical point of view, you shouldn’t cheat, but from a purely monetary point of view, could it also be the wrong decision? To model this, consider the long-term monetary consequences of all possible outcomes.

Level A 30. The SweetTooth Candy Company knows it will need

10 tons of sugar six months from now to implement its production plans. The company has essentially two options for acquiring the needed sugar. It can either buy the sugar at the going market price when it is needed, six months from now, or it can buy a futures contract now. The contract guarantees delivery of the sugar in six months but the cost of purchasing it will be based on today’s market price. Assume that possible sugar futures contracts available for purchase are for five tons or ten tons only. No futures contracts can be purchased or sold in the intervening months. Thus, SweetTooth’s possible decisions are to (1) purchase a futures contract for ten tons of sugar now, (2) purchase a futures contract for five tons of sugar now and purchase five tons of sugar in six months, or (3) purchase all ten tons of needed sugar in six months. The price of sugar bought now for deliv- ery in six months is $0.0851 per pound. The transac- tion costs for five-ton and ten-ton futures contracts are $65 and $110, respectively. Finally, the company has assessed the probability distribution for the possible prices of sugar six months from now (in dollars per pound). The file P06_30.xlsx contains these possible prices and their corresponding probabilities. a. Use PrecisionTree to identify the decision that

minimizes SweetTooth’s expected cost of meeting its sugar demand.

b. Perform a sensitivity analysis on the optimal decision, letting each of the three currency inputs vary one at a time plus or minus 25% from its base value, and summarize your findings. Which of the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-7 Conclusion 267

inputs appears to have the largest effect on the best decision?

31. Carlisle Tire and Rubber, Inc., is considering expanding production to meet potential increases in the demand for one of its tire products. Carlisle’s alternatives are to construct a new plant, expand the existing plant, or do nothing in the short run. The mar- ket for this particular tire product may expand, remain stable, or contract. Carlisle’s marketing department estimates the probabilities of these market outcomes to be 0.25, 0.35, and 0.40, respectively. The file P06_31.xlsx contains Carlisle’s payoffs and costs for the various combinations of decisions and outcomes. a. Use PrecisionTree to identify the strategy that

maximizes this tire manufacturer’s expected profit. b. Perform a sensitivity analysis on the optimal

decision, letting each of the monetary inputs vary one at a time plus or minus 10% from its base value, and summarize your findings. Which of the inputs appears to have the largest effect on the best solution?

32. A local energy provider offers a landowner $180,000 for the exploration rights to natural gas on a certain site and the option for future development. This option, if exercised, is worth an additional $1,800,000 to the landowner, but this will occur only if natural gas is discovered during the exploration phase. The landowner, believing that the energy company’s interest in the site is a good indication that gas is present, is tempted to develop the field herself. To do so, she must contract with local experts in natural gas exploration and development. The initial cost for such a contract is $300,000, which is lost forever if no gas is found on the site. If gas is discovered, however, the landowner expects to earn a net profit of $6,000,000. The landowner estimates the probability of finding gas on this site to be 60%. a. Use PrecisionTree to identify the strategy that

maximizes the landowner’s expected net earnings from this opportunity.

b. Perform a sensitivity analysis on the optimal decision, letting each of the inputs vary one at a time plus or minus 25% from its base value, and summarize your findings. Which of the inputs appears to have the largest effect on the best solution?

33. Techware Incorporated is considering the introduc- tion of two new software products to the market. The company has four options regarding these products: introduce neither product, introduce product 1 only, introduce product 2 only, or introduce both products. Research and development costs for products 1 and 2 are $180,000 and $150,000, respectively. Note that the first option entails no costs because research and development efforts have not yet begun. The

success of these software products depends on the national economy in the coming year. The company’s revenues, depending on its decision and the state of the economy, are given in the file P06_33.xlsx. The probabilities of a strong, fair, or weak economy in the coming year are assessed to be 0.30, 0.50, and 0.20, respectively. a. Use PrecisionTree to identify the strategy that

maximizes Techware’s expected net revenue. b. Perform a sensitivity analysis on the optimal deci-

sion, letting each of the inputs vary one at a time plus or minus 25% from its base value, and sum- marize your findings. Which of the inputs appears to have the largest effect on the best solution?

34. An investor with $10,000 available to invest has the following options: (1) he can invest in a risk-free savings account with a guaranteed 3% annual rate of return; (2) he can invest in a fairly safe stock, where the possible annual rates of return are 6%, 8%, or 10%; or (3) he can invest in a more risky stock, where the possible annual rates of return are 1%, 9%, or 17%. The investor can place all of his available funds in any one of these options, or he can split his $10,000 into two $5000 investments in any two of these options. The joint probability distribution of the possible return rates for the two stocks is given in the file P06_34.xlsx. a. Use PrecisionTree to identify the strategy that

maximizes the investor’s expected one-year earn- ings.

b. Perform a sensitivity analysis on the optimal deci- sion, letting the amount available to invest and the risk-free return both vary, one at a time, plus or minus 100% from their base values, and summa- rize your findings.

35. A buyer for a large department store chain must place orders with an athletic shoe manufacturer six months prior to the time the shoes will be sold in the department stores. The buyer must decide on November 1 how many pairs of the manufacturer’s newest model of tennis shoes to order for sale during the coming summer season. Assume that each pair of this new brand of tennis shoes costs the depart- ment store chain $45 per pair. Furthermore, assume that each pair of these shoes can then be sold to the chain’s customers for $70 per pair. Any pairs of these shoes remaining unsold at the end of the sum- mer season will be sold in a closeout sale next fall for $35 each. The probability distribution of consumer demand for these tennis shoes during the coming summer season has been assessed by market research specialists and is provided in the file P06_35.xlsx. Finally, assume that the department store chain must purchase these tennis shoes from the manufacturer in lots of 100 pairs.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

268 Chapter 6 Decision Making Under Uncertainty

a. Identify the strategy that maximizes the department store chain’s expected profit earned by purchasing and subsequently selling pairs of the new tennis shoes. Is a decision tree really necessary? If so, what does it add to the analysis? If not, why not?

b. Perform a sensitivity analysis on the optimal deci- sion, letting the three monetary inputs vary one at a time over reasonable ranges, and summarize your findings. Which of the inputs appears to have the largest effect on the best solution?

36. Two construction companies are bidding against one another for the right to construct a new community center building in Bloomington, Indiana. The first construction company, Fine Line Homes, believes that its competitor, Buffalo Valley Construction, will place a bid for this project according to the distribution shown in the file P06_36.xlsx. Furthermore, Fine Line Homes estimates that it will cost $160,000 for its own company to construct this building. Given its fine reputation and long-standing service within the local community, Fine Line Homes believes that it will likely be awarded the project in the event that it and Buffalo Valley Construction submit exactly the same bids. Find the bid that maximizes Fine Line’s expected profit. Is a decision tree really necessary? If so, what does it add to the analysis? If not, why not?

37. You have sued your employer for damages suffered when you recently slipped and fell on an icy surface that should have been treated by your company’s physical plant department. Your injury was sufficiently serious that you, in consultation with your attorney, decided to sue your company for $500,000. Your company’s insurance provider has offered to settle this suit with you out of court. If you decide to reject the settlement and go to court, your attorney is confident that you will win the case but is uncertain about the amount the court will award you in damages. He has provided his assessment of the probability distribution of the court’s award to you in the file P06_37.xlsx. In addition, there are extra legal fees of $10,000 you will have to pay if you go to court. Let S be the insurance provider’s proposed out-of-court S be the insurance provider’s proposed out-of-court S settlement (in dollars). For which values of S will you S will you S decide to accept the settlement? For which values of S will you choose to take your chances in court? Assume that your goal is to maximize the expected net payoff from this litigation.

38. Consider a population of 2000 people, 800 of whom are women. Assume that 300 of the women in this population earn at least $60,000 per year, and 200 of the men earn at least $60,000 per year. a. What is the probability that a randomly selected

person from this population earns less than $60,000 per year?

b. If a randomly selected person is observed to earn less than $60,000 per year, what is the probability that this person is a man?

c. If a randomly selected person is observed to earn at least $60,000 per year, what is the probability that this person is a woman?

39. Yearly automobile inspections are required for resi- dents of the state of Pennsylvania. Suppose that 18% of all inspected cars in Pennsylvania have problems that need to be corrected. Unfortunately, Pennsylvania state inspections fail to detect these problems 12% of the time. On the other hand, assume that an inspection never detects a problem when there is no problem. Consider a car that is inspected and is found to be free of problems. What is the probability that there is indeed something wrong that the inspection has failed to uncover?

40. Referring to the landowner’s decision problem in Problem 32, suppose now that, at a cost of $90,000, the landowner can request a soundings test on the site where natural gas is believed to be present. The com- pany that conducts the soundings concedes that the test has a 30% false-negative rate (it indicates no gas when gas is present) and a 10% false-positive rate (it indicates gas when no gas is present). a. If the landowner pays for the soundings test and

the test indicates that gas is present, what is the landowner’s revised probability that the site con- tains gas?

b. If the landowner pays for the soundings test and the test indicates that gas is not present, what is the landowner’s revised probability that there is no gas on the site?

c. Should the landowner request the soundings test at a cost of $90,000? Why or why not? If not, at what price (if any) would the landowner be willing to pay for the soundings test?

41. A customer has approached a bank for a $100,000 one-year loan at an 8% interest rate. If the bank does not approve this loan application, the $100,000 will be invested in bonds that earn a 6% annual return. Without additional information, the bank believes that there is a 4% chance that this customer will default on the loan, assuming that the loan is approved. If the customer defaults on the loan, the bank will lose $100,000. At a cost of $1000, the bank can thoroughly investigate the customer’s credit record and supply a favorable or unfavorable recommendation. Past experience indicates that the probability of a favorable recommendation for a customer who will eventually not default is 0.80, and the chance of a favorable recommendation for a customer who will eventually default is 0.15. a. Use a decision tree to find the strategy the bank

should follow to maximize its expected profit.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-7 Conclusion 269

b. Calculate and interpret the expected value of infor- mation (EVI) for this decision problem.

c. Calculate and interpret the expected value of per- fect information (EVPI) for this decision problem.

d. How sensitive are the results to the accuracy of the credit record recommendations? Are there any “reasonable” values of the error probabilities that change the optimal strategy?

42. A company is considering whether to market a new product. Assume, for simplicity, that if this product is marketed, there are only two possible outcomes: success or failure. The company assesses that the probabilities of these two outcomes are p and 1 2 p, respectively. If the product is marketed and it proves to be a failure, the company will have a net loss of $450,000. If the product is marketed and it proves to be a success, the com- pany will have a net gain of $750,000. If the company decides not to market the product, there is no gain or loss. The company can first survey prospective buyers of this new product. The results of the consumer survey can be classified as favorable, neutral, or unfavorable. Based on similar surveys for previous products, the company assesses the probabilities of favorable, neutral, and unfavorable survey results to be 0.6, 0.3, and 0.1 for a product that will eventually be a success, and it assesses these probabilities to be 0.1, 0.2, and 0.7 for a product that will eventually be a failure. The total cost of administering this survey is C dollars.C dollars.C a. Let p 5 0.4. For which values of C, if any, would this

company choose to conduct the survey? b. Let p 5 0.4. What is the largest amount this com-

pany would be willing to pay for perfect informa- tion about the potential success or failure of the new product?

c. Let p 5 0.5 and C 5 $15,000. Find the strategy that maximizes the company’s expected net earn- ings. Does the optimal strategy involve conducting the survey? Explain why or why not.

43. The U.S. government wants to determine whether immigrants should be tested for a contagious disease, and it is planning to base this decision on financial considerations. Assume that each immigrant who is allowed to enter the United States and has the disease costs the country $100,000. Also, assume that each immigrant who is allowed to enter the United States and does not have the disease will contribute $10,000 to the national economy. Finally, assume that x percent x percent x of all potential immigrants have the disease. The U.S. government can choose to admit all immigrants, admit no immigrants, or test immigrants for the disease before determining whether they should be admitted. It costs T dollars to test a person for the disease, and the T dollars to test a person for the disease, and the T test result is either positive or negative. A person who does not have the disease always tests negative. How- ever, 10% of all people who do have the disease test

negative. The government’s goal is to maximize the expected net financial benefits per potential immigrant. a. If x 5 x 5 x 5, what is the largest value of T at which T at which T

the U.S. government will choose to test potential immigrants for the disease?

b. How does your answer to the question in part a change if x increases to 10?x increases to 10?x

c. If x 5 x 5 x 5 and T 5 T 5 T $500, what is the government’s optimal strategy?

44. The senior executives of an oil company are trying to decide whether to drill for oil in a particular field in the Gulf of Mexico. It costs the company $600,000 to drill in the selected field. Company executives believe that if oil is found in this field its estimated value will be $3,400,000. At present, this oil company believes that there is a 45% chance that the selected field actu- ally contains oil. Before drilling, the company can hire a geologist at a cost of $55,000 to perform seismo- graphic tests. Based on similar tests in other fields, the tests have a 25% false negative rate (no oil predicted when oil is present) and a 15% false positive rate (oil predicted when no oil is present). a. Assuming that this oil company wants to

maximize its expected net earnings, use a decision tree to determine its optimal strategy.

b. Calculate and interpret EVI for this decision prob- lem. Experiment with the accuracy probabilities of the geologist to see how EVI changes as they change.

c. Calculate and interpret EVPI for this decision problem.

45. A product manager at Clean & Brite (C&B) wants to determine whether her company should market a new brand of toothpaste. If this new product suc- ceeds in the marketplace, C&B estimates that it could earn $1,800,000 in future profits from the sale of the new toothpaste. If this new product fails, however, the company expects that it could lose approximately $750,000. If C&B chooses not to market this new brand, the product manager believes that there would be little, if any, impact on the profits earned through sales of C&B’s other products. The manager has estimated that the new toothpaste brand will succeed with probability 0.50. Before making her decision regarding this tooth- paste product, the manager can spend $75,000 on a market research study. Based on similar studies with past products, C&B believes that the study will predict a successful product, given that product would actually be a success, with probability 0.75. It also believes that the study will predict a failure, given that the product would actually be a failure, with probability 0.65. a. To maximize expected profit, what strategy should

the C&B product manager follow?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

270 Chapter 6 Decision Making Under Uncertainty

b. Calculate and interpret EVI for this decision prob- lem.

c. Calculate and interpret EVPI for this decision problem.

46. Ford is going to produce a new vehicle, the Pioneer, and wants to determine the amount of annual capacity it should build. Ford’s goal is to maximize the profit from this vehicle over the next five years. Each ve- hicle will sell for $19,000 and incur a variable produc- tion cost of $16,000. Building one unit of annual ca- pacity will cost $2000. Each unit of capacity will also cost $1000 per year to maintain, even if the capacity is unused. Demand for the Pioneer is unknown but marketing estimates the distribution of annual demand to be as shown in the file P06_46.xlsx. Assume that the number of units sold during a year is the minimum of capacity and annual demand. Which capacity level should Ford choose? Do you think EMV is the appro- priate criterion?

47. Many decision problems have the following simple structure. A decision maker has two possible deci- sions, 1 and 2. If decision 1 is made, a sure cost of c is incurred. If decision 2 is made, there are two possible outcomes, with costs c1 and c2 and probabilities p and 1 2 p. We assume that c1 , c , c2. The idea is that decision 1, the riskless decision, has a moderate cost, whereas decision 2, the risky decision, has a low cost c1 or a high cost c2. a. Calculate the expected cost from the risky

decision. b. List as many scenarios as you can think of that

have this structure. (Here’s an example to get you started. Think of insurance, where you pay a sure premium to avoid a large possible loss.) For each of these scenarios, indicate whether you would base your decision on EMV or on expected utility.

48. A nuclear power company is deciding whether to build a nuclear power plant at Diablo Canyon or at Roy Rogers City. The cost of building the power plant is $10 million at Diablo and $20 million at Roy Rogers City. If the company builds at Diablo, however, and an earthquake occurs at Diablo during the next five years, construction will be terminated and the company will lose $10 million (and will still have to build a power plant at Roy Rogers City). Without further expert information the company believes there is a 20% chance that an earthquake will occur, at Diablo during the next five years. For $1 million, a geologist can be hired to analyze the fault structure at Diablo Canyon. She will predict either that an earthquake will occur or that an earth- quake will not occur. The geologist’s past record indicates that she will predict an earthquake with probability 0.95 if an earthquake will occur, and she will predict no earthquake with probability 0.90

if an earthquake will not occur. Should the power company hire the geologist? Also, calculate and interpret EVI and EVPI.

49. Referring to Techware’s decision problem in Problem 33, suppose now that Techware’s utility function of net revenue x (measured in dollars) is x (measured in dollars) is x U1x2 = 1 − e−x/x/x 350000. a. Find the decision that maximizes Techware’s

expected utility. How does this optimal decision compare to the optimal decision with an EMV criterion? Explain any difference between the two optimal decisions.

b. Repeat part a when Techware’s utility function is U1x2 = 1 − e−x/x/x 50000.

50. Referring to the bank’s customer loan decision problem in Problem 41, suppose now that the bank’s utility function of profit x (in dollars) is x (in dollars) is x U1x2 = 1 − e−x/x/x 150000. Find the strategy that maximizes the bank’s expected utility. How does this optimal strategy compare to the optimal decision with an EMV criterion? Explain any difference between the two optimal strategies.

51. A television network earns an average of $25 million each season from a hit program and loses an average of $8 million each season on a program that turns out to be a flop. Of all programs picked up by this network in recent years, 25% turn out to be hits and 75% turn out to be flops. At a cost of C dollars, a market C dollars, a market C research firm will analyze a pilot episode of a prospec- tive program and issue a report predicting whether the given program will end up being a hit. If the program is actually going to be a hit, there is a 75% chance that the market researchers will predict the program to be a hit. If the program is actually going to be a flop, there is only a 30% chance that the market researchers will predict the program to be a hit. a. What is the maximum value of C that the network C that the network C

should be willing to pay the market research firm? b. Calculate and interpret EVPI for this decision

problem.

52. [Based on Balson et al. (1992).] An electric utility company is trying to decide whether to replace its PCB transformer in a generating station with a new and safer transformer. To evaluate this decision, the utility needs information about the likelihood of an incident, such as a fire, the cost of such an incident, and the cost of replacing the unit. Suppose that the total cost of replacement as a present value is $75,000. If the transformer is replaced, there is virtually no chance of a fire. However, if the current transformer is retained, the probability of a fire is assessed to be 0.0025. If a fire occurs, the cleanup cost could be high ($80 million) or low ($20 million). The probability of a high cleanup cost, given that a fire oc- curs, is assessed at 0.2.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-7 Conclusion 271

a. If the company uses EMV as its decision criterion, should it replace the transformer?

b. Perform a sensitivity analysis on the key parameters of the problem that are difficult to assess, namely, the probability of a fire, the probability of a high cleanup cost, and the high and low cleanup costs. Does the optimal decision from part a remain opti- mal for a wide range of these parameters?

c. Do you believe EMV is the correct criterion to use in this type of problem involving environmental accidents?

53. The Indiana University basketball team trails by two points with eight seconds to go and has the ball. Should it attempt a two-point shot or a three-point shot? Assume that the Indiana shot will end the game and that no foul will occur on the shot. Assume that a three- point shot has a 30% chance of success, and a two-point shot has a 45% chance of success. Finally, assume that Indiana has a 50% chance of winning in overtime.

Level B 54. Mr. Maloy has just bought a new $30,000 sport utility

vehicle. As a reasonably safe driver, he believes there is only about a 5% chance of being in an accident in the coming year. If he is involved in an accident, the damage to his new vehicle depends on the severity of the accident. The probability distribution of damage amounts (in dollars) is given in the file P06_54.xlsx. Mr. Maloy is trying to decide whether to pay $170 each year for collision insurance with a $300 deduct- ible. Note that with this type of insurance, he pays the first $300 in damages if he causes an accident and the first $300 in damages if he causes an accident and the first insurance company pays the remainder. a. Identify the decision that minimizes Mr. Maloy’s

annual expected cost. b. Perform a sensitivity analysis on the best decision

with respect to the probability of an accident, the premium, and the deductible amount, and summa- rize your findings. (You can choose the ranges to test.)

55. The purchasing agent for a PC manufacturer is currently negotiating a purchase agreement for a particular electronic component with a given sup- plier. This component is produced in lots of 1000, and the cost of purchasing a lot is $30,000. Unfor- tunately, past experience indicates that this supplier has occasionally shipped defective components to its customers. Specifically, the proportion of defec- tive components supplied by this supplier has the probability distribution given in the file P06_55. xlsx. Although the PC manufacturer can repair a defective component at a cost of $20 each, the purchasing agent  learns that this supplier will now assume the cost of replacing defective components in

excess of the first 100 faulty items found in a given lot. This guarantee may be purchased by the PC manufacturer prior to the receipt of a given lot at a cost of $1000 per lot. The purchasing agent wants to determine whether it is worthwhile to purchase the supplier’s guarantee policy. a. Identify the strategy that minimizes the expected

total cost of achieving a complete lot of satisfac- tory microcomputer components.

b. Perform a sensitivity analysis on the optimal decision with respect to the number of components per lot and the three monetary inputs, and summarize your findings. (You can choose the ranges to test.)

56. A home appliance company is interested in market- ing an innovative new product. The company must decide whether to manufacture this product in house or employ a subcontractor to manufacture it. The file P06_56.xlsx contains the estimated probability distribution of the cost of manufacturing one unit of this new product (in dollars) if the home appliance company produces the product in house. This file also contains the estimated probability distribution of the cost of purchasing one unit of the product if from the subcontractor. There is also uncertainty about demand for the product in the coming year, as shown in the same file. The company plans to meet all demand, but there is a capacity issue. The subcontractor has unlimited capacity, but the home appliance company has capacity for only 5000 units per year. If it decides to make the product in house and demand is greater than capacity, it will have to purchase the excess demand from an external source at a premium: $225 per unit. Assuming that the company wants to minimize the expected cost of meeting demand in the coming year, should it make the new product in house or buy it from the subcontractor? Do you need a decision tree, or can you perform the required EMV calculations without one? (You can assume that neither the company nor the subcontractor will ever produce more than demand.)

57. A grapefruit farmer in central Florida is trying to decide whether to take protective action to limit damage to his crop in the event that the overnight temperature falls to a level well below freezing. He is concerned that if the temperature falls sufficiently low and he fails to make an effort to protect his grapefruit trees, he runs the risk of losing his entire crop, which is worth approximately $75,000. Based on the latest forecast issued by the National Weather Service, the farmer estimates that there is a 60% chance that he will lose his entire crop if it is left unprotected. Alternatively, the farmer can insulate his fruit by spraying water on all of the trees in his orchards. This action, which would likely cost the farmer C dollars, would prevent total devastation C dollars, would prevent total devastation C but might not completely protect the grapefruit trees

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

272 Chapter 6 Decision Making Under Uncertainty

from incurring some damage as a result of the unusu- ally cold overnight temperatures. The file P06_57. xlsx contains the assessed distribution of possible damages (in dollars) to the insulated fruit in light of the cold weather forecast. The farmer wants to minimize the expected total cost of coping with the threatening weather. a. Find the maximum value of C below which the C below which the C

farmer should insulate his crop to limit the damage from the unusually cold weather.

b. Set C equal to the value identified in part C equal to the value identified in part C a. Perform sensitivity analysis to determine under what conditions, if any, the farmer would be better off not spraying his grapefruit trees and taking his chances in spite of the threat to his crop.

c. Suppose that C equals $25,000, and in addition to C equals $25,000, and in addition to C this protection, the farmer can purchase insurance on the crop. Discuss possibilities for reasonable insurance policies and how much they would be worth to the farmer. You can assume that the insur- ance is relevant only if the farmer purchases the protection, and you can decide on the terms of the insurance policy.

58. A retired partner from a large brokerage firm has one million dollars available to invest in particular stocks or bonds. Each investment’s annual rate of return depends on the state of the economy in the coming year. The file P06_58.xlsx contains the distribution of returns for these stocks and bonds as a function of the economy’s state in the coming year. As this file indicates, the returns from stocks and bonds in a fair economy are listed as X and X and X Y. This investor wants to allocate her one million dollars to maximize her expected value of the portfolio one year from now. a. If X 5 Y 5 15%, find the optimal investment strat-

egy for this investor. (Hint: You could try a decision tree approach, but it would involve a massive tree. It is much easier to find an algebraic expression for the expected final value of the investment when a percentage p is put in stocks and the remaining percentage is put in bonds.)

b. For which values of X (where 10%X (where 10%X , X , 20%) and Y (where 12.5%Y (where 12.5%Y , Y , 17.5%), if any, will this investor prefer to place all of her available funds in stocks? Use the same method as in part a for each combination of X and Y.Y.Y

59. A city in Ohio is considering replacing its fleet of gasoline-powered automobiles with electric cars. The manufacturer of the electric cars claims that this municipality will experience significant cost savings over the life of the fleet if it chooses to pursue the conversion. If the manufacturer is correct, the city will save about $1.5 million dollars. If the new technology employed within the electric cars is faulty, as some critics suggest, the conversion to electric cars will cost

the city $675,000. A third possibility is that less seri- ous problems will arise and the city will break even with the conversion. A consultant hired by the city estimates that the probabilities of these three outcomes are 0.30, 0.30, and 0.40, respectively. The city has an opportunity to implement a pilot program that would indicate the potential cost or savings resulting from a switch to electric cars. The pilot program involves renting a small number of electric cars for three months and running them under typical conditions. This program would cost the city $75,000. The city’s consultant believes that the results of the pilot program would be significant but not conclusive; she submits the values in the file P06_59.xlsx, a compilation of probabilities based on the experience of other cities, to support her contention. For example, the first row of her table indicates that if a conversion to electric cars will actually result in a savings of $1.5 million, the pilot program will indicate that the city saves money, loses money, and breaks even with probabilities 0.6, 0.1, and 0.3, respectively. What actions should the city take to maximize its expected savings? When should it run the pilot program, if ever?

60. Sharp Outfits is trying to decide whether to ship some customer orders now via UPS or wait until after the threat of another UPS strike is over. If Sharp Outfits decides to ship the requested merchandise now and the UPS strike takes place, the company will incur $60,000 in delay and shipping costs. If Sharp Outfits decides to ship the customer orders via UPS and no strike occurs, the company will incur $4000 in ship- ping costs. If Sharp Outfits decides to postpone ship- ping its customer orders via UPS, the company will incur $10,000 in delay costs regardless of whether UPS goes on strike. Let p represent the probability that UPS will go on strike and impact Sharp Outfits’s shipments. a. For which values of p, if any, does Sharp Outfits

minimize its expected total cost by choosing to postpone shipping its customer orders via UPS?

b. Suppose now that, at a cost of $1000, Sharp Outfits can purchase information regarding the likelihood of a UPS strike in the near future. Based on similar strike threats in the past, the company assesses that if there will be a strike, the information will predict a strike with probability 0.75, and if there will not be a strike, the information will predict no strike with probability 0.85. Provided that p 5 0.15, what strategy should Sharp Outfits pursue to minimize its expected total cost?

c. Using the analysis from part b, find the EVI when p 5 0.15. Then use a data table to find EVI for p from 0.05 to 0.30 in increments of 0.05, and chart EVI versus p.

d. Continuing part b, calculate and interpret the EVPI when p 5 0.15.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

6-7 Conclusion 273

61. A homeowner wants to decide whether he should install an electronic heat pump in his home. Given that the cost of installing a new heat pump is fairly large, the homeowner wants to do so only if he can count on being able to recover the initial expense over five consecutive years of cold winter weather. After reviewing historical data on the operation of heat pumps in various kinds of winter weather, he computes the expected annual costs of heating his home during the winter months with and without a heat pump in operation. These cost figures are shown in the file P06_61.xlsx. The probabilities of experiencing a mild, normal, colder than normal, and se- vere winter are 0.2(1 2 x), 0.5(1 2 x), 0.3(1 2 x), and x, respectively. In words, as the last probability varies, the first three probabilities remain in the ratios 2 to 5 to 3, and all probabilities continue to sum to 1. a. Given that x 5 0.1, what is the most that the home-

owner is willing to pay for the heat pump? b. If the heat pump costs $500, how large must x be x be x

before the homeowner decides it is economically worthwhile to install the heat pump?

c. Given that x 5 0.1, calculate and interpret EVPI when the heat pump costs $500.

62. Suppose an investor has the opportunity to buy the fol- lowing contract, a stock call option, on March 1. The contract allows him to buy 100 shares of ABC stock at the end of March, April, or May at a guaranteed price of $50 per share. He can exercise this option at most once. For example, if he purchases the stock at the end of March, he can’t purchase more in April or May at the guaranteed price. The current price of the stock is $50. Each month, assume that the stock price either goes up by a dollar (with probability 0.55) or goes down by a dollar (with probability 0.45). If the investor buys the contract, he is hoping that the stock price will go up. The reasoning is that if he buys the contract, the price goes up to $51, and he buys the stock (that is, he exercises his option) for $50, he can then sell the stock for $51 and make a profit of $1 per share. On the other hand, if the stock price goes down, he doesn’t have to exercise his option; he can just throw the contract away. a. Use a decision tree to find the investor’s optimal

strategy—that is, when he should exercise the option—assuming that he purchases the contract.

b. How much should he be willing to pay for such a contract?

63. (This problem assumes knowledge of the basic rules of football.) The ending of the game between the Indianapolis Colts and the New England Patriots (NFL teams) in Fall 2009 was quite controversial. With about two minutes left in the game, the Patriots were ahead 34 to 28 and had the ball on their own 28-yard line with fourth down and two yards to go. In other words, they were 72 yards from a

touchdown. Their coach, Bill Belichick, decided to go for the first down rather than punt, contrary to conventional wisdom. They didn’t make the first down, so that possession went to the Colts, who then scored a touchdown to win by a point. Belichick was harshly criticized by most of the media, but was his unorthodox decision really a bad one? a. Use a decision tree to analyze the problem. You

can make some simplifying decisions: (1) the game would essentially be over if the Patriots made a first down, and (2) at most one score would occur after a punt or a failed first down attempt. (Note that there are no monetary values. However, you can assume the Patriots receive $1 for a win and $0 for a loss, so that maximizing EMV is equivalent to maximizing the probability that the Patriots win.)

b. Show that the Patriots should go for the first down if p . 1 2 q/r. Here, p is the probability the Patriots make the first down, q is the probability the Colts score a touchdown after a punt, and r is the r is the r probability the Colts score a touchdown after the Patriots fail to make a first down. What are your best guesses for these three probabilities? Based on them, was Belichick’s decision a good one?

64. (This problem assumes knowledge of the basic rules of baseball.) George Lindsey (1959) looked at box scores of more than 1000 baseball games and found the expected number of runs scored in an inning for each on-base and out situation to be as listed in the file P06_64.xlsx. For example, if a team has a man on first base with one out, it scores 0.5 run on average until the end of the inning. You can assume throughout this problem that the team batting wants to maximize the expected number of runs scored in the inning. a. Use this data to explain why, in most cases,

bunting with a man on first base and no outs is a bad decision. In what situation might bunting with a man on first base and no outs be a good decision?

b. Assume there is a man on first base with one out. What probability of stealing second makes an at- tempted steal a good idea?

65. (This problem assumes knowledge of the basic rules of basketball.) One controversial topic in basketball (college or any other level) is whether to foul a player deliberately with only a few seconds left in the game. Consider the following scenario. With about 10 sec- onds left in the game, team A is ahead of team B by three points, and team B is just about to inbound the ball. Assume team A has committed enough fouls so that future fouls result in team B going to the free-throw line. If team A purposely commits a foul as soon as possible, team B will shoot two foul shots (a point apiece). The thinking is that this is better than letting team B shoot a three-point shot, which

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

274 Chapter 6 Decision Making Under Uncertainty

would be their best way to tie the game and send it into overtime. However, there is a downside to fouling. Team B could make the first free throw, purposely miss the second, get the rebound, and score a two-point shot to tie the game, or it even score a three-point shot to win the game. Examine this decision, using reasonable input parameters. It doesn’t appear that this deliberate fouling strategy is used very often, but do you think it should be used?

66. (This problem assumes knowledge of the basic rules of football.) The following situation actually occurred in a 2009 college football game between Washington and Notre Dame. With about 3.5 minutes left in the

game, Washington had fourth down and one yard to go for a touchdown, already leading by two points. Notre Dame had just had two successful goal-line stands from in close, so Washington’s coach decided not to go for the touchdown and the virtually sure win. Instead, Washington kicked a field goal, and Notre Dame even- tually won in overtime. Use a decision tree, with some reasonable inputs, to see whether Washington made a wise decision or should have gone for the touchdown. Note that the only “monetary” values here are 1 and 0. You can think of Washington getting $1 if they win and $0 if they lose. Then the EMV is 1*P(Win) 1 0*P(lose) 5 P(Win), so maximizing EMV is equivalent to maximizing the probability of winning.

The Jogger Shoe Company is trying to decide whether to make a change in its most popular brand of running shoes. The new style would cost the same to produce and be priced the same, but it would incorporate a new kind of lacing system that (according to its marketing research people) would make it more popular.

There is a fixed cost of $300,000 for changing over to the new style. The unit contribution to before-tax profit for either style is $8. The tax rate is 35%. Also, because the fixed cost can be depreci- ated and will therefore affect the after-tax cash flow, a depreciation method is needed. You can assume it is straight-line depreciation.

The current demand for these shoes is 190,000 pairs annually. The company assumes this demand will continue for the next three years if the current style is retained. However, there is uncertainty about demand for the new style, if it is introduced. The company models this uncertainty by assuming a normal distribution in year 1, with mean 220,000

and standard deviation 20,000. The company also assumes that this demand, whatever it is, will remain constant for the next three years. However, if demand in year 1 for the new style is sufficiently low, the company can always switch back to the current style and realize an annual demand of 190,000. The company wants a strategy that will maximize the expected net present value (NPV) of total cash flow for the next three years, where a 10% interest rate is used for the purpose of calculating NPV.

Realizing that the continuous normal demand distribution doesn’t lend itself well to decision trees that require a discrete set of outcomes, the com- pany decides to replace the normal demand distri- bution with a discrete distribution with five “typical” values. Specifically, it decides to use the 10th, 30th, 50th, 70th, and 90th percentiles of the given normal distribution. Why is it reasonable to assume that these five possibilities are equally likely? With this discrete approximation, how should the company proceed?

6.1 JOGGER SHOE COMPANYC A S E

The Westhouser Paper Company in the state of Washington currently has an option to pur- chase a piece of land with good timber forest on it. It is now May 1, and the current price of the land is $2.2 million. Westhouser does not actually need

the timber from this land until the beginning of July, but its top executives fear that another company might buy the land between now and the beginning of July. They assess that there is a 5% chance that a competitor will buy the land during May. If this does

C A S E 6.2 WESTHOUSER PAPER COMPANY

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Case 6.3 Electronic Timing System for Olympics 275

not occur, they assess that there is a 10% chance that the competitor will buy the land during June. If Westhouser does not take advantage of its current option, it can attempt to buy the land at the begin- ning of June or the beginning of July, provided that it is still available.

Westhouser’s incentive for delaying the purchase is that its financial experts believe there is a good chance that the price of the land will fall significantly in one or both of the next two months. They assess the possible price decreases and their probabilities in Table 6.2 and Table 6.3. Table 6.2 shows the probabilities of the possible price decreases during May. Table 6.3 lists the conditional probabilities of conditional probabilities of conditional the possible price decreases in June, given the price decrease in May. For example, it indicates that if the

price decrease in May is $60,000, then the possible price decreases in June are $0, $30,000, and $60,000 with respective probabilities 0.6, 0.2, and 0.2.

If Westhouser purchases the land, it believes that it can gross $3 million. (This does not count the cost of purchasing the land.) But if it does not pur- chase the land, Westhouser believes that it can make $650,000 from alternative investments. What should the company do?

Table 6.2 Distribution of Price Decrease in May Price Decrease Probability

$0 0.5 $60,000 0.3 $120,000 0.2

Table 6.3 Distribution of Price Decrease in June Price Decrease in May

$0 $60,000 $120,000

June Decrease Probability June Decrease Probability June Decrease Probability

$0 0.3 $0 0.6 $0 0.7 $60,000 0.6 $30,000 0.2 $20,000 0.2 $120,000 0.1 $60,000 0.2 $40,000 0.1

C A S E

Sarah Chang is the owner of a small electronics company. In six months, a proposal is due for an electronic timing system for the next Olympic Games. For several years, Chang’s company has been developing a new microprocessor, a critical com- ponent in a timing system that would be superior to any product currently on the market. However, progress in research and development has been slow, and Chang is unsure whether her staff can produce the microprocessor in time. If they succeed in developing the microprocessor (probability p1), there is an excellent chance (probability p2) that Chang’s company will win the $1 million Olympic contract. If they do not, there is a small chance (probability p3) that she will still be able to win the same contract with an alternative but inferior timing system that has already been developed.

If she continues the project, Chang must invest $200,000 in research and development. In addition,

making a proposal (which she will decide whether to do after seeing whether the R&D is successful) requires developing a prototype timing system at an additional cost. This additional cost is $50,000 if R&D is successful (so that she can develop the new timing system), and it is $40,000 if R&D is unsuccessful (so that she needs to go with the older timing system). Finally, if Chang wins the contract, the finished prod- uct will cost an additional $150,000 to produce. a. Develop a decision tree that can be used to

solve Chang’s problem. You can assume in this part of the problem that she is using EMV (of her net profit) as a decision criterion. Build the tree so that she can enter any values for p1, p2, and p3 (in input cells) and automatically see her optimal EMV and optimal strategy from the tree.

b. If p2 5 0.8 and p3 5 0.1, what value of p1 makes Chang indifferent between abandoning the proj- ect and going ahead with it?

6.3 ELECTRONIC TIMING SYSTEM FOR OLYMPICS

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

276 Chapter 6 Decision Making Under Uncertainty

c. How much would Chang benefit if she knew for certain that the Olympic organization would guarantee her the contract? (This guarantee would be in force only if she were successful in developing the product.) Assume p1 5 0.4, p2 5 0.8, and p3 5 0.1.

d. Suppose now that this is a relatively big project for Chang. Therefore, she decides to use expected utility as her criterion, with an exponential utility function. Using some trial and error, see which risk tolerance changes her initial decision from “go ahead” to “abandon” when p1 5 0.4, p2 5 0.8, and p3 5 0.1.

C A S E 6.4 DEVELOPING A HELICOPTER COMPONENT FOR THE ARMY

The Ventron Engineering Company has just been awarded a $2 million development contract by the U.S. Army Aviation Systems Command to develop a blade spar for its Heavy Lift Helicopter program. The blade spar is a metal tube that runs the length of and provides strength to the helicop- ter blade. Due to the unusual length and size of the Heavy Lift Helicopter blade, Ventron is unable to produce a single-piece blade spar of the required dimensions using existing extrusion equipment and material. The engineering department has prepared two alternatives for developing the blade spar: (1) sectioning or (2) an improved extrusion process. Ventron must decide which process to use. (Backing out of the contract at any point is not an option.) The risk report has been prepared by the engineer- ing department. The information from this report is explained next.

The sectioning option involves joining several shorter lengths of extruded metal into a blade spar of sufficient length. This work will require extensive testing and rework over a 12-month period at a total cost of $1.8 million. Although this process will definitely produce an adequate blade spar, it merely represents an extension of existing technology.

To improve the extrusion process, on the other hand, it will be necessary to perform two steps: (1) improve the material used, at a cost of $300,000, and (2) modify the extrusion press, at a cost of $960,000. The first step will require six months of work, and if this first step is successful, the second step will require another six months of work. If both steps are successful, the blade spar will be available at that time, that is, a year from now. The engineers estimate that the probabilities of succeeding in steps 1 and 2 are 0.9 and 0.75, respectively. However, if

either step is unsuccessful (which will be known only in six months for step 1 and in a year for step 2), Ventron will have no alternative but to switch to the sectioning process—and incur the sectioning cost on top of any costs already incurred.

Development of the blade spar must be com- pleted within 18 months to avoid holding up the rest of the contract. If necessary, the sectioning work can be done on an accelerated basis in a six-month period, but the cost of sectioning will then increase from $1.8 million to $2.4 million. The director of engineering, Dr. Smith, wants to try developing the improved extrusion process. He reasons that this is not only cheaper (if successful) for the current proj- ect, but its expected side benefits for future projects could be sizable. Although these side benefits are dif- ficult to gauge, Dr. Smith’s best guess is an additional $2 million. (These side benefits are obtained only if both steps of the modified extrusion process are completed successfully.)

a. Develop a decision tree to maximize Ventron’s EMV. This includes the revenue from this project, the side benefits (if applicable) from an improved extrusion process, and relevant costs. You don’t need to worry about the time value of money; that is, no discounting or net present values are required. Summarize your findings in words in the spreadsheet.

b. What value of side benefits would make Ventron indifferent between the two alternatives?

c. How much would Ventron be willing to pay, right now, for perfect information about both steps of the improved extrusion process? (This information would tell Ventron, right now, the ultimate success or failure outcomes of both steps.) ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Statistical Inference CHAPTER 7 Sampling and Sampling Distributions

CHAPTER 8 Confidence Interval Estimation

CHAPTER 9 Hypothesis Testing

PA RT

3

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

279

SAMPLE SIZE SELECTION IN A LEGAL CASE

This chapter introduces the important problem of estimating an unknown population quantity by randomly sampling from the population. Sampling is often expensive and/or time-consuming, so a key step in any sampling plan is to determine the sample size that produces a prescribed level of accuracy. Some of the issues in finding an appropriate sample size are discussed in Afshartous (2008). The author was involved as an expert statistical witness for the plaintiff in a court case. Over a period of several years, a service company had collected a flat “special service handling fee” from its client during any month in which a special service request was made. The plaintiff claimed that many of these fees had been charged erroneously and sought to recover all of the money collected from such erroneous fees. The statistical question concerns either the proportion of all monthly billing records that were erroneous or the total number of all erroneous billing records. Both total number of all erroneous billing records. Both total number sides had to agree on a sampling method for sampling through the very large population of billing records. They eventually agreed to simple random sampling, as discussed in this chapter. However, there was some contention (and confusion) regarding the appropriate sample size.

Their initial approach was to find a sample size n sufficiently large to accurately estimate p, the unknown proportion of all monthly billing records in error. Specifically, if they wanted to be 95% confident that the error in their estimate of p would be no more than 5%, then a standard sample size formula (provided in Chapter 8) requires n to be 385. (This number is surprisingly independent of the total number of billing records.) Then, for example, if the sample discovered 77 errors, or 20% of the sampled items,

Sampling and Sampling Distributions

C H A P T E R

7

m e va

n s/

iS to

c kp

h o to

.c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

280 Chapter 7 Sampling and Sampling Distributions

they would be 95% confident that between 15% and 25% (20% plus or minus 5%) of all billing records were in error.

The author argued that this “plus or minus 5%” does not necessarily provide the desired level of accuracy for the quantity of most interest, the total number of errone- ously charged fees. A couple of numerical examples illustrate his point. Let’s suppose that there were 100,000 billing records total and that 20%, or 20,000, were billed erroneously. Then the plus or minus 5% interval translates to an interval from 15,000 to 25,000 bad billings. That is, we are 95% confident that the estimate is not off by more than 5000 billing records on either side. The author defines the relative error in this case relative error in this case relative error to be 0.25: the potential error, 5000, divided by the number to be estimated, 20,000. Now change the example slightly so that 60%, or 60,000, were billed erroneously. Then plus or minus 5% translates to the interval from 55,000 to 65,000, and the relative error is 5000/60,000, or 0.083. The point is that the same plus or minus 5% absolute error for p results in a much smaller relative error in the second example.

Using this reasoning, the author suggested that they should choose the sample size to achieve a prescribed relative error in the number of bad billings. This can change the magnitude of the sample size considerably. For example, the author shows by means of a rather complicated sample size formula that if a relative error of 0.10 is desired and the value of p is somewhere around 0.10, a sample size of about 3600 is required. On the other hand, if a relative error of 0.10 is still desired but the value of p is somewhere around 0.5, then the required sample size is only about 400.

Sample size formulas, and statistical arguments that lead to them, are far from intuitive. In this legal case, by keeping the math to a minimum and using simple terminology like relative error, the author eventually convinced the others to use his approach, even though it led to a considerably larger sample size than the 385 originally proposed. ■

7-1 INTRODUCTION This chapter sets the stage for statistical inference, a topic that is explored in the following two chapters. In a typical statistical inference problem, you want to discover one or more characteristics of a given population. For example, you might want to know the propor- tion of toothpaste customers who have tried, or intend to try, a particular brand. Or you might want to know the average amount owed on credit card accounts for a population of customers at a shopping mall. Generally, the population is large and/or spread out, and it is dif�cult, maybe even impossible, to contact each member. Therefore, you identify a sample of the population and then obtain information from the members of the sample.

There are two main objectives of this chapter. The �rst is to discuss the sampling schemes that are generally used in real sampling applications. We focus on several types of random samples and see why these are preferable to nonrandom samples. The second objective is to see how the information from a sample of the population—for example, 1% of the population—can be used to infer the properties of the entire population. The key here is the concept of a sampling distribution. In this chapter we focus on the sampling distribu- tion of the sample mean, and we discuss the role of a famous mathematical result called the central limit theorem. Speci�cally, we discuss how the central limit theorem is the reason for the importance of the normal distribution in statistical inference.normal distribution in statistical inference.normal

7-2 SAMPLING TERMINOLOGY We begin by introducing some terminology that is used in sampling. In any sampling problem there is a relevant population. The population is the set of all members about which a study intends to make inferences, where an inference is a statement about a numeri- cal characteristic of the population, such as an average income or the proportion of incomes

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-2 Sampling Terminology 281

below $50,000. It is important to realize that a population is de�ned in relationship to any particular study. Any analyst planning a survey should �rst decide which population the conclusions of the study will concern, so that a sample can be chosen from this population.

The relevant population contains all members about which a study intends to make inferences.

A frame is a list of all members, called sampling units, in the population.

It is customary in virtually all statistical literature to let uppercase N be the population size and lowercase n be the sample size. We follow this convention as well.

For example, if a marketing researcher plans to use a questionnaire to infer consumers’ reactions to a new product, she must �rst decide which population of consumers is of interest—all consumers, consumers over 21 years old, consumers who do most of their shopping in shopping malls, or others. Once the relevant consumer population has been designated, a sample from this population can then be surveyed. However, it is important to remember that inferences made from the study pertain only to this particular population.particular population.particular

Before you can choose a sample from a given population, you typically need a list of all members of the population. In sampling terminology, this list is called a frame, and the potential sample members are called sampling units. Depending on the context, sampling units could be individual people, households, companies, cities, or others.

In this chapter we assume that the population is �nite and consists of N sampling units. We also assume that a frame of these N sampling units is available. Unfortunately, there are many situations where a complete frame is practically impossible to obtain. For example, if the purpose of a study is to survey the attitudes of all unemployed teenagers in Chicago, it is practically impossible to obtain a complete frame of them. In this situation the best alternative is to obtain a partial frame from which the sample can be selected. If the partial frame omits any signi�cant segments of the population that a complete frame would include, then the resulting sample could be biased. For instance, if you use the Yellow Pages of a Los Angeles telephone book to choose a sample of restaurants, you auto- matically omit all restaurants that do not advertise in the Yellow Pages. Depending on the purposes of the study, this could be a serious omission.

There are two basic types of samples: probability samples and judgmental samples. A probability sample is a sample in which the sampling units are chosen from the popula- tion according to a random mechanism. In contrast, no formal random mechanism is used to select a judgmental sample. In this case the sampling units are chosen according to the sampler’s judgment.

The members of a probability sample are chosen according to a random mechanism, whereas the members of a judgmental sample are chosen according to the sampler’s judgment.

Why Random Sampling? One reason for sampling randomly from a population is to avoid biases (such as choosing mainly stay-at-home mothers because they are easier to contact). An equally important reason is that random sampling allows you to use probability to make inferences about unknown population parameters. If sampling were not random, there would be no basis for using probability to make such inferences.

F u n da m e n ta l I n s i g h t

We do not discuss judgmental samples. The rea- son is very simple—there is no way to measure the accuracy of judgmental samples because the rules of probability do not apply to them. In other words, if a population characteristic is estimated from the obser- vations in a judgmental sample, there is no way to measure the accuracy of this estimate. In addition, it is very dif�cult to choose a representative sample from a population without using some random mechwithout using some random mechwithout - anism. Because our judgment is usually not as good as we think, judgmental samples are likely to contain our own built-in biases. Therefore, we focus exclu- sively on probability samples from here on.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

282 Chapter 7 Sampling and Sampling Distributions

A simple random sample of size n is one where each possible sample of size n has the same chance of being chosen.

Remember that the RAND function in Excel generates numbers that are distributed randomly and uniformly between 0 and 1.

7-3 METHODS FOR SELECTING RANDOM SAMPLES In this section we discuss the types of random samples that are used in real sampling applications. Different types of sampling schemes have different properties. There is typically a trade-off between cost and accuracy. Some sampling schemes are cheaper and easier to administer, whereas others are more costly but provide more accurate information. We discuss some of these issues. However, anyone who intends to make a living in survey sampling needs to learn much more about the topic than we can cover here.

7-3a Simple Random Sampling

The simplest type of sampling scheme is appropriately called simple random sampling. Suppose you want to sample n units from a population of size N. Then a simple random sample of size n has the property that every possible sample of size n has the same prob- ability of being chosen. Simple random samples are the easiest to understand, and their statistical properties are the most straightforward. Therefore, we will focus primarily on simple random samples in the rest of this book. However, as we discuss shortly, more complex random samples are often used in real applications.

Let’s illustrate the concept with a simple random sample for a small population. Suppose the population size is N = 5, and the �ve members of the population are labeled a, b, c, d, and e. Also, suppose the sample size is n = 2. Then the possible samples are (a, b), (a, c), (a, d), (a, e), (b, c), (b, d), (b, e), (c, d), (c, e), and (d, e). That is, there are 10 possible samples—the number of ways two members can be chosen from �ve members. Then a simple random sample of size n = 2 has the property that each of these 10 possible samples has the same probability, 1/10, of being chosen.

One other property of simple random samples can be seen from this example. If you focus on any member of the population, say, member b, you will see that b is a member of 4 of the 10 samples. Therefore, the probability that b is chosen in a simple random sample is 4/10, or 2/5. In general, any member has the same probability n/N/N/ of being chosen in a simple random sample. If you are one of 100,000 members of a population, then the prob- ability that you will be selected in a simple random sample of size 100 is 100/100,000, or 1 out of 1000.

There are several ways simple random samples can be chosen, all of which involve random numbers. One approach that works well for the small example with N = 5 and n = 2 is to generate a single random number with the RAND function in Excel®. You divide the interval from 0 to 1 into 10 equal subintervals of length 1/10 each and see which of these subintervals the random number falls into. You then choose the corresponding sample. For example, suppose the random number is 0.465. This is in the �fth subinterval, that is, the interval from 0.4 to 0.5, so you choose the �fth sample, (b, c).

This method is clearly consistent with simple random sampling—each of the samples has the same chance of being chosen—but it is prohibitive when n and N are large. In this case there are too many possible samples to list. Fortunately, there is another method that can be used. The idea is simple. You sort the N members of the population randomly, using Excel’s RAND function to generate random numbers for the sort. Then you include the �rst n members from the sorted sequence in the random sample. This procedure is illustrated in Example 7.1.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-3 Methods for Selecting Random Samples 283

E X A M P L E 7.1 SAMPLING FAMILIES TO ANALYZE ANNUAL INCOMES

Consider the frame of 40 families with annual incomes shown in column B of Figure 7.1. (See the file Random Sampling.xlsm. The extension is .xlsm because this file con- tains a macro. When you open it, you will need to click the button above the formula bar to enable the macro.) We want to choose a simple random sample of size 10 from this frame. How can this be done? And how do summary statistics of the chosen families compare to the corresponding summary statistics of the population?

1 2 3 4 5 6 7 8 9

10 11 12

47 48 49

A BA B C DC D Simple random sampling

Summary sta�s�cs Mean Median Stdev

$39,985 $38,500 $7,377 Sample Popula�on

Popula�on Family Income

1 $43,300 2 $44,300 3 $34,600

38 $46,900 39 $37,300 40 $41,000

n M n S

13 4 $38,000

Figure 7.1 Population Income Data

Objective To illustrate how Excel’s random number function, RAND, can be used to generate simple random samples.

Solution The idea is very simple. You first generate a column of random numbers in column F. Then you sort the rows according to the random numbers and choose the first 10 families in the sorted rows. The following procedure produces the results in Figure 7.2. (See the first sheet in the finished version of the file.)

1. Random numbers next to a copy. Copy the original data to columns D and E. Then enter the formula

=RAND()

in cell F10 and copy it down column F.

2. Replace with values. To enable sorting, you must first “freeze” the random numbers—that is, replace their formulas with values. To do this, copy the range F10:F49 and select Paste Values from the Paste dropdown menu on the Home ribbon.

3. Sort. Sort on column F in ascending order. Then the 10 families with the 10 smallest random numbers are the ones in the sample. These are shaded in the figure. (Note that you could instead have chosen the 10 families with the 10 largest random numlargest random numlargest - bers. This would be equally valid.)

4. Means. Use the AVERAGE, MEDIAN, and STDEV.S functions in row 6 to calculate summary statistics of the first 10 incomes in column E. Similar summary statistics for the population have already been calculated in row 5. (Cell D5 uses the STDEV.P function because this is the population standard deviation.)

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

284 Chapter 7 Sampling and Sampling Distributions

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20

A BA B C DC D E FE F Simple random sampling

Summary sta�s�cs Mean Median Sn Stdev

$39,985 $38,500 $7,377 Sampl Popula�on

e $41,490 $42,850 $5,323

Popula�on Rn Rn Rn Random sample Family Income Family Income Random #

1 $43,300 10 10 1 $43,300 0.04545 2 $44,300 20 20 2 $44,300 0.1496768 3 $34,600 10 10 12 $51,500 00 0.23527 4 $38,000 70 70 7 $42,700 0.2746325 5 $44,700 10 10 13 $35,900 00 0.3003506 6 $45,600 10 10 15 $43,000 00 0.3197393 7 $42,700 60 60 6 $45,600 0.3610983 8 $36,900 30 30 3 $34,600 0.3852641 9 $38,400 90 90 9 $38,400 0.4427564

10 $33,700 14 $35,600 0.4447877 11 $44,100 5 $44,700 0.4505899 12 $51,500 $41,000 0.459736121

47 48 49

40 38 $46,900 39 $37,300 0.8644119 39 $37,300 8 $36,900 0.9059098 40 $41,000 10 $33,700 0.9637509

0 0

Figure 7.2 Selecting a Simple Random Sample

To obtain more random samples of size 10 (for comparison), you would need to go through this process repeatedly. To save you the trouble of doing so, we wrote a macro to automate the process. (See the Automated sheet in the finished version of the file.) This sheet looks essentially the same as the sheet in Figure 7.2, except that there is a button to run the macro, and only the required data remain on the spreadsheet. Try clicking this but- ton. Each time you do so, you will get a different random sample—and different summary measures in row 6. By doing this many times and keeping track of the sample summary data, you can see how the summary measures vary from sample to sample. We will have much more to say about this variation later in the chapter. ■

The procedure described in Example 7.1 can be used in Excel to select a simple random sample of any size from any population. All you need is a frame that lists the population values. Then it is just a matter of inserting random numbers, freezing them, and sorting on the random numbers.

Perhaps surprisingly, simple random samples are used infrequently in real applications. There are several reasons for this.

■ Because each sampling unit has the same chance of being sampled, simple random sampling can result in samples that are spread over a large geographical region. This can make sampling extremely expensive, especially if personal interviews are used.

■ Simple random sampling requires that all sampling units be identi�ed prior to sampling. Sometimes this is infeasible.

■ Simple random sampling can result in underrepresentation or overrepresentation of certain segments of the population. For example, if the primary—but not sole— interest is in the graduate student subpopulation of university students, a simple random sample of all university students might not provide enough information all university students might not provide enough information all about the graduate students.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-3 Methods for Selecting Random Samples 285

Despite this, most of the statistical analysis in this book assumes simple random samples. The analysis is considerably more complex for other types of random samples and is best left to more advanced books on sampling.

Using StatTools to Generate Simple Random Samples The method described in Example 7.1 is simple but somewhat tedious, especially if you want to generate more than one random sample. (Even the macro described at the end of the example works only for that particular �le.) Fortunately, a more general method is available in StatTools. This procedure generates any number of simple random samples of any speci�ed sample size from a given data set. It can be found in the Data Utilities (not Utilities) dropdown list on the StatTools ribbon.

E X A M P L E 7.2 SAMPLING ACCOUNTS RECEIVABLE AT SPRING MILLS

The file Accounts Receivable.xlsx contains 280 accounts receivable for Spring Mills Company. There are three variables: ■ Size: customer size, categorized as small, medium, or large depending on its volume

of business with Spring Mills

■ Days: number of days since the customer was billed

■ Amount: amount of the bill

Generate 25 random samples of size 15 each from the small customers only, calculate the average amount owed in each random sample, and construct a histogram of these 25 averages.

Objective To illustrate StatTools’s method of choosing simple random samples and to demonstrate how sample means are distributed.

Solution In most real-world applications, you would generate only a single random sample from a population, so why do we ask you to generate 25 random samples in this example? The reason is that we want to introduce the concept of a sampling distribution, in this case the sampling distribution of the sample mean. This is the distribution of all possi- ble sample means you could generate from all possible samples (of a given size) from a population. By generating a fairly large number of random samples from the population of accounts receivable, you can see what the approximate sampling distribution of the sample mean looks like.

We proceed in several steps. First, because you want random samples of the small customers only and the data are already sorted on Size, you first create a StatTools data set of the small customers only. (It is the range A1:D151.) Then select Random Sample from the StatTools Data Utilities dropdown list to generate 25 samples of size 15 each of the Amount variable.3 from the StatTools Data Utilities dropdown list to generate

3 from the StatTools Data Utilities dropdown list to generate

(The Random Sample dialog box should be filled out as shown in Figure 7.3.) These will appear on a new Random Sample sheet, as shown in Figure 7.4 (with many columns hidden). Each of these columns is a random sample of 15 Amount values (from small customers).

Next, insert a new column A, as shown in Figure 7.4, and calculate the averages in row  17 for each sample with Excel’s AVERAGE function. Finally, create a histogram of the averages in row 17. (The histogram in Figure 7.5 was created with Excel 2016’s

3Strictly speaking, the sampling distribution of the sample mean is the distribution of all possible sample means when sampling is done with replacement, where any member of the population can be sampled multiple times. However, real-world sampling is almost always done without replacement, so this is what we illustrate here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

286 Chapter 7 Sampling and Sampling Distributions

Figure 7.3 Random Sample Dialog Box

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17

A BA B C DC D Y ZY Z Amount(1) Amount(2) Amount(3) Amount(24) Amount(25)

260 200 290 240 260 230 240 260 210 290 250 310 240 230 300 280 250 290 220 240 210 210 330 200 250 310 270 210 220 270 280 270 290 240 270 260 190 260 410 250 280 240 370 300 230 240 190 290 260 240 210 240 260 270 250 270 240 260 210 150 240 240 230 210 180 220 300 240 250 310 260 320 240 280 200

Average 253.333 247.333 270.667 250.000 246.000

Figure 7.4 Randomly Generated Samples

histogram tool. Alternatively, you can define a second StatTools data set of the data in row 17 of Figure 7.4, but for a change, specify that the only variable for this data set is in a row, not a column. This is an option in the StatTools Data Set Manager. You can then create a histogram of these 25 averages in the usual way.)

The histogram in Figure 7.5 indicates the variability of sample means you might obtain by selecting many different random samples of size different random samples of size different 15 from this particular popu- lation of small customer accounts. This histogram, which is approximately bell-shaped, approximates the sampling distribution of the sample mean. We will come back to this important idea when we discuss sampling distributions in Section 7-4. ■

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-3 Methods for Selecting Random Samples 287

In the next several subsections we describe sampling plans that are often used. These plans differ from simple random sampling both in the way the samples are chosen and in the way the data analysis is performed. However, we will barely touch on this latter issue. The details are quite complicated and are better left to a book devoted entirely to sampling.2 issue. The details are quite complicated and are better left to a book devoted entirely to

2 issue. The details are quite complicated and are better left to a book devoted entirely to

Figure 7.5 Histogram of 25 Sample Averages

2See, for example, the excellent book by Levy and Lemeshow (2008).

7-3b Systematic Sampling

Suppose you are asked to select a random sample of 250 names from the white pages of a telephone book. Let’s also say that there are 55,000 names listed in the white pages. A systematic sample provides a convenient way to choose the sample. First, you divide the population size by the sample size: 55,000/2/2/ 50 = 220. Conceptually, you can think of dividing the book into 250 “blocks” with 220 names per block. Next, you use a random mechanism to choose a number between 1 and 220. Suppose this number is 131. Then you choose the 131st name and every 220th name thereafter. So you would choose name 131, name 351, name 571, and so on. The result is a systematic sample of size n = 250.

In general, one of the �rst k members is selected randomly, and then every kth member after this one is selected. The value k is called the sampling interval and equals the ratio sampling interval and equals the ratio sampling interval N/N/N n/n/ , where N is the population size and n is the desired sample size.

Types of Random Samples There are actually many methods for choosing random samples, some described only briefly in this book, and they all have their advantages and disadvantages from practical and statistical standpoints. Surprisingly, the simplest of these, where each subset of the population

has the same chance of being chosen, is not the most not the most not frequently used method in real applications. This is basi- cally because other more complex methods can make more efficient use of a given sample size. Nevertheless, the concepts you learn here remain essentially the same, regardless of the exact sampling method used.

F u n da m e n ta l I n s i g h t

6

7 Histogram of Averages

4

5

3

1

2

0 (238.000,… (245.222,… (252.444,… (259.667,… (266.889,… (274.111,… ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

288 Chapter 7 Sampling and Sampling Distributions

Systematic sampling is quite different from simple random sampling because not every sample of size 250 has a chance of being chosen. In fact, there are only 220 differ- ent samples possible (depending on the �rst number chosen), and each of these is equally likely. Nevertheless, systematic sampling is generally similar to simple random sampling in its statistical properties. The key is the relationship between the ordering of the sampling units in the frame (the white pages of the telephone book in this case) and the purpose of the study.

If the purpose of the study is to analyze personal incomes, then there is probably no relationship between the alphabetical ordering of names in the telephone book and per- sonal income. However, there are situations where the ordering of the sampling units is not random, which could make systematic sampling more or less appealing. For example, sup- pose that a company wants to sample randomly from its customers, and its customer list is in decreasing order of order volumes. That is, the largest customers are at the top of the list and the smallest are at the bottom. Then systematic sampling might be more representative than simple random sampling because it guarantees a wide range of customers in terms of order volumes.

However, some type of cyclical ordering in the list of sampling units can lead to very unrepresentative samples. As an extreme, suppose a company has a list of daily transac- tions (Monday through Saturday) and it decides to draw a systematic sample with the sampling interval equal to 6. Then if the �rst sampled day is Monday, all other days in the sample will be Mondays. This could clearly bias the sample. Except for obvious examples like this one, however, systematic sampling can be an attractive alternative to simple ran- dom sampling and is often used because of its convenience.

7-3c Stratified Sampling

Suppose various subpopulations within the total population can be identi�ed. These sub- populations are called strata. Then instead of taking a simple random sample from the entire population, it might make more sense to select a simple random sample from each stratum separately. This sampling method is called strati�ed sampling. It is a particularly useful approach when there is considerable variation between the various strata but rela- tively little variation within a given stratum.

Systematic random samples are typically chosen because of their convenience.

In stratified sampling, the population is divided into relatively homogeneous subsets called strata, and then random samples are taken from each stratum.

Stratified samples are typically chosen because they provide more accurate estimates of population parameters for a given sampling cost.

There are several advantages to strati�ed sampling. One obvious advantage is that separate estimates can be obtained within each stratum—which would not be obtained with a simple random sample from the entire population. Even if the samples from the individual strata are eventually pooled, it cannot hurt to have the total sample broken down into separate samples initially.

A more important advantage of strati�ed sampling is that the accuracy of the result- ing population estimates can be increased by using appropriately de�ned strata. The trick is to de�ne the strata so that there is less variability within the individual strata than in the population as a whole. You want strata such that there is relative homoge- neity within the strata, but relative heterogeneity across the strata, with respect to the variable(s) being analyzed. By choosing the strata in this way, you can generally obtain more accuracy for a given sampling cost than you could obtain from a simple random sample at the same cost. Alternatively, you can achieve the same level of accuracy at a lower sampling cost.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-3 Methods for Selecting Random Samples 289

The key to using strati�ed sampling effectively is selecting the appropriate strata. Suppose a company that advertises its product on television wants to estimate the reaction of viewers to the advertising. Here the population consists of all viewers who have seen the advertising. But what are the appropriate strata? The answer depends on the com- pany’s objectives and its product. The company could stratify the population by gender, by income, by age, by amount of television watched, by the amount of the product class consumed, and probably others. Without knowing more speci�c information about the company’s objectives, it is impossible to say which of these strati�cation schemes is most appropriate.

Suppose that you have identi�ed I nonoverlapping strata in a given population. Let N be the total population size, and let NiNiN be the population size of stratum i, so that

N = N1 + N2N2N + . . . + NININ

To obtain a strati�ed random sample, you must �rst choose a total sample size n, and then choose a sample size ni from each stratum i such that

n = n1 + n2 + . . . + nI

You can then select a simple random sample of the specified size from each stratum exactly as in Example 7.1.

However, how do you choose the individual sample sizes n1 through nI, given that the total sample size n has been chosen? For example, if you decide to sample 500 customers in total, how many should come from each stratum? There are many ways to choose sample sizes n1 through nI that sum to n, but probably the most popular method is to use proportional sample sizes. The idea is very simple. If one stratum has, say, 15% of the total population, then you select 15% of the total sample from this stratum. For example, if the total sample size is n = 500, you select 0.15(500) = 75 members from this stratum.

With proportional sample sizes, the proportion of a stratum in the sample is the same as the proportion of that stratum in the population.

The advantage of proportional sample sizes is that they are very easy to determine. The disadvantage is that they ignore differences in variability among the strata. If such differences are large, more complex sample size calculations can be used, but they are not discussed here.

7-3d Cluster Sampling

Suppose that a company is interested in various characteristics of households in a particular city. The sampling units are households. You could select a random sample of households by one of the sampling methods already discussed. However, it might be more convenient to proceed somewhat differently. You could �rst divide the city into city blocks and con- sider the city blocks as sampling units. You could then select a simple random sample of city blocks and then sample all of the households in the chosen blocks. In this case the city blocks are called clusters and the sampling scheme is called cluster sampling.

In cluster sampling, the population is separated into clusters, such as cities or city blocks, and then a random sample of the clusters is selected.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

290 Chapter 7 Sampling and Sampling Distributions

The primary advantage of cluster sampling is sampling convenience (and possi- bly lower cost). If an agency is sending interviewers to interview heads of household, it is much easier for them to concentrate on particular city blocks than to contact households throughout the city. The downside, however, is that the inferences drawn from a cluster sample can be less accurate for a given sample size than from other sampling plans.

Consider the following scenario. A nationwide company wants to survey its sales- people with regard to management practices. It decides to randomly select several sales districts (the clusters) and then interview all salespeople in the selected districts. It is likely that in any particular sales district the attitudes toward management are somewhat similar. This overlapping information means that the company is probably not getting the maximum amount of information per sampling dollar spent. Instead of sampling 20 salespeople from a given district, all of whom have similar attitudes, it might be better to sample 20 salespeople from different districts who have a wider variety of attitudes. Nevertheless, the relative convenience of cluster sampling sometimes outweighs these statistical considerations.

Selecting a cluster sample is straightforward. The key is to de�ne the sampling units as the clusters—the city blocks, for example. Then a simple random sample of clusters can be chosen exactly as in Example 7.1. Once the clusters are selected, it is typical to sample all of the population members in each selected cluster.

7-3e Multistage Sampling Schemes

The cluster sampling scheme just described, where a sample of clusters is chosen and then all of the sampling units within each chosen cluster are taken, is called a single-stage sam- pling scheme. Real applications are often more complex than this, resulting in multistage sampling schemes. For example, the Gallup organization uses multistage sampling in its nationwide surveys. A random sample of approximately 300 locations is chosen in the �rst stage of the sampling process. City blocks or other geographical areas are then randomly sampled from the �rst-stage locations in the second stage of the process. This is followed by a systematic sampling of households from each second-stage area. A total of about 1500 households comprise a typical Gallup poll.3 by a systematic sampling of households from each second-stage area. A total of about

3 by a systematic sampling of households from each second-stage area. A total of about

We will not pursue the topic of multistage sampling schemes in this book. However, you should realize that real-world sampling procedures can be very complex.

Cluster analysis is typically more convenient and less costly than other random sampling methods.

P R O B L E M S Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P02_07.xlsx includes data on 204 employees

at the (fictional) company Beta Technologies. For this problem, consider this data set as the population frame.

a. Using the method in this section (not StatTools), generate a simple random sample of size 20 from this population.

b. Use StatTools to generate 10 simple random samples of size 20 from this population.

c. Calculate the population mean, median, and standard deviation of Annual Salary. Then calculate

3If you watch discussions of politics on the news, you are aware that the results of new polls are available on an almost daily basis from a variety of polling organizations. Surprisingly, the organization probably best known for polling, Gallup, announced in October 2015 that it was getting out of the political polling business. Its traditional polling method, evening calls to landline phones, evidently doesn’t work in an environment dominated by cell phones and social media. Gallup will continue polling in other areas, just not political races.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-3 Methods for Selecting Random Samples 291

the sample mean, median, and standard deviation of Annual Salary for each of the samples in parts a and b. Comment briefly on how they compare to each other and the population measures.

2. The file P07_02.xlsx contains data on the 1995 students who have gone through the MBA program at State University. You can consider this the population of State University’s MBA students. a. Find the mean and standard deviation for each of

the numerical variables in this population. Also, find the following proportions: the proportion of students who are male, the proportion of students who are international (not from the USA), the proportion of students under 30 years of age, and the proportion of students with an engineering undergrad major.

b. Using the method in this section (not StatTools), generate a simple random sample of 100 students from this population, and find the mean and standard deviation of each numerical variable in the sample. Is there any way to know (without the information in part a) whether your summary measures for the sample are lower or higher than the (supposedly unknown) population summary measures?

c. Use StatTools to generate 10 simple random samples of size 100. For each, find the mean of School Debt and its deviation from the population mean in part a (negative if it is below the population mean, positive if it is above the population mean). What is the average of these 10 deviations? What would you expect it to be?

d. We want random samples to be representative of the population in terms of various demographics. For each of the samples in part c, find each of the proportions requested in part a. Do these samples appear to be representative of the population in terms of age, gender, nationality, and undergrad major? Why or why not? If they are not representative, is it because there is something wrong with the sampling procedure?

3. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. a. Suppose you decide to generate a systematic

random sample of size 25 from this population of data. How many such samples are there? What is the mean of Debt for each of the first three such samples, using the data in the order given?

b. If you wanted to estimate the (supposedly unknown) population mean of Debt from a systematic random sample as in part a, why might it be a good idea to sort first on Debt? If you do so, what is the mean of Debt for each of the first three such samples?

4. Recall from Chapter 2 that the file Supermarket Transactions.xlsx contains over 14,000 transactions

made by supermarket customers over a period of approximately two years. For this problem, consider this data set the population of transactions. a. If you were interested in estimating the mean of

Revenue for the population, why might it make might it make might sense to use a stratified sample, stratified by product family, to estimate this mean?

b. Suppose you want to generate a stratified random sample, stratified by product family, and have the total sample size be 250. If you use proportional sample sizes, how many transactions should you sample from each of the three product families?

c. Using the sample sizes from part b, generate a corresponding stratified random sample. What are the individual sample means from the three product families? What are the sample standard deviations?

Level B 5. This problem illustrates an interesting variation of

simple random sampling. a. Open a blank spreadsheet and use the RAND()

function to create a column of 1000 random numbers. Don’t freeze them. This is actually a simple random sample from the uniform distribution between 0 and 1. Use the COUNTIF function to count the number of values between 0 and 0.1, between 0.1 and 0.2, and so on. Each such interval should contain about 1/10 of all values. Do they? (Keep pressing the F9 key to see how the results change.)

b. Repeat part a, generating a second column of random numbers, but now generate the first 100 as uniform between 0 and 0.1, the next 100 as uniform between 0.1 and 0.2, and so on, up to 0.9 to 1. (Hint: For example, to create a random number uniformly distributed between 0.5 and 0.6, use the formula =0.5+0.1*RAND(). Do you see why?) Again, use COUNTIF to find the number of the 1000 values in each of the intervals, although there shouldn’t be any surprises this time. Why might this type of random sampling be preferable to the random sampling in part a? (Note: The sampling in part a is called Monte Carlo sampling, whereas the sampling in part b is basically Latin Hypercube sampling, the form of sampling we advocate in Chapters 15 and 16 on simulation.)

6. Another type of random sample is called a bootstrap sample. (It comes from the expression “pulling your- self up by your own bootstraps.”) Given a data set with n observations, a bootstrap sample, also of size n, is when you randomly sample from the data set with replacement. To do so, you keep choosing a random integer from 1 to n and include that item in the sample.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

292 Chapter 7 Sampling and Sampling Distributions

The “with replacement” part means that you can sample the same item more than once. For example, if n = 4, the sampled items might be 1, 2, 2, and 4. Using the data in the file Accounts Receivable.xlsx, illustrate a simple method for choosing bootstrap samples with the RANDBETWEEN and VLOOKUP

functions. For each bootstrap sample, find the mean and standard deviation of Days and Amount, and find the counts in the different size categories. How do these compare to the similar measures for the original data set? (For more on bootstrap sampling, do a Web search. Wikipedia has a nice overview.)

7-4 INTRODUCTION TO ESTIMATION The purpose of any random sample, simple or otherwise, is to estimate properties of a population from the data observed in the sample. The following is a good example to keep in mind. Suppose a government agency wants to know the average household income over the population of all households in Indiana. Then this unknown average is the population parameter of interest, and the government is likely to estimate it by sampling several repre- sentative households in Indiana and reporting the average of their incomes.

The mathematical procedures appropriate for performing this estimation depend on which properties of the population are of interest and which type of random sampling scheme is used. Because the details are considerably more complex for more complex sampling schemes such as multistage sampling, we will focus on simple random samples, where the mathematical details are relatively straightforward. Details for other sampling schemes such as strati�ed sampling can be found in Levy and Lemeshow (2008). However, even for more complex sampling schemes, the concepts are the same as those we discuss here; only the details change.

Throughout most of this section, we focus on the population mean of some variable such as household income. Our goal is to estimate this population mean by using the data in a randomly selected sample. We �rst discuss the types of errors that can occur.

7-4a Sources of Estimation Error

There are two basic sources of errors that can occur when sampling randomly from a popu- lation: sampling error and all other sources, usually lumped together as sampling error and all other sources, usually lumped together as sampling error nonsampling error. Sampling error results from “unlucky” samples. As such, the term error is somewhat error is somewhat error misleading. Suppose, for example, that the mean household income in Indiana is $58,225. (We can only assume that this is the true value. It wouldn’t actually be known without taking a census.) A government agency wants to estimate this mean, so it randomly sam- ples 500 Indiana households and �nds that their average household income is $60,495. If the agency then infers that the mean of all Indiana household incomes is all Indiana household incomes is all $60,495, the resulting sampling error is the difference between the reported value and the true value: $60,495 – $ – $ – 58,225 = $2270. In this case, the agency hasn’t done anything wrong. This sampling error is essentially due to bad luck.

Sampling error is the inevitable result of basing an inference on a random sample rather than on the entire population.

We will soon discuss how to measure the potential sampling error involved. The point potential sampling error involved. The point potential here is that the resulting estimation error is not caused by anything the government agency is doing wrong—it might just get unlucky.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 293

Nonsampling error is quite different and can occur for a variety of reasons. We dis- cuss a few of them.

■ Perhaps the most serious type of nonsampling error is nonresponse bias. This occurs when a portion of the sample fails to respond to the survey. Anyone who has ever conducted a questionnaire, whether by mail, by phone, or any other method, knows that the percentage of nonrespondents can be quite large. The question is whether this introduces estimation error. If the nonrespondents would have responded similarly would have responded similarly would to the respondents, not much is lost by not hearing from them. However, because the nonrespondents don’t respond, there is typically no way of knowing whether they dif-knowing whether they dif-knowing whether they dif fer in some important respect from the respondents.

■ Another source of nonsampling error is nontruthful responses. This is particularly a problem when there are sensitive questions in a questionnaire. For example, if the questions “Have you ever had an abortion?” or “Do you regularly use cocaine?” are asked, most people will answer “no,” regardless of whether the true answer is “yes” or “no.”

There is a way of getting at such sensitive information, called the randomized response technique. Here the investigator presents each respondent with two questions, one of which is the sensitive question. The other is innocuous, such as, “Were you born in the summer?” The respondent is asked to decide randomly which of the two questions to answer—by �ipping a coin, say—and then answer the chosen question truthfully. The investigator sees only the answer (yes or no), not the result of the coin �ip. That is, the investigator doesn’t know which question is being answered. However, by using prob- ability theory, it is possible for the investigator to infer from many such responses the percentage of the population whose truthful answer to the sensitive question is “yes.”

■ Another type of nonsampling error is measurement error. This occurs when the responses to the questions do not re�ect what the investigator had in mind. It might result from poorly worded questions, questions the respondents don’t fully understand, questions that require the respondents to supply information they don’t have, and so on. Undoubtedly, there have been times when you were �lling out a questionnaire and said to yourself, “OK, I’ll answer this as well as I can, but I know it’s not what they want to know.”

■ One �nal type of nonsampling error is voluntary response bias. This occurs when the subset of people who respond to a survey differ in some important respect from all potential respondents. For example, suppose a population of students is surveyed to see how many hours they study per night. If the students who respond are predominantly those who get the best grades, the resulting sample mean number of hours could be biased on the high side.

From this discussion and your own experience with questionnaires, you should realize that the potential for nonsampling error is enormous. However, unlike sampling error, it cannot be measured with probability theory. It can be controlled only by using appropriate sampling procedures and designing good survey instruments. We will not pursue this topic any further here. If you are interested, however, you can learn about methods for controlling nonsampling error, such as proper questionnaire design, from books on survey sampling.

7-4b Key Terms in Sampling

We now set the stage for the rest of this chapter, as well as for the next two chapters. Suppose there is some numerical population parameter you want to know. This parameter

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

294 Chapter 7 Sampling and Sampling Distributions

could be a population mean, a population proportion, the difference between two popula- tion means, the difference between two population proportions, or many others. Unless you measure each member of the population—that is, unless you take a census—you cannot learn the exact value of this population parameter. Therefore, you instead take a random sample of some type and estimate the population parameter from the data in the sample.

You typically begin by calculating a point estimate (or, simply, an estimate) from the sample data. This is a “best guess” of the population parameter. The difference between the point estimate and the true value of the population parameter is called the sampling error (or estimation error). You then use probability theory to estimate the magnitude of the sampling error. The key to this is the sampling distribution of the point estimate, which is de�ned as the distribution of the point estimates you would see from all possible samples all possible samples all (of a given sample size) from the population. Often you report the accuracy of the point estimate with an accompanying con�dence interval. A con�dence interval is an interval around the point estimate, calculated from the sample data, that is very likely to contain the true value of the population parameter. (We will say much more about con�dence intervals in the next chapter.)

A point estimate is a single numeric value, a “best guess” of a population parameter, based on the data in a random sample.

The sampling error (or estimation error) is the difference between the point estimate and the true value of the population parameter being estimated.

The sampling distribution of any point estimate is the distribution of the point estimates from all possible samples (of a given sample size) from the population.all possible samples (of a given sample size) from the population.all

A confidence interval is an interval around the point estimate, calculated from the sample data, that is very likely to contain the true value of the population parameter.

An unbiased estimate is a point estimate such that the mean of its sampling distribution is equal to the true value of the population parameter being estimated.

Additionally, there are two other key terms you should know. First, consider the mean of the sampling distribution of a point estimate. It is the average value of the point estimates you would see from all possible samples. When this mean is equal to the true value of the population parameter, the point estimate is unbiased. Otherwise, it is biased. Naturally, unbiased estimates are preferred. Even if they sometimes miss on the low side and some- times miss on the high side, they tend to be on target on average.

Unbiased estimates are desirable because they average out to the correct value. However, this isn’t enough. Point estimates from different samples should vary as little as possible from sample to sample. If they vary wildly, a point estimate from a single random sample isn’t very reliable. Therefore, it is common to measure the standard deviation of the sampling distribution of the estimate. This indicates how much point estimates from differ- ent samples vary. In the context of sampling, this standard deviation is called the standard error of the estimate. Ideally, estimates should have small standard errors.small standard errors.small

The standard error of an estimate is the standard deviation of the sampling distribution of the estimate. It measures how much estimates vary from sample to sample.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 295

The terms in this subsection are relevant for practically any population parameter you might want to estimate. In the following subsection we discuss them in the context of esti- mating a population mean.

7-4c Sampling Distribution of the Sample Mean

In this section we discuss the estimation of the population mean from some population. For example, you might be interested in the mean household income for all families in a par- ticular city, the mean diameter of all parts from a manufacturing process, the mean amount of underreported taxes by all U.S. taxpayers, and so on. We label the unknown population mean by μ. (It is common to label population parameters with Greek letters.)

The point estimate of μ typically used, based on a sample from the population, is the sample mean X, the average of the observations in the sample. There are other possible point estimates for a population mean besides the sample mean, such as the sample median, the trimmed mean (where all but the few most extreme observations are averaged), and others. However, it turns out that this “natural” estimate, the sample mean, has very good theoretical properties, so it is the point estimate used most often.

How accurate is X in estimating X in estimating X μ? That is, how large does the estimation error X − μ tend to be? The sampling distribution of the sample mean X provides the key. Before X provides the key. Before X describing this sampling distribution in some generality, we provide some insight into it by revisiting the population of 40 incomes in Example 7.1. There we showed how to generate a single random sample of size 10. For the particular sample we generated (see Figure 7.2), the sample mean was $41,490. Because the population mean of all 40 incomes is $39,985, the estimation error based on this particular sample is the difference $41,490 − $39,985, or $1505 on the high side.

However, this is only one of many possible samples. To see other possibilities, you can use StatTools’s procedure for generating random samples to generate 100 random samples of size 0 random samples of size 0 10 from the population of 40 incomes. (You must do this by generating four groups of 0 incomes. (You must do this by generating four groups of 0 25 samples each because StatTools limits you to 25 random samples at a time.) You can then calculate the sample mean for each random sample and create a histogram of these sample means. We did this, with the result shown in Figure 7.6. Although this is not exactly the sampling distribution of the exactly the sampling distribution of the exactly sample mean (because there are many more than 100 possible samples of size 0 possible samples of size 0 10 from a popula0 from a popula0 - tion of size 40), it indicates approximately how the possible sample means are distributed. They are most likely to be near the population mean ($39,985), very unlikely to be more than about $3000 from this population mean, and have an approximately bell-shaped distribution.0 from this population mean, and have an approximately bell-shaped distribution.0

Figure 7.6 Approximate Sampling Distribution of Sample Mean

30 Histogram of Sample Means

20

25

15

5

10

0

(3 48

20 ,…

(3 60

86 .25

,…

(3 73

52 .5,

(3 86

18 .75

,…

(4 11

51 .25

,…

(4 24

17 .5,

(3 98

85 ,…

(4 36

83 .75

,…

© C

e n g

a g

e L

e a

rn in

g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

296 Chapter 7 Sampling and Sampling Distributions

The insights in the previous paragraph can be generalized. It turns out that the sam- pling distribution of the sample mean has the following properties, regardless of the under- lying population. First, it is an unbiased estimate of the population mean, as indicated in Equation (7.1). The sample means from some samples will be too low, and those from other samples will be too high, but on the average, they will be on target.

The second property involves the variability of the X estimate. Recall that the standard deviation of an estimate, called the standard error, indicates how much the estimate varies from sample to sample. The standard error of X is given in Equation (7.2). Here, SE(X)X)X is an abbreviation for the standard error of X, σ is the standard deviation of the population, and n is the sample size. You can see that the standard error is large when the observations in the population are spread out (large σ), but that the standard error can be reduced by taking a larger sample.4

Unbiased Property of Sample Mean E(X)X)X = μ (7.1)

4This formula for SE(X)X)X assumes that the sample size n is small relative to the population size N. As a rule of thumb, we assume that n is no more than 5% of N. Later we provide a “correction” to this formula when n is a larger percentage of N.

Standard Error of Sample Mean SE(X)X)X = σ/!n!n!! (7.2)

There is one problem with the standard error in Equation (7.2). Its value depends on another unknown population parameter, another unknown population parameter, another σ. Therefore, it is customary to approximate the standard error by substituting the sample standard deviation, s, for σ. This leads to Equation (7.3).

Approximate Standard Error of Sample Mean SE(X)X)X = s/!n!n!! (7.3)

As we discuss in the next subsection, the shape of the sampling distribution of X is approxiX is approxiX - mately normal. Therefore, you can use the standard error exactly as you have used standard deviations in previous chapters to obtain con�dence intervals for the population mean. Speci�cally, if you go out two standard errors on either side of the sample mean, as shown in Expression (7.4), you can be approximately 95% con�dent of capturing the population mean. Equivalently, you can be 95% con�dent that the estimation error will be no greater than two standard errors in magnitude.

(Approximate) Confidence Interval for Population Mean X ± 2s/!n!n!! (7.4)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 297

Example 7.3 illustrates a typical use of sample information.

Sampling Distributions and Standard Errors Any point estimate, such as the sample mean, is ran- dom because it depends on the random sample that happens to be chosen. The sampling distribution of the point estimate is the probability distribution of point estimates from all possible random samples.

This distribution describes how the sample means vary from one sample to another. The correspond- ing standard error is the standard deviation of the sampling distribution. These two concepts, sampling distribution and standard error, are the keys to sta- tistical inference, as discussed here and in the next two chapters.

F u n da m e n ta l I n s i g h t

E X A M P L E 7.3 ESTIMATING THE MEAN OF ACCOUNTS RECEIVABLE

An internal auditor for a furniture retailer wants to estimate the average of all accounts receivable, where this average is taken over the population of all customer accounts. Because the company has approximately 10,000 accounts, an exhaustive enumeration of all accounts receivable is impractical. Therefore, the auditor randomly samples 100 of the accounts. The data from the sample appear in Figure 7.7. (See the file Auditing Receivables.xlsx.) What can the auditor conclude from this sample?

1 2 3 4 5 6 7 8 9

10 11 12 13

105 106 107

A BA B C DC D E Random sample of accounts receivable

10000 Sample size 100

Sample of receivables Summary measures from sample Account Amount Sample mean $278.92

1 $85 Sample stdev $419.21 2 $1,061 Std Error of mean $41.92 3 $0 4 $1,260 With fpc $41.71 5 $924 6 $129

98 $657 99 $86

100 $0

t A

3 $

t S

1 S

t S

1 S

Popula�on size

Figure 7.7 Sampling in Auditing Example

© C

e n g

a g

e L

e a rn

in g

Objective To illustrate the meaning of standard error of the mean in a sample of accounts receivable.

Solution The receivables for the 100 sampled accounts appear in column B. This is the only infor- mation available to the auditor, so he must base all conclusions on these sample data. Begin by calculating the sample mean and sample standard deviation in cells E7 and E8 with the AVERAGE and STDEV.S functions. Then use Equation (7.3) to calculate the (approximate) standard error of the mean in cell E9 with the formula

=E8/SQRT(B4)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

298 Chapter 7 Sampling and Sampling Distributions

It is important to distinguish between the sample standard deviation s and the standard error of the mean, approximated by s/!n!n!! . The sample standard deviation in the auditing example, $419, measures the variability across individual receivables in the sample (or in individual receivables in the sample (or in individual the population). By scrolling down column B, you can see that there are some very low amounts (many zeros) and some fairly large amounts. This variability is indicated by the rather large sample standard deviation s. However, this value does not measure the accu- racy of the sample mean as an estimate of the population mean. To judge its accuracy, you need to divide s by the square root of the sample size n. The resulting standard error, about $42, is much smaller than the sample standard deviation. It indicates that you can be about 95% con�dent that the sampling error is no greater than $84. In short, sample means vary much less than individual observations from a given population.

�e Finite Population Correction We mentioned that Equation (7.2) [or Equation (7.3)] for the standard error of X is approX is approX - priate when the sample size n is small relative to the population size N. Generally, “small” means that n is no more than 5% of N. In most realistic samples this is certainly true. For example, political polls are typically based on samples of approximately 1000 people from the entire U.S. population.

There are situations, however, when the sample size is greater than 5% of the popula- tion. In this case the formula for the standard error of the mean should be modi�ed with a �nite population correction, or fpc, factor. The modi�ed standard error of the mean appears in Equation (7.5), where the fpc is given by Equation (7.6). Note that this factor is always less than 1 (when n > 1) and it decreases as n increases. Therefore, the standard error of the mean decreases—and the accuracy increases—as n increases.

To see how the fpc varies with n and N, consider the values in Table 7.1. Rather than listing n, we have listed the percentage of the population sampled, that is, n/N/N/ × 100%. It is clear that when 5% or less of the population is sampled, the fpc is very close to 1 and can safely be ignored. In this case you can use s/!n!n!! as the standard error of the mean. Otherwise, you should use the modi�ed formula in Equation (7.5).

In the auditing example, n/N/N/ = 100/100,000 = 0.1%. This suggests that the fpc can safely be omitted. We illustrate this in cell E11 of Figure 7.7, which uses the formula from Equation (7.5):

=SQRT((B3-B4)/(B3-1))*E9

The auditor should interpret these values as follows. First, the sample mean $279 is a point estimate of the unknown population mean. It provides a best guess for the average of the receivables from all 10,000 accounts. In fact, because the sample mean is an unbiased estimate of the population mean, there is no reason to suspect that $279 either underestimates or overestimates the population mean. Second, the standard error $42 provides a measure of accuracy of the $279 estimate. Specifically, there is about a 95% chance that the estimate differs by no more than two standard errors (about $84) from the true but unknown popula- tion mean. Therefore, the auditor can be approximately 95% confident that the mean from all 10,000 accounts is within the interval $279 ± $84, that is, between $195 and $363. ■

Standard Error of Mean with Finite Population Correction Factor SE(X)X)X = fpfpf c × (s/!n!n!! ) (7.5)

Finite Population Correction Factor

fpfpf c = Å N − n N − 1Å (7.6)

If less than 5% of the population is sampled, as is often the case, the fpc can safely be ignored.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 299

Table 7.1 Finite Population Correction Factors N % Sampled fpc

100 5 0.980 100 10 0.953 10,000 1 0.995 10,000 5 0.975 10,000 10 0.949 1,000,000 1 0.995 1,000,000 5 0.975 1,000,000 10 0.949

Clearly, it makes no practical difference in this example whether you use the fpc or not. The standard error, rounded to the nearest dollar, is $42 in either case.

Virtually all standard error formulas used in sampling include an fpc factor. However, because it is rarely necessary—the sample size is usually very small relative to the popula- tion size—we omit it from here on.

7-4d The Central Limit Theorem

Our discussion to this point has concentrated primarily on the mean and standard deviation of the sampling distribution of the sample mean. In this section we discuss this sampling distribution in more detail. Because of an important theoretical result called the central limit theorem, this sampling distribution is approximately normal with mean normal with mean normal μ and standard deviation σ/!n!n!! . This theorem is the primary reason why the normal distribution appears in so many statistical results. The theorem can be stated as follows.

The important part of this result is the normality of the sampling distribution. We know, without any conditions placed upon the sample size n, that the mean and standard deviation are μ and σ/!n!n!! . However, the central limit theorem also implies normality, pro- vided that n is reasonably large.

For any population distribution with mean μ and standard deviation σ, the sampling distribution of the sample mean X is approximately normal with mean μ and standard deviation σ/!n!n!! , and the approximation improves as n increases.

The Central Limit Theorem This important result states that when you sum or average n randomly selected values from any distriany distriany - bution, normal or otherwise, the distribution of the sum or average is approximately normal, provided that n is sufficiently large. This is the primary reason why the normal distribution is relevant in so many real applications.

How large must n be for the approximation to be valid? Many textbooks suggest n ≥ 30 as a rule

of thumb. However, this depends heavily on the population distribution. If the population distribution is very nonnormal—extremely skewed or bimodal, nonnormal—extremely skewed or bimodal, nonnormal for example—the normal approximation might not be accurate unless n is considerably greater than 30. On the other hand, if the population distribution is already approximately symmetric, the normal approximation is quite good for n considerably less than 30. In fact, in the special case where the popu- lation distribution itself is normal, the sampling dis- tribution of X is exactly normal for exactly normal for exactly any value of any value of any n.

F u n da m e n ta l I n s i g h t

The central limit theorem is not a simple concept to grasp. To help explain it, we use simulation in the following example.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

300 Chapter 7 Sampling and Sampling Distributions

E X A M P L E 7.4 AVERAGE WINNINGS FROM A WHEEL OF FORTUNE

Suppose you have the opportunity to play a game with a “wheel of fortune” (similar to the one in a popular television game show). When you spin a large wheel, it is equally likely to stop in any position. Depending on where it stops, you win anywhere from $0 to $1000. Let’s suppose your winnings are actually based on not one spin, but on the average of n spins of the wheel. For example, if n = 2, your winnings are based on the average of two spins. If the first spin results in $580 and the second spin results in $320, you win the average, $450. How does the distribution of your winnings depend on n?

Objective To illustrate the central limit theorem by a simulation of winnings in a game of chance.

Solution First, what does this experiment have to do with random sampling? Here, the population is the set of all outcomes you could obtain from a single spin of the wheel—that is, all dol- lar values from $0 to $1000. Each spin results in one randomly sampled dollar value from this population. Furthermore, because we have assumed that the wheel is equally likely to land in any position, all possible values in the continuum from $0 to $1000 have the same chance of occurring. The resulting population distribution is called the uniform distribu- tion on the interval from $0 to $1000. (See Figure 7.8, where the 1 on the horizontal axis corresponds to $1000.) It can be shown (with calculus) that the mean and standard devia- tion of this uniform distribution are μ = $500 and σ = $289.5

Figure 7.8 Uniform Distribution

© C

e n g

a g

e L

e a rn

in g

Before we go any further, take a moment to test your own intuition. If you play this game once and your winnings are based on the average of n spins, how likely is that you will win at least $600 if n = 1? if n = 3? if n = 10? (The answers are 0.4, 0.27, and 0.14, respectively, where the last two answers are approximate and are based on the central limit theorem or the simulation. So you are much less likely to win big if your winnings are based on the average of many spins.)

Now we analyze the distribution of winnings based on the average of n spins. We do so by means of a sequence of simulations in Excel. (See the file Wheel of Fortune Simulation.xlsx, which is set up to work for any number of spins up to 10.) For each simu- lation, consider 1000 replications of an experiment. Each replication of the experiment simulates n spins of the wheel and calculates the average—that is, the winnings—from these n spins. Based on these 1000 replications, the average and standard deviation of win- nings can be calculated, and a histogram of winnings can be formed, for any value of n. These will show clearly how the distribution of winnings depends on n.

5In general, if a distribution is uniform on the interval from a to b, its mean is the midpoint (a + b)/2 and its standard deviation is (b − a)/!12! .

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 301

1 2 3 4 5 6 7 8

A BA B C DC D E FE F G HG H I JI J K LK L Wheel of fortune simulation

Minimum winnings $0 Summary measures of winnings Maximum winnings $1,000 Mean $497

$290 0.406

Stdev Number of spins 1 P(>600)

Simulation of spins 9

10 11 12 13 14 15 16

1007 1008

Spin 1 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 81 2 3 4 5 6 7 8 9 19 10 Outcome Outcome Outcome Outcome Outcome Outcome Outcome Outcome Outcome Outcome Winnings

1 $404 $893 $111 $764 $960 $363 $569 $869

$24 $255

$404 $893 $111 $764 $960 $363 $569 $869

$24 $255

2 3 4 5 6

997 998

1009 1010

999 1000

Replica�on

Figure 7.9 Simulation of Winnings from a Single Spin

Histogram of Winnings

0

20

40

60

80

100

120

($ 1,

$ 10

1)

($ 10

1, $

20 0)

($ 20

0, $

30 0)

($ 30

0, $

40 0)

($ 40

0, $

50 0)

($ 50

0, $

60 0)

($ 60

0, $

70 0)

($ 70

0, $

79 9)

($ 79

9, $

89 9)

($ 89

9, $

99 9)

Figure 7.10 Histogram of Simulated Winnings from a Single Spin

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

The values in Figure 7.9 and the histogram in Figure 7.10 show the results for n = 1. Here there is no averaging—you spin the wheel once and win the amount shown. To repli- cate this experiment 1000 times and collect statistics, proceed as follows.

Calculating the Distribution of Winnings by Simulation

1. Random outcomes. To generate outcomes uniformly distributed between $0 and $1000, enter the formula

=IF(B$9<=$B$6,$B$3+($B$4−$B$3)*RAND(), “ ”)

in cell B11 and copy it to the entire range B11:K1010. The effect of this formula, given the values in cells B3 and B4, is to generate a random number between 0 and 1 and multiply it by $1000. The effect of the IF part is to fill as many Outcome columns as there are spins in cell B6 and to leave the rest blank.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

302 Chapter 7 Sampling and Sampling Distributions

2. Winnings. Calculate the winnings in each row in column L as the average of the out- comes of the spins in that row. (Note that the AVERAGE function ignores blanks.)

3. Summary measures. Calculate the average and standard deviation of the 1000 winnings in column L with the AVERAGE and STDEV.S functions. These values appear in cells L4 and L5.

4. Histogram. Create a histogram of the values in column L.

Note the following from Figures 7.9 and 7.10:

■ The sample mean of the winnings (cell L4) is very close to the population mean, $500.

■ The standard deviation of the winnings (cell L5) is very close to the population standard deviation, $289.

■ The histogram is nearly �at.

These properties should come as no surprise. When n = 1, the sample mean is a single observation—that is, no averaging takes place. Therefore, the sampling distribution of the sample mean is equivalent to the flat population distribution in Figure 7.8.equivalent to the flat population distribution in Figure 7.8.equivalent

But what happens when n > 1? Figure 7.11 shows the results for n = 2. All you need to do is change the number of spins in cell B6, and everything updates automatically. The average winnings are again very close to $500, but the standard deviation of winnings is much lower. In fact, you should find that it is close to σ/!2!2!! = 289/!2!2!! = $204, exactly as the theory predicts. In addition, the histogram of winnings is no longer flat. It is triangu- larly shaped—symmetric, but not really bell-shaped.

Histogram of Winnings

100

120

140

200

160

180

0

20

40

60

80

($ 35

, $ 12

6)

($ 12

6, $

21 7)

($ 21

7, $

30 8)

($ 30

8, $

39 9)

($ 39

9, $

49 0)

($ 49

0, $

58 1)

($ 58

1, $

67 2)

($ 67

2, $

76 3)

($ 76

3, $

85 4)

($ 85

4, $

94 5)

Figure 7.11 Histogram of Simulated Winnings from Two Spins

© C

e n g

a g

e L

e a rn

in g

To develop similar simulations for n = 3, n = 6, n = 10, or any other n, simply change the number of spins in cell B6. The resulting histograms appear in Figures 7.12 through 7.14. They clearly show two effects of increasing n: (1) the histogram becomes more bell- shaped, and (2) there is less variability. However, the mean stays right at $500. This behavior is exactly what the central limit theorem predicts. In fact, because the population distribution is symmetric in this example—it is flat—you can see the effect of the central limit theorem for n much less than 30; it is already evident for n as low as 6.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 303

Finally, it is easy to answer the question we posed previously: How does the prob- ability of winning at least $600 depend on n? For any specific value of n, you can find the fraction of the 1000 replications where the average of n spins is greater than $600 with a COUNTIF formula in cell L6. (The value shown in Figure 7.9, 0.406, is only a point estimate of the true probability, which turns out to be very close to 0.4.) ■

Histogram of Winnings

0

250

200

150

100

50

($ 50

, $ 14

3)

($ 14

3, $

23 6)

($ 23

6, $

32 9)

($ 32

9, $

42 2)

($ 42

2, $

51 5)

($ 51

5, $

60 8)

($ 60

8, $

70 1)

($ 70

1, $

79 4)

($ 79

4, $

88 7)

($ 88

7, $

98 0)

Figure 7.12 Histogram of Simulated Winnings from Three Spins

Histogram of Winnings

0

250

200

150

100

50

($ 14

2, $

21 7)

($ 21

7, $

29 2)

($ 29

2, $

36 6)

($ 36

6, $

44 1)

($ 44

1, $

51 6)

($ 51

6, $

59 1)

($ 59

1, $

66 6)

($ 66

6, $

74 1)

($ 74

1, $

81 6)

($ 81

6, $

89 1)

Histogram of Winnings

0

300

250

200

150

100

50

($ 19

7, $

25 7)

($ 25

7, $

31 8)

($ 31

8, $

37 8)

($ 37

8, $

43 8)

($ 43

8, $

49 8)

($ 49

8, $

55 8)

($ 55

8, $

61 9)

($ 61

9, $

67 9)

($ 67

9, $

73 9)

($ 73

9, $

79 9)

Figure 7.14 Histogram of Simulated Winnings from Ten Spins

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Figure 7.13 Histogram of Simulated Winnings from Six Spins

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

304 Chapter 7 Sampling and Sampling Distributions

What are the main lessons from this example? For one, you can see that the sampling distribution of the sample mean (winnings) is bell-shaped when n is reasonably large. This is in spite of the fact that the population distribution is �at—far from bell-shaped. Actually, the population distribution could have any shape, not just uniform, and the bell-shaped property would still hold (although n might have to be larger than in the example). This bell-shaped normality property allows you to perform probability calculations with the NORM.DIST and NORM.INV functions, as discussed in Chapter 5.

Equally important, this example demonstrates the decreased variability in the sample means as n increases. Why should an increased sample size lead to decreased variability? This is due to averaging. Think about winning $750 based on the average of two spins. All you need is two lucky spins. In fact, one really lucky spin and an average spin will do. But think about winning $750 based on the average of 10 spins. Now you need a lot of really lucky spins—and virtually no unlucky ones. The point is that you are much less likely to obtain a really large (or really small) sample mean when n is large than when n is small. This is exactly what we mean when we say that the variability of the sample means decreases with larger sample sizes.

This decreasing variability is predicted by the formula for the standard error of the mean, σ/!n!n!! . As n increases, the standard error decreases. This is what drives the behaviour in Figures 7.11 through 7.14. In fact, using σ = $289, the (theoretical) standard errors for n = 2, n = 3, n = 6, and n = 10 are $204, $167, $118, and $91, respectively.

Finally, what does this decreasing variability have to do with estimating a population mean with a sample mean? Very simply, it means that the sample mean tends to be a more accurate estimate when the sample size is large. Because of the approximate normality from the central limit theorem, you know from Chapter 5 that there is about a 95% chance that the sample mean will be within two standard errors of the population mean. In other words, there is about a 95% chance that the sampling error will be no greater than two standard errors in magnitude. Therefore, because the standard error decreases as the sample size increases, the sampling error is likely to decrease as well.

The Averaging Effect As you average more and more observations from a given distribution, the variance of the average decreases. This has a very intuitive explanation. For example, suppose you average only two observa- tions. Then it is easy to get an abnormally large (or small) average. All it takes are two abnormally large (or small) observations. But if you average a much

larger number of observations, you aren’t likely to get an abnormally large (or small) average. The reason is that a few abnormally large observations will typically be cancelled by a few abnormally small observations. This cancellation produces the averag- ing effect. It also explains why a larger sample size tends to produce a more accurate estimate of a population mean.

F u n da m e n ta l I n s i g h t

7-4e Sample Size Selection

The problem of selecting the appropriate sample size in any sampling context is not an easy one (as illustrated in the chapter opener), but it must be faced in the planning stages, before any sampling is done. We focus here on the relationship between sampling error and sample size. As we discussed previously, the sampling error tends to decrease as the sam- ple size increases, so the desire to minimize sampling error encourages us to select larger sample sizes. We should note, however, that several other factors encourage us to select smaller sample sizes. The ultimate sample size selection must achieve a trade-off between smaller sample sizes. The ultimate sample size selection must achieve a trade-off between smaller these opposing forces.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-4 Introduction to Estimation 305

What are these other factors? First, there is the obvious cost of sampling. Larger sam- ples cost more. Sometimes, a company or agency might have a budget for a given sampling project. If the sample size required to achieve an acceptable sampling error is 500, but the budget allows for a sample size of only 300, budget considerations will probably prevail.

Another problem caused by large sample sizes is timely collection of the data. Suppose a retailer wants to collect sample data from its customers to decide whether to run an adver- tising blitz in the coming week. Obviously, the retailer needs to collect the data quickly if they are to be of any use, and a large sample could require too much time to collect.

Finally, a more subtle problem caused by large sample sizes is the increased chance of nonsampling error, such as nonresponse bias. As we discussed previously in this chapter, there are many potential sources of nonsampling error, and they are usually very dif�cult to quan- tify. However, they are likely to increase as the sample size increases. Arguably, the potential increase in sampling error from a smaller sample could be more than offset by a decrease in nonsampling error, especially if the cost saved by the smaller sample size is used to reduce the sources of nonsampling error—conducting more follow-up of nonrespondents, for example.

Nevertheless, the determination of sample size is usually driven by sampling error considerations. If you want to estimate a population mean with a sample mean, then the key is the standard error of the mean, given by

SE(X)X)X = σ/!n!n!! The central limit theorem says that if n is reasonably large, there is about a 95% chance that the magnitude of the sampling error will be no more than two standard errors. Because σ is �xed in the formula for SE(X)X)X , n can be chosen to make 2SE(X)X)X acceptably small.

Effect of Larger Sample Sizes Accurate estimates of population parameters require small standard errors, and small standard errors require large sample sizes. However, standard errors are typically inversely proportional to the square root of the sample size (or sample sizes). The implication

is that if you want to decrease the standard error by a given factor, you must increase the sample size by a much larger factor. For example, to decrease the standard error by a factor of 2, you must increase the sample size by a factor of 4. Accurate estimates are not cheap.

F u n da m e n ta l I n s i g h t

We postpone further discussion of sample size selection until the next chapter, where we will discuss in detail how it can be used to control con�dence interval length.

7-4f Summary of Key Ideas for Simple Random Sampling

To this point, we have covered some very important concepts. Because we build on these concepts in later chapters, we summarize them here.

Key Concepts of Simple Random Sampling

■ To estimate a population mean with a simple random sample, the sample mean is typically used as a “best guess.” This estimate is called a point estimate. That is, X is a point estimate of μ.

■ The accuracy of the point estimate is measured by its standard error. It is the standard deviation of the sampling distribution of the point estimate. The standard error of X is X is X approximately s/!n!n!! , where s is the sample standard deviation.

■ A con�dence interval (with con�dence interval (with con�dence interval 95% con�dence) for the population mean extends to approximately two standard errors on either side of the sample mean.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

306 Chapter 7 Sampling and Sampling Distributions

■ From the central limit theorem, the sampling distribution of X is approximately normal when n is reasonably large.

■ There is approximately a 95% chance that any particular X will be within two standard errors of the population mean μ.

■ The sampling error can be reduced by increasing the sample size n. Appropriate sample size formulas for controlling con�dence interval length are given in the next chapter.

P R O B L E M S

Level A 7. A manufacturing company’s quality control personnel

have recorded the proportion of defective items for each of 500 monthly shipments of one of the computer components that the company produces. The data are in the file P07_07.xlsx. The quality control department manager does not have sufficient time to review all of these data. Rather, she would like to examine the proportions of defective items for a sample of these shipments. For this problem, you can assume that the population is the data from the 500 shipments. a. Use Excel to generate a simple random sample of

size 25 from the data. b. Calculate a point estimate of the population mean

from the sample selected in part a. What is the sampling error, that is, by how much does the sample mean differ from the population mean?

c. Calculate a good approximation for the standard error of the mean.

d. Repeat parts b and c after generating a simple random sample of size 50 from the population. Is this estimate bound to be more accurate than the one in part b? Is its standard error bound to be smaller than the one in part c?

8. The manager of a local fast-food restaurant is interested in improving the service provided to customers who use the restaurant’s drive-up window. As a first step in this process, the manager asks his assistant to record the time it takes to serve a large number of customers at the final window in the facility’s drive-up system. The results are in the file P07_08.xlsx, which consists of nearly 1200 service times. For this problem, you can assume that the population is the data in this file. a. Use Excel to generate a simple random sample of

size 30 from the data. b. Calculate a point estimate of the population mean

from the sample selected in part a. What is the sampling error, that is, by how much does the sample mean differ from the population mean?

c. Calculate a good approximation for the standard error of the mean.

d. If you wanted to halve the standard error from part c, what approximate sample size would you need? Why is this only approximate?

9. The file P02_16.xlsx contains traffic data from 256 weekdays on four variables. Each variable lists the number of arrivals during a specific 5-minute period of the day. For this problem, consider this data set a sim- ple random sample from all possible weekdays. a. For each of the four variables, find the sample

mean. If each of these is used as an estimate from the corresponding (unknown) population mean, is there any reason to believe that they either underestimate or overestimate the population means? Why or why not?

b. What are the (approximate) standard errors of the estimates in part a? How can you interpret these standard errors? Be as specific as possible.

c. Is it likely that the estimates in part a are accurate to within 0.4 arrival? Why or why not? (Answer for each variable separately.)

10. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. For this problem, consider this data set a simple random sample from all possible households, where the number of households in the population is well over 1,000,000. a. Create a new variable, Total Income, that is the

sum of First Income and Second Income. b. For each of the four variables Total Income,

Monthly Payment, Utilities, and Debt, find the sample mean. If each of these is used as an estimate from the corresponding (unknown) population mean, is there any reason to believe that they either underestimate or overestimate the corresponding population means? Why or why not?

c. What are the (approximate) standard errors of the esti- mates in part b? How can you interpret these standard errors? Be as specific as possible. Is the finite popula- tion correction required? Why or why not?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

d. Is it likely that the estimate of Total Income in part b is accurate to within $1500? Why or why not?

11. The file P02_10.xlsx contains midterm and final exam scores for 96 students in a corporate finance course. For this problem, assume that these 96 students represent a sample of the 175 students taking the course, and that these 175 students represent the relevant population. a. Assuming the same instructor is teaching all four

sections of this course and that the 96 students are the students in two of these sections, is it fair to say that the 96 students represent a random sample from the population? Does it matter?

b. Find the sample mean and the standard error of the sample mean, based on the 96 students in the file. Should the finite population correction be used? What is the standard error without it? What is the standard error with it?

Level B 12. Create a simulation similar to the one in the Wheel

of Fortune Similation.xlsx file. However, suppose that the outcome of each spin is no longer uniformly distributed between $0 and $1000. Instead, it is the number of 7’s you get in 20 rolls of two dice. In other words, each spin results in a binomially distributed random number with parameters n = 20 and p = 1/6 (because the chance of rolling a 7 is 1 out of 6). The simulation should still allow you to vary the number of “spins” from 1 to 10, and the “winnings” is still the average of the outcomes of the spins. What is

fundamentally different from the simulation in the text? Does the central limit theorem still work? Explain from the results you obtain.

13. Suppose you plan to take a simple random sample from a population with N members. Specifically, N members. Specifically, N you plan to sample a percentage p of the population. If p is 1%, is the finite population correction really necessary? Does the answer depend on N? Explain. Then answer the same questions when p is 5%, 10%, 25%, and 50%, respectively. In general, explain what goes wrong if the finite population correction is really necessary but isn’t used.

14. The file P07_14.xlsx contains a very small population of only five members. For each member, the height of the person is listed. The purpose of this problem is to let you see exactly what a sampling distribution is. Find the exact sampling distribution of the sample exact sampling distribution of the sample exact mean with sample size 3. Verify that Equation (7.1) holds, that is, the mean of this sampling distribution is equal to the population mean. Also, verify that Equation (7.2) holds, that is, the standard deviation of this sampling distribution is equal to the population standard deviation divided by the square root of 3. (Hint: You will have to do this by brute force. There are 125 different samples of size 3 that could be drawn from this population. These include samples with duplicate members, and order counts. For example, they include (1,1,2), (1,2,1), (2,1,1), and (1,1,1). You will need to find the sample mean of each and then find the mean and standard deviation of these sample means.)

7-5 CONCLUSION This chapter has provided the fundamental concepts behind statistical inference. We dis- cussed ways to obtain random samples from a population; how to calculate a point estimate of a particular population parameter, the population mean; and how to measure the accu- racy of this point estimate. The key idea is the sampling distribution of the estimate and speci�cally its standard deviation, called the standard error of the estimate. Due to the cen- tral limit theorem, the sampling distribution of the sample mean is approximately normal, which implies that the sample mean will be within two standard errors of the population mean in approximately 95% of all random samples. In the next two chapters we build on these important concepts.

Summary of Key Terms

Term Symbol Explanation Excel Page Equation

Population Contains all members about which a study intends to make inferences

281

Frame A list of all members of the population 281

Sampling units Potential members of a sample from a population 281

(continued)

7-5 Conclusion 307 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

308 Chapter 7 Sampling and Sampling Distributions

Term Symbol Explanation Excel Page Equation

Probability sample Any sample that is chosen by using a random mechanism

281

Judgmental sample Any sample that is chosen according to a sampler’s judgment rather than a random mechanism

281

Simple random sample

A sample where each member of the population has the same chance of being chosen

StatTools/ Data Utilities

282

Systematic sample A sample where one of the first k members is selected k members is selected k randomly, and then every ktktk h member after this one is selected

287

Stratified sampling Sampling in which the population is divided into relatively homogeneous subsets called strata, and then random samples are taken from each of the strata

288

Proportional sample sizes (in stratified sampling)

The property of each stratum selected having the same proportion from stratum to stratum

289

Cluster sampling A sample where the population is separated into clusters, such as cities or city blocks, and then a random sample of the clusters is selected

289

Sampling error The inevitable result of basing an inference on a sample rather than on the entire population

292

Nonsampling error Any type of estimation error that is not sampling error, including nonresponse bias, nontruthful responses, measurement error, and voluntary response bias

293

Point estimate A single numeric value, a “best guess” of a population parameter, based on the data in a sample

294

Sampling error (or estimation error)

Difference between the estimate of a population parameter and the true value of the parameter

294

Sampling distribution The distribution of the point estimates from all possible samples (of a given sample size) from the population

294

Confidence interval An interval around the point estimate, calculated from the sample data, where the true value of the population parameter is very likely to be

294

Unbiased estimate An estimate where the mean of its sampling distribution equals the value of the parameter being estimated

294

Standard error of an estimate

The standard deviation of the sampling distribution of the estimate

294

Mean of sample mean

E(X(X( )X)X Indicates property of unbiasedness of sample mean 296 7.1

Standard error of sample mean

SE(X(X( )X)X Indicates how sample means from different samples vary 296 7.2, 7.3

Confidence interval for population mean

An interval that is very likely to contain the population mean mean

296 7.4

Finite population correction

fpc A correction for the standard error when the sample size is fairly large relative to the population size

298 7.5, 7.6

Central limit theorem States that the distribution of the sample mean is approximately normal for sufficiently large sample sizes

299

Summary of Key Terms (Continued )

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

7-5 Conclusion 309

P R O B L E M S Note: Because the material in this chapter is more conceptual than calculation-based, we have included only conceptual questions here. You will get plenty of practice with calculations in the next two chapters, which build upon the concepts in this chapter.

Conceptual Questions C.1. Suppose that you want to know the opinions of

American secondary school teachers about estab- lishing a national test for high school graduation. You obtain a list of the members of the National Education Association (the largest teachers’ union) and mail a questionnaire to 3000 teachers chosen at random from this list. In all, 823 teachers return the questionnaire. Identify the relevant population. Do you believe there is a good possibility of nonsampling error? Why or why not?

C.2. A sportswriter wants to know how strongly the residents of Indianapolis, Indiana, support the local minor league baseball team, the Indianapolis Indians. He stands outside the stadium before a game and interviews the first 30 people who enter the stadium. Suppose that the newspaper asks you to comment on the approach taken by this sportswriter in performing the survey. How would you respond?

C.3. A large corporation has 4520 male and 567 female employees. The organization’s equal employment opportunity officer wants to poll the opinions of a random sample of employees. To give adequate attention to the opinions of female employees, exactly how should the EEO officer sample from the given population? Be specific.

C.4. Suppose that you want to estimate the mean monthly gross income of all households in your local community. You decide to estimate this population parameter by calling 150 randomly selected residents and asking each individual to report the household’s monthly income. Assume that you use the local phone directory as the frame in selecting the households to be included in your sample. What are some possible sources of error that might arise in your effort to estimate the population mean?

C.5. Provide an example of when you might want to take a stratified random sample instead of a simple random sample, and explain what the advantages of a stratified sample might be.

C.6. Provide an example of when you might want to take a cluster random sample instead of a simple random sample, and explain what the advantages of a cluster sample might be. Also, explain how you would choose the cluster sample.

C.7. Do you agree with the statement that nonresponse error can be overcome with larger samples? If you

agree, explain why. If you disagree, provide an example that backs up your opinion.

C.8. When pollsters take a random sample of about 1000 people to estimate the mean of some quantity over a population of millions of people, how is it possible for them to estimate the accuracy of the sample mean?

C.9. Suppose you want to estimate the population mean of some quantity when the population consists of millions of members (such as the population of all U.S. households). How is it possible that you can obtain a fairly accurate estimate, using the sample mean of only about 1000 randomly selected members?

C.10. What is the difference between a standard deviation and a standard error? Be precise.

C.11. Explain as precisely as possible what it means that the sample mean is an unbiased estimate of the unbiased estimate of the unbiased population mean [as indicated in Equation (7.1)].

C.12. Explain the difference between the standard error formulas in equations (7.2) and (7.3). Why is Equation (7.3) the one necessarily used in real situations?

C.13. Explain as precisely as possible what Equation (7.4) means, and the reason for the 2 in the formula.

C.14. Explain as precisely as possible the role of the finite population correction. In which types of situations is it necessary? Is it necessarily used in the typical polls you see in the news?

C.15. In the wheel of fortune simulation with, say, three spins, many people mistakenly believe that the distribution of the average is the flat graph in Figure 7.9, that is, they believe the average of three spins is uniformly distributed between $0 and $1000. Explain intuitively why they are wrong.

C.16. Explain the difference between a point estimate for the mean and a confidence interval for the mean. Which provides more information?

C.17. Explain as precisely as possible what the central limit theorem says about averages.

C.18. Many people seem to believe that the central limit theorem “kicks in” only when n is at least 30. Why is this not necessarily true? When is such a large n necessary?

C.19. Suppose you are a pollster and are planning to take a sample that is very small relative to the population. In terms of estimating a population mean, can you say that a sample of size 9n is about 3 times as accurate as a sample of size n? Why or why not? Does the answer depend on the population size? For example, would it matter if the population size were 50 million instead of 10 million?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 7.1 SAMPLING FROM DVD MOVIE RENTERS

The file C07_01.xlsx contains a large data set of 10,000 customer transactions for a fictional chain of video stores in the United States. Each row corresponds to a different customer and lists (1) a customer ID number (1−10,000), (2) the state where the customer lives, (3) the city where the customer lives, (4) the customer’s gender, (5) the customer’s favorite type of movie (drama, comedy, science fiction, or action), (6) the customer’s next favorite type of movie, (7) the number of times the customer has rented movies in the past year, and (8) the total dollar amount the customer has spent on movie rentals during the past year. The data are sorted by state, then city, then gender. We assume that this data set represents the entire population of customers for this video chain. (Of course, national chains would have significantly larger customer populations, but this data set is large enough to illustrate the ideas.)

Imagine that only the data in columns A through D are readily available for this population. The company is interested in summary statistics of the data in columns E through H, such as the percentage of customers whose favorite movie type is drama or the average amount spent annually per customer, but it will have to do some work to obtain the data

in columns E through H for any particular customer. Therefore, the company wants to perform sampling. The question is: What form—simple random sampling, systematic sampling, stratified sampling, cluster sampling, or even some type of multistage sampling—is most appropriate?

Your job is to investigate the possibilities and to write a report on your findings. For any sampling method, any sample size, and any quantity of interest (such as average dollar amount spent annually), you should be concerned with sampling cost and accuracy. One way to judge the latter is to generate several random samples from a particular method and calculate the mean and standard deviation of your point estimates from these samples. For example, you might generate 10 systematic samples, calculate the average amount spent (an X) for each sample, and then calculate the mean and standard deviation of these 10 Xs. If your sampling method is accurate, the mean of the Xs should be close to the population average, and the standard deviation should be small. By doing this for several sampling methods and possibly several sample sizes, you can experiment to see what is most cost-efficient for the company. You can make any reasonable assumptions about the cost of sampling with any particular method.

C.20. You saw in Equation (7.1) that the sample mean You saw in Equation (7.1) that the sample mean Y is an unbiased estimate of the population mean. However, some estimates of population parameters are biased. In such cases, there are two sources of error in estimating the population parameter: the bias and the standard error. To understand these, imagine a rifleman shooting at a bull’s-eye. The rifleman

could be aiming wrong and/or his shots could vary wildly from shot to shot. If he is aiming wrong but his shots are very consistent, what can you say about his bias and standard error? Answer the same question if he is correctly aiming at the bull’s-eye but is very inconsistent. Can you say which of these two situations is worse?

310 Chapter 7 Sampling and Sampling Distributions Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

311

vi tm

a /S

h u tt e rs

to c k.

c o

m

ESTIMATING A COMPANY’S TOTAL TAXABLTAXABLT E INCOME

In Example 7.3 in the previous chapter, we illustrated how sampling can be used in auditing. We see another illustration of sampling in auditing in Example 8.5 of this chapter. In both examples, the point of the sampling is to discover some property (such as a mean or a proportion) from a large population of a company’s accounts by examining a small fraction of these accounts and projecting the results to the population. An article by Press (1995) offers an interesting variation on this problem. He poses the question of how a government revenue agency should assess a business taxpayer’s income for tax purposes on the basis of a sample audit of the company’s business transactions. A sample of the company’s transactions will indicate a taxable income for each sampled transaction. The methods of this chapter will be applied to the sample information to obtain a confidence interval for the total taxable income owed by the company.

Suppose for the sake of illustration that this confidence interval extends from $1,000,000 to $2,200,000 and is centered at $1,600,000. In other words, the government’s best guess of the company’s taxable income is $1,600,000, and the government is fairly confident that the true taxable income is between $1,000,000 and $2,200,000. How much tax should it assess the company? Press argues that the agency would like to maximize its revenue while minimizing the risk that the company will be assessed more than it really owes. This last assumption, that the government does not want to overassess the company, is crucial. By making

Confidence Interval Estimation

C H A P T E R

8

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

312 Chapter 8 Confidence Interval Estimation

several reasonable assumptions, he is able to argue that the agency should base the tax on the lower limit of the confidence interval, in this case, lower limit of the confidence interval, in this case, lower $1,000,000.1 several reasonable assumptions, he is able to argue that the agency should base the

1 several reasonable assumptions, he is able to argue that the agency should base the

On the other hand, if the agency were indifferent between overcharging and undercharging, then it would base the tax on the midpoint, $1,600,000, of the confidence interval. Using this strategy, the agency would overcharge in about half the cases and undercharge in the other half. This would certainly be upsetting to companies—it would appear that the agency is flipping a coin to decide whether to overcharge or undercharge.

If the government agency does indeed decide to base the tax on the lower limit lower limit lower of the confidence interval, Press argues that it can still increase its tax revenue—by increasing the sample size of the audit. When the sample size increases, the confidence interval shrinks in width, and the lower limit, which governs the agency’s tax revenue, almost surely increases. But there is some point at which larger samples are not warranted, for the simple reason that larger samples cost more money to obtain. Therefore, there is an optimal size that will balance the cost of sampling with the desire to obtain more tax revenue. ■

8-1 INTRODUCTION This chapter expands on the ideas from the previous chapter. Given an observed data set, we want to make inferences to some larger population. Two typical examples follow:

■ A mail-order company has accounts with thousands of customers. The company would like to infer the average time its customers take to pay their bills, so it randomly samples a relatively small number of its customers, sees how long these customers take to pay their bills, and draws inferences about the entire population of customers.

■ A manufacturing company is considering two compensation schemes to implement for its workers. It believes that these two different compensation schemes might provide different incentives and hence result in different worker productivity. To see whether this is true, the company randomly assigns groups of workers to the two different compensation schemes for a period of three months and observes their productivity. Then it attempts to infer whether any differences observed in the experiment can be generalized to the overall worker population.

In each of these examples, there is an unknown population parameter a company would like to estimate. In the mail-order example, the unknown parameter is the mean length of time customers take to pay their bills. Its true value could be discovered only by learning how long every customer in the entire population takes to pay its bills. This is not really possible, given the large number of customers. In the manufacturing example, the unknown parameter is a mean difference, the difference between the mean produc- tivities with the two different compensation schemes. This mean difference could be discovered only by subjecting each worker to each compensation scheme and measuring their resulting productivities. This procedure would almost certainly be impossible from a practical standpoint. Therefore, the companies in these examples are likely to select

1In case this sounds overly generous on the government’s part, the result is based on two important assumptions: (1) the con�dence interval is a 90% con�dence interval, and (2) the agency is 19 times more concerned about overassessing than about underassessing.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-1 Introduction 313

random samples and base their estimates of the unknown population parameters on the sample data.

The inferences discussed in this chapter are always based on an underlying probability model, which means that some type of random mechanism must generate the data. Two random mechanisms are generally used. The �rst involves sampling randomly from a larger population, as we discussed in the previous chapter. This is the mechanism responsible for generating the sample of customers in the mail-order example. Regardless of whether the sample is a simple random sample or a more complex random sample, such as a strati�ed sample, the fact that it is random allows us to use the rules of probability to make infer- ences about the population as a whole.

The second commonly used random mechanism is called a randomized experiment. The compensation scheme example just described is a typical randomized experiment. Here the company selects a set of subjects (employees), randomly assigns them to two different treatment groups (compensation schemes), and then compares some quantitative measure (productivity) across the groups. The fact that the subjects are randomly assigned to the two treatment groups is useful for two reasons. First, it allows us to rule out a num- ber of factors that might have led to differences across groups. For example, assuming that males and females are randomly spread across the two groups, we can rule out gender as the cause of any observed group differences. Second, the random selection allows us to use the rules of probability to infer whether observed differences can be generalized to all employees.

Generally, statistical inferences are of two types: con�dence interval estimation and hypothesis testing. The �rst of these is the subject of the current chapter; hypothesis testing is discussed in the next chapter. They differ primarily in their point of view. For example, the mail-order company might sample 100 customers and �nd that they average 15.5 days before paying their bills. In con�dence interval estimation, the data are used to obtain a point estimate and a con�dence interval around this point estimate. In this example the point estimate is 15.5 days. It is a best guess for the mean bill-paying time in the entire customer population. Then, using the methods in this chapter, the company might �nd that a 95% con�dence interval for the mean bill-paying time in the population is from 13.2 days to 17.8 days. The company is now 95% con�dent that the true mean bill-paying time in the population is within this interval.

Hypothesis testing takes a different point of view. Here we wish to check whether the observed data provide support for a particular hypothesis. In the compensation scheme example, suppose the manager believes that workers will have higher produc- tivity if they are paid by salary than by an hourly wage. He runs the three-month rand- omized experiment described previously and �nds that the salaried workers produce on average eight more parts per day than the hourly workers. Now he must make one of two conclusions. Either salaried workers are in general no more productive than hourly workers and the ones in the experiment just got lucky, or salaried workers really are more productive. The next chapter explains how to decide which of these conclusions is more reasonable.

There are only a few key ideas in this chapter, and the most important of these, sam- pling distributions, was introduced in the previous chapter. It is important to concentrate on these key ideas and not get bogged down in formulas or numerical calculations. Software such as Excel or StatTools is generally available to take care of these calculations. The job of a businessperson is much more dependent on knowing which methods to use in which situations and how to interpret computer outputs than on memorizing and plugging into formulas.

We actually introduced 95% confidence intervals for the mean in the previous chapter. We generalize this method in the current chapter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

314 Chapter 8 Confidence Interval Estimation

8-2 SAMPLING DISTRIBUTIONS As you will soon learn, most con�dence intervals are of the form in Equation (8.1). For example, when estimating a population mean, the point estimate is the sample mean, the standard error is the sample standard deviation divided by the square root of the sample size, and the multiple is approximately equal to 2. To learn why it works this way, you must �rst understand sampling distributions. This knowledge will then be put to use in the next section.

In the previous chapter, we introduced the sampling distribution of the sample mean X and saw how it was related to the central limit theorem. In general, whenever you make inferences about one or more population parameters, such as a mean or the difference between two means, you always base this inference on the sampling distribution of a point estimate, such as the sample mean. Although the concepts of point estimates and sampling distributions are no different from those in the previous chapter, there are some new details to learn.

We again begin with the sample mean X. The central limit theorem states that if the sample size n is reasonably large, then for any population distribution, the sampling dis- tribution of X is approximately normally distributed with mean X is approximately normally distributed with mean X μ and standard deviation σ/!n!n!! , where μ and σ are the population mean and standard deviation. An equivalent state- ment is that the standardized quantity Z de�ned in Equation (8.2) is approximately normal with mean 0 and standard deviation 1.

Typically, this fact is used to make inferences about an unknown population mean μ. There is one problem, however—the population standard deviation σ is virtually never known. This parameter, σ, is then called a nuisance parameter. Although it is typically not the parameter of primary interest, its value is needed for making inferences about the mean μ. The solution appears to be straightforward: Replace the nuisance parameter σ by the sample standard deviation s in the formula for Z and proceed from there. However, when Z and proceed from there. However, when Z σ is replaced by s, this introduces a new source of variability, and the sampling distribution is no longer normal. It is instead called the t distribution, a close relative of the normal distribution that appears in a variety of statistical applications.

8-2a The t Distribution

We �rst set the stage for this new sampling distribution. We are interested in estimating a population mean μ with a sample of size n. We assume the population distribution is normal with unknown standard deviation σ. We intend to base inferences on the standardized value of X from Equation (8.2), where X from Equation (8.2), where X σ is replaced by the sample standard deviation s, as shown in Equation (8.3). Then the standardized value in Equation (8.3) has a t distribution with n − 1 degrees of freedom.

Typical Form of Confidence Interval Point Estimate ± Multiple × Standard Error (8.1)

Standardized Z-Value

Z = X − μ σ/!n!n!!

(8.2)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-2 Sampling Distributions 315

The degrees of freedom is a numerical parameter of the t distribution that de�nes the t distribution that de�nes the t precise shape of the distribution. Each time we encounter a t distribution, we will specify t distribution, we will specify t its degrees of freedom. In this particular sampling context, where we are basing inferences about μ on the sampling distribution of X, the degrees of freedom turns out to be 1 less than the sample size n.

The t distribution looks very much like the standard normal distribution. It is bell- shaped and centered at 0. The only difference is that it is slightly more spread out, and this increase in spread is greater for small degrees of freedom. In fact, when small degrees of freedom. In fact, when small n is large, so that the degrees of freedom is large, the t distribution and the standard normal distribution are practically indistinguishable. This is illustrated in Figure 8.1. With 5 degrees of freedom, it is possible to see the increased spread in the t distribution. With 30 degrees of freedom, the t and standard normal curves are practically the same curve.

Standardized Value

t = X − μ s/!n!n!!

(8.3)

The t distribution and the standard normal distribution are practically the same when the degrees of freedom parameter is large.

Figure 8.1 The t and Standard Normal Distributions

The t-value in Equation (8.3) is very much like a typical Z-value such as in Equation (8.2). That is, the t-value represents the number of standard errors by which the  sample mean differs from the population mean. For example, if a t-value is 2.5, the sample mean is 2.5 standard errors above the population mean. Or if a t-value is −2.5, the sample mean is 2.5 standard errors below the population mean. Also, t-values greater in magnitude than 3 are quite unexpected because of the same property of the normal distribu- tion: It is very unlikely for a random value to be more than three standard deviations from its mean.

Because of this interpretation, t-values are perfect candidates for the multiple term in Equation (8.1), as you will soon see. First, however, we brie�y examine some Excel® func- tions that are useful for working with the t distribution in Excel.

Chapter 5 explained how to use Excel’s NORM.S.DIST and NORM.S.INV functions to calculate probabilities or percentiles from the standard normal distribution. There are simi- lar Excel functions for the t distribution. Unfortunately, these functions are somewhat more t distribution. Unfortunately, these functions are somewhat more t

A t-value indicates the number of standard errors by which a sample mean differs from a population mean.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

316 Chapter 8 Confidence Interval Estimation

dif�cult to master than their normal counterparts. The �le t Calculations.xlsx spells out the possibilities (see Figure 8.2). The top three examples show how to �nd the probability to the left or right of a given value. The bottom three examples show how to �nd the value with a given probability beyond it in one or both tails. You can refer to this �gure as often as necessary when you work with the t distribution.t distribution.t

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

Calcula�ons for the t distribu�ont distribu�ont

Sample size Degrees of freedom

One-tailed probabili es Value Probability in le� tail

Value Probability in right tail

Two-tailed probability Value Probability in both tails

Inverse calcula�ons Probability in le tail Value

Probability in right tail Value

Probability in both tails Value

30 29

–2 0.9725

2 0.0275

2 0.0549

0.05 –1.699

0.05 1.699

0.05 2.045

A BA B C DC D E FE F G HG H I J

Formulas in Excel 2010 (or later) Formulas using "old" T func�ons

=T.DIST(–B7,B4,TRUE) =TDIST(–B7,B4,1)

=T.DIST.RT(B10,B4) =TDIST(B10,B4,1)

=T.DIST.2T(B14,B4) =TDIST(B14,B4,2) Half of this probability is in each tail

=T.INV(B18,B4) =–TINV(2*B18,B4)

=TINV(2*B21,B4)=T.INV(1-B21,B4)

Half of this probability is in each tail =T.INV.2T(B24,B4) =TINV(B24,B4)

Figure 8.2 Excel Functions for the t Distribution

CHANGES IN EXCEL 2010

Chapter 5 discussed new statistical functions in Excel 2010. Except possibly for the replacement of CRITBINOM by BINOM.INV, these changes don’t really seem to make much difference. However, the new functions definitely help with the t distribution. Before, the only available functions were t distribution. Before, the only available functions were t TDIST and TINV, and because of the obscure way they work, everyone found them difficult to remember. Therefore, Microsoft introduced five new functions in Excel 2010: T.DIST, T. DIST.RT, T.DIST.2T, T.INV, and T.INV.2T. As usual, a “DIST” function takes a value and returns a probability, whereas an “INV” function takes a probability and returns a value. Normally, these kinds of functions are written for left-hand tails (“ < ” problems), and this is the case for T.DIST and T.INV. However, T.DIST.RT lets you work with right-hand tails (“ > ” problems), and T.DIST.2T and T.INV.2T let you work with both tails. Figure 8.2 shows both the old and the new functions, and the t Calculations.xlsx file provides more details on their use. We strongly recommend the new functions if you have Excel 2010 or later..

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-3 Confidence Interval for a Mean 317

8-2b Other Sampling Distributions

The t distribution, a close relative of the normal distribution, is used to make inferences t distribution, a close relative of the normal distribution, is used to make inferences t about a population mean when the population standard deviation is unknown. Throughout this chapter (and later chapters) you will see other contexts where the t distribution appears. The theme is always the same—one or more means are of interest, and one or more stand- ard deviations are unknown.

The t (and normal) distributions are not the only sampling distributions you will encounter. Two other close relatives of the normal distribution that appear in various con- texts are the chi-square and F distributions. These are used primarily to make inferences about variances (or standard deviations), as opposed to means. We omit the details of these distributions for now, but you will see them in later sections.

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Calculate the following probabilities using Excel.

(If you have Excel 2010 or later, we suggest using its new functions.) a. P(t10 ≥ 1.75), where t10 has a t distribution with

10 degrees of freedom. b. P(t100 ≥ 1.75), where t100 has a t distribution with

100 degrees of freedom. How do you explain the difference between this result and the one obtained in part a?

c. P(Z ≥ 1.75), where Z is a standard normal random variable. Compare this result to the results obtained in parts a and b. How do you explain the differences in these probabilities?

d. P(t20 ≤ −0.80), where t20 has a t distribution with 20 degrees of freedom.

e. P(t3 ≤ −0.80), where t3 has a t distribution with 3 degrees of freedom. How do you explain the difference between this result and the result obtained in part d?

2. Calculate the following quantities using Excel. (If you have Excel 2010 or later, we suggest using its new functions.) a. P(−2.00 ≤ t10 ≤ 1.00), where t10 has a

t distribution with 10 degrees of freedom.

b. P(−2.00 ≤ t100 ≤ 1.00), where t100 has a t distribution with 100 degrees of freedom. How do you explain the difference between this result and the one obtained in part a?

c. P(−2.00 ≤ Z ≤ 1.00), where Z is a Z is a Z standard normal random variable. Compare this result to the results obtained in parts a and b. How do you explain the differences in these probabilities?

d. Find the 68th percentile of the t distribution with 20 degrees of freedom.

e. Find the 68th percentile of the t distribution with 3 degrees of freedom. How do you explain the difference between this result and the result obtained in part d?

3. Calculate the following quantities using Excel. (If you have Excel 2010 or later, we suggest using its new functions.) a. Find the value of x such that x such that x P(t10 > x) = 0.75,

where t10 has a t distribution with 10 degrees of freedom.

b. Find the value of y such that P(t100 > y) = 0.75, where t100 has a t distribution with t distribution with t 100 degrees of freedom. How do you explain the difference between this result and the result obtained in part a?

c. Find the value of z such that P(Z > z) = 0.75, where Z is a standard normal random variable. Compare this result to the results obtained in parts a and b. How do you explain the differences in the values of x, y, and z?

P R O B L E M S

8-3 CONFIDENCE INTERVAL FOR A MEAN We now come to the main topic of this chapter: using properties of sampling distributions to construct con�dence intervals. We assume that data have been generated by some random mechanism, either by observing a random sample from some population or by performing

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

318 Chapter 8 Confidence Interval Estimation

a randomized experiment. The goal is to infer the values of one or more population param- eters such as the mean, the standard deviation, or a proportion from sample data. For each such parameter, you use the data to calculate a point estimate, which can be considered a best guess for the unknown parameter. You then calculate a con�dence interval around the point estimate to measure its accuracy.

We begin by deriving a con�dence interval for a population mean μ, and we discuss its interpretation. Although the particular details pertain to a speci�c parameter, the mean, the same ideas carry over to other parameters as well, as will be described in later sections. As usual, the sample X is used as the point estimate of μ.

To obtain a con�dence interval for μ, you �rst specify a con�dence level, usually 90%, 95%, or 99%. You then use the sampling distribution of the point estimate to deter- mine the multiple of the standard error (SE) to go out on either side of the point esti- mate to achieve the given con�dence level. If the con�dence level is 95%, the value used most frequently in applications, the multiple is approximately 2. More precisely, it is a t-value. That is, a typical con�dence interval for μ is of the form in Equation (8.4), where SE(X)X)X = s/!n!n!! .

To obtain the correct t-multiple, let α be one minus the con�dence level (expressed as a decimal). For example, if the con�dence level is 90%, then α = 0.10. Then the appro- priate t-multiple is the value that cuts off probability α/2 in each tail of the t distribution t distribution t with n − 1 degrees of freedom. For example, if n = 30 and the con�dence level is 95%, cell B25 of Figure 8.2 indicates that the correct t-value is 2.045. The corresponding 95% con�dence interval for μ is then

X ± 2.045(s/!n!n!! ) If the con�dence level is instead 90%, the appropriate t-value is 1.699 (change the proba- bility in cell B24 to 0.10 to see this), and the resulting 90% con�dence interval is

X ± 1.699(s/!n!n!! ) If the con�dence level is 99%, the appropriate t-value is 2.756 (change the probability in cell B24 to 0.01 to see this), and the resulting 99% con�dence interval is

X ± 2.756(s/!n!n!! ) Note that as the con�dence level increases, the length of the con�dence interval also increases. Because narrow con�dence intervals are desirable, this presents a trade-off. You can either have less con�dence and a narrow interval, or you can have more con�dence and a wide interval. However, you can also take a larger sample. As n increases, the standard error s/!n!n!! tends to decrease, so the length of the con�dence interval tends to decrease for any con�dence level. (Why won’t it decrease for sure? The larger sample might result in a might result in a might larger value of s that could offset the increase in n.)

Example 8.1 illustrates con�dence interval estimation for a population mean. Starting in this edition of the book, we illustrate this in two ways: with Excel-only formulas and with StatTools. The advantages of the Excel-only method are that no add-in is required, and it shows exactly how the calculations are performed. The advantage of StatTools is that it is much faster, requiring only that you �ll in a dialog box. You might want to try the

Confidence Interval for Population Mean X ± t-multiple × SE (X)X)X (8.4)

Confidence interval lengths increase when you ask for higher confidence levels, but they tend to decrease when you use larger sample sizes.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-3 Confidence Interval for a Mean 319

E X A M P L E 8.1 CUSTOMER RESPONSE TO A NEW SANDWICH

Afast-food restaurant recently added a new sandwich to its menu. To estimate the popu-larity of this sandwich, a random sample of 40 customers who ordered the sand- wich were surveyed. Each of these customers was asked to rate the sandwich on a scale of 1 to 10, 10 being the best. The results of this survey appear in column B of Figure 8.3 (with several rows hidden). (See the file Satisfaction Ratings.xlsx.) The manager wants to estimate the mean satisfaction rating over the entire population of customers by finding a 95% confidence interval. How should she proceed?

1

2

3

4

5

6

7

8

9

10

11

12

39

40

41

Customer

A

1

2

3

4

5

6

7

8

9

10

11

38

39

40

Sa�sfac�onSa�sfac�onSa�sf Excel-only confidence interval for mean

B CB C D ED E F GF G

7

5

5

6

8

7

6

7

10

7

9

9

5

4

Sample size

Sample mean

Sample Std Dev

Std Error of mean

Confidence level

Degrees of freedom

t mul�ple

Lower limit

Upper limit

=COUNT(B2:B41)

=AVERAGE( B2:B41)=AVERAGE( B2:B41)=A

=STDEV.S(B2:B41)=STDEV.S(B2:B41)=STDEV

=E4/SQRT(E2)

=E2-1

=T.INV=T.INV=T .2T(1-E6,E7).INV.2T(1-E6,E7).INV

=E3-E8*E5

=E3+E8*E5

40

6.25

1.597

0.253

95%

39

2.023

5.739

6.761

Objective To obtain a 95% confidence interval for the mean satisfaction rating of the new sandwich.

Solution The Excel-only method is spelled out in Figure 8.3 by the formulas shown in column G. The calculations follow directly from Equation (8.4). As in Figure 8.2, the T.INV.2T func- tion is used to find the correct multiple. Its arguments are one minus the confidence level and the degrees of freedom. The result is that the 95% confidence interval extends from 5.739 to 6.761.

Alternatively, to use StatTools, make sure a StatTools data set has been designated, select Confidence Interval from the StatTools Statistical Inference dropdown list, and select the Mean/Std. Deviation option. Then fill in the resulting dialog box as shown in Figure  8.4. In particular, select One-Sample Analysis as the Analysis type. (Other types will be used later in the chapter.) You should obtain the output shown in the figure. It

Figure 8.3 Analysis of New Sandwich Data

© C

e n g

a g

e L

e a rn

in g

Excel-only method at �rst and then move to StatTools when you are more comfortable with the procedure, but this is totally up to you. These comments apply to the other con�dence intervals in this chapter as well.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

320 Chapter 8 Confidence Interval Estimation

doesn’t show the “ingredients” shown in the Excel-only method, but it arrives at exactly the same confidence interval. (Note: If you want to place the output next to the data, as shown here, select Settings from the StatTools ribbon, and, in the Report group, select either of the last two Placement options.)

From either method, the principal results are that (1) the best guess for the population mean rating is 6.250, and (2) a 95% confidence interval for the population mean rating extends from 5.739 to 6.761. The manager can be 95% confident that the true mean rating over all customers who might try the sandwich is within this confidence interval.

We stated previously that as the confidence level increases, the length of the confi- dence interval increases. You can convince yourself of this by entering different confidence levels such as 90% or 99%. The lower and upper limits of the confidence interval will change automatically, getting closer together for the 90% level and farther apart for the 99% level. Just remember that you, the analyst, can choose the confidence level, but 95% is the level most commonly chosen.

Before leaving this example, we discuss the assumptions that lead to the confidence interval. First, you might question whether the sample is really a random sample—or whether it matters. Perhaps the manager used some random mechanism to select the customers to be surveyed. More likely, however, she simply surveyed 40 consecutive customers who tried the sandwich on a given day. This is called a convenience sample and is not really a random sample. However, unless there is some reason to believe that these 40 customers differ in some relevant aspect from the entire population of customers, it is probably safe to treat them as a random sample.

A second assumption is that the population distribution is normal. We made this assumption when we introduced the t distribution. Obviously, the population distribution t distribution. Obviously, the population distribution t cannot be exactly normal because it is concentrated on the cannot be exactly normal because it is concentrated on the cannot 10 possible satisfaction rat- ings, and the normal distribution describes a continuum. However, this is probably not a problem for two reasons. First, confidence intervals based on the t distribution are robust

Figure 8.4 StatTools Confidence Interval Method

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-3 Confidence Interval for a Mean 321

to violations of normality. This means that the resulting confidence intervals are approxi- mately valid for any populations that are approximately normal. Second, the normal population assumption is less crucial for larger sample sizes because of the central limit theorem. A sample size of 40 should be large enough.

Finally, it is important to recognize what this confidence interval implies and what it doesn’t imply. In the entire population of customers who ordered this sandwich, there is a distribution of satisfaction ratings. Some fraction rate it as 1, some rate it as 2, and so on. All we are trying to determine here is the average of all these ratings. Based on the analysis, the manager can be 95% confident that this (still unknown) average is between 5.739 and 6.761. However, this confidence interval doesn’t tell her other char- acteristics of the population of ratings that might be of interest, such as the proportion of customers who rate the sandwich 6 or higher. It only provides information about the mean rating. Later in this chapter, you will see how to find a confidence interval for a proportion, which allows you to analyze another important characteristic of a population distribution. ■

In the sandwich example, we said that the manager can be 95% con�dent that the true mean rating is between 5.739 and 6.761. What does this statement really mean? Contrary to what you might expect, it does not mean that the true mean lies between not mean that the true mean lies between not 5.739 and 6.761 with probability 0.95. Either the true mean is inside this interval or it is not. The true meaning of a 95% con�dence interval is based on the procedure used to obtain it. Speci�cally, if you use this procedure on a large number of random samples, all from the same population, then approximately 95% of the resulting con�dence intervals will be “good” ones that include the true mean, and the other 5% will be “bad” ones that do not include the true mean. Unfortunately, when you have only a single sample, as in the sandwich example, you have no way of knowing whether your con�dence interval is one of the good ones or one of the bad ones, but you can be 95% con�dent that you obtained one of the good intervals.

Because this is such an important concept, we illustrate it in Figure 8.5 with simulation. (See the �le Con�dence Interval Simulation Finished.xlsx. There is no “un�nished” ver- sion of this �le.) The data in column B are generated randomly from a normal distribution with the known values of μ and σ in cells B3 and B4. Next, the con�dence interval proce- dure is used to calculate a 95% con�dence interval for the true value of μ, exactly as in the sandwich example. However, because the true value of μ is known, it is possible to record a 1 in cell H6 if the true mean is inside the interval and a 0 otherwise. The appropriate formula is

=IF(AND(B3>=D14,B3<=D15),1,0) Finally, a data table can be used to replicate the simulated results 1000 times.2

Speci�cally, the formula in H11 is

=G6 Then to build the data table in the range G11:H1011, leave the row input cell box empty and specify any blank cell as the column input cell. Finally, the AVERAGE function can be used in cell H7 to �nd the fraction of 1’s in the range H12:H1011.

2Depending on the speed of your computer, it can take a few seconds to simulate 1000 samples of size 30 in this data table. Therefore, it is a good idea to set the recalculation mode to “automatic except tables.” (You can �nd this option under the Calculation Options dropdown menu on the Formulas ribbon.) That way, the data table recalculates only if you explicitly tell it to (by pressing the F9 key).

This simulation is performed only to illustrate the true meaning of a “95% confidence interval.”

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

322 Chapter 8 Confidence Interval Estimation

True Meaning of a 95% Confidence Interval Given the data in a particular sample, a 95% confidence interval for the mean will either include the (unknown) population mean or it won’t. The true meaning of a 95% confidence interval is that if the same procedure is used on many different random samples, about 95% of the resulting confidence intervals will include the popula- tion mean, and only about 5% won’t. Therefore, you can be 95% confident that any particular confidence inter- confident that any particular confidence inter- confident that any particular confidence inter val you happen to get is a “good” one.

F u n da m e n ta l I n s i g h t

1

2

3

4

5 6 7

8

Sample size Sample mean Sample Std DevSample Std Dev Std Error of mean Confidence level Degrees of freedom t mul�ple Lower limit Upper limit

This simula�on uses a normal popula�on normal popula�on normal for illustra�on. But you could generate the random sample from another distribu�on (e.g., triangular) to see if the confidence intervals are s�ll valid. i.e, if the % in cell H7 is about 95%.

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

HGFEDCBA

Interpreta�on of a "95% confidence interval"

Popula�on Popula�on

Random sample Mean captured? 1 95.3%94.97

88.60 86.84 96.14 96.93

116.49 114.00 118.25 106.82

94.87 126.44

93.86 109.07 109.51 105.59

72.34 103.97

88.66 118.69

85.76 100.35

73.20 133.48

90.77 130.74 127.71

75.53 98.32

102.14 87.90

Confidence interval for mean

Graphical representa�on

% of Cl's capturing mean

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

30

101.60 16.548

3.021 95%

29 2.045

95.419 107.777

Limit 95.42

107.78

Mean 100

Height 1 1

Height 1

Data table to replicate confidence interval Replica�on Mean captured?

1 1 1 1 1 1 1 1 1 1 1 0 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

mean 100 stdev 2v 20

0

1

2

80.00 90.00 100.00 110.00 120.00

Confidence limits

Mean

Figure 8.5 Simulation Demonstration of Confidence IntervalsSimulation Demonstration of Confidence Intervals

© C

e n g

a g

e L

e a rn

in g

You can see that 953 of the simulated con�dence intervals (each based on a different random sample of size 30) contain the true mean 100. In theory, 950 of the 1000 intervals should cover the true mean, and this is almost exactly what occurred. Of course, in a par- ticular application you might unluckily obtain the 11th sample (in row 22). However, with-

out knowing that the true mean is 100, you would have no way of knowing that you obtained a “bad” interval.

We also show this graphically in the �le. (See Figure 8.5.) The small square in this graph is posi- tioned at the known mean and never changes. The blue line represents a particular con�dence interval. Put your cursor below this chart in, say, cell C35, and press the Delete key. (This forces a recalcula- tion without recalculating the whole data table.) The position of the blue line will change. About 95% of the time, the blue line will straddle the small square—the con�dence interval will include the true mean—but about 1 time out of 20, it will not. This also illustrates the meaning of a “95% con�- dence interval.”

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-3 Confidence Interval for a Mean 323

P R O B L E M S

Level A 4. A manufacturing company’s quality control personnel

have recorded the proportion of defective items for each of 500 monthly shipments of one of the computer components that the company produces. The data are in the file P07_07.xlsx. The quality control department manager does not have sufficient time to review all of these data. Rather, she would like to examine the proportions of defective items for a sample of these shipments. a. Generate a simple random sample of size 25. b. Using the sample generated in part a, calculate a

95% confidence interval for the mean proportion of defective items over all monthly shipments. Assume that the population consists of the proportion of defective items for each of the given 500 monthly shipments.

c. Interpret the 95% confidence interval constructed in part b.

d. Does the 95% confidence interval contain the actual population mean in this case? If not, explain why not. What proportion of many similarly constructed confidence intervals should include the true population mean?

5. The file P08_05.xlsx contains salary data on all NFL players in each of the years 2002 to 2009. Because this file contains all players for each of these years, you can calculate the population mean for each year if population is defined as all NFL players that year. However, proceed as in the previous chapter to select a random sample of size 50 from the 2009 popula- tion. Based on this random sample, calculate a 95% confidence interval for the mean NFL total salary in 2009. Does it contain the population mean? Repeat this procedure several times until you find a random sample where the population mean is not included in not included in not the confidence interval.

6. The file P08_06.xlsx contains data on repetitive task times for each of two workers. John has been doing this task for months, whereas Fred has just started. Each time listed is the time (in seconds) to perform a routine task on an assembly line. The times shown are in chronological order. a. Calculate a 95% confidence interval for the mean

time it takes John to perform the task. Do the same for Fred.

b. Do you believe both of the confidence intervals in part a are valid and/or useful? Why or why not? Which of the two workers would you rather have, assuming that task time is the only issue?

7. The manager of a local fast-food restaurant is interested in improving the service provided to customers who use the restaurant’s drive-up window. As a first step in this process, the manager asks an assistant to record the time (in seconds) it takes to serve a large number of customers at the final window in the facility’s drive-up system. The file P08_07.xlsx contains a random sample of 200 service times during the busiest hour of the day. a. Identify the relevant population. b. Calculate and interpret a 95% confidence interval for

the mean service time of all customers arriving during the busiest hour of the day at this fast-food operation.

c. If the manager wants to improve service, at least during the busiest time of day, does this confidence interval provide useful information? What useful information does it not provide?not provide?not

Level B 8. Continuing Problem 5, generate a random sample

of 50 players for each of the eight years in the file P08_05.xlsx. For each of these samples, calculate a 95% confidence interval for the mean total salary for that year. What is the confidence level that any particular one of these confidence intervals includes the population mean for that year? Is this the same confidence level that all eight of these confidence all eight of these confidence all eight intervals include the respective population means? Why or why not?

9. The file Confidence Interval Simulation.xlsx gener- ates observations randomly from a normal population. normal population. normal Suppose instead that each observation in column A is exponentially distributed with mean 10. (Refer to Section 5-6 for a brief explanation of the exponential distribution.) Unlike a normal distribution, an expo- nential distribution is very skewed to the right. A value from this distribution can be generated with the for- mula =−10*LN(RAND()). Rerun the simulation, still with sample size 30, with this exponential distribution. Are 95% confidence intervals still valid? That is, is the percentage in cell H7 approximately equal to 95%, as it should be? Press the F9 key a few times to check this.

10. Answer the questions in the previous problem when the population is a mixture of two normal distribu- tions. Specifically, suppose each observation has a 65% chance of coming from a normal distribution with mean 100 and standard deviation 20, and a 35% chance of coming from a normal distribution with mean 200 and standard deviation 40. What is the mean of this mixture distribution? (Hint: Use an IF function to generate each random value in column A.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

324 Chapter 8 Confidence Interval Estimation

Mean and Standard Error of Point Estimate for Population Total E(T̂ ) = T (8.6)

SESES (T̂ ) = NσNσN /!n!n!! (8.7)

Approximate Standard Error of Point Estimate for Population Total SESES (T̂ ) = NsNsN /!n!n!! = N × SESES (X)X)X (8.8)

8-4 CONFIDENCE INTERVAL FOR A TOTAL 3

There are situations where a population mean is not the population parameter of most interest. A good example is the auditing example discussed in the previous chapter (Example  7.3). Rather than estimating the mean amount of receivables per account, the auditor might be more interested in the total amount of all receivables, summed over all total amount of all receivables, summed over all total accounts. In this section we provide a point estimate and a con�dence interval for a popula- tion total.

First, we introduce some notation. Let T be a population total we want to estimate, such as the total of all receivables, and let T̂ be a point estimate of T based on a simple random sample of size n from a population of size N. We �rst need a point estimate of T . For the population total T , it is reasonable to sum all of the values in the sample, denoted TsTsT , and then “project” this total to the population with Equation (8.5), where the second equality follows because the sample total TsTsT divided by the sample size n is the sample mean X.

Equation (8.5) is quite intuitive. For example, suppose there are 1000 accounts in the population, you sample 50 of them, and you observe a sample total of $5000. Then, because only 1/20 of the population was sampled, a natural estimate of the population total is 20 × $5000 = $100,000.

Like the sample mean X, the estimate T̂ has a sampling distribution. The mean and T has a sampling distribution. The mean and T standard deviation of this sampling distribution are given in Equations (8.6) and (8.7), where σ is again the population standard deviation.

Because σ is usually unknown, s is used instead of σ to obtain the approximate stand- ard error of  T̂ given in Equation (8.8). The second equality follows because s/!n!n!! is the standard error of X.

Note from Equation (8.6) that T̂ is an unbiased estimate of the population total T . Therefore, it has no tendency to either overestimate or underestimate T .

From equations (8.5) and (8.8), the point estimate of T is the point estimate of the mean multiplied by N , and the standard error of this point estimate is the standard error of the sample mean multiplied by N . We illustrate this procedure in the following example.

3This section can be omitted without any loss of continuity.

Point Estimate for Population Total

T̂ = N n

TsTsT = NXNXN (8.5)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-4 Confidence Interval for a Total 325

E X A M P L E 8.2 ESTIMATING TOTAL TAX REFUNDS

The Internal Revenue Service would like to estimate the total net amount of refund due to a particular set of 1,000,000 taxpayers. Each taxpayer will either receive a refund, in which case the net refund is positive, or will have to pay an amount due, in which case the net refund is negative. Therefore the total net amount of refund is a natural quantity total net amount of refund is a natural quantity total of interest; it is the net amount the IRS will have to pay out (or receive, if negative). Find a 95% confidence interval for this total using the refunds from a random sample of 500 taxpayers in the file IRS Refunds.xlsx.

Objective To find a 95% confidence interval for the total (net) amount the IRS must pay out to these 1,000,000 taxpayers.

Solution The data and the Excel-only method appear in Figure 8.6 (with many hidden rows). The formulas in column G spell out the method, which follows directly from Equations (8.5) and (8.8). Note in particular how the sample mean is multiplied by the population size in cell E4 and how the standard error of the mean is also multiplied by the population size in cell E7. The effect is to scale the usual confidence interval for the mean by the popula- tion size.

This confidence interval for the total can also be calculated with StatTools. The procedure is not shown here, but you can see it in the finished version of the IRS refunds file.

1 2 3 4 5 6 7 8 9

10 11 12 13

499 500 501

Customer A

1 2 3 4 5 6 7 8 9

10 11 12

498 499 500

Refund Excel-only confidence interval for total B CB C D ED E F HF HG IG IF HG IF HF HG IF H

$70 $1,190

$220 –$280

$260 $370 $450 $210

$1,150 $270 $470 –$10 $190

$1,840 –$20

1000000 500

$294,980,000 $581.31

$26.00 $25,997,048

95% 499

1.965 $243,902,836 $346,057,164

Popula�on size Sample size Es�mate of total Sample std dev Std Error of mean Std Error of total Confidence level Degrees of freedom t mul�ple Lower limit Upper limit

=COUNT(B2:B501) =E2*AVERAGE(B2:B501) =STDEV.S(B2:B501)=STDEV.S(B2:B501)=STDEV =E5/SQRT(E3) =E2*E6

=E3-1 =T.INV=T.INV=T .2T(1-E8,E9).INV.2T(1-E8,E9).INV =E4-E10*E7 =E4+E10*E7

Figure 8.6 Analysis of IRS Refund Data

© C

e n g

a g

e L

e a rn

in g

Based on these calculations, the IRS can be 95% confident that it will need to pay out somewhere between 244 and 346 million dollars to these 1,000,000 taxpayers. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

326 Chapter 8 Confidence Interval Estimation

8-5 CONFIDENCE INTERVAL FOR A PROPORTION How often have you heard on the evening news a survey �nding such as, “52% of the public agree with the president’s handling of the economy, with a sampling error of plus or minus 3%”? Surveys are often used to estimate proportions, such as the proportion of the public who agree with the president’s handling of the economy. We will now discuss how to form a con�dence interval for any population proportion p.

The basic procedure is very similar to the procedure for a population mean. It requires a point estimate, the standard error of this point estimate, and a multiple that depends on the con�dence level. Then the con�dence level has the same form as in Equation (8.1):

point estimate ± multiple × standard error In the news example the point estimate is 52% and the “multiple × standard error” is 3%. Therefore, the con�dence interval extends from 49% to 55%. Although the news show doesn’t state the con�dence level explicitly, it is 95% by convention. In words, they are 95% con�dent that the percentage of the public who agree with the president’s handling of the economy is somewhere between 49% and 55%.

P R O B L E M S

Level A 11. The file P02_16.xlsx contains the number of arrivals

at a turnpike tollbooth for each of four 5-minute inter- vals for each of 256 days. For this problem, assume that each column, such as arrivals from 8:00 am to 8:05 am, is a random sample of all arrivals from the corresponding hour of the day, such as 8:00 am to 9:00 am. Calculate a 95% confidence interval for the mean number of arrivals during each corresponding hour of the day, that is, one for 8:00 am to 9:00 am, one for 9:00 am to 10:00 am, and so on.

12. A lightbulb manufacturer wants to estimate the total number of defective bulbs contained in all of the boxes shipped by the company during the past week. Production personnel at this company have recorded the number of defective bulbs found in each of 50 randomly selected boxes shipped during the past week. These data are provided in the file P08_12.xlsx. Calculate a 95% confidence interval for the total number of defective bulbs contained in the 1000 boxes shipped by this company during the past week.

13. Auditors of a particular bank are interested in compar- ing the reported value of all 2265 customer savings account balances with their own findings regarding the actual value of such assets. Rather than reviewing the records of each savings account at the bank, the auditors decide to examine a representative sample of savings account balances. The population from which they will sample is given in the file P08_13.xlsx.

a. Select 10 simple random samples, each consisting of 100 savings account balances from this population.

b. For each sample generated in part a, calculate a 95% confidence interval for the total value of all 2265 savings account balances within this bank. How many of them include the (known) population total?

Level B 14. Suppose you are gambling on a roulette wheel. Each

time the wheel is spun, the result is one of the out- comes 0, 1, and so on through 36. Of these outcomes, 16 are red, 16 are black, and 1 is green. On each spin you bet $5 that a red outcome will occur and $1 that the green outcome will occur. If red occurs, you win a net $4. (You win $10 from red and nothing from green.) If green occurs, you win a net $24. (You win $30 from green and nothing from red.) If black occurs, you lose everything you bet for a loss of $6. a. Use simulation to generate 20 plays from this strategy.

Each play should indicate the net amount won or lost. Then, based on these 20 outcomes, calculate a 95% confidence interval for the total net amount won or lost from 1000 plays of the game. Would you conclude that this strategy is a winning one for you?

b. Repeat part a, but with slightly changed rules. Now your betting strategy is the same, but if red occurs, your net gain is $5 (you win $11 from red, nothing from green). Comment on whether this slight change makes much of a difference in the mean total from 1000 bets.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-5 Confidence Interval for a Proportion 327

Standard Error of Sample Proportion

SE( p̂) = Å p

Å p

Å ^(1 − p̂)

nÅ (8.9)

The theory that leads to this result is fairly straightforward. Let A be any property that members of a population either have or do not have. As examples, A might be the property that

■ a person agrees with the president’s handling of the economy

■ a person has purchased a company’s product at least once in the past three months

■ the diameter of a part is within speci�cation limits

■ a customer’s account is at least two months overdue

■ a customer’s rating of a new sandwich is at least 6 on a 10-point scale.

In each of these examples, let p be the proportion of the population with property A. From a random sample of size n, let p̂ be the sample proportion of members with property A. For example, if 10 out of 50 sampled members have property A, then p̂ = 10/50 = 0.2. Then p̂ is used as a point estimate of p.

It can be shown that for suf�ciently large n, the sampling distribution of p̂ is approxi- mately normal with mean normal with mean normal p and standard error !p!p! (1 − p)/n! . Because p is the unknown parameter, p̂ is substituted for p in this standard error to obtain the following approximate standard error of p̂:

Finally, the multiple used to obtain a con�dence interval for p is a Z-value. (It is not a not a not t-value.) It is the standard normal value that cuts off an appropriate probability in each tail. For example, the z-multiple for a 95% con�dence interval is 1.96 because this value cuts off probability 0.025 in each tail of the standard normal distribution. In general, the con�dence interval has the form in Equation (8.10):

This con�dence interval is based on the assumption of a large sample size. A rule of thumb for checking the validity of this assumption is the following. Let pL and pU be the lower and upper limits of the con�dence interval. Then the sample size is suf�- ciently large—and the con�dence interval is valid—if npnpn L > 5, n(1 − pL) > 5, npnpn U > 5, and n(1 − pU) > 5. Essentially, these mean that n should be reasonably large and the two values of p should not be too close to 0 or 1.

We illustrate the procedure in the following example.

E X A M P L E 8.3 ESTIMATING THE RESPONSE TO A NEW SANDWICH

The fast-food manager from Example 8.1 has already sampled 40 customers to estimate the population mean rating of the restaurant’s new sandwich. Recall that each rating is on a 1-to-10 scale, 10 being the best. The manager would now like to use the same sample to estimate the proportion of customers who rate the sandwich at least 6. Her thinking is that these are the customers who are likely to purchase the sandwich on subsequent visits.

Objective To illustrate the procedure for finding a confidence interval for the proportion of customers who rate the new sandwich at least 6 on a 10-point scale.

Confidence Interval for a Proportion

p̂ ± z-multiple × Å p

Å p

Å ^(1 − p̂)

nÅ (8.1 (8.10)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

328 Chapter 8 Confidence Interval Estimation

1 2 3 4 5 6 7 8 9

10 39 40 41

Customer Sa�sfac�on Confidence interval for propor�on of ra�ngs at least 6 A

r S 1 2 3 4 5 6 7 8 9

38 39 40

7 5 5 6 8 7 6 7

10 9 5 4

B CB C D ED E F HF HG IG IF HG IF HF HG IF H

Sample size Sample propor�on Std Error of propor�on Confidence level z mul�ple Lower limit Upper limit

=COUNT(B2:B41) =COUNTIF(B2:B41,">="&6)/E2 =SQRT(E3*(1-E3)/E2)

=NORM.S.INV(E5+(1-E5)/2) =E3-E6*E4 =E3+E6*E4

40 0.625 0.077

95% 1.960 0.475 0.775

Figure 8.7 Confidence Interval for Proportion

© C

e n g

a g

e L

e a rn

in g

Solution The solution appears in Figure 8.7. (See the file Satisfaction Ratings.xlsx.) Again, we will explain the Excel-only method, which is quite straightforward. The StatTools method is a bit tricky because it can accommodate several different formats for the sample data. It is not shown here, but you can find the details in the finished version of the file.

We explore this �nal statement a bit more. Referring again to news shows, you have probably noticed that they almost always quote a sampling error of plus or minus 3%. In words, the “plus or minus” part of their 95% con�dence interval is 3%, or 0.03. How large a sample size must they use to achieve this? The “plus or minus” part of the con�dence interval is 1.96 times the standard error of p̂, so we must have

1.96 × "p"p"^(1 − p̂)/n" = 0.03 Now, the quantity p̂(1 − p̂) is fairly constant for values of p̂ between 0 and 1, provided that p̂ isn’t too close to 0 or 1. To get a reasonable estimate of the required n, we use p̂ = 0.5. Then we have

1.96 × !(0.5) (0.5)/n! = 0.03 Solving for n, we obtain n = [(1.96) (0.5)/0.03]2 ≃ 1067.

The calculations in Figure 8.7 correspond exactly to Equation (8.10). Note in par- ticular how the sample proportion is calculated directly from the sample data with a COUNTIF function. Also, note the formula for the z multiple in row 6. The argument for the NORM.S.INV function is 95% + 5%/2, or 97.5%. The effect is to find the value that cuts off 2.5% in the right tail. You will see this type of calculation quite often.

The output is fairly good news for the manager. Based on this sample of size 40, she can be 95% confident that the percentage of all customers who would rate the sandwich 6 or higher is somewhere between 47.5% and 77.5%. Of course, she realizes that this is a very wide interval, so there is still a lot of uncertainty about the true population proportion. To reduce the length of this interval, she would need to sample more customers—quite a few more customers. Typically, confidence intervals for proportions are fairly wide unless n is quite large. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-5 Confidence Interval for a Proportion 329

Sample Size for Estimating a Proportion

To obtain an estimate of a proportion that is accurate to within 3 percentage points with 95% confidence, it is sufficient to sample approximately 1000 members of the population, regardless of the population size. This remarkable fact allows news broadcasters to make such statements about various proportions on a nightly basis. By sampling only about 1000 people from the entire country, they can estimate quite accurately what the entire population believes.

F u n da m e n ta l I n s i g h t

This is a rather remarkable result. To obtain a 95% con�dence interval of this length for a population proportion, where the population consists of millions of people, only about 1000 people need to be sampled. The remarkable fact is that this small a sample can pro- vide such accurate information about such a large population.

One of many business applications of con�dence intervals for proportions is in audit- ing. Auditors typically use attribute sampling to check whether certain procedures are being fol- lowed correctly. The term “attribute” means that each item checked is done either correctly or incor- rectly—there is no in-between. Examples of items not done correctly might include (1) an invoice copy that is not initialed by an accounting clerk, (2) an invoice quantity that does not agree with the quan- tity on the shipping document, (3) an invoice price that does not agree with the price on an authorized price list, and (4) an invoice with a clerical inaccu- racy. Typically, an auditor focuses on one of these types of errors and then estimates the proportion of items with this type of error.

Because auditors are concerned primarily with how large the proportion of errors might be, they usually calculate one-sided con�dence intervals for one-sided con�dence intervals for one-sided

proportions. Instead of using sample data to �nd lower and upper limits pL and pU of a con- �dence interval, they automatically use pL = 0 and then determine an upper limit pU such that the 95% con�dence interval is from 0 to pU. A simple modi�cation of the con�dence interval in Equation (8.10) provides the result in Equation (8.11), where the z-multiple is chosen so that the entire probability (0.05 for a 95% interval) is in the right-hand tail. For a 95% con�dence level, the relevant z-multiple is 1.645.

One further complication occurs, however. This formula for pU relies on the large- sample approximation of the normal distribution to the binomial distribution. Auditors typically use an exact procedure to �nd exact procedure to �nd exact pU that is based directly on the binomial distribu- tion. We illustrate how this is done in the following example.

Upper Limit of a One-Sided Confidence Interval for a Proportion

pU = p̂ + z-multiple × "p"p"^(1 − p̂)/n" (8.11)

E X A M P L E 8.4 AUDITING FOR PRICE ERRORS

An auditor wants to check the proportion of invoices that contain price errors—that is, prices that do not agree with those on an authorized price list. He checks 93 randomly sampled invoices and finds that two of them include price errors. What can he conclude, in terms of a one-sided 95% confidence interval, about the proportion of all invoices with price errors?

Objective To find the upper limit of a one-sided 95% confidence interval for the propor- tion of errors in the context of attribute sampling in auditing.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

330 Chapter 8 Confidence Interval Estimation

Formula for Upper Confidence Limit P(X ≤ k) = α (8.12)

Figure 8.8 Analysis of Auditing Example

© C

e n g

a g

e L

e a rn

in g

Solution The results appear in Figure 8.8. (See the file One-Sided Confidence Interval.xlsx.) The sample proportion is p = 2/93 = 0.0215 and the upper confidence limit based on the large- sample approximation is 0.046. This latter value is calculated in cell B14 with the formula

=B7+B13*SQRT(B7*(1-B7)/B5) However, note that npnpn U = 93(0.046) = 4.278, which is less than 5. This indicates that the large-sample approximation might not be valid.

A more valid procedure, based on the binomial distribution, appears in row 10. It turns out that if pU is the appropriate upper confidence limit, then pU satisfies the following equation.

Here, X is binomially distributed with parameters X is binomially distributed with parameters X n and pU, k is the observed number of k is the observed number of k errors, and α is one minus the confidence level. There is no way to find pU directly (by means of a formula) from Equation (8.12). However, you can use Excel’s Goal Seek tool, as illustrated in the figure. First, enter any trial value of pU in cell B10 and the binomial formula

=BINOM.DIST(B4,B5,B10,TRUE)

in cell D10. [This formula calculates P(X ≤ k) from the trial value in cell B10.] Then use Goal Seek from the What-If Analysis dropdown menu on the Data ribbon, with cell D10 as the Set cell, 0.05 as the target value, and cell B10 as the changing cell.

The resulting value of pU is 0.066. This is considerably different (from the auditor’s point of view) from the 0.046 value found from the large-sample approximation. It allows the auditor to state with 95% confidence that the percentage of invoices with price errors is no greater than 6.6%, based on the two errors out of 93 observed in the sample. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-6 Confidence Interval for a Standard Deviation 331

P R O B L E M S

Level A 15. A drugstore manager needs to purchase adequate

supplies of various brands of toothpaste to meet the ongoing demands of its customers. In particular, the company is interested in estimating the proportion of its customers who favor the country’s leading brand of toothpaste, Crest. The Data sheet of the file P08_15 .xlsx contains the toothpaste brand preferences of 200 randomly selected customers, obtained recently through a customer survey. Calculate a 95% confidence interval for the proportion of all of the company’s customers who prefer Crest toothpaste. How might the manager use this confidence interval for purchasing decisions?

16. The same data as in the previous problem are stored in a different format in the last two sheets of the file P08_15.xlsx. a. Use StatTools to find a 95% confidence interval

for the proportion who favor Crest from the data in the Counts sheet. Using this same data on counts, calculate the confidence interval directly from the appropriate formulas, without using StatTools.

b. Use StatTools to find a 95% confidence interval for the proportion who favor Crest from the data in the proportions sheet. Using this same data on proportions, calculate the confidence interval directly from the appropriate formulas, without using StatTools.

17. The employee benefits manager of a large public university would like to estimate the proportion of full-time employees who prefer adopting the first (plan A) of three available health care plans in the next annual enrollment period. A random sample of the university’s employees and their tentative health care preferences are given in the file P08_17.xlsx. a. Calculate a 90% confidence interval for the

proportion of all the university’s employees who favor plan A.

b. The file also includes the classification of each employee (administrative staff, support staff, or faculty). Calculate a separate 90% confidence interval for each of these groups for the proportion who favor plan A. How do these confidence intervals compare to one another? How do their lengths compare to the confidence interval in part a? Is this what you would expect? Explain.

18. A market research consultant hired by a leading soft- drink company wants to determine the proportion of consumers who favor its low-calorie brand over the leading low-calorie competitor in a particular geo- graphic region. A random sample of 250 consumers from the market under investigation is provided in the file P08_18.xlsx. a. Calculate a 90% confidence interval for the

proportion of all consumers in this market who prefer the company’s brand.

b. The file contains the gender and age group for each customer in the sample. Calculate a separate 90% confidence for each gender for the proportion who prefer the company’s brand. Then do the same for each age group. Explain briefly how these confidence intervals compare to each other and to the confidence interval in part a.

Level B 19. Starting with the data from problem 17 in the file

P08_17.xlsx, restructure the data so that you have a table of counts. Then use StatTools on the counts to answer the same questions as in problem 17.

20. Starting with the data from problem 18 in the file P08_18.xlsx, restructure the data so that you have a table of proportions. Then use StatTools on the proportions to answer the same questions as in problem 18.

8-6 CONFIDENCE INTERVAL FOR A STANDARD DEVIATION 4

In Section 8-3 we focused primarily on estimation of a population mean. We had to deal with the population standard deviation σ in its role as a nuisance parameter. That is, we needed an estimate of σ to estimate the standard error of the sample mean. However, there are cases where the variability in the population, measured by σ, is of interest in its own right. We brie�y describe a procedure for obtaining a con�dence interval for σ in this section.

The theory is somewhat more complex than for the case of the mean. As you might expect, the sample standard deviation s is used as a point estimate of σ. However, the

4This section can be omitted without any loss of continuity.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

332 Chapter 8 Confidence Interval Estimation

CHANGES IN EXCEL 2010

These chi-square functions were changed considerably in Excel 2010. There are now CHISQ. DIST and CHISQ.INV functions for left tails, and CHISQ.left tails, and CHISQ.left DIST has a last “cum” argument just like NORM.DIST and T.DIST. Also, there are two functions, CHISQ.DIST.RT and CHISQ.INV.RT, for right tails.right tails.right

sampling distribution of s is not symmetric—in particular, it is not the normal distribution or the t distribution. Rather, the appropriate sampling distribution is a right-skewed distrit distribution. Rather, the appropriate sampling distribution is a right-skewed distrit - bution called the chi-square distribution. Like the t distribution, the chi-square distribu- tion has a degrees of freedom parameter, which (for this procedure) is again n − 1.

Tables of the chi-square distribution, for selected degrees of freedom, appear in many statistics books, but the necessary information can be obtained more easily with Excel’s chi-square functions, as illustrated in Figure 8.9. (See the �le Chi-Square Calculations Finished.xlsx.)

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18

Calcula�ons for the chi-square distribu�on A B CB C D E F HF HG JG JF HG JF HF HG JF HG JIG J

Sample size Degrees of freedom

One-tailed probabili�es Value Probability in le� tail

Value Probability in right tail

Inverse calcula�ons Probabiity in le� tail Value

Probabiity in right tail Value

30 29

20 0.107

45 0.029

0.05 17.708

0.05 42.557

Formulas in Excel 2010 (or later)

=CHISQ.DIST(B7,B4,TRUE)

=CHISQ.DIST.RT(B10,B4)

=CHISQ.INV(B14,B4)

=CHISQ.INV.RT(B17,B4=CHISQ.INV.RT(B17,B4=CHISQ.INV )

Formulas using “old” CHI func�ons

=1-CHIDIST(B7, B4)

=CHIDIST(B10,B4)

=CHIINV(1-B14,B4)

=CHIINV(B17,B4)

D E

© C

e n g

a g

e L

e a rn

in g

Because of the skewness of the sampling distribution of s, a con�dence interval for σ is not centered at not centered at not s. That is, the con�dence interval is not the point estimate plus or minus not the point estimate plus or minus not a multiple of a standard error. Instead, s is always closer to the left endpoint of the con�- dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the population standard deviation extends from s" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

(n − 1)/c1 dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

to s" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

(n − 1)c2 dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

" dence interval than to the right endpoint. Speci�cally, the endpoints of a con�dence for the

. Here, c1 is the value that cuts off probability (1 − α)/2 in the right tail of the chi-square distribution with right tail of the chi-square distribution with right n − 1 degrees of freedom, and c2 similarly cuts off probability (1 − α)/2 in the left tail. For left tail. For left example, if the con�dence level is 95%, these values cut off probability 0.025 in each tail. Note that c1 is larger than larger than larger c2, so the left endpoint of the con�dence interval is indeed lower than the right endpoint. The procedure is illustrated in the following example.

Figure 8.9 Excel Functions for the Chi-Square Distribution

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-6 Confidence Interval for a Standard Deviation 333

E X A M P L E 8.5 ANALYZING VARIABILITY IN DIAMETERS OF MACHINE PARTS

Amachine produces parts that are supposed to have diameter 10 centimeters. However, due to inherent variability, some diameters are greater than 10 and some are less. The production supervisor is concerned about two things. First, he is concerned that the mean diameter is not what it should be, 10 centimeters. Second, he is worried about the extent of variability in the diameters. Even if the mean is on target, excessive variability implies that many of the parts will fail to meet specifications. To analyze the process, he randomly sam- ples 50 parts during the course of a day and measures the diameter of each part to the near- est millimeter. The results are shown in columns A and B of Figure 8.10. (See the file Part Diameters.xlsx.) Should the supervisor be concerned about the results from this sample?

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 48 49 50 51

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 47 48 49 50

10.031 10.011 10.003 10.025 10.048 10.014 10.030 10.008 10.049

9.995 9.965

10.003 9.959

10.013 10.012 10.005

9.921 9.930 9.990 9.948

10.077 9.959

10.000 9.998 9.983 9.995 9.917 9.934

10.044 10.023 10.006 10.009

9.973 9.970

50 9.996 0.034 0.005

95% 49

2.010 9.986

10.005

Sample size Sample mean Sample std dev Std error of mean Confidence level (mean) Degrees of freedom t mul ple Lower limit (mean) Upper limit (mean)

Part Diameter Excel-only confidence intervals for mean and standard devia on A

r E B CB C D E F HG JG JF HG JF HF HG JF H K LG JIG J

Confidence level (std dev) Degrees of freedom Lower chi-sq value Upper chi-sq value Lower limit (std dev) Upper limit (std dev)

95% 49

31.5549 70.2224

0.0287 0.0427

=E2-1 =CHISQ.INV((1-E12)/2,E13) =CHISQ.INV.RT((1-E12)/2,E13)=CHISQ.INV.RT((1-E12)/2,E13)=CHISQ.INV =SQRT(E13)*E4/SQRT(E15) =SQRT(E13)*E4/SQRT(E14)

Same formulas as before for mean

Propor on of unusable parts Maximum devia on for usability Assumed mean Assumed standard devia on Propor on unusuable

0.065 10

0.043 0.131

0.131 9.986 9.996

10.005

0.029 0.041 0.025 0.026

0.034 0.080 0.060 0.061

0.043 0.149 0.130 0.131

Assumed mean

Assumed standard devia on

=NORMDIST(10-E20,E21,E22,1)+(1-NORMDIST(10+E20,E21,E22,1))

Twoway data table for finding propor on unusable as a func on of mean and stdev

K LF HD E r E

Figure 8.10 Analysis of Parts Data

© C

e n g

a g

e L

e a rn

in g

Objective To find a confidence interval for the standard deviation of part diameters, and to see how variability affects the proportion of unusable parts produced.

Solution Because the manager is concerned about the mean and the standard deviation of diameters, and the standard deviation of diameters, and it is useful to obtain 95% confidence intervals for both. This is easy to do with StatTools’s One-Sample Confidence Interval procedure for Mean/Std. Deviation, as shown in the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

334 Chapter 8 Confidence Interval Estimation

P R O B L E M S

Level A 21. Senior management of a large consulting firm is con-

cerned about a growing decline in the organization’s weekly number of billable hours. Ideally, the organiza- tion expects each professional employee to spend at least 40 hours per week on work. The file P08_21.xlsx contains the work hours reported by a random sample of employees in a typical week. a. Calculate a 95% confidence interval for the

mean number of hours worked by the company’s employees in a typical week.

b. Calculate a 95% confidence interval for the standard deviation of the number of hours worked by the company’s employees in a typical week.

c. Given the target range of 40 to 60 hours of work per week, should senior management be concerned about the number of hours their employees are currently devoting to work? Explain how the

answers to both parts a and b help to answer this question.

Level B 22. The file P08_06.xlsx contains data on repetitive task

times for each of two workers. John has been doing this task for months, whereas Fred has just started. Each time listed is the time (in seconds) to perform a routine task on an assembly line. The times shown are in chronological order. a. Calculate a 95% confidence interval for the

standard deviation of times for John. Do the same for Fred. What do these indicate?

b. Given that these times are listed chronologically, how useful are the confidence intervals in part a? Specifically, is there any evidence that the variation in times is changing over time for either of the two workers?

finished version of the file. Figure 8.10 illustrates how it can be done with Excel formulas only. The top part of the output in Figure 8.10 (through cell E9) provides a 95% confi- dence interval for the mean. This confidence interval extends from 9.986 cm to 10.005 cm. Therefore, there is probably not too much cause for concern about the mean. The supervi- sor can be fairly confident that the mean diameter of all parts is close to 10 cm.

The bottom part of the output (the range E12:E17) provides a 95% confidence interval for the standard deviation of diameters. Note how it first calculates the two chi-square val- ues that cut off probability 0.025 in each tail and then uses these to calculate the endpoints of the confidence interval. This interval extends from 0.029 cm to 0.043 cm. Is this good news or bad news? It depends. Let’s say that a part is unusable if its diameter is more than 0.065 cm from the target. Let’s also assume that the true mean is right on target and that the standard deviation is at the upper end of the confidence interval, that is, upper end of the confidence interval, that is, upper σ = 0.043 cm. Finally, assume that the population distribution of diameters is normal. Then the calcula- tion in cell E23 shows that 13.1% of the parts will be unusable. It adds the normal prob- abilities of being below or above the usable range.

To pursue this analysis one step further, a two-way data table in the range E27:H30 is useful. The means used in column E are the lower confidence limit, the sample mean, and the upper confidence limit. Similarly, the assumed standard deviations used in row 27 are the lower confidence limit, the sample standard deviation, and the upper confidence limit. To form the table, enter the formula =E23 in cell E27, highlight the range E27:H30, and create a data table with cells E22 and E21 as the row and column input cells.

Each value in the body of the data table is the resulting proportion of unusable parts. Obviously, a mean close to the target and a small standard deviation are best, but even this best-case scenario results in 2.5% unusable parts (see cell F29). However, a mean off target and a large standard deviation can lead to as many as 14.9% unusable parts (see cell H28). In any case, the message for the supervisor is clear—he must work to reduce the underlying variability in the process. This variability is hurting him much more than an off-target mean. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-7 Confidence Interval for the Difference between Means 335

8-7 CONFIDENCE INTERVAL FOR THE DIFFERENCE BETWEEN MEANS

One of the most important applications of statistical inference is the comparison of two population means. There are many applications to business, including the following.

Applications of Comparisons of Means in Business

■ Men and women shop at a retail clothing store. The manager would like to know how much more (or less), on average, a woman spends on a typical purchase occasion than a man.

■ Two airline companies �y similar routes. A consumer organization would like to check how much the average delay differs between the two airlines, where delay is de�ned as the actual arrival time at the destination minus the scheduled arrival time.

■ A supermarket chain mails coupons for various products to a randomly selected sub- set of its customers in a particular city. Its other customers in this city receive no such coupons. The chain would like to check how much the average amount spent on these products differs between the two sets of customers over the next couple of months.

■ A computer company has a customer service center that responds to customers’ questions and complaints. The center employs two types of people: those who have had a recent course in dealing with customers (but little actual experience) and those with a lot of experience dealing with customers (but no formal course). The company would like to know how these two types of employees differ with respect to the average number of customer complaints of poor service in the last six months.

■ A consulting company hires business students directly out of undergraduate school. The new hires all take a problem-solving test. They then go through an intensive three-month training program, after which they take another similar problem-solving test. The com- pany wants to know how much the average test score improves after the training program.

■ A car dealership often deals with husband–wife pairs shopping for cars. To check whether husbands react differently than their wives to the sales presentation, husbands and wives are asked (separately) to rate the quality of the sales presentation. The dealership wants to know how much husbands differ from their wives in terms of average ratings.

Each of these examples deals with a difference between means from two populations. However, the �rst four examples differ in one important respect from the last two. In the last two examples, there is a natural pairing across the two samples. In the �rst of these, each employee takes a test before a course and then a test after the course, so that each employee is naturally paired with himself or herself. In the �nal example, husbands and wives are naturally paired with one another. There is no such pairing in the �rst four exam- ples. Instead, we assume that the samples in these �rst four examples are chosen inde- pendently of one another. For statistical reasons we need to distinguish these two cases, independent samples and paired samples, in the discussion that follows.

8-7a Independent Samples

The framework for this situation is the following. We are interested in some quantity, such as dollars spent or airplane delay, for each of two populations. The population means are μ1 and μ2, and the population standard deviations are σ1 and σ2. We take random samples of sizes n1 and n2 (which need not be equal) from the populations to estimate the differ- ence between means, μ1 − μ2. A point estimate of this difference is the natural one, the difference between sample means, X1 − X2X2X . Starting with this estimate, we want to form a con�dence interval for the unknown population mean difference, μ1 − μ2.

Statisticians call these general types of problems “comparison problems.” They are among the most important types of problems tackled with statistical methods.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

336 Chapter 8 Confidence Interval Estimation

Confidence Interval for Difference Between Means X1 − X2X2X ± t-multiple × SESES (X1 − X2X2X ) (8.13)

Pooled Estimate of Common Standard Deviation

sp = Å (n1 − 1)s

2 1 + (n2 − 1)s

2 2

n1 + n2 − 2Å (8.14)

Standard Error of Difference Between Sample Means

SE1X1 − X2X2X 2 = spÅ 1 n1

+ 1 n2Å

(8.15)

It can be shown mathematically that the appropriate sampling distribution of the dif-It can be shown mathematically that the appropriate sampling distribution of the dif-It can be shown mathematically that the appropriate sampling distribution of the dif ference between sample means is again the t distribution, now with t distribution, now with t n1 + n2 − 2 degrees of freedom.5 ference between sample means is again the

5 ference between sample means is again the

Therefore, a con�dence interval for μ1 − μ2 is given by Expression (8.13). The t-multiple is the value that cuts off the appropriate probability (depending on the con- �dence level) in each tail of the t distribution with t distribution with t n1 + n2 − 2 degrees of freedom. For example, if the con�dence level is 95% and n1 = n2 = 30, the appropriate t-multiple is 2.002, which can be found in Excel with the function T.INV(0.025,58).

The standard error, SE(X1 − X2X2X ), is more involved. We must �rst make the assump- tion that the population standard deviations are equal, that is, σ1 = σ2. (We shortly present an alternative procedure for the situation where the population standard deviations are not assumed to be equal.) Then an estimate of this common standard deviation is provided by the “pooled” estimate from both samples, labeled sp.

Here, s1 and s2 are the sample standard deviations from the two samples. This pooled estimate is somewhere between s1 and s2, with the relative sample sizes determining its exact value. Then the standard error of X1 − X2X2X is given by Equation (8.15):

This procedure, usually referred to as “two-sample t,” is illustrated in the following example.

5This assumes that either the population distributions are normal or that the sample sizes are reasonably large, conditions that are at least approximately met in a wide variety of applications.

E X A M P L E 8.6 RELIABILITY OF TREADMILL MOTORS AT SURESTEP

SureStep Company manufactures high-quality treadmills for use in exercise clubs. SureStep currently purchases its motors for these treadmills from supplier A. However, it is considering a change to supplier B, which offers a slightly lower cost. The only ques- tion is whether supplier B’s motors are as reliable as supplier A’s. To check this, SureStep installs motors from supplier A on 30 of its treadmills and motors from supplier B on another 30 of its treadmills. It then runs these treadmills under typical conditions and, for each treadmill, records the number of hours until the motor fails. The data from this experiment appear in Figure 8.11. (See the file Treadmill Motors.xlsx.) What can SureStep conclude?

Objective To find a confidence interval for the difference between mean lifetimes of motors, and to see how this confidence interval can help SureStep choose the better supplier.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-7 Confidence Interval for the Difference between Means 337

Figure 8.11 Analysis of Treadmill Motors Data

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 29 30 31

1358 793 587 608 472 562 879 575

1293 1457

705 623 725 569 424 791 684 666

658 404 735 457 431 658 453 488 522

1247 1095

430 726 793 498 846 732 507

Summary measures Sample size Sample mean Sample std dev

Sample mean diff Confidence level Degrees of freedom

Pooled std dev Std error of diff t mul�ple Lower limit Upper limit

Supplier A 30

748.8 283.881

93.133 95%

58

272.196 70.281

2.002 –47.549 233.815

Supplier B 30

655.667 259.986

=E4-F4

=E3+F3-2

=SQRT(((E3-1)*E5^2+(F3-1)*F5^2)/E9) =E11*SQRT(1/E3+1/F3) =T.INV=T.INV=T .2T(1-E8,E9).INV.2T(1-E8,E9).INV =E7-E13*E12 =E7+E13*E12

Supplier A Supplier B Excel-only confidence interval for difference between means A B C D E F HF HG JF HG JF HG JIG JG JG JG JF HG JF HD EB C

Solution In any comparison problem it is a good idea to look initially at side-by-side box plots of the two samples. These appear in Figure 8.12. These show that (1) the distributions of times until failure are skewed to the right for each supplier, (2) the mean for supplier A is some- what greater than the mean for supplier B, and (3) there are several outliers. There seems to be little doubt that supplier A’s motors will last longer on average than supplier B’s—or is there? A confidence interval for the mean difference allows you to see whether the dif-is there? A confidence interval for the mean difference allows you to see whether the dif-is there? A confidence interval for the mean difference allows you to see whether the dif ferences apparent in the box plots can be generalized to all motors from the two suppliers.all motors from the two suppliers.all

You can find this confidence interval with Excel formulas only, as spelled out in Figure 8.11. The top part of the output summarizes the two samples. It shows that the sample means differ by approximately 93 hours and the sample standard deviations are of roughly the same magnitude.

Figure 8.12 Box Plots for Treadmill Motors Data

© C

e n g

a g

e L

e a rn

in g

Box Plots (Supplier A on the le )

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

338 Chapter 8 Confidence Interval Estimation

The confidence interval calculations appear in the range E7:E15. The difference between sample means is 93.133 hours, the pooled standard deviation from Equation (8.14) is 272.196, the standard error of the sample mean difference from Equation (8.15) is 70.281 hours, and a 95% confidence interval for the mean difference extends from −47.549 to 233.815 hours. Not only is this interval quite wide, but it extends from a nega- tive value to a positive value. If SureStep had to make a guess, it would say that supplier A’s motors last longer on average than supplier B’s. But because of the negative part of the confidence interval, there is still a possibility that the opposite is true.

You can also use StatTools to find this confidence interval, as illustrated in the finished version of the file. A benefit of StatTools is that it creates two confidence intervals, as explained in the next subsection.

StatTools Tip: Stacked versus Unstacked Data Sets The data are “unstacked” because there are separate columns for supplier A’s times and supplier B’s times. The Format button in the StatTools dialog box allows you to select the appropriate option: Stacked or Unstacked.

Should SureStep continue with supplier A? This depends on the trade-off between the cost of the motors and warranty costs (and any other relevant costs). Because the war- ranty probably depends on whether a motor lasts a certain amount of time, warranty costs probably depend on a proportion (the proportion that fail before 500 hours, say) rather than a mean. Confidence intervals for differences between proportions are discussed in Section 8-8. ■

Equal-Variance Assumption This two-sample analysis makes the strong assumption that the standard deviations (or variances) of the two populations are equal. How can you tell if they are equal, and what do you do if they are clearly not equal?not equal?not

To check whether they are equal, �rst look at the two sample standard deviations. If they are of widely different magnitudes, this certainly casts doubt on the equal-vari- ance assumption. The sample standard deviations in the treadmill example, 283.881 and 259.986, are of similar magnitudes and present no clear evidence of unequal population variances. However, a statistical test for equality of two population variances is automati- cally shown at the bottom of the StatTools Two-Sample output. Because we have not yet discussed hypothesis testing, we postpone the discussion of this test for now. Suf�ce it to say that the test presents no evidence of unequal variances for this example.

However, if there is reason to believe that the population variances are not equal, then a not equal, then a not slightly different procedure can be used to calculate a con�dence interval for the difference between means. The appropriate standard error of X1 − X2X2X is now

SE1X1 − X2X2X 2 = "s"s" 21/n1 + s22/n2" and the degrees of freedom used to �nd the t-multiple is given by a complex expression not shown here.

StatTools’s Two-Sample procedure automatically calculates the con�dence interval under this unequal-variance assumption. For the treadmill example the results are in col- umn G of the �nished version of the treadmill motors �le. In this example they are exactly the same as the results in Figure 8.11, which makes the equal-variance assumption. This is a consequence of equal sample sizes and roughly equal sample variances. In general, the two results differ appreciably only when the sample sizes and the sample variances differ and the sample variances differ and considerably across samples.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-7 Confidence Interval for the Difference between Means 339

Role of Variances in Estimating the Difference between Means It might be surprising that variances (or standard deviations) play such an important role in estimat- ing the difference between means, but this is actually

quite intuitive. If there is a lot of variability in the pop- ulations, it is more difficult to get accurate estimates of the population means, and hence the difference between the means. But if there is very little variabil- ity, it is much easier to estimate the means accurately.

F u n da m e n ta l I n s i g h t

8-7b Paired Samples

When the samples to be compared are paired in some natural way, such as a pre-test and post-test for each person, or husband–wife pairs, there is a more appropriate form of analy- sis than the two-sample procedure. Consider the example where each new employee takes a test, then receives a three-month training course, and afterward takes another similar test. There is likely to be a fairly strong correlation between the pre-test and post-test scores. Employees who score relatively low on the �rst test are likely to score relatively low on the second test, and employees who score relatively high on the �rst test are likely to score relatively high on the second test. The two-sample procedure in the previous section for independent samples does not take this correlation into account and therefore ignores important information. The paired procedure described in this section, on the other hand, uses this information to advantage.

The procedure itself is very straightforward. It does not directly analyze two separate variables (pre-test scores and post-test scores, say); it analyzes their differences. For each pair in the sample, the difference between the two scores for the pair is calculated. Then a one-sample analysis, as in Section 8-3, is performed on these differences. This is illustrated in the following example.

E X A M P L E 8.7 HUSBAND AND WIFE REACTIONS TO SALES PRESENTATIONS

Stevens Honda-Buick automobile dealership often sells to husband-wife pairs. The manager would like to check whether the sales presentation is viewed any more or less favorably by the husbands than by the wives. If it is, then some new training might be rec- ommended for its salespeople. To check for differences, a random sample of husbands and wives are asked (separately) to rate the sales presentation on a scale of 1 to 10, 10 being the most favorable rating. The results appear in Figure 8.13. (See the Sales Presentation Ratings.xlsx file.) What can the manager conclude from these data?

Objective To use a paired-sample procedure to find a confidence interval for the mean difference between husbands’ and wives’ ratings of sales presentations.

Solution The Excel-only procedure is straightforward, as illustrated in Figure 8.13. We first create a new variable in column D called Difference by entering the formula

=B2-C2

in cell D2 and copying it down column D. This new variable is, for each couple, the hus- band’s rating minus the wife’s rating. We then calculate a confidence interval for the mean of the differences, exactly as in Section 8.3. This produces the output shown in Figure 8.13. The sample mean Husband minus Wife difference is 1.629 and a 95% confidence interval for this difference extends from 1.057 to 2.200.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

340 Chapter 8 Confidence Interval Estimation

You could create side-by-side box plots of the husband and wife scores. However, these box plots are not as useful here as in the two-sample procedure because you lose sight of which husbands are paired with which wives. A more useful box plot is of the differences, shown in Figure 8.13. Here it is apparent that the sample mean difference is positive, and even more importantly, the vast majority of husband scores are greater than the corresponding wife scores. There is little doubt that most husbands tend to react more favorably to the sales presentations than their wives. Perhaps the salespeople need to be somewhat more sensitive to their female customers.

Before leaving this example, we again note that the finished version of the file indi- cates how StatTools can be used. Among other things, it shows what would have hap- pened if the two-sample procedure had been used on the Husband and Wife variables. Because there is a considerable difference between the sample standard deviations, it is best to use the form of the confidence interval that does not assume equal variances. The not assume equal variances. The not important point, however, is that the resulting confidence interval for the mean difference extends from 0.895 to 2.362, which is somewhat longer than the confidence interval from longer than the confidence interval from longer the paired-sample procedure. This is typical. When the two-sample procedure is used in a situation where the paired-sample procedure is more appropriate, the data are not used as efficiently. The effect is that the standard error of the difference tends to be larger, and the resulting confidence interval tends to be longer.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 34 35 36

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 33 34 35

6 7 8 6 8 7 8 6 7 7 6 5 8 7 7 7 6 5 6 9 7 9 6 7 7

10

Pair Husband 3 8 5 4 5 6 5 7 8 5 3 4 5 8 5 6 5 4 5

10 9 6 5 5 4 5

Wife A BA B C D E F G JHG JHG JIG JC D

3 1

3 2 3 1 3

1 1

2 3 1 3

1 2 1 1 1 1

1 2

3 1 2 3 5

Sample size Sample mean Sample Std Dev Std Error of mean Confidence level Degrees of freedom t mul�ple Lower limit Upper limit

35 1.629 1.664 0.281

95% 34

2.032 1.057 2.200

Difference Excel-only confidence interval for mean difference G JG JG JE F

Box Plot of Differences 6 5 4 3 2 1 0

1 2 3

Figure 8.13 Sales Presentation Analysis

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-7 Confidence Interval for the Difference between Means 341

Why is the paired-sample procedure appropriate here? It is not just because husbands not just because husbands not and wives naturally come in pairs. It is because they tend to react similarly to one another. You can check that the correlation between the husbands’ scores and their wives’ scores is 0.442. (This can be found with Excel’s CORREL function on the Husband and Wife variables.) This is far from a perfect correlation, but it is large enough to warrant using the paired-sample procedure. ■

In general, the paired-sample procedure is appropriate when the samples are naturally paired in some way and there is a reasonably large positive correlation between the pairs. and there is a reasonably large positive correlation between the pairs. and In this case the paired-sample procedure makes more ef�cient use of the data and generally results in narrower con�dence intervals.

P R O B L E M S

Level A 23. The director of a university’s career develop-

ment center is interested in comparing the start- ing annual salaries of male and female students who recently graduated from the university and commenced full-time employment. The director has formed pairs of male and female graduates with the same major and similar grade-point averages. Specifically, she has collected a random sample of 50 such pairs and has recorded the starting annual salary of each per- son. These data are provided in the file P08_23.xlsx. Calculate a 95% confidence interval for the mean dif- confidence interval for the mean dif- confidence interval for the mean dif ference between similar male and female graduates of this university. Interpret your result.

24. A real estate agent has collected a random sample of 75 houses that were recently sold in a suburban community. She is particularly interested in compar- ing the appraised value and recent selling price of the houses in this particular market. The data are provided in the file P08_24.xlsx. Using this sample data, calcu- late a 95% confidence interval for the mean difference between the appraised values and selling prices of the houses sold in this suburban community. Interpret the confidence interval for the real estate agent.

25. The Wall Street Journal CEO Compensation Study ana- lyzed CEO pay from many U.S. companies with fiscal year 2008 revenue of at least $5 billion that filed their proxy statements between October 2008 and March 2009. The data are in the file P02_30.xlsx. a. Create a new column, Total, that is the sum of

columns D and E. b. After combining Telecommunications and

Technology into a single company type, there are nine company types. For each of these, calculate a 95% confidence interval for the difference between the mean of Total for that company type and mean of Total for all other company types. Comment on what these nine confidence intervals indicate about CEO pay in different industries.

Level B 26. The file P02_35.xlsx contains data from a survey of

500 randomly selected households. a. Separate the households in the sample by the

location of their residence within the given community. For each of the four locations, use the sample information to calculate a 90% confidence interval for the mean annual income (sum of first income and second income) of all relevant households. Compare these four interval estimates. You might also consider generating box plots of the total income for households in each of the four locations.

b. Calculate a 90% confidence interval for the difference between the mean annual income of all households in the first (i.e., SW) and second (i.e., NW) sectors of this community. Calculate similar 90% confidence intervals for the differences between the mean annual income levels of all households from all other pairs of locations (i.e., first and third, first and fourth, second and third, second and fourth, and third and fourth). Summarize your findings.

27. A company employs two shifts of workers. Each shift produces a type of gasket where the thickness is the critical dimension. The average thickness and the standard deviation of thickness for shift 1, based on a random sample of 30 gaskets, are 10.53 mm and 0.14 mm. The similar figures for shift 2, based on a random sample of 25 gaskets, are 10.55 mm and 0.17 mm. Let μ1 − μ2 be the mean difference in thickness between shifts 1 and 2. a. Calculate a 95% confidence interval for μ1 − μ2. b. Based on your answer to part a, are you convinced

that the gaskets from shift 2 are, on average, wider than those from shift 1? Why or why not?

c. How would your answers to parts a and b change if the sample sizes were instead 300 and 250?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

342 Chapter 8 Confidence Interval Estimation

Confidence Interval for Difference Between Proportions p̂1 − p̂2 ± z-multiple × SE( p̂1 − p̂2) (8.16)

8-8 CONFIDENCE INTERVAL FOR THE DIFFERENCE BETWEEN PROPORTIONS

The �nal con�dence interval we examine is a con�dence interval for the difference between two population proportions. As in the previous section, this comparison procedure �nds many real applications. Several potential business applications follow.

Applications of Comparisons of Proportions in Business

■ When an appliance store is about to have a sale, it sometimes sends selected customers a mailing to notify them of the sale. On other occasions it includes a coupon for 5% off the sale price in these mailings. The store’s manager would like to know whether the inclusion of coupons affects the proportion of customers who respond.

■ A manufacturing company has two plants that produce identical products. The com- pany wants to know how much the proportion of out-of-spec products differs across the two plants.

■ A pharmaceutical company has developed a new over-the-counter sleeping pill. To judge its effectiveness, the company runs an experiment where one set of randomly chosen people takes the new pill and another set takes a placebo. (Neither set knows which type of pill they are taking.) The company judges the effectiveness of the new pill by comparing the proportions of people who fall asleep within a certain amount of time with the new pill and with the placebo.

■ An advertising agency would like to check whether men are more likely than women to switch TV channels when a commercial comes on. The agency runs an experiment where the channel-switching behavior of randomly chosen men and women can be monitored, and it collects data on the proportion of viewers who switch channels on at least half of the commercial times. The agency then compares these proportions across gender.

The basic form of analysis in each of these examples is the same as in the two-sample analysis for differences between means. However, instead of comparing two means, we now compare two proportions.

Formally, let p1 and p2 represent the two unknown population proportions, and let p̂1 and p̂2 be the two sample proportions, based on samples of sizes n1 and n2. Then the point estimate of the difference between proportions, p1 − p2, is the difference between sample proportions, p̂1 − p̂2. If the sample sizes are reasonably large, then the sampling distribu- tion of p̂1 − p̂2 is approximately normal.

6 . If the sample sizes are reasonably large, then the sampling distribu

6 . If the sample sizes are reasonably large, then the sampling distribu

Therefore, a con�dence interval for p1 − p2 is given by Equation (8.16). Here, the z-multiple is the usual value from the standard normal distribution that cuts off the appro- priate probability in each tail (1.96 for a 95% con�dence interval, for example). Also, the standard error of p̂1 − p̂2 is given by Equation (8.17).

6This large-sample assumption is valid as long as ni p̂i > 5 and ni(1 − p̂i) > 5 for i = 1 and i = 2.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-8 Confidence Interval for the Diffiffif erence betweference betwef en Proportions 343

The following example illustrates this procedure.

Standard Error of Difference Between Sample Proportions

SE( p̂1 − p̂2) = Å p

Å p

Å ^1(1 − p̂1)

n1 +

p̂2(1 − p̂2) n2Å

(8.17)

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22

299 300 301

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21

298 299 300

No No No No Yes Yes No Yes Yes No Yes Yes Yes No No Yes Yes Yes Yes No No Yes No Yes

No No No Yes No Yes Yes No No No No Yes No No No No Yes No Yes No No Yes No Yes

Category Purchased Didn't purchase Sample sizes

Table of prTable of prT opor�ons

Category Purchased Didn't purchase Sample sizes

Received coupon Didn’t receive coupon

Received coupon Didn’t receive coupon

Customer Received coupon Purchased Table of countsTable of countsT

Sample difference Std error of difference Confidence level z mul�ple Lower limit Upper limit

Excel-only confidence interval for difference between propor�ons who purchased

A B C D E F IG HF IG HF I KJF I

eceived coupon Didn’t r

eceived coupon Didn’t r

F ID EB C

55 95

150

35 115 150

0.3667 0.6333

150

0.1333 0.052

95% 1.960 0.031 0.236

=F11-G11 =SQRT(F11*F12/F13+G11*G12/G13)

=NORM.S.INV(F18+(1-F18)/2) =F16-F19*F17 =F16+F19*F17

0.2333 0.7667

150

G HF IG HF I

Figure 8.14 Analysis of Coupon Data

E X A M P L E 8.8 SALES RESPONSE TO COUPONS FOR DISCOUNTS ON APPLIANCES

An appliance store is about to have a big sale. It selects 300 of its best customers and randomly divides them into two sets of 150 customers each. It then mails a notice of the sale to all 300 customers but includes a coupon for an extra 5% off the sale price to the second set of customers only. As the sale progresses, the store keeps track of which of these customers purchase appliances. The resulting data appear in Figure 8.14. (See the file Coupon Effectiveness.xlsx.) What can the store’s manager conclude about the effec- tiveness of the coupons?

Objective To find a confidence interval for the difference between proportions of cus- tomers purchasing appliances with and without 5% discount coupons.

Solution First, keep in mind the overall objective. From Figure 8.14 (cells F11 and G11), you can see that 36.67% of customers who received a coupon purchased something, as opposed to only 23.33% of those who didn’t receive a coupon. The difference, 36.67% − 23.33% = 13.33% (or 0.1333 ), is the quantity of interest. Specifically, the sample difference is 13.33%, and the objective is to find a confidence interval for this difference for the entire population.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

344 Chapter 8 Confidence Interval Estimation

Using Equations (8.16) and (8.17), the relevant confidence interval formulas are spelled out in column H. They show that the confidence interval for the difference between propor- tions extends from 0.031 to 0.236 (all positive). So there is good reason to conclude that the proportion who purchase is larger for those who receive a coupon.larger for those who receive a coupon.larger

As usual, the �nished version of the �le shows how the procedure can be implemented in StatTools. As with con�dence intervals for a single proportion (discussed in Section 8-5), the StatTools approach is a bit tricky because it accepts data in several formats. ■

P R O B L E M S

Level A 28. A company that advertises on the Web wants to know

which search engine its customers prefer as their primary search engine: Google or Bing. Specifically, the company wants to know whether the preference depends on the browser being used. The file P08_28.xlsx con- tains counts of 800 customers’ favorite search engine, broken down by the browser used. a. Calculate a 95% confidence interval for the

difference between two proportions: the proportion of Internet Explorer users whose favorite search engine is Google and the similar proportion of Firefox users.

b. Repeat part a, replacing Google with Bing. c. Interpret the results in parts a and b. Do the

search engine preferences seem to depend on the browser used?

29. A market research consultant hired by a leading soft-drink company is interested in estimating the difference between the proportions of female and male consumers who favor the company’s low-calorie brand over the leading competitor’s low-calorie brand in a particular geographical region. A random sample of 250 consumers from the market under investigation is provided in the file P08_18.xlsx. After separat- ing the 250 randomly selected consumers by gender, calculate a 95% confidence interval for the difference between these two proportions. Of what value might this interval estimate be to marketing managers at the company?

Level B 30. The file P02_35.xlsx contains data from a survey

of 500 randomly selected households. Researchers would like to use the available sample information to see whether home ownership rates vary by household location. For example, is there a nonzero difference between the proportions of individuals who own their homes (as opposed to those who rent their homes) in households located in the first (i.e., SW) and second (i.e., NW) sectors of this community? Use the given sample to calculate a 95% confidence interval that estimates this difference between proportions in home ownership rates for each pair of locations. Interpret and summarize your results. (The solution should include six confidence intervals.)

31. Continuing from problem 29, marketing managers at the soft-drink company have asked their market research consultant to explore further the difference between the proportions of women and men who prefer drinking their brand over the leading competitor. Specifically, the company’s managers would like to know whether the difference between the proportions of female and male consumers who favor their brand varies by the age of the consumers. Use the same data as in problem 29 to assess whether estimates of this difference vary across the four given age categories: under 20, between 20 and 40, between 40 and 60, and over 60. Use a 95% confidence level for each of the four required confidence intervals. Summarize your four required confidence intervals. Summarize your four findings. What recommendations would you make to the marketing managers in light of your findings?

8-9 SAMPLE SIZE SELECTION In this section we discuss the most widely used methods for achieving a con�dence interval of a speci�ed length. Con�dence intervals are a function of three things: (1) the data in the sample, (2) the con�dence level, and (3) the sample size(s). We brie�y discuss the role of the �rst two in terms of their effect on con�dence interval length and then discuss the effect of sample size in more depth.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-9 Sample Size Selection 345

The data in the sample directly affect the length of a con�dence interval through their sample standard deviation(s). It might appear that because of random sampling, you have no control over the sample data, but this is not entirely true. In the case of surveys from a population, there are random sampling plans that can reduce the amount of variability in the sample and hence reduce con�dence interval length. Indeed, this is the primary reason for using the strati�ed sampling procedure discussed in the previous chapter.

Variance reduction is also possible in randomized experiments. There is a whole area of statistics called experimental design that suggests how to perform experiments to obtain the most information from a given amount of sample data. Although this is often aimed at scienti�c and medical research, it is also appropriate in business contexts. For example, the automobile dealership in Example 8.7 was wise to use paired husband–wife data rather paired husband–wife data rather paired than two independent samples of men and women. The pairing leads to a potential reduc- tion in variability and hence a narrower con�dence interval.

The con�dence level has a clear effect on con�dence interval length. As the con�dence con�dence level has a clear effect on con�dence interval length. As the con�dence con�dence level level increases, the length of the con�dence interval increases as well. For example, a 99% con�dence interval is always longer than a 95% con�dence interval, assuming that they are both based on the same data. However, the con�dence level is rarely used to control the length of the con�dence interval. Instead, the con�dence level choice is usually based on convention, and 95% is by far the most commonly used value. In fact, it is the default level built into most software packages, including StatTools. You can override this default (by choosing 90% or 99%, for example), but it is not common to do so simply to control con�dence interval length.

The most obvious way to control con�dence interval length is to choose the sam- ple size(s) appropriately. The rest of this section explains how this can be done. For each parameter we discuss, the goal is to make the length of a con�dence interval suf�ciently narrow. Because each con�dence interval discussed so far (with the exception of the con�- dence interval for a standard deviation) is a point estimate plus or minus some quantity, we focus on the “plus or minus” part, called the half-length of the interval. (See Figure 8.15.) The usual approach is to specify the half-length B you would like to obtain. Then you �nd the sample size(s) necessary to achieve this half-length.

Lower limit Point es�mate Upper limit

Half-length of interval B

Figure 8.15 Half-Length of Confidence Interval

© C

e n g

a g

e L

e a rn

in g

Confidence Interval Length The length of any confidence interval is influenced by three things: the sample size, the confidence level, and the variability in the population. The con- fidence level is typically set at 95%, and you have no

control over the variability in the population (except possibly by choosing an appropriate experimental design). Therefore, the best way to control confi- dence interval length is through the choice of the sample size.

F u n da m e n ta l I n s i g h t

8-9a Sample Size Selection for Estimation of the Mean

We begin with a con�dence interval for the mean. From Section 8-3, the relevant formula is

X ± t-multiple × s/!n!n!!

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

346 Chapter 8 Confidence Interval Estimation

E X A M P L E 8.9 SAMPLE SIZE SELECTION FOR ESTIMATING REACTION TO A NEW SANDWICH

The fast-food manager in Example 8.1 surveyed 40 customers, each of whom rated a new sandwich on a scale of 1 to 10. Based on the data, a 95% confidence interval for the mean rating of all potential customers extended from 5.739 to 6.761, with a half-length of (6.761 − 5.739)/2 = 0.511. How large a sample would be needed to reduce this half- length to approximately 0.3?

Objective To find the sample size of customers required to achieve a sufficiently narrow confidence interval for the mean rating of the new sandwich.

Solution Equation (8.18) for n uses three inputs: the z-multiple, which is 1.96 for a 95% confi- dence level; the prescribed confidence interval half-length B, which is 0.3 for this example; and an estimate σest of the standard deviation. This final quantity must be guessed, but based on the given sample of size 40, the observed sample standard deviation, 1.597, from Example 8.1 can be used. Therefore, Equation (8.18) yields

n = a1.96(1.597) 0.3

b 2

= 108.86

Keep in mind that the sample size must be determined before the data are observed.

Sample Size Formula for Estimating a Mean

n = a z-multiple × σest

B b

2 (8.18)

The goal is to make the half-length of this interval equal to some prescribed value B. For example, if you want the confidence interval to be of the form X ± 5, you use B = 5. Actually, it is not possible to achieve this half-length B exactly, but you can come close.

By setting

t-multiple × s/!n!n!! = B and solving for n, the appropriate sample size is

n = at-multiple × s B

b 2

Unfortunately, sample size selection must be done before a sample is observed. Therefore, no value of s is yet available. Also, because the t-multiple depends on n (through the degrees of freedom parameter), it is not clear which t-multiple to use.

The usual solution is to replace s by some reasonable estimate σest of the population standard deviation σ, and to replace the t-multiple with the corresponding z-multiple from the standard normal distribution. The latter replacement is justi�ed because z-values and t-values are practically equal unless n is very small. The resulting sample size formula is given in Equation (8.18). This formula generally results in a noninteger value of n, in which case the practice is to round n up to the next larger integer.

The following example, an extension of Example 8.1, shows how to implement Equation (8.18).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-9 Sample Size Selection 347

which is rounded up to n = 109. The claim, then, is that if the manager surveys 109 customers, a 95% confidence interval will have approximate half-length 0.3. Its exact half-exact half-exact length will differ slightly from 0.3 because the standard deviation from the sample will almost surely not be exactly 1.597.

Figure 8.16 shows how this formula can be implemented in Excel. (See the file Sample Size Calculations Finished.xlsx, which has the calculations for all of this sec- tion.) Here, the CEILING function is used to round up to the nearest integer. StatTools also has a Sample Size Selection procedure that performs this sample size calculation and can be used anywhere in a spreadsheet. There doesn’t even have to be a data set. The details are shown in the file. In any case, you can see that a sample size of 109 is required.

Figure 8.16 Sample Size for Mean

3

4

5

6

7

8

Confidence level

Half-length of interval

Std dev (estimate)

z multiple

Sample size

95%

0.30

1.597

1.960

109

=NORM.S.INV(B4+(1-B4)/2)

=CEILING((B7*B6/B5)^2,1)

Sample Size for Mean A B C D E FD EB C

© C

e n g

a g

e L

e a rn

in g

We have demonstrated the use of Equation (8.18) for a sample mean. In the same way, it can also be used in the paired-sample procedure. In this case the resulting value of n refers to the number of pairs that should be included in the sample, and σest refers to an estimate of the standard deviation of the differences (Husband scores minus Wife scores, for example).

What if the manager is at the planning stage and doesn’t have a “preliminary” sample of size 40? What standard deviation estimate should she use for σest (because the value 1.597 is no longer available)? This is not an easy question to answer, but because of the role of σest in Equation (8.18), it is crucial for the determination of n. The manager basi- cally has three choices: (1) she can base her estimate of the standard deviation on historical data, assuming relevant historical data are available; (2) she can take a small preliminary sample (of size 20, say) to get an estimate of the standard deviation; or (3) she can simply guess a value for the standard deviation. We do not recommend the third option, but there are cases in which it is the only feasible option available. ■

8-9b Sample Size Selection for Estimation of Other Parameters

The sample-size analysis for the mean carries over with very few changes to other parame- ters. We discuss three other parameters in this section: a proportion, the difference between two means, and the difference between two proportions. In each case the required con�- dence interval can be obtained by setting the half-length equal to a prescribed value B and solving for n.

There are two points worth mentioning. First, the con�dence interval for the differ- ence between means uses a t-multiple. As was done for the mean, this can be replaced by a z-multiple, which is perfectly acceptable in most situations. Second, the con�dence

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

348 Chapter 8 Confidence Interval Estimation

Sample Size Formula for Estimating the Difference Between Means

n = 2a z-multiple × σest

B b

2 (8.20)

Sample Size Formula for Estimating the Difference Between Proportions

n = az-multiple B

b 2 [p[p[ 1est(1 − p1est) + p2est(1 − p2est)] (8.21)

E X A M P L E 8.10 SAMPLE SIZE SELECTION FOR ESTIMATING THE PROPORTION WHO HAVE TRIED A NEW SANDWICH

Suppose that the fast-food manager from the previous example wants to estimate the proportion of customers who have tried its new sandwich. She wants a 90% confidence interval for this proportion to have half-length 0.05. For example, if the sample proportion turns out to be 0.42, a 90% confidence interval should be (approximately) 0.42 ± 0.05. How many customers need to be surveyed?

Objective To find the sample size of customers required to achieve a sufficiently narrow confidence interval for the proportion of customers who have tried the new sandwich.

Solution If the manager has no idea what the proportion is, she can use pest = 0.5 in Equation (8.19) to obtain a conservative value of n. The appropriate z-multiple is now 1.645 because this value cuts off probability 0.05 in each tail of the standard normal distribution. (Remember

intervals for differences between means or proportions require two sample sizes, one for each sample. The formulas below assume that each sample uses the same sample size, denoted by n.

The sample size formula for a proportion p is given by Equation (8.19). Here, pest is an estimate of the population proportion p. A conservative value of n can be obtained by using pest = 0.5. It is conservative in the sense that the sample size obtained by using pest = 0.5 guarantees a con�dence interval half-length no greater than B, regardless of the true value of p.

The sample size formula for the difference between means is given by Equation (8.20). Here, σest is an estimate of the standard deviation of each population, where we assume (as in Section 8-7a) that the two populations have a common standard deviation σ.

Finally, the sample size formula for the difference between proportions is given by Equation (8.21). Here, p1est and p2est are estimates of the two unknown population propor- tions p1 and p2. As in the case of a single proportion, a conservative value of n is obtained by using the estimates p1est = p2est = 0.5.

Sample Size Formula for Estimating a Proportion

n = az-multiple B

b 2 pest(1 − pest) (8.19)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-9 Sample Size Selection 349

Figure 8.17 Sample Size for Proportion

10

11

12

13

14

15

Confidence level

Half-length of interval

Proportion (estimate)

z multiple

Sample size

90%

0.05

0.30

1.645

228

=N0RM.S.INV(B11+(1-B11)/2)

=CEILING((B14/B12)^2*B13*(1-B13),1)

Sample Size for Pr

A B C D E FD EB C G

© C

e n g

a g

e L

e a rn

in g

that we are asking for a 90% confidence level, not the usual 95% level.) Therefore, the required value of n is

n = a1.645 0.05

b 2 (0.5) (1 − 0.5) ≃ 271

On the other hand, if the manager is fairly sure that the proportion who have tried the new sandwich is around 0.3, she can use pest = 0.3 instead. The resulting output is shown in Figure 8.17.

These calculations indicate that if you have more specific information about the unknown proportion, you can use a smaller sample size—in this case 228 rather than 271. Also, note that we selected a 90% confidence level rather than the usual 95% level. There is a trade-off here. Using 90% rather than 95% obviously provides less confidence in the result, but it requires a smaller sample size. You can check that the required sample sizes for a 95% confidence level increase from the current values, 271 and 228, to 385 and 323, respectively. ■

Again, remember that lower confidence levels result in narrower confidence intervals.

E X A M P L E 8.11 SAMPLE SIZE SELECTION FOR ANALYZING CUSTOMER COMPLAINTS

Acomputer company has a customer service center that responds to customers’ ques-tions and complaints. The center employs two types of people: those who have had a recent course in dealing with customers (but little actual experience) and those with a lot of experience dealing with customers (but no formal course). The company wants to estimate the difference between these two types of employees in terms of the average number of customer complaints regarding poor service in the last six months. The company plans to obtain information on a randomly selected sample of each type of employee, using equal sample sizes. How many employees should be in each sample to achieve a 95% confidence interval with approximate half-length 2?

Objective To see how many employees in each experimental group must be sampled to achieve a sufficiently narrow confidence interval for the difference between the mean numbers of complaints.

Solution Equation (8.20) should be used with z-multiple 1.96 and B = 2. However, this formula also requires a value for σest, an estimate of the (assumed) common standard deviation for each group of employees, and there is no obvious estimate available. The manager might use the following argument. Based on a brief look at complaint data, he believes that some employees receive as few as 6 complaints over a six-month period, whereas others receive as many as 36 (about six per month). Now he can estimate σest by arguing that all

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

350 Chapter 8 Confidence Interval Estimation

The following example illustrates what can happen when you ask for extremely accu- rate con�dence intervals.

E X A M P L E 8.12 SAMPLE SIZE SELECTION FOR ANALYZING PROPORTIONS OF OUT-OF-SPEC PRODUCTS

observations are likely to be within three standard deviations of the mean, so that the range of data—minimum to maximum—is about six standard deviations. Therefore, he sets

6σest = 36 − 6 = 30

and obtains σest = 5. Using this value in Equation (8.20), the required sample size is

n = 2a1.96(5) 2

b 2

≃ 49

The output in Figure 18.18 confirms this value.

Amanufacturing company has two plants that produce identical products. The production supervisor wants to know how much the proportion of out-of-spec products differs across the two plants. He suspects that the proportion of out-of-spec products in each plant is in the range of 3% to 5%, and he wants a 99% confidence interval to have approximate half-length 0.005 (or 0.5%). How many items should he sample from each plant?

Objective To see how many products in each plant must be sampled to achieve a suf-To see how many products in each plant must be sampled to achieve a suf-To see how many products in each plant must be sampled to achieve a suf ficiently narrow confidence interval for the difference between the proportions of out-of- spec products.

Solution Equation (8.21) should be used with z-multiple 2.576 (the value that cuts off probability 0.005 in each tail of the standard normal distribution), B = 0.005, and p1est = p2est = 0.05. The

Figure 8.18 Sample Size for Difference Between Means

17

18

19

20

21

22

Confidence level

Half-length of interval

Common std dev (estimate)

z multiple

Sample size (each sample)

95%

2.00

5.00

1.960

49

=NORM.S.INV(B18+(1-B18)/2)

=CEILING(2*(B21*B20/B19)^2,1)

Sample Size for Difference of Means A B C D E FD EB C

© C

e n g

a g

e L

e a rn

in g

Some analysts prefer the estimate

4σest = 36 − 6 = 30

that is, σest = 7.5, arguing that the quoted range (6 to 36) might not include “extreme” values and hence might extend to only two standard deviations on either side of the mean. By using this estimate of the standard deviation, you can check that the required sample size increases from 49 to 109. The important point here is that the estimate of the standard deviation can have a dramatic effect on the required sample size. (And don’t forget that this size sample must be taken from each group of employees.) ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-9 Sample Size Selection 351

Figure 8.19 Sample Size for Difference Between Proportions

24

25

26

27

28

29

30

Confidence level

Half-length of interval

Proportion 1 (estimate)

Proportion 2 (estimate)

z multiple

Sample size (each sample)

95%

0.025

0.050

0.050

1.960

584

=NORM.S.INV(B25+(1-B25)/2)

=CEILING((B29/B26)^2*(B27*(1-B27)+B28*(1-B28)),1)

Sample Size for Difference of Propor�ons A B C D E FD EB C G H

© C

e n g

a g

e L

e a rn

in g

reasoning for the latter is that the supervisor believes each proportion is around 3% to 5%, and the most conservative (largest) sample size corresponds to using the larger 5% value. Then the required sample size is

n = a2.576 0.005

b 2 [0.05(0.95) + 0.05(0.95)] ≃ 25,213

This sample size (from each sample) is almost certainly prohibitive, so the supervisor real- izes he must lower his goals. One way is to decrease the confidence level, say, from 99% to 95%. Another way is to increase the desired half-length from 0.005 to, say, 0.025. We implemented both of these changes in Figure 8.19. Even now each required sample size is 584. Obviously, narrow confidence intervals for differences between proportions can require very large sample sizes. ■

P R O B L E M S

Level A 32. Elected officials in a California city are preparing the

annual budget for their community. They would like to estimate how much their constituents living in this city are typically paying each year in real estate taxes. Given that there are over 100,000 homeowners in this city, the officials have decided to sample a representative subset of taxpayers and study their tax payments. a. What sample size is required to generate a 95%

confidence interval for the mean annual real estate tax payment with a half-length of $100? Assume that the best estimate of the population standard deviation σ is $535.

b. If a random sample of the size from part a is selected and a 95% confidence interval for the mean is calculated from this sample, will the half- length of the confidence interval be equal to $100? Explain why or why not.

c. Now suppose that the officials want to construct a 95% confidence interval with a half-length of $75. What sample size is required to achieve this objective?

Again, assume that the best estimate of the population standard deviation σ is $535. Explain the difference between this result and the result from part a.

33. You have been assigned to determine whether more people prefer Coke or Pepsi. Assume that roughly half the population prefers Coke and half prefers Pepsi. How large a sample do you need to take to ensure that you can estimate, with 95% confidence, the proportion of people preferring Coke within 2% of the actual value?

34. You are trying to estimate the average amount a family spends on food during a year. In the past the standard deviation of the amount a family has spent on food during a year has been approximately $1000. If you want to be 99% sure that you have estimated aver- age family food expenditures within $50, how many families do you need to survey?

35. In past years, approximately 20% of all U.S. families purchased potato chips at least once a month. You are interested in determining the fraction of all U.S. families that currently purchase potato chips at least once a month. How many families must you survey if

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

352 Chapter 8 Confidence Interval Estimation

8-10 CONCLUSION When you want to estimate a population parameter from sample data, one of the most useful ways to do so is to report a point estimate and a corresponding con�dence interval. This con�- dence interval provides a quick sense of where the true parameter lies. It essentially quanti�es the amount of uncertainty in the point estimate. Obviously, narrow con�dence intervals are desired. You have seen that the length of a con�dence interval is determined by the variability in the data, the con�dence level, usually set at 95%, and the sample size(s). You have also seen how sample size formulas can be used at the planning stage to achieve con�dence intervals that are suf�ciently narrow. Finally, you have seen how con�dence intervals can be calculated from Excel formulas or with statistical software such as StatTools.

Summary of Key Terms

you want to be 99% sure that your estimate of the rel- evant proportion is accurate within 2%?

36. Continuing Problem 32, suppose that the officials in this city want to estimate the proportion of taxpayers whose annual real estate tax payments exceed $2000. a. What sample size is required to generate a

99% confidence interval for this proportion with a half-length of 0.10? Assume for now that the relevant population proportion p is close to 0.50.

b. Assume now that officials discover another source that suggests that approximately 30% of all property owners in this community pay more than $2000 annually in real estate taxes. What sample size is now required to generate the 99% confidence interval requested in part a?

c. Why is there a difference between your answers to parts a and b?

d. If a random sample of the size from part a is selected and a 99% confidence for the proportion is calculated from this sample, will the half-length of the confidence interval be equal to 0.10? Explain why or why not.

Level B 37. Continuing the previous problem, suppose that

the officials in this city want to estimate the difference between the proportions, labeled p1 and p2, of taxpayers living in neighborhood 1 whose annual real estate tax payments exceed $2000 and the similar proportion for taxpayers living in neighborhood 2. a. What sample size (randomly selected from all

taxpayers residing in each of neighborhoods 1 and 2) is required to generate a 90% confidence interval for this difference between proportions with a half-length of 0.10? Assume for now that p1 and p2 are both close to 0.5.

b. We assumed that the two population proportions in part a are both close to a are both close to a 0.5. Use a two-way data table to find the required (common) sample size when each of the population proportions is allowed to vary from 0.1 to 0.9 in increments of 0.1. Comment on the sensitivity of the required sample size to the magnitudes of the population proportions.

Term Explanation Excel Pages Equation

Confidence interval An interval that, with a stated level of confidence, captures a population parameter

313 8.1

t distribution The sampling distribution of the standardized sample mean when the sample standard deviation is used in place of the population standard deviation

T.DIST, T.INV, and other Excel T functions

314 8.2

Confidence level Percentage (usually 90%, 95%, or 99%) that indicates how confident you are that the interval captures the true population parameter

318

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

8-10 Conclusion 353

Term Explanation Excel Pages Equation

Confidence interval for a mean

Interval that is likely to capture a population mean

Excel formulas or StatTools 318 8.4

Confidence interval for a total

Interval that is likely to capture the total of all observations in a population

Excel formulas or StatTools 324

Confidence interval for a proportion

Interval that is likely to capture the proportion of all population members that satisfy a specified property

Excel formulas or StatTools 327 8.10

Confidence interval for a standard deviation

Interval that is likely to capture a population standard deviation

Excel formulas or StatTools 331

Chi-square distribution

Skewed distribution useful for estimating standard deviations

CHI.DIST, CHI.INV, and other Excel CHI functions

332

Confidence interval for difference between means with independent samples

Interval that is likely to capture the difference between two population means when the samples are independent

Excel formulas or StatTools 335–336 8.13–8.15

Confidence interval for difference between means with paired samples

Interval that is likely to capture the difference between two population means when the samples are paired in a natural way

Excel formulas or StatTools 339

Confidence interval for difference between proportions

Interval that is likely to capture the difference between similarly defined proportions from two populations

Excel formulas or StatTools 342 8.16, 8.17

Sample size formulas Formulas that specify the sample size(s) required to obtain sufficiently narrow confidence intervals

Excel formulas or StatTools 345–348 8.18–8.21

P R O B L E M S

Conceptual Questions C.1. Under what conditions, if any, is it not correct to not correct to not

assume that the sampling distribution of the sample mean is approximately normally distributed?

C.2. When, if ever, is it appropriate to use the standard normal distribution as a substitute for the t distribu- tion with n − 1 degrees of freedom in estimating a population mean?

C.3. “Assuming that all else remains constant, the length of a confidence interval for a population mean increases whenever the confidence level and sample size increase simultaneously.” Is this statement true or false? Explain your choice.

C.4. Assuming that all else remains constant, what happens to the length of a 95% confidence interval for a population parameter when the sample size is reduced by half? You can assume that the resulting sample size is still quite large. Justify your answer.

C.5. “The probability is 0.99 that a 99% confidence interval contains the true value of the relevant population parameter.” Is this statement true or false? Explain your choice.

C.6. Suppose you have a list of salaries of all professional all professional all athletes in a given sport in a given year. For example, you might have the salaries of all Major League Baseball players in 2016. Does it make sense to find a 95% confidence interval for the mean salary? If so, what is the relevant population?

C.7. Suppose that someone proposes a new way to calculate a 95% confidence interval for a mean. This could involve any arithmetic on the given data. For example, it could say to go out could say to go out could 1.75 interquartile ranges (IQRs) on either side of the median. What would it mean to say that this procedure produces valid 95% confidence intervals? How could you use simulation to check whether the procedure produces valid 95% confidence intervals?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C.8. The sample size formula for a confidence interval for the population mean requires an estimate of the population standard deviation. Intuitively, why is this the case? Specifically, why is the required sample size larger if the population standard deviation is larger?

C.9. Suppose a 95% confidence interval for a population mean has been calculated, and it extends from 123.7 to 155.2. Some people would then state, “The prob- ability that the population mean is between 123.7 and 155.2 is 0.95.” Why is this, strictly speaking, an invalid statement? How would you rephrase it to make it a valid statement?

C.10. Researchers often create multiple 95% confidence intervals based on a given data set. For example, if the variable of interest is home price and there are five neighborhoods in the population, they might create 10 confidence intervals, one for each differ- ence between mean home prices for a given pair of neighborhoods. (There are 10 pairs.) Can they then conclude that there is 95% confidence that all 10 of their confidence intervals will include the all 10 of their confidence intervals will include the all corresponding population mean differences? Why or why not?

C.11. Based on a given random sample, suppose you calculate a 95% confidence interval for the following difference: the mean test score for stu- dents under 25 years old minus the mean test score for students at least 25 years old, and the confidence interval extends from –14.3 to 1.2. How would you interpret these results? Would you claim that older students, on average, score higher on this test? Would you claim that, on average, it is possible that the younger students score higher on this test?

Level A 38. A sample of 15 quality control managers with more

than 20 years experience have an average salary of $68,000 and a sample standard deviation of $19,000. a. You can be 95% confident that the mean salary for all

quality managers with at least 20 years of experience is between what two numbers? What assumption are you making about the distribution of salaries?

b. What size sample is needed to ensure that you can estimate the population mean salary of all quality managers with more than 20 years of experience and have only one chance in 100 of being off by more than $500?

39. Political polls typically sample randomly from the U.S. population to investigate the percentage of voters who favor some candidate or issue. The number of people polled is usually on the order of 1000. Suppose that one such poll asks voters how they feel about the President’s handling of environmental issues. The

results show that 575 out of the 1280 people polled say they either approve or strongly approve of the President’s handling. Find a 95% confidence interval for the proportion of the entire voter population who approve or strongly approve of the President’s handling. If the same sample proportion were found in a sample twice as large—that is 1150 out of 2560—how would this affect the confidence interval? How would the confidence interval change if the confidence level were 90% instead of 95%?

40. Referring to the previous problem, you often hear the results of such a poll in the news. In fact, the newscasters usually report something such as, “44.9% of the population approve or strongly approve of the President’s handling of the environ- ment. The margin of error in this result is plus or minus 3%.” Where does this 3% comes from? If the pollsters want the margin of error to be plus or minus 3%, how does this lead to a sample size of approximately 1000?

41. The widths of 100 elevator rails have been measured. The sample mean and standard deviation of the eleva- tor rails are 2.05 inches and 0.01 inch. a. Calculate a 95% confidence interval for the average

width of an elevator rail. Do you need to assume that the widths of elevator rails are normally distributed?

b. How large a sample of elevator rails would you have to measure to ensure that you could estimate, with 95% confidence, the average diameter of an elevator rail within 0.01 inch?

42. You want to determine the percentage of Fortune 500 CEOs who think Indiana University (IU) deserves its current Business Week rating. You mail a quesBusiness Week rating. You mail a quesBusiness Week - tionnaire to all 500 CEOs and 100 respond. Exactly half of the respondents believe IU does deserve its ranking. a. Calculate a 95% confidence interval for the fraction

of Fortune 500 CEOs who believe IU deserves its ranking.

b. Suppose again that you want to estimate the fraction of Fortune 500 CEOs who believe IU deserves its ranking. Your goal is to have only a 5% chance of having your estimate be in error by more than 0.02. What size sample would you need to take? Is it possible to implement this result?

c. Is the finite population correct ( fpc) from the previous chapter relevant here? Why or why not?

43. The SEC requires companies to file annual reports concerning their financial status. It is impossible to audit every account receivable. Suppose an auditor audits a random sample of 49 accounts receivable invoices and finds a sample average of $128 and a sample standard deviation of $53.

354 Chapter 8 Confidence Interval Estimation Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

3558-10 Conclusion 355

a. Calculate a 99% confidence interval for the mean size of an accounts receivable invoice. Does your answer require the sizes of the accounts receivable invoices to be normally distributed?

b. How large a sample is required for you to be 99% sure that the estimate of the mean invoice size is accurate within $5?

44. An opinion poll surveyed 900 people and reported that 36% believe a certain governor broke campaign financing laws in his election campaign. a. Calculate a 95% confidence interval for the

population proportion of people who believe the governor broke campaign financing laws. Does the result of the poll convince you that fewer than 38% of all U.S. citizens favor that viewpoint?

b. Suppose 10,000 (not 900) people are surveyed and 36% believe that the governor broke campaign financing laws. Would you now be convinced that fewer than 38% of all U.S. citizens favor that viewpoint? Why is your answer different than in part a?

c. How many people would you have to survey to be 99% confident that you can estimate to within 1% the fraction of people who believe the governor broke campaign financing laws?

45. The file P08_07.xlsx contains a random sample of 200 service times during the busiest hour of the day at a particular fast-food restaurant. Calculate a 95% confidence interval for each of the following population parameters. Then explain how each result might be useful to the manager of the restaurant in terms of improving service. a. The mean service time b. The standard deviation of service times c. The proportion of service times longer than

90 seconds d. The proportion of service times shorter than

60 seconds

46. We know that IQs are normally distributed with a mean of 100 and standard deviation of 15. Suppose you want to verify this, so you take 100 random samples of size four each and, for each sample, calculate a 95% confidence interval for the mean IQ. You expect that approximately 95 of these intervals will contain the true mean IQ (100) and approxi- mately five of these intervals will not contain the true mean. Use simulation in Excel to check whether this is the case.

47. In Section 8-9, we gave a sample size formula for confidence interval estimation of a mean. If the con- fidence level is 95%, then because the z-multiple is about 2, this formula is essentially

n = 4σ2

B2

However, this formula is based on the assumption that the sample size n will be small relative to the population size N. If this is not the case, the not the case, the not appropriate formula turns out to be

n = NσNσN 2

σ2 + (N − 1)B2/4 (This is based on the same idea as the finite population correction from the previous chapter.) Now suppose you want to find a 95% confidence interval for a population mean. Based on preliminary (or historical) data, you believe that the population standard deviation is approximately 15. You want the confidence interval to have length 4. That is, you want the confidence interval to be of the form X ± 2. What sample size is required if N = 400? if N = 800? if N = 10,000? if N = 100,000,000? How would you summarize these findings in words?

48. Ritter Manufacturing Company has kept track of machine hours and overhead costs at its main manu- facturing plant for the past 52 weeks. The data appear in the file P08_48.xlsx. Ritter has studied these data to understand the relationship between machine hours and overhead costs. Although the relationship is far from perfect, Ritter believes a fairly accurate predic- tion of overhead costs can be obtained from machine hours through the equation

Estimated Overhead = 746.5078 + 3.3175* Machine Hours

By substituting any observed value of Machine Hours into this equation, Ritter obtains an estimated value of Overhead, which is always somewhat different from the true value of Overhead. The difference is called the prediction error. a. Calculate a 95% confidence interval for the mean

prediction error. Do the same for the absolute prediction error. (For example, the prediction error in week 1, actual overhead minus predicted overhead, is –94.5303. The absolute prediction error is the absolute value, 94.5303.)

b. A close examination of the data suggests that week 45 is a possible outlier. Illustrate this by creating a box plot of the prediction errors. In what sense is week 45 an outlier? See whether week 45 has much effect on the confidence intervals from part a by recalculating these confidence intervals, this time with week 45 deleted. Discuss your findings briefly.

Problems 49 through 58 are related to the data in the file P08_49.xlsx. This file contains data on 400 customers’ orders from ElecMart, a company that sells electronic appliances by mail order. (This same data set was used in Example 3.4 of Chapter 3.) You can consider the data as a random sample from all of ElecMart’s orders.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

49. Calculate a 95% confidence interval for the mean total cost of all customer orders. Then do this separately for each of the four regions. Create side-by-side box plots of total cost for the four regions. Does the positive skewness in these box plots invalidate the confidence interval procedure used?

50. Calculate a 95% confidence interval for the propor- tion of all customers whose order is for more than $100. Then do this separately for each of the three times of day.

51. Calculate a 95% confidence interval for the proportion of all customers whose orders contain at least three items and cost at least and cost at least and $100 total.

52. Calculate a 95% confidence interval for the difference between the mean amount of the highest cost item purchased for the High customer category and the similar mean for the Medium customer category. Do the same for the difference between the Medium and Low customer categories. Because of the way these customer categories are defined, you would probably expect these mean differences to be positive. Is this what the data indicate?

53. Of the subpopulation of customers who order in the evening, consider the proportion who are female. Similarly, of the subpopulation of customers who order in the morning, consider the proportion who are female. Calculate a 95% confidence interval for the difference between these two proportions.

54. Calculate a 95% confidence interval for the difference between the following two proportions: the proportion of female customers who order during the evening and the proportion of male customers who order during the evening.

55. Calculate a 95% confidence interval for the difference between the following means: the mean total order cost for West customers and the mean total order cost for Northeast customers. Do the same for the other combinations: West versus Midwest, West versus South, Northeast versus South, Northeast versus Midwest, and South versus Midwest.

56. Calculate a 95% confidence interval for the difference between the mean cost per item for female orders and the similar mean for males.

Level B 57. Let pE,F be the proportion of female orders that are

paid for with the ElecMart credit card, and let pE,M be the similar proportion for male orders. a. Calculate a 95% confidence interval for pE,F; for

pE,M; and for the difference pE,F − pE,M. b. Let pE,F,Wd be the proportion of female orders

on weekdays that are paid for with the ElecMart credit card, and let pE,F,We be the similar proportion for weekends. Define pE,M,Wd

and pE,M,We similarly for males. Calculate a 95% confidence interval for the difference (p(p( E,F,Wd − pE,M,Wd) − (p(p( E,F,We − pE,M,We). Interpret this difference in words. Why might it be of interest to ElecMart?

58. Suppose these 400 orders are a sample of the 4295 orders made during this time period, and suppose 2531 of these orders were placed by females. Calculate a 95% confidence interval for the total paid for all 4295 orders. Do the same for all 2531 orders placed by females. Do the same for all 1764 orders placed by males.

Problems 59 through 64 are related to the data in the file P08_59.xlsx. This file contains data on 91 billings from Rebco, a company that sells plumbing supplies to retailers. You can consider the data as a random sample from all of Rebco’s billings.

59. Calculate a 95% confidence interval for the mean amount of all Rebco’s bills. Do the same for each cus- tomer size separately.

60. Calculate a 95% confidence interval for the mean number of days it takes Rebco’s customers (as a com- bined group) to pay their bills. Do the same for each customer size separately. Create a box plot for the variable Days, based on all 91 billings. Also, create side-by-side box plots for Days for the three separate customer sizes. Do any of these suggest problems with the validity of the confidence intervals?

61. Calculate a 95% confidence interval for the proportion of all large customers who pay bills of at least $1000 at least 15 days after they are billed.

62. Calculate a 95% confidence interval for the propor- tion of all bills paid within 15 days. Calculate a 95% confidence interval for the difference between the proportion of large customers who pay within 15 days and the similar proportion of medium-size customers. Calculate a 95% confidence interval for the difference between the proportion of medium- size customers who pay within 15 days and the simi- lar proportion of small customers.

63. Suppose a bill is considered late if it is paid after 20 days. In this case its “lateness” is the number of days over 20. For example, a bill paid 23 days after billing has a lateness of 3, whereas a bill paid 18 days after billing has a lateness of 0. Calculate a 95% confidence interval for the mean amount of lateness for all customers. Calculate similar confi- dence intervals for each customer size separately. Why is the distribution of lateness certainly not nor- mal? Do you think this matters for the validity of the confidence interval?

64. Suppose Rebco can earn interest at the rate of 0.011% daily on excess cash. The company realizes that it could earn extra interest if its customers paid their bills more promptly.

356 Chapter 8 Confidence Interval Estimation Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

a. Calculate a 95% confidence interval for the mean amount of interest it could gain if each of its customers paid exactly one day more promptly. Calculate similar confidence intervals for each customer class separately.

b. Suppose these 91 billings represent a random sample of the 2792 billings Rebco generates during the year. Calculate a 95% confidence interval for the total amount of extra interest it could gain by getting each of these 2792 billings to be paid two days more promptly.

65. The file P08_65.xlsx contains data on the first 100 customers who entered a two-teller bank on Friday. All variables in this file are times, measured in minutes. a. Calculate a 95% confidence interval for the mean

amount of time a customer spends in service with a teller.

b. The bank is most interested in mean waiting times because customers get upset when they have to spend a lot of time waiting in line. Use the usual procedure to calculate a 95% confidence interval for the mean waiting time per customer.

c. Your answer in part b is not valid! (It is much too narrow. It makes you believe you have a much more accurate estimate of the mean waiting time than you really have.) We made two implicit assumptions when we stated the confidence interval procedure for a mean: (1) The individual observations come from the same distribution, and (2) the individual observations are probabilistically independent. Why are both of these, particularly (2), violated for the customer waiting times? [Hint: For (1), how do the first few customers differ from “typical” customers? For (2), if you are behind someone in line who has to wait a long time, what do you suspect about your own waiting time?]

d. Following up on assumption (2) of part c, you might expect waiting times of successive customers to be autocorrelated, that is, correlated with each other. Large waiting times tend to be followed by large waiting times, and small by small. Check this with StatTools’s Autocorrelation procedure in the Time Series & Forecasting group. An autocorrelation of a certain lag, say, lag 2, is the correlation in waiting times between a customer and the second customer behind her. Do these successive waiting times appear to be autocorrelated? (A valid confidence interval for valid confidence interval for valid the mean waiting time takes autocorrelations into account—but it is considerably more difficult to calculate.)

Problems 66 through 68 are related to the data in the file P08_66.xlsx. SoftBus Company sells

PC equipment and customized software to small companies to help them manage their day-to- day business activities. Although SoftBus spends time with all customers to understand their needs, the customers are eventually on their own to use the equipment and software intelligently. To understand its customers better, SoftBus recently sent questionnaires to a large number of prospective customers. Key personnel—those who would be using the software—were asked to fill out the questionnaire. SoftBus received 82 usable responses, as shown in the file. You can assume that these employees represent a random sample of all of SoftBus’s prospective customers.

66. Create a histogram of the PC Knowledge variable. [Because there are only five possible responses (1–5), this histogram should have only five bars.] Repeat this separately for those who own a PC and those who do not. Then calculate a 95% confidence interval for the mean value of PC Knowledge for all of SoftBus’s prospective customers; and of all its prospective customers who own PCs; and of all its prospective customers who do not own PCs. The PC Knowledge variable obviously can’t be exactly normally distrib- uted because it has only five possible values. Do you think this invalidates the confidence intervals? Explain your choice.

67. SoftBus believes it can afford to spend much less time with customers who own PCs and score at least 4 on PC Knowledge. Let’s call these the “PC-savvy” customers. On the other hand, SoftBus believes it will have to spend a lot of time with customers who do not own a PC and score 2 or less on PC Knowledge. Let’s call these the “PC-illiterate” customers. a. Calculate a 95% confidence interval for the

proportion of all prospective customers who are PC-savvy. Calculate a similar confidence interval for the proportion who are PC-illiterate.

b. Repeat part a twice, once for the subpopulation of customers who have at least 12 years of experience and once for the subpopulation who have less than 12 years of experience.

c. Again repeat part a twice, once for the subpopulation of customers who have no more than a high school diploma and once for the subpopulation who have more than a high school diploma.

d. Calculate a 95% confidence interval for the difference between two proportions: the proportion of all customers with some college education who are PC-savvy and the similar proportion of all customers with no college education. Repeat this, substituting “PC-savvy” with “PC-illiterate.”

e. Discuss any insights you gain from parts a through d that might be of interest to SoftBus.

8-10 Conclusion 357 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

68. Following up on the previous problem, SoftBus believes its profit from each prospective customer depends on the customer’s level of PC knowledge. It divides the customers into three classes: PC-savvy, PC-illiterate, and all others (where the first two classes are as defined in the previous problem). As a rough guide, SoftBus figures it can gain profit P1 from each PC-savvy customer, profit P3 from each PC-illiterate customer, and profit P2 from each of the others. a. What values of P1, P2, and P3 seem reasonable?

For example, would you expect P1 < P2 < P3 or the opposite?

b. Using any reasonable values for P1, P2, and P3, calculate a 95% confidence interval for the mean profit per customer that SoftBus can expect to obtain.

Problems 69 through 72 are related to the data in the file P08_69.xlsx. Comfy Company sells medium- priced patio furniture through a mail-order catalog. It has operated primarily in the East but is now expanding to the Southwest. To get off to a good start, it plans to send potential customers a catalog with a discount coupon. However, Comfy is not sure how large a discount is needed to entice customers to buy. It experiments by sending catalogs to selected residents in six cities. Tucson and San Diego receive coupons for 5% off any furniture within the next two months, Phoenix and Santa Fe receive coupons for 10% off, and Riverside and Albuquerque receive coupons for 15% off.

69. Calculate a 95% confidence interval for the proportion of customers who will purchase at least one item if they receive a coupon for 5% off. Repeat for 10% off and for 15% off.

70. Calculate a 95% confidence interval for the proportion of customers who will purchase at least one item and pay at least $500 total if they receive a coupon for 5% off. Repeat for 10% off and for 15% off.

71. Comfy wonders whether the customers who receive larger discounts are buying more expensive items. Recalling that the value in the Total Paid column is after the discount, calculate a after the discount, calculate a after 95% confidence interval for the difference between the mean original price per item for customers who purchase something with the 5% coupon and the similar mean for customers who purchase something with the 10% coupon. Repeat with 5% and 10% replaced by 10% and 15%. What can you conclude?

72. Comfy wonders whether there are differences across pairs of cities that receive the same discount. a. Calculate a 95% confidence interval for the

difference between the mean amount spent in Tucson and the similar mean in San Diego. (These

means should include the “0 purchases.”) Repeat this for the difference between Phoenix and Santa Fe and then between Riverside and Albuquerque. Does city appear to make a difference?

b. Repeat part a, but instead of analyzing differences between means, analyze differences between proportions of customers who purchase something. Does city appear to make a difference?

Problems 73 through 76 are related to the data in the file P08_73.xlsx. Niyaki Company sells Blu-ray disc players through a number of retail stores. On one popular model, there is a standard warranty that covers parts for the first six months and labor for the first year. Customers are always asked whether they wish to purchase an extended service plan for $50 that extends the original warranty two more years—that is, to 30 months on parts and 36 months on service. To get a better understanding of warranty costs, the company has gathered data on 70 Blu-ray units purchased. This data is listed in the Data1 sheet of the file P08_73 .xlsx. The two costs in this sheet (columns D and E) are tracked only for repairs covered by warranty. [Otherwise, the customer bears the cost(s).]

73. Create a histogram of the time until first failure for this type of disc player. Then calculate a 95% confidence interval for the mean time until failure for this type of disc player. Does the shape of the histogram invalidate the confidence interval? Why or why not?

74. Calculate a 95% confidence interval for the proportion of customers who purchase the extended service plan. Calculate a 95% confidence interval for the proportion of all customers who would benefit by purchasing the extended service plan.

75. Calculate a 95% confidence interval for Niyaki’s mean net warranty cost per unit sold (net of the $50 paid for the plan for those who purchase it). You can assume that this mean is for the first failure only; subsequent first failure only; subsequent first failures of the same units are ignored here.

76. This problem follows up on the previous two problems with the data in the Data2 sheet of the file. Here Niyaki did more investigation on the same 70 custom- ers. It tracked subsequent failures and costs (if any) that occurred within the warranty period. (Note: Only two customers had three failures within the warranty period, and parts weren’t covered for either on the third failure. Also, no one had more than three failures within the warranty period.) a. With these data, calculate the confidence intervals

requested in the previous two problems. b. Suppose that Niyaki sold this Blu-ray model to

12,450 customers during the year. Calculate a 95% confidence interval for its total net cost due to warranties from all of these sales.

358 Chapter 8 Confidence Interval Estimation Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

359

77. The file P08_77.xlsx contains data on 856 custom- ers who have either tried or not tried a company’s new frozen lasagna dinner. (This data set was used in Example 3.5 in Chapter 3.) The manager of the company would like to compare the proportion of cus- tomers who have tried the lasagna across various sub- populations. For each of the following, calculate a 95% confidence interval for the difference between the proportions who have tried the lasagna for the two specified subpopulations. Explain briefly how the results help the manager to understand his customers. (Hint: One approach is to use pivot tables to get the count data you need.) a. Those with weight under 190 versus those with

weight at least 190 b. Females versus males c. Those who live alone versus those who do not live

alone d. Those who live in a home or condo versus those

who live in an apartment e. Those who live in the South or West versus those

who live in the East f. f. f Those who average five or more trips to the mall

per month versus those who average fewer than five trips to the mall per month.

78. The formula for a 95% confidence interval for a mean (sample mean plus or minus approximately two standard errors) is so well-rooted in statisti- cal theory and practice that you might not even consider other possibilities. However, many researchers and even practitioners favor a totally different method of calculating a 95% confidence interval for the mean. It is called the bootstrap method. Starting with a sample of size n, they generate many “bootstrap samples,” calculate the sample mean of each, and report the 2.5 and 97.5 percentiles of these sample means as the endpoints of the confidence interval. Each bootstrap sample is a random sample of size n, with replacement, from the given data. That is, each member of a bootstrap sample is equally likely to be any of the original n data points. Implement this in Excel, starting with the sample of 50 salaries in the file P08_78.xlsx. Create at least 100 bootstrap samples. Compare the resulting bootstrap confidence interval with the traditional one. (Hint: The bootstrap samples can be generated quickly with a combination of the RANDBETWEEN and VLOOKUP functions.)

8-10 Conclusion 359 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 8.1 HARRIGAN UNIVERSITY ADMISSIONS

Harrigan University is a liberal arts university in the Midwest that attempts to attract the highest- quality students, especially from its region of the country. It has gathered data on 178 applicants who were accepted by Harrigan (a random sample from all acceptable applicants over the past several years). The data are in the file C08_01.xlsx. The variables are as follows:

■ Accepted: whether the applicant accepts Harrigan’s offer to enroll

■ MainRival: whether the applicant enrolls at Harrigan’s main rival university

■ HSClubs: number of high school clubs applicant served as an officer

■ HSSports: number of varsity letters applicant earned

■ HSGPAGPAGP : applicant’s high school GPA: applicant’s high school GPA: applicant’s high school GP

■ HSPctile: applicant’s percentile (in terms of GPAPctile: applicant’s percentile (in terms of GPAPctile: applicant’s percentile (in terms of GP ) in his or her graduating class

■ HSSize: number of students in applicant’s graduating class

■ SATSATSA : applicant’s combined SAT scorSAT scorSA e

■ Combined Score: a combined score for the applicant used by Harrigan to rank applicants

The derivation of the combined score is a closely kept secret by Harrigan, but it is basically a weighted average of the various components of high school performance and SAT. Harrigan is concerned that it is not getting enough of the best students, and worse yet, that many of these best students are going to Harrigan’s main rival. Solve the following problems and then, based on your analysis, comment on whether Harrigan appears to have a legitimate concern.

1. Calculate a 95% confidence interval for the pro- portion of all acceptable applicants who accept Harrigan’s invitation to enroll. Do the same for all acceptable applicants with a combined score less than 330, with a combined score between

330 and 375, and then with a combined score greater than 375. (Note that 330 and 375 are approximately the first and third quartiles of the Combined Score variable.)

2. Calculate a 95% confidence interval for the proportion of all acceptable students with a combined score less than the median (356) who choose Harrigan’s rival over Harrigan. Do the same for those with a combined score greater than the median.

3. Calculate 95% confidence intervals for the mean combined score, the mean high school GPAGPAGP , and the mean SAT scorSAT scorSA e of all acceptable students who accept Harrigan’s invitation to enroll. Do the same for all acceptable students who choose to enroll elsewhere. Then calculate 95% confidence intervals for the differences between these means, where each difference is a mean for students enrolling at Harrigan minus the similar mean for students enrolling elsewhere.

4. Harrigan is interested (as are most schools) in getting students who are involved in extracurric- ular activities (clubs and sports). Does it appear to be doing so? Calculate a 95% confidence inter- val for the proportion of all students who decide to enroll at Harrigan who have been officers of at least two clubs. Calculate a similar confidence interval for those who have earned at least four varsity letters in sports.

5. The combined score Harrigan calculates for each student gives some advantage to students who rank highly in a large high school relative to those who rank highly in a small high school. Therefore, Harrigan wonders whether it is relatively more successful in attracting students from large high schools than from small high schools. Calculate one or more confidence intervals for relevant parameters to shed some light on this issue.

360 Chapter 8 Confidence Interval Estimation Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 8.2 EMPLOYEE RETENTION AT D&Y

Demand for systems analysts in the consulting industry is greater than ever. Graduates with a combination of business and computer knowledge— some even from liberal arts programs—are getting great offers from consulting companies. Once these people are hired, they frequently switch from one company to another as competing companies lure them away with even better offers. One consulting company, D&Y, has collected data on a sample of systems analysts with undergraduate degrees they hired several years ago. The data are in the file C08_02.xlsx. The variables are as follows:

■ Starting Salary: employee’s starting salary at D&Y

■ On Road Pct: percentage of time employee has spent on the road with clients

■ State Univ: whether the employee graduated from State University (D&Y’s principal source of recruits)

■ CIS Degree: whether the employee majored in Computer Information Computer Information Computer Inf Systems (CIS) or a similar computer-related area

■ Stayed 3 Years: whether the employee stayed at least three years with D&Y

■ Tenure: tenure of employee at D&Y (months) if he or she moved before three years

D&Y is trying to learn everything it can about retention of these valuable employees. You can help by solving the following problems and then, based on your analysis, presenting a report to D&Y.

1. Although starting salaries are in a fairly narrow band, D&Y wonders whether they have anything to do with retention.

b. Calculate a 95% confidence interval for the mean starting salary of all employees who stay at least three years with D&Y. Do the same for those who leave before three years. Then calculate a 95% confidence interval for the dif- ference between these means.

c. Among all employees whose starting salary is below the median ($37,750), calculate a 95% confidence interval for the proportion who stay with D&Y for at least three years. Do the same for the employees with starting salaries above the median. Then calculate a 95% con- fidence interval for the difference between these proportions.

2. D&Y wonders whether the percentage of time on the road might influence who stays and who leaves. Repeat the previous problem, but now do the analysis in terms of percentage of time on the road rather than starting salary. (The median percentage of time on the road is 54%.)

3. Find a 95% confidence interval for the mean tenure (in months) of all employees who leave D&Y within three years of being hired. Why is it not possible with the given data to calculate a confidence interval for the mean tenure at D&Y among all systems analysts hired by D&Y?all systems analysts hired by D&Y?all

4. State University’s students, particularly those in its nationally acclaimed CIS area, have traditionally been among the best of D&Y’s recruits. But are they relatively hard to retain? Calculate one or more relevant confidence intervals to help you make an argument one way or the other.

C A S E 8.3 DELIVERY TIMES AT SNOWPEA RESTAURANT

The SnowPea Restaurant is a Chinese carryout/ delivery restaurant. Most of SnowPea’s deliveries are within a 10-mile radius, but it occasionally delivers to customers more than 10 miles away. SnowPea employs a number of delivery people, four

of whom are relatively new hires. The restaurant has recently been receiving customer complaints about excessively long delivery times. Therefore, SnowPea has collected data on a random sample of deliveries by its four new delivery people during the peak

Case 8.3 Delivery Times at SnowPea Restaurant 361 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

362

dinner time. The data are in the file C08_03.xlsx. The variables are as follows:

■ Deliverer: which person made the delivery

■ Prep Time: time from when order was placed until delivery person started driving it to the customer

■ Travel Time: time to drive from SnowPea to customer

■ Distance: distance (miles) from SnowPea to customer

Solve the following problems and then, based on your analysis, write a report that makes reasonable recommendations to SnowPea management.

1. SnowPea is concerned that one or more of the new delivery people might be slower than others.

a. Let μDi and μTi be the mean delivery time and mean total time for delivery person i, where the total time is the sum of the delivery and prep times. Calculate 95% confidence intervals for each of these means for each delivery per-for each of these means for each delivery per-for each of these means for each delivery per son. Although these might be interesting, give two reasons why they are not really fair meas- ures for comparing the efficiency of the delivery people.

b. Responding to the criticisms in part a, calcu- late a 95% confidence interval for the mean speed of delivery for each delivery person, where speed is measured as miles per hour during the trip from SnowPea to the cus- tomer. Then calculate 95% confidence inter- confidence inter- confidence inter vals for the mean difference in speed between each pair of delivery people.

2. SnowPea would like to advertise that it can achieve a total delivery time of no more than M minutes for all customers within a 10-mile radius. On all orders that take more than M minutes, SnowPea will give the customers a $10 certificate on their next purchase.

a. Assuming for now that the delivery peo-Assuming for now that the delivery peo-Assuming f ple in the sample are representative of all of SnowPea’s delivery people, calculate a 95% confidence interval for the proportion

of deliveries (within the 10-mile limit) that will be on time if M = 25 minutes; if M = 30 minutes; if M = 35 minutes.

b. Suppose SnowPea makes 1000 deliveries within the 10-mile limit. For each of the val- ues of M in part a, calculate a 95% confidence interval for the total dollar amount of certifi- cates it will have to pay for being late.

3. The policy in the previous problem is simple to state and simple to administer. However, it is somewhat unfair to customers who live close to SnowPea—they will never get $10 certifi- cates. A fairer, but more complex, policy is the following. SnowPea first analyzes the data and following. SnowPea first analyzes the data and f finds that total delivery times can be predicted fairly well with the equation

Predicted Delivery Time = 14.8 + 2.06*Distance

(This is based on regression analysis, the topic of Chapters 10 and 11.) Also, most of these predic- tions are within 5 minutes of the actual delivery times. Therefore, whenever SnowPea receives an order over the phone, it looks up the customer’s address in its computerized geographical data- base to find distance, calculates the predicted delivery time based on this equation, rounds this to the nearest minute, adds 5 minutes, and guarantees this delivery time or else a $10 cer- tificate. It does this for all customers, even those all customers, even those all beyond the 10-mile limit.

a. Assuming again that the delivery people in the sample are representative of all of SnowPea’s delivery people, calculate a 95% confidence interval for the proportion of all deliveries that will be within the guaranteed total deliv- ery time.

b. Suppose SnowPea makes 1000 deliveries. Calculate a 95% confidence interval for the total dollar amount of certificates it will have to pay for being late.

362 Chapter 8 Confidence Interval Estimation Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

363

OFFICIAL SPONSORS OF THE OLYMPICS

Hypothesis testing is one of the most frequently used tools in academic research, including research in the area of business. Many studies pose interesting questions, stated as hypotheses, and then test these with appropriate statistical analysis of experimental data. One such study is reported in McDaniel and Kinney (1996). They investigate the effectiveness of “ambush marketing” in prominent sports events such as the Olympic Games. Many companies pay significant amounts of money, perhaps $10 million, to become official sponsors of the Olympics. Ambushers are their competitors, who pay no such fees but nevertheless advertise heavily during the Olympics, with the intention of linking their own brand image to the event in the minds of consumers. The question McDaniel and Kinney investigate is whether consumers are confused into thinking that the ambushers are the official sponsors.

At the time of the 1994 Winter Olympics in Lillehammer, Norway, the researchers ran a controlled experiment using 215 subjects ranging in age from 19 to 49 years old. Approximately half of the subjects—the “control group”—viewed a 20-minute tape of a women’s skiing event in which several actual commercials for official sponsors in four product categories were interspersed. (The categories were fast food, automobile, credit card, and insurance; the official sponsors were McDonald’s, Chrysler, VISA, and John Hancock.) The other half—the “treatment group”—watched the same tape but with commercials for competing ambushers. (The ambushers were Wendy’s, Ford, American Express, and Northwestern Mutual, all of which advertised during the 1994 Olympics.) After watching the tape, each subject was asked to fill out a questionnaire. This questionnaire asked subjects to

Hypothesis Testing

C H A P T E R

9

R O

B E

R T P

A R

IG G

E R

/E PA

/N e w

sc o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

364 Chapter 9 Hypothesis Testing

recall the official Olympics sponsors in each product category, to rate their attitudes toward the products, and to state their intentions to purchase the products.

McDaniel and Kinney tested several hypotheses. First, they tested the hypothesis that there would be no difference between the control and treatment groups in terms of which products they would recall as official Olympics sponsors. The experimental evidence allowed them to reject this hypothesis decisively. For example, the vast majority of the control group, who watched the McDonald’s commercial, recalled McDonald’s as being the official sponsor in the fast-food category. But a clear majority of the treatment group, who watched the Wendy’s commercial, recalled Wendy’s as being the official sponsor in this category. Evidently, Wendy’s commercial was compelling.

Because the ultimate objective of commercials is to increase purchases of a company’s brand, the researchers also tested the hypothesis that viewers of official sponsor commercials would rate their intent to purchase that brand higher than viewers higher than viewers higher of ambusher commercials would rate their intent to purchase the ambusher brand. After all, isn’t this why the official sponsors were paying large fees? However, except for the credit card category, the data did not support this hypothesis. VISA viewers did indeed not support this hypothesis. VISA viewers did indeed not rate their intent to use VISA higher than American Express viewers rated their intent to use American Express. But in the other three product categories, the ambusher brand came out ahead of the official brand in terms of intent to purchase (although the ahead of the official brand in terms of intent to purchase (although the ahead differences were not statistically significant).

There are at least two important messages this research should convey to business. First, if a company is going to spend a lot of money to become an official sponsor of an event such as the Olympic Games, it must create a more vivid link in the mind of consumers between its product and the event. Otherwise, the company might be wasting its money. Second, ambush marketing is very possibly a wise strategy. By seeing enough of the ambushers’ commercials during the event, consumers get confused into thinking that the ambusher is an official sponsor. In addition, previous research in the area suggests that consumers do not view ambushers negatively for using an ambush strategy. ■

9-1 INTRODUCTION When you make inferences about a population on the basis of sample data, you can perform the analysis in either of two ways. You can proceed as in the previous chapter, where you calculate a point estimate of a population parameter and then form a con�- dence interval around this point estimate. In this way you bring no preconceived ideas to the analysis but instead let the data speak for themselves in estimating the parameter’s true value.

In contrast, an analyst often has a particular theory, or hypothesis, that he or she would like to test. This hypothesis might be that a new packaging design will produce more sales than the current design, that a new drug will have a higher cure rate for a given disease than any drug currently on the market, that people who smoke cigarettes are more susceptible to heart disease than nonsmokers, and so on. In this case the analyst typically collects sample data and checks whether the data provide enough evidence to support the hypothesis.

The hypothesis that the analyst is attempting to prove is called the alternative hypothesis. It is also frequently called the research hypothesis. The opposite of the alternative hypothesis is called the null hypothesis. It usually represents the current thinking

Hypothesis testing is a form of decision making under uncertainty, where you decide which of two competing hypotheses to accept, based on sample data. However, it is performed in a very specific way, as described in this chapter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-2 Concepts in Hypothesis Testing 365

or status quo. That is, the null hypothesis is usually the accepted theory that the analyst is trying to disprove. In the previous examples the null hypotheses are:

■ The new packaging design is no better than the current design.

■ The new drug has a cure rate no higher than other drugs on the market.

■ Smokers are no more susceptible to heart disease than nonsmokers.

The burden of proof is traditionally on the alternative hypothesis. It is up to the analyst to provide enough evidence in support of the alternative; otherwise, the null hypothesis will continue to be accepted. A slight amount of evidence in favor of the alternative is usually not enough. For example, if a slightly higher percentage of people are cured with a new drug in a sequence of clinical tests, this still might not be enough evidence to warrant introducing the new drug to the market. In general, we reject the null hypothesis—and accept the alternative—only if the results of the hypothesis test are statistically signi�cant, a concept explained in this chapter.

The null hypothesis is usually the current thinking, or status quo. The alternative, or research, hypothesis is usually the hypothesis a researcher wants to prove. The burden of proof is on the alternative hypothesis.

Con�dence interval estimation and hypothesis testing use data in much the same way and they often report basically the same results, only from different points of view. There contin- ues to be a debate (largely among academic researchers) over which of these two procedures is more useful. We believe that in a business context, con�dence interval estimation is more useful and enlightening than hypothesis testing. However, hypothesis testing continues to be a key aspect of statistical analysis. Indeed, statistical software packages routinely include the elements of standard hypothesis tests in their outputs. You will see this, for example, when you study regression analysis in Chapters 10 and 11. Therefore, it is important to understand the fundamentals of hypothesis testing so that you can interpret this output intelligently.

9-2 CONCEPTS IN HYPOTHESIS TESTING Before we plunge into the details of speci�c hypothesis tests, it is useful to discuss the concepts behind hypothesis testing. There are a number of concepts and statistical terms involved, all of which lead eventually to the key concept of statistical signi�cance. The following example provides context for this discussion.

E X A M P L E 9.1 A NEW PIZZA STYLE AT PEPPERONI PIZZA RESTAURANT

The manager of Pepperoni Pizza Restaurant has recently begun experimenting with a new method of baking pepperoni pizzas. He personally believes that the new method produces a better-tasting pizza, but he would like to base the decision whether to switch from the old method to the new method on customer reactions. Therefore, he performs an experiment. For 100 randomly selected customers who order a pepperoni pizza for home delivery, he includes both an old-style and a free new-style pizza in the order. All he asks is that these customers rate the difference between pizzas on a −10 to +10 scale, where −10 means that they strongly favor the old style, +10 means they strongly favor the new style, and 0 means they are indifferent between the two styles. Once he gets the ratings from the customers, how should he proceed?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

366 Chapter 9 Hypothesis Testing

Hypotheses for Pizza Example

Null hypothesis: μ ≤ 0 Alternative hypothesis: μ > 0 where μ is the mean population rating

We begin by stating that Example 9.1 is used primarily to explain hypothesis- testing concepts. We do not mean to imply that the manager would, or should, use not mean to imply that the manager would, or should, use not a hypothesis-testing procedure to decide whether to switch from the old method to the new method. First, hypothesis testing does not take costs into account. If the new method of making pizzas uses more expensive cheese, for example, then hypothesis testing would ignore this important aspect of the decision problem. Second, even if the costs of the two pizza-making methods are equivalent, the manager might base his deci- sion on a simple point estimate and possibly a confidence interval. For example, if the sample mean rating is 1.8 and a 95% confidence interval for the mean rating extends from 0.3 to 3.3, this in itself should probably be enough evidence to make the manager switch to the new method.

We come back to these ideas—basically, that hypothesis testing is not necessarily the best procedure to use in a business decision-making context—throughout this chapter. However, with these caveats in mind, we discuss how the manager might proceed by using might proceed by using might hypothesis testing. ■

9-2a Null and Alternative Hypotheses

As we stated in the introduction to this chapter, the hypothesis the manager is trying to prove is called the alternative, or research, hypothesis, whereas the null hypothesis repre- sents the status quo. In this example the manager would personally like to prove that the new method provides better-tasting pizza, so this becomes the alternative hypothesis. The opposite, that the old-style pizzas are at least as good as the new-style pizzas, becomes the null hypothesis. We assume he judges which of these is true on the basis of the mean rating over the entire customer population, labeled μ. If μ ≤ 0, the null hypothesis is true. Otherwise, if μ > 0, the alternative hypothesis is true.

Usually, the null hypothesis is labeled H0H0H and the alternative hypothesis is labeled HaHaH . Therefore, in our example they can be speci�ed as H0H0H :μ ≤ 0 and HaHaH :μ > 0. This is typical. The null and alternative hypotheses divide all possibilities into two nonoverlapping sets, exactly one of which must be true. In our case the mean rating is either less than or equal to 0, or it is positive. Exactly one of these possibilities must be true, and the manager’s goal is must be true, and the manager’s goal is must to use sample data to decide which is true.

Traditionally, hypothesis testing has been phrased as a decision-making problem, where an analyst decides either to accept the null hypothesis or reject it, based on the sample evidence. In our example, accepting the null hypothesis means deciding that the new-style pizza is not really better than the old-style pizza and presumably discontinuing the new style. In contrast, rejecting the null hypothesis means deciding that the new-style pizza is indeed better than the old-style pizza and presumably switching to the new style.

9-2b One-Tailed Versus Two-Tailed Tests

The form of the alternative hypothesis can be either one-tailed or one-tailed or one-tailed two-tailed, depending on what the analyst is trying to prove. The pizza manager’s alternative hypothesis is one-tailed

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-2 Concepts in Hypothesis Testing 367

because he is hoping to prove that the customers’ ratings are, on average, greater than 0. The only sample results that will lead to rejection of the null hypothesis are those in a particular direction, namely, those where the sample mean rating is positive. On the other hand, if the manager sets up his rating scale in the reverse order, so that negative ratings favor the new-style pizza, the test is still one-tailed, but now only negative sample means lead to rejection of the null hypothesis.

In contrast, a two-tailed test is one where results in either of two directions can lead to rejection of the null hypothesis. A slight modi�cation of the pizza example where a two-tailed alternative might be appropriate is the following. Suppose the manager cur- rently uses two methods for producing pepperoni pizzas. He is thinking of discontinuing one of these methods if it appears that customers, on average, favor one method over the other. Therefore, he runs the same experiment as before, but now the hypotheses he tests are H0H0H :μ = 0 versus HaHaH :μ ≠ 0, where μ is again the mean rating across the customer popu- lation. In this case either a large positive sample mean or a large negative sample mean or a large negative sample mean or will lead to rejection of the null hypothesis—and presumably to discontinuing one of the production methods.

A one-tailed alternative is one that is supported only by evidence in a single direction.

A two-tailed alternative is one that is supported by evidence in either of two directions.

It is important to realize that the analyst, not the data, determines the type of alternative hypothesis. The hypothesis depends on what the analyst wants to prove, and it should be formed before the data are collected.

Once the hypotheses are set up, it is easy to detect whether the test is one-tailed or two-tailed. One-tailed alternatives are phrased in terms of “>” or “<” whereas two-tailed alternatives are phrased in terms of “≠”. The question is whether to set up hypotheses for a particular problem as one-tailed or two-tailed. There is no statistical answer to this quesstatistical answer to this quesstatistical - tion. It depends entirely on what an analyst is trying to prove. If the pizza manager is trying to prove that the new-style pizza is better than the old-style pizza—only results on one side will lead to a switch—a one-tailed alternative is appropriate. However, if he is trying to decide whether to discontinue either of two existing production methods—where results on either side will lead to a switch—then a two-tailed alternative is appropriate.either side will lead to a switch—then a two-tailed alternative is appropriate.either

9-2c Types of Errors

Regardless of whether the manager decides to accept or reject the null hypothesis, it might be the wrong decision. He might incorrectly reject the null hypothesis when it is true (μ ≤ 0), and he might incorrectly accept the null hypothesis when it is false (μ > 0). In the tradition of hypothesis testing, these two types of errors have acquired the names type I and type II errors. In general, you commit a type I error when you incorrectly reject a reject a reject null hypothesis that is true. You commit a type II error when you incorrectly accept a null accept a null accept hypothesis that is false. These ideas appear graphically in Figure 9.1.

The pizza manager commits a type I error if he concludes, based on sample evidence, that the new-style pizza is better (and switches to it) when in fact the entire customer population would, on average, favor the old-style pizza. In contrast, he commits a type II error if he concludes, again based on sample evidence, that the new style is no better (and

Figure 9.1 Types of Errors in Hypothesis Testing

© Cengage Learning

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

368 Chapter 9 Hypothesis Testing

discontinues it) when in fact the entire customer population would, on average, favor the new style.

Type I error: Switching to new style when it is no better than old style

Type II error: Staying with old style when new style is better

The rejection region is the set of sample data that leads to the rejection of the null hypothesis.

The significance level, α, determines the size of the rejection region. Sample results in the rejection region are called statistically significant at the α level.

Type I errors are usually considered more costly, although this can lead to conservative decision making.

The analyst gets to choose the significance level α. It is traditionally chosen to be 0.05, but it is occasionally chosen to be 0.01 or 0.10.

The traditional hypothesis-testing procedure favors caution in terms of rejecting the null hypothesis. The thinking is that if you reject the null hypothesis and it is really true, then you commit a type I error—which is bad. Given this rather conservative way of think- ing, you are inclined to accept the null hypothesis unless the sample evidence provides strong support for the alternative hypothesis. Unfortunately, you can’t have it both ways. When you accept the null hypothesis, you risk committing a type II error.

This is exactly the dilemma the pizza manager faces. If he wants to avoid a type I error (where he switches to the new style but really shouldn’t), then he will require fairly convincing evidence from the survey that he should switch. If he observes should switch. If he observes should some evidence supporting the new style, such as a sample mean rating of +1.5 and a 95% con�dence inter- val that extends from −0.3 to +3.3, this evidence might not be strong enough to make him switch. However, if he decides not to switch, he risks committing a type II error.

9-2d Significance Level and Rejection Region

The question, then, is how strong the evidence in favor of the alternative hypothesis must be to reject the null hypothesis. Two approaches to this problem are commonly used. In the �rst, you prescribe the probability of a type I error that you are willing to tolerate. This type I error probability is usually denoted by α and is most commonly set equal to 0.05, although α = 0.01 and α = 0.10 are also frequently used. The value of α is called the sig- ni�cance level of the test. Then, given the value of α, you use statistical theory to determine a rejection region. If the sample evidence falls in the rejection region, you reject the null hypothesis; otherwise, you accept it. The rejection region is chosen precisely so that the probability of a type I error is at most α. Sample evidence that falls into the rejection region is called statistically signi�cant at the α level. For example, if α = 0.05, the evidence is statistically signi�cant at the 5% level.

It is important to understand the effect of varying α. If α is small, such as 0.01, the probability of a type I error is small. Therefore, a lot of sample evidence in favor of the alternative hypothesis is required before the null hypothesis can be rejected. Equivalently, the rejection region in this case is small. In contrast, when α is larger, such as 0.10, the rejection region is larger, and it is easier to reject the null hypothesis.

9-2e Significance from p-values

A second more popular approach is to avoid the use of a signi�cance level α and instead simply report how signi�cant the sample evidence is. This is done by means of a how signi�cant the sample evidence is. This is done by means of a how signi�cant p-value. The idea is quite simple—and very important. Suppose in the pizza example that the true mean rating (if it could be observed) is μ = 0. In other words, the customer population,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-2 Concepts in Hypothesis Testing 369

on average, judges the two styles of pizza to be equal. Now suppose that the sample mean rating is +2.5. The manager has two options at this point. (Remember that he doesn’t know that μ equals 0; he observes only the sample.) He can conclude that (1) the null hypothesis is true—the new-style pizza is not preferred over the old style—and he just observed an unusual sample, or (2) the null hypothesis is not true—customers do prefer the new-style not true—customers do prefer the new-style not pizza—and the sample he observed is a typical one for such customers.

The p-value of the sample quanti�es this. The p-value is the probability of seeing a random sample at least as extreme as the observed sample, given that the null hypothesis is true. Here, “extreme” is relative to the null hypothesis. For example, a sample mean rating of +3.5 from the pizza customers is more extreme evidence than a sample mean rating of +2.5. Each provides some evidence against the null hypothesis, but the former provides stronger, more extreme evidence.

The p-value of a sample is the probability of seeing a sample with at least as much evidence in favor of the alternative hypothesis as the sample actually observed. The smaller the p-value, the more evidence there is in favor of the alternative hypothesis.

Figure 9.2 Evidence in Favor of the Alternative Hypothesis

Let’s suppose that the pizza manager collects data from the 100 sampled customers and �nds that the p-value for the sample is 0.03. This means that if the entire customer if the entire customer if population, on average, judges the two types of pizza to be approximately equal, then only three random samples out of 100 would provide as much evidence in support of the new style as the observed sample. So should he conclude that the null hypothesis is true and he just happened to observe an unusual sample, or should he conclude that the null hypoth- esis is not true? There is no clear not true? There is no clear not statistical answer to this question; it depends on how statistical answer to this question; it depends on how statistical convinced the manager must be before switching. But we can say in general that smaller p-values indicate more evidence in support of the alternative hypothesis. If a p-value is suf�ciently small, then almost any analyst will conclude that rejecting the null hypothesis (and accepting the alternative) is the more reasonable decision.

How small is a “small” p-value? This is largely a matter of semantics, but Figure 9.2 indicates the attitude of many analysts. A p-value less than 0.01 is regarded as convincing evidence that the alternative hypothesis is true. After all, fewer than one sample out of 100 would provide this much support for the alternative hypothesis if it weren’t true. If the p-value is between 0.01 and 0.05, there is strong evidence in favor of the alternative hypoth- esis. Unless the consequences of making a type I error are really serious, this is typically enough evidence to reject the null hypothesis.

The interval between 0.05 and 0.10 is a gray area. If a researcher is trying to prove a research hypothesis and observes a p-value between 0.05 and 0.10, she will probably be reluctant to publish her results as “proof” of the alternative hypothesis, but she will prob- ably be encouraged to continue her research and collect more sample evidence. Finally, p-values larger than 0.10 are generally interpreted as weak evidence (or no evidence) in support of the alternative.

© Cengage Learning

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

370 Chapter 9 Hypothesis Testing

There is a strong connection between the α-level approach and the p-value approach. Speci�cally, the null hypothesis can be rejected at a speci�ed signi�cance level α only if the p-value from the sample is less than or equal to α. Equivalently, the sample evidence is statistically signi�cant at a given α level only if its p-value is less than or equal to α. For example, if the p-value from a sample is 0.03, the null hypothesis can be rejected at the 10% and the 5% signi�cance levels but not at the 1% level. The p-value essentially states how signi�cant a given sample is.

Sample evidence is statistically significant at the α level only if the p-value is less than α.

Key Role of p-values The single most important thing to remember from this chapter is the role of p-values. This is especially impor--values. This is especially impor--values. This is especially impor tant because p-values are listed in virtually all outputs from statistical software. If a p-value is small, the result is statistically significant, meaning that the null hypoth- esis can be rejected in favor of the alternative.

Analysts don’t always agree on how “small” a p-value needs to be—some say less than 0.01, some say less than 0.05, and some say less than 0.10. But just about all analysts agree that if a p-value is greater than 0.10, the result is not statistically significant, which not statistically significant, which not means that there is not enough evidence to reject the null hypothesis.

F u n da m e n ta l I n s i g h t

A p-value measures how unlikely the observed sample results are, given that the null hypothesis is true. Therefore, a low p-value provides evidence for rejecting the null hypothesis and accepting the alternative.

The advantage of the p-value approach is that you don’t have to choose a signi�cance level α ahead of time. Because it is far from obvious what value of α to choose in any particular situation, this is certainly an advantage. Another compelling advantage is that p-values for standard hypothesis tests are included in virtually all statistical software out- put. In addition, all p-values can be interpreted in basically the same way: A small p-value provides support for the alternative hypothesis.

9-2f Type II Errors and Power

A type II error occurs when the alternative hypothesis is true but there isn’t enough evi- dence in the sample to reject the null hypothesis. This type of error is traditionally con- sidered less important than a type I error, but it can lead to serious consequences in real situations. For example, in medical trials on a proposed new cancer drug, a type II error occurs if the new drug is really superior to existing drugs but experimental evidence is not suf�ciently conclusive to warrant marketing the new drug. For patients suffering from can- cer, this is obviously a serious error.

As we stated previously, the alternative hypothesis is typically the hypothesis a researcher wants to prove. If it is in fact true, the researcher wants to be able to reject the null hypothesis and hence avoid a type II error. The probability that she is able to do so is called the power of the test—that is, the power is one minus the probability of a type II error. There are several ways to achieve high power, the most obvious of which is to increase sample size. By sampling more members of the population, you are better able to see whether the alternative is really true and hence avoid a type II error if the alternative is indeed true. As in the previous chapter, there are formulas that specify the sample size required to achieve a certain power for a given set of hypotheses. We will not pursue these in this book, but you should be aware that they exist.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-2 Concepts in Hypothesis Testing 371

The power of a test is one minus the probability of a type II error. It is the probability of rejecting the null hypothesis when the alternative hypothesis is true.

When using a con�dence interval to perform a two-tailed hypothesis test, reject the null hypothesis if and only if the hypothesized value does not lie inside a con�dence interval not lie inside a con�dence interval not for the parameter.

9-2g Hypothesis Tests and Confidence Intervals

The results of hypothesis tests are often accompanied by con�dence intervals. This provides two complementary ways to interpret the data. However, there is a more formal connection between the two, at least for two-tailed tests. Let α be the stated signi�cance level of the test. We will state the connection for the most commonly used level, α = 0.05, although it extends to any α value. The connection is that the null hypothesis can be rejected at the 5% signi�cance level if and only if a 95% con�dence interval does not include the hypothnot include the hypothnot - esized value of the parameter.

As an example, consider the test of H0H0H :μ = 0 versus HaHaH :μ ≠ 0. Suppose a 95% con�- dence interval for μ extends from 1.35 to 3.42, so that it does not include the hypothesized not include the hypothesized not value 0. Then H0H0H can be rejected at the 5% signi�cance level, and the p-value from the sam- ple must be less than 0.05. On the other hand, if a 95% con�dence interval for μ extends, say, from −1.25 to 2.31 (negative to positive), the null hypothesis cannot be rejected at the 5% signi�cance level, and the p-value must be greater than 0.05.

There is also a correspondence between one-tailed hypothesis tests and one-sided con�dence intervals, but we will not pursue it here.

9-2h Practical versus Statistical Significance

We have stated that statistically signi�cant results are those that produce suf�ciently small p-values. In other words, statistically signi�cant results are those that provide strong evidence in support of the alternative hypothesis. You frequently hear about studies, par- ticularly in the medical sciences, that produce statistically signi�cant results. For example, you might hear that mice injected with one kind of drug develop signi�cantly more cancer cells than mice injected with a second kind of drug.

The point of this section is that such results are not necessarily signi�cant in terms of importance. They might be signi�cant only in the statistical sense. An example of what could happen is the following. An education researcher wants to see whether quantitative SAT scores differ, on average, across gender. He sets up the hypotheses H0H0H :μM = μF versus HaHaH :μM ≠ μF, where μM and μF are the mean quantitative SAT scores for males and females, respectively. He then randomly samples scores from 4000 males and 4000 females and �nds the male and female sample averages to be 521 and 524. He also �nds that the sample standard deviation for each group is about 50. Based on these numbers, the p-value for the sample data is approximately 0.007. (You will learn how to make this calculation later in the chapter.) Therefore, he claims that the results are signi�cant proof that males do score differently (lower) than females.

If you read these results in a newspaper, your immediate reaction might be, “Who cares?” After all, the difference between 521 and 524 is not very large from a practical point of view. So why does the education researcher get to make his claim? The reasoning is as follows. In all likelihood, the means μM and μF are not exactly equal. There is bound to

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

372 Chapter 9 Hypothesis Testing

be some difference between genders over the entire population. If the researcher takes large enough samples—and 4000 is plenty large—he is almost certain to obtain enough evidence to “prove” that the means are not equal. That is, he will almost surely obtain statistically signi�cant results. However, the difference he �nds, as in the numbers we quoted, might be of little practical signi�cance. No one really cares whether females score three points practical signi�cance. No one really cares whether females score three points practical higher or lower than males. If the difference were on the order of 30 to 40 points, then the result would be more interesting.

As this example illustrates, there is always a possibility of statistical signi�cance but not practical signi�cance with large sample sizes. To be fair, we should also mention the opposite case, which typically occurs with small sample sizes. Here the results are some- times not statistically signi�cant even though the truth about the population(s), if it were known, would be of practical signi�cance. Let’s assume that a medical researcher wants practical signi�cance. Let’s assume that a medical researcher wants practical to test whether a new form of treatment produces a higher cure rate for a deadly disease than the best treatment currently on the market. Due to expenses, the researcher is able to run a controlled experiment on only a relatively small number of patients with the disease. Unfortunately, the results of the experiment are inconclusive. They show some evidence that the new treatment works better, but the p-value for the test is only 0.25.

In the scienti�c community these results would not be enough to warrant a switch to the new treatment. However, it is certainly possible that the new treatment, if it were used on a large number of patients, would provide a “signi�cant” improvement in the cure rate—where “signi�cant” now means practical signi�cance. In this type of situation, the practical signi�cance. In this type of situation, the practical researcher could easily fail to discover practical signi�cance because the sample sizes are not large enough to detect it statistically.

From here on, when we use the term “signi�cant,” we mean statistically signi�cant. However, you should always keep the ideas in this section in mind. A statistically signi�- cant result is not necessarily of practical importance. Conversely, a result that fails to be statistically signi�cant is not necessarily one that should be ignored.

9-3 HYPOTHESIS TESTS FOR A POPULATION MEAN Now that we have covered the general concepts behind hypothesis testing and the principal sampling distributions (in the previous two chapters), the mechanics of hypothesis testing are fairly straightforward. We discuss in some detail how the procedure works for a popula- tion mean. Then in later sections we illustrate similar hypothesis tests for other parameters.

As with con�dence intervals, the key to the analysis is the sampling distribution of the sample mean. Recall that if you subtract the true mean μ from the sample mean and divide the difference by the standard error s/!n!n!! , the result has a t distribution with t distribution with t n − 1 degrees of freedom. In a hypothesis-testing context, the true mean to use is the null hypothesis value, speci�cally, the borderline value between the null and alternative hypotheses. This value is usually labeled μ0, where the subscript indicates that it is based on the null hypothesis.null hypothesis.null

To run the test, referred to as the t test for a population mean, you calculate the test statistic in Equation (9.1). This t-value indicates how many standard errors the sample mean is from the null value, μ0. If the null hypothesis is true, or more speci�cally, if μ = μ0, this test statistic has a t distribution with n − 1 degrees of freedom. The p-value for the test is the probability beyond the test statistic in both tails (for a two-tailed alternative) or in a single tail (for a one-tailed alternative) of the t distribution.t distribution.t

Extremely large samples can easily lead to statistically significant results that are not practically significant. In contrast, small samples can fail to produce statistically significant results that might indeed be practically significant.

Test Statistic for Test of Mean

t-value = X − μ0 s/!n!n!!

(9.1)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-3 Hypothesis Tests for a Population Mean 373

Objective To use a one-sample t test to see whether consumers prefer the new-style pizza to the old style.

Solution From the summary statistics, we see that the sample mean is X = 2.10 and the sample standard deviation is s = 4.717. This positive sample mean provides some evidence in favor of the alternative hypothesis, but given the rather large value of s, does it provide enough evidence to reject H0H0H ?

To run the test, you calculate the test statistic, using the borderline null hypothesis value μ0 = 0, and report how much probability is beyond it in the right tail of the appropri- ate t distribution. The t distribution. The t right tail is appropriate because the alternative is one-tailed of the right tail is appropriate because the alternative is one-tailed of the right “greater than” variety. The test statistic, calculated in cell E9, is

t-value = 2.1 − 0 4.717/!4!4! 0!

= 2.816

We illustrate the procedure by continuing the pizza manager’s problem in Example 9.1.

E X A M P L E 9.1 A NEW PIZZA STYLE AT PEPPERONI PIZZA RESTAURANT (CONTINUED)

Recall that the manager of Pepperoni Pizza Restaurant is running an experiment to test the hypotheses H0H0H :μ ≤ 0 versus HaHaH :μ > 0, where μ is the mean rating in the entire cus- tomer population. Here, each customer rates the difference between an old-style pizza and a new-style pizza on a scale from −10 to +10, where negative ratings favor the old style and positive ratings favor the new style. The ratings for 40 randomly selected customers appear in Figure 9.3. (See the file Pizza Ratings.xlsx.) Is there sufficient evidence from these sample data for the manager to reject H0H0H ?

Figure 9.3 Analysis of Pizza Data

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

39

40

41

Customer

A

1

2

3

4

5

6

7

8

9

10

11

12

13

14

38

39

40

Ra�ng Excel-only hypothesis test on mean

B CB C D ED E F GF G H

–7

7

–2

4

7

6

0

2

8

2

3

–4

8

–5

3

5

–6

Null mean

Alterna�ve type

Sample size

Sample mean

Sample std dev

Std error of mean

t-value test sta�s�c

Degrees of freedom

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

=COUNT(B2:B41)

=AVERAGE(B2:B41)=AVERAGE(B2:B41)=A

=STDEV.S(B2:B41)=STDEV.S(B2:B41)=STDEV

=E7/SQRT( E5)

=(E6–E2)/E8

=E5–1

=T.DIS=T.DIS=T T.RT(E9,E10)

=IF($E$11<=0.1,“Yes”“Yes”“Y ,es”,es”“No”)

=IF($E$11<=0.05,“Yes”“Yes”“Y ,es”,es”“No”)

=1F($E$11<=0.01,“Yes”“Yes”“Y ,es”,es”“No”)

0

greater than

40

2.1

4.717

0.746

2.816

39

0.0038

Yes

Yes

Yes

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

374 Chapter 9 Hypothesis Testing

This t-value indicates that the sample mean is slightly more than 2.8 standard errors to the right of the null value, 0. Intuitively, this provides a lot of evidence in favor of the alterna- tive—it is quite unlikely to see a sample mean 2.8 standard errors to the right of a “true” mean. The probability beyond this value in the right tail of a t distribution with t distribution with t n − 1 = 39 degrees of freedom is approximately 0.004, as shown in cell E11.

This probability, 0.004, is the p-value for the test. It indicates that these sample results would be very unlikely if the null hypothesis were true. The manager has two choices at this point. He can conclude that the null hypothesis is true and he obtained a very unlikely sam- ple, or he can conclude that the alternative hypothesis is true—and presumably switch to the new-style pizza. This second conclusion certainly appears to be the more reasonable choice.

Another way of interpreting the results of the test is in terms of traditional significance levels. The null hypothesis can be rejected at the 1% significance level because the p-value is less than 0.01. Of course, it can also be rejected at the 5% level or the 10% level because the p-value is also less than 0.05 and 0.10. The corresponding Yes/No values are calculated with IF functions in cells E12 to E14, but they are clear by comparing the traditional signif-with IF functions in cells E12 to E14, but they are clear by comparing the traditional signif-with IF functions in cells E12 to E14, but they are clear by comparing the traditional signif icance levels to the observed p-value. Just remember that the p-value is the preferred way to report the results because it indicates exactly how significant these sample results are.

As in the previous chapter, you can use Excel-only formulas as in Figure 9.3 to perform most common hypothesis tests, or you can use StatTools. To use StatTools for this example, you select Hypothesis Test and then Mean/Std. Deviation from the StatTools Statistical Inference dropdown list. Then you fill out the resulting dialog box as shown in the finished version of the pizza ratings file. The StatTools output is almost identical to the output shown in Figure 9.3.

Before leaving this example, we ask one last question. Should the manager switch to the new-style pizza on the basis of these sample results? We would probably recommend “yes.” There is no indication that the new-style pizza costs any more to make than the old-style pizza, and the sample evidence is fairly convincing that customers, on average, prefer the new-style pizza. Therefore, unless there are reasons for not switching that we haven’t mentioned here, we recommend the switch. However, if it costs more to make the new-style pizza (and its price is no higher), hypothesis testing is not the best way to not the best way to not perform the decision analysis.

Figure 9.3 illustrates how to run and interpret any one-tailed hypothesis for the mean, assuming

the alternative is of the “greater than” variety. If the alternative is still one-tailed but of the “less than” variety, there is virtually no change. We illustrate this in Figure 9.4, where the ratings have been reversed in sign. That is, each rating was multiplied by −1, so that negative ratings now favor the new-style pizza. The hypotheses are now H0H0H :μ ≥ 0 versus HaHaH :μ < 0 because a negative mean now supports the new style. The only difference in run- ning the analysis is that the test statistic is now the negative of the previous test statistic, −2.816, and the p-value, 0.004, is exactly the same. This is now the probability in the left tail of the t distribution, but the interpretation of the results is the same as before.

To complete this example, Figure 9.5 illustrates how a two-tailed test would be run, using exactly the same sample data. Remember that this would be relevant if the pizza man- ager were deciding which of two new-style pizzas to switch to. The same t-statistic is calcu- lated, but because of the two-tailed nature of the test, the previous p-value is doubled. (The ABS function in cell E11 ensures that the same p-value is obtained regardless of whether

Test Statistics and p-values All hypothesis tests are implemented by calculating a test statistic from the data and seeing how far out this test statistic is in one or both tails of some well- known distribution. The details of this procedure might or might not be included in the output from statistical software, but the p-value is always included. The p-value specifies the probability in the tail (or tails) beyond the test statistic. In words, it measures how unlikely such an extreme value of the test statistic is if the null hypoth- esis is true.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-3 Hypothesis Tests for a Population Mean 375

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

38

39

40

41

Customer

A

1

2

3

4

5

6

7

8

9

10

11

12

13

14

37

38

39

40

Ra�ng Excel-only hypothesis test on mean

B CB C D ED E F GF G H

7

–7

2

–4

–7

–6

0

–2

–8

–2

–3

4

–8

5

–7

–3

–5

6

Null mean

Alterna�ve type

Sample size

Sample mean

Sample std dev

Std error of mean

t-value test sta�s�c

Degrees of freedom

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

=COUNT(B2:B41)

=AVERAGE(B2:B41)=AVERAGE(B2:B41)=A

=STDEV.S(B2:B41)=STDEV.S(B2:B41)=STDEV

=E7/SQRT( E5)

=(E6–E2)/E8

=E5–1

=T.DIST(E9,E10,=T.DIST(E9,E10,=T TRUE)

=IF($E$11<=0.1,“Yes”“Yes”“Y ,es”,es”“No”)

=IF($E$11<=0.05,“Yes”“Yes”“Y ,es”,es”“No”)

=IF($E$11<=0.01,“Yes”“Yes”“Y ,es”,es”“No”)

0

less than

40

–2.1

4.717

0.746

–2.816

39

0.0038

Yes

Yes

Yes

Figure 9.4 Hypothesis Test with Reverse Coding

© C

e n g

a g

e L

e a rn

in g

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

39

40

Customer

A

1

2

3

4

5

6

7

8

9

10

11

12

13

14

38

39

Ra�ng Excel-only hypothesis test on mean

B CB C D ED E F GF G IH

–7

7

–2

4

7

6

0

2

8

2

3

–4

8

–5

3

5

Null mean

Alterna�ve type

Sample size

Sample mean

Sample std dev

Std error of mean

t-value test sta�s�c

Degrees of freedom

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

=COUNT(B2:B41)

=AVERAGE(B2:B41)=AVERAGE(B2:B41)=A

=STDEV.S(B2:B41)=STDEV.S(B2:B41)=STDEV

=E7/SQRT(E5)

=(E6–E2)/E8

=E5–1

=2*T.DIS=2*T.DIS=2*T T.RT(ABS(E9),E10)

=IF($E$11<=0.1,“Yes”“Yes”“Y ,es”,es”“No”)

=IF($E$11<=0.05,“Yes”“Yes”“Y ,es”,es”“No”)

=IF($E$11<=0.01,“Yes”“Yes”“Y ,es”,es”“No”)

0

not equal

40

2.1

4.717

0.746

2.816

39

0.0076

Yes

Yes

Yes

Figure 9.5 Two-Tailed Hypothesis Test

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

376 Chapter 9 Hypothesis Testing

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P09_01.xlsx contains a random sample of

100 lightbulb lifetimes. The company that produces these lightbulbs wants to know whether it can claim that its lightbulbs typically last more than 1000 burn- ing hours. a. Identify the null and alternative hypotheses for this

situation. b. Can this lightbulb manufacturer claim that its

lightbulbs typically last more than 1000 hours at the 5% significance level? What about at the 1% significance level? Explain your answers.

2. A manufacturer is interested in determining whether it can claim that the boxes of detergent it sells contain, on average, more than 500 grams of detergent. The firm selects a random sample of 100 boxes and records the amount of detergent (in grams) in each box. The data are provided in the file P09_02.xlsx. a. Identify the null and alternative hypotheses for this

situation. b. Is there statistical support for the manufacturer’s

claim? Explain.

3. A producer of steel cables wants to know whether the steel cables it produces have an average breaking strength of 5000 pounds. An average breaking strength of less than 5000 pounds would not be adequate, and to produce steel cables with an average breaking strength in excess of 5000 pounds would unnecessar- ily increase production costs. The producer collects a random sample of 64 steel cable pieces. The breaking strength for each of these cable pieces is recorded in the file P09_03.xlsx. a. Identify the null and alternative hypotheses for this

situation. b. Using a 5% significance level, what statistical

conclusion can the producer reach regarding the average breaking strength of its steel cables? Would the conclusion be any different at the 1% level? Explain your answers.

4. A U.S. Navy recruiting center knows from past experience that the heights of its recruits have tradi- tionally been normally distributed with mean

69 inches. The recruiting center wants to test the claim that the average height of this year’s recruits is greater than 69 inches. To do this, recruiting personnel take a random sample of 64 recruits from this year and record their heights. The data are provided in the file P09_04.xlsx. a. Identify the null and alternative hypotheses for this

situation. b. On the basis of the available sample information,

do the recruiters find support for the given claim at the 5% significance level? Explain.

c. Use the sample data to calculate a 95% confidence interval for the average height of this year’s recruits. Based on this confidence interval, what conclusion should recruiting personnel reach regarding the given claim?

5. Suppose that you wish to test H0H0H :μ ≤ 10 versus HaHaH :μ > 10 at the α = 0.05 significance level. Furthermore, suppose that you observe values of the sample mean and sample standard deviation when n = 40 that do not lead to the rejection of not lead to the rejection of not H0H0H . Is it true that you might reject H0H0H if you observed the same values of the sample mean and sample stand- ard deviation from a sample with n > 40? Why or why not?

Level B 6. A study is performed in a large southern town to

determine whether the average amount spent on food per four-person family in the town is significantly different from the national average. A random sample of the weekly grocery bills of two-person families in this town is given in the file P09_06.xlsx. Assume the national average amount spent on food for a four- person family is $150. a. Identify the null and alternative hypotheses for this

situation. b. Is the sample evidence statistically significant? If

so, at what significance levels can you reject the null hypothesis?

c. For which values of the sample mean (i.e., average weekly grocery bill) would you reject the null hypothesis at the 1% significance level? For which values of the sample mean would you reject the null hypothesis at the 10% level?

the t-statistic is positive or negative.) However, because the p-value is still less than 0.01, the null hypothesis can be rejected at any of the traditional signi�cance levels. In words, the manager can con�dently conclude that the mean ratings of the two new-style pizzas are not the same. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 377

7. An aircraft manufacturer needs to buy aluminum sheets with an average thickness of 0.05 inch. The manufacturer knows that significantly thinner sheets would be unsafe and considerably thicker sheets would be too heavy. A random sample of 100 sheets from a potential supplier is collected. The thickness of each sheet in this sample is measured (in inches) and recorded in the file P09_07.xlsx. a. Identify the null and alternative hypotheses for this

situation. b. Based on the results of an appropriate hypothesis

test, should the aircraft manufacturer buy aluminum sheets from this supplier? Explain why or why not.

c. For which values of the sample mean (i.e., average thickness) would the aircraft manufacturer decide to buy sheets from this supplier? Assume a significance level of 5% in answering this question.

8. Suppose that you observe a random sample of size n from a normally distributed population. If you are able to reject H0H0H :μ = μ0 in favor of a two-tailed alternative hypothesis at the 10% significance level, is it true that you can definitely reject H0H0H in favor of the appropriate one-tailed alternative at the 5% significance level? Why or why not?

Test Statistic for Test of Proportion

z - value = p̂ − p0

"p"p" 0(1 − p0)" /n (9.2)

9-4 HYPOTHESIS TESTS FOR OTHER PARAMETERS Just as we developed con�dence intervals for a variety of parameters, we can develop hypothesis tests for other parameters. They are based on the same sampling distributions discussed in the previous chapter, and they are run and interpreted exactly as the tests for the mean in the previous section. In each case the sample data are used to calculate a test statistic that has a well-known sampling distribution. Then a corresponding p-value meas- ures the support for the alternative hypothesis. Beyond this, only the details change, as we illustrate in this section.

9-4a Hypothesis Tests for a Population Proportion

To test a population proportion p, recall that the sample proportion p̂ has a sampling distri- bution that is approximately normal when the sample size is reasonably large. Speci�cally, the distribution of the standardized value

p̂ − p !p!p! (1 − p)/n!

is approximately normal with mean 0 and standard deviation 1. This leads to the following z test for a population proportion.

Let p0 be the borderline value of p between the null and alternative hypotheses. Then p0 is substituted for p to obtain the test statistic in Equation (9.2). The p-value of the test is found by seeing how much probability is beyond this test statistic in the tail (or tails) of the standard normal distribution.1 found by seeing how much probability is beyond this test statistic in the tail (or tails) of the

1 found by seeing how much probability is beyond this test statistic in the tail (or tails) of the

A rule of thumb for checking the large-sample assumption of this test is to check whether npnpn 0 > 5 and n(1 − p0) > 5.

The following example illustrates this test of proportion.

1Do not confuse the unknown proportion p with the p-value of the test. They are logically different concepts and just happen, by tradition, to share the same letter p.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

378 Chapter 9 Hypothesis Testing

E X A M P L E 9.2 CUSTOMER COMPLAINTS AT WALPOLE APPLIANCE COMPANY

Walpole Appliance Company has a customer service department that handles cus-tomer questions and complaints. This department’s processes are set up to respond quickly and accurately to customers who phone in or email their concerns. However, there is a sizable minority of customers who prefer to write letters. Traditionally, the customer service department has not been very efficient in responding to these customers.

Letter writers first receive an email asking them to call customer service (which is exactly what letter writers wanted to avoid in the first place), and when they do call, the cus- tomer service representative who answers the phone typically has no knowledge of the cus- tomer’s problem. As a result, the department manager estimates that 15% of letter writers have not obtained a satisfactory response within 30 days of the time their letters were first received. The manager’s goal is to reduce this value by at least half, that is, to 7.5% or less.

To do so, she changes the process for responding to letter writers. Under the new pro- cess, these customers now receive a prompt and courteous form letter that responds to their problem. (This is possible because the vast majority of concerns can be addressed by one of several form letters.) Each form letter states that if the customer still has problems, he or she can call the department. The manager also files the original letters so that if customers do call back, the representative who answers will be able to find their letters quickly and respond intelligently. With this new process in place, the manager has tracked 400 letter writers and has found that only 23 of them are classified as “unsatisfied” after a 30-day period. Does it appear that the manager has achieved her goal?

Objective To use a test for a proportion to see whether the new process of responding to complaint letters results in an acceptably low proportion of unsatisfied customers.

Solution The manager’s goal is to reduce the proportion of unsatisfied customers after 30 days from 0.15 to 0.075 or less. Because the burden of proof is on her to “prove” that she has accom- plished this goal, we set up the hypotheses as H0H0H :p ≥ 0.075 versus HaHaH :p < 0.075, where p is the proportion of all letter writers who are still unsatisfied after 30 days. The sample proportion she has observed is p̂ = 23/400 = 0.0575. This is obviously less than 0.075, but is it enough less to reject the null hypothesis?

The test can be performed with Excel-only formulas, as shown in rows 5–12 of Figure  9.6. See the file Customer Complaints.xlsx. (It can also be performed with StatTools, as illustrated in the finished version of the file.) Note that the standard error and z-value test statistic are calculated according to Equation (9.2), and the p-value is the prob- ability to the left of the test statistic, calculated with the NORM.S.DIST function.left of the test statistic, calculated with the NORM.S.DIST function.left

The p-value might not be as low as you expected—or as low as the manager would like. In spite of the fact that the sample proportion appears to be well below the target proportion of 0.075, the evidence in support of the alternative hypothesis is not overwhelming. In statis- tical terminology, the results are significant at the 10% level, but not at the 5% or 1% levels.

Figure 9.6 also shows a 95% confidence interval for the unknown proportion p. This confidence interval extends from 0.035 to 0.080. It includes the target value, 0.075, but just barely. In this sense it also provides some support for the argument that the manager has indeed achieved her goal.2 barely. In this sense it also provides some support for the argument that the manager has

2 barely. In this sense it also provides some support for the argument that the manager has

2Note that the standard error in cell E7 for the hypothesis test uses the target proportion 0.075. In contrast, the standard error for the con�dence interval in cell E15 uses the sample proportion 0.0575. The sampling distribution for a hypothesis test always uses the borderline value between H0H0H and HaHaH . But because con�dence intervals are not connected to any hypotheses, their standard errors must rely on sample data. In most cases the two standard errors are practically the same.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 379

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

Test of a propor�on: responding to customer complaint le�ers Excel-only hypothesis test on propor�on unsa�sfied

A

Category

Number of unsa�sfied customers

Number of sa�sfied customers

Count

23

377

B CB C D ED E F GF G H I JI J

Null mean

Alterna�ve type

Sample size

Sample propor�on unsa�sfied

Std error of propor�on (under null)

z-value test sta�s�c

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

Confidence interval for propor�on unsa�sfied

Std error of propor�on

Confidence level

z mul�ple

Lower limit

Upper limit

0.075

less than

400

0.0575

0.013

–1.329

0.0920

Yes

No

No

0.012

95%

1.960

0.035

0.080

=B4+B5

=B4/F5

=SQRT(F2*(1–F2)/F5)

=(F6–F2)/F7

=NORM.S.DIST(F8,TRUE)

=SQRT(F6*(1–F6)/F5)

Figure 9.6 Analysis of Customer Complaints

© C

e n g

a g

e L

e a rn

in g

Analysts might disagree on whether a hypothesis test or a confidence interval is the more appropriate way to present these results. However, we see them as complementary and do not necessarily favor one over the other. The bottom line is that they both provide some, but not totally conclusive, evidence that the manager has achieved her goal. ■

9-4b Hypothesis Tests for Differences between Population Means

We now discuss the comparison problem, where the difference between two population means is tested. As in the previous chapter, the form of the analysis depends on whether the two samples are independent or paired. For variety, we begin with the paired case.

If the samples are paired, then the test, referred to as the t test for difference between means from paired samples, proceeds exactly as in Section 9-3, using the differences as the single variable of analysis. That is, if D is the sample mean difference between n pairs, D0 is the hypothesized difference (the borderline value between H0H0H and HaHaH ), and sD is the sample standard deviation of the differences, then the test is based on the test statistic in Equation (9.3). If D0 is the true mean difference, this test statistic has a t distribution with t distribution with t n − 1 degrees of freedom. The validity of the test also requires that n be reasonably large and/or the population of differences be approximately normally distributed.

In contrast, if the samples are independent, the test is referred to as the t test for difference between means from independent samples. If the population standard deviations are equal, the two-sample theory discussed in Section 8-7 is relevant. It leads to the test statistic in Equation (9.4). Here, X1 and X2X2X are the two sample means, D0 is the hypothesized

This comparison problem— comparing two population means—is one of the most important problems analyzed with statistical methods. It can be analyzed with confidence intervals, hypothesis tests, or both.

Test Statistic for Paired Samples Test of Difference Between Means

t-value = D − D0 sD/!n!n!!

(9.3)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

380 Chapter 9 Hypothesis Testing

Test Statistic for Independent Samples Test of Difference Between Means

t-value = (X1 − X2X2X ) − D0 sp"1/n1 + 1/n2"

(9.5)

E X A M P L E 9.3 MEASURING THE EFFECTS OF TRADITIONAL AND NEW STYLES OF SOFT-DRINK CANS

Beer and soft-drink companies have become very concerned about the style of their cans. There are cans with fluted and embossed sides and cans with six-color graphics and holograms. Coca-Cola has even introduced a contoured can, shaped like the old-fashioned Coke bottle minus the neck. Evidently, these companies believe the style of the can makes a difference to consumers, which presumably translates into higher sales.

Assume that a soft-drink company is considering a style change to its current can, which has been the company’s trademark for many years. To determine whether this new style is popular with consumers, the company runs a number of focus group sessions around the country. At each of these sessions, randomly selected consumers are allowed to examine the new and traditional styles, exchange ideas, and offer their opinions. Eventually, they fill out a form where, among other questions, they are asked to respond to the following items, each on a scale of 1 to 7, 7 being the best:

■ Rate the attractiveness of the traditional-style can (AO).

■ Rate the attractiveness of the new-style can (AN).

■ Rate the likelihood that you would buy the product with the traditional-style can (WBO).

■ Rate the likelihood that you would buy the product with the new-style can (WBN).

(A and WB stand for “attractiveness” and “would buy,” and O and N stand for “old” and “new.”) What can the company conclude from these data? (See the file Soft-Drink Cans.xlsx.) Are hypothesis tests appropriate?

Objective To use paired-sample t tests for differences between means to see whether t tests for differences between means to see whether t consumers rate the attractiveness, and their likelihood to purchase, higher for a new-style can than for the traditional-style can.

Solution First, it is a good idea to examine summary statistics for the data. The averages from each sur- vey item are shown at the bottom of Figure 9.7. They indicate some support for the new-style

difference, n1 and n2 are the sample sizes, and sp is the same pooled estimate of the com- mon population standard deviation as in the previous chapter:

If D0 is the true mean difference, this test statistic has a t distribution with n1 + n2 − 2 degrees of freedom. The validity of this test again requires that the sample sizes be reason- ably large and/or the populations be approximately normally distributed.

Estimate of Common Standard Deviation

sp = Å (n1 − 1)s

2 1 + (n2 − 1)s

2 2

n1 + n2 − 2Å (9.4)

The following example illustrates the paired-sample t test.t test.t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 381

1 2 3 4 5 6

179 180 181 182 183 184 185 186 187 188 189

A BA B C DC D E Consumer AO AN WBO WO WBN

1 2 3 4 5

178 179 180

Averages

Correla�ons AO AN WBO WBN

5 7 6 1 3 5 3 3

4.41

AO 1.000 0.740 0.746 0.594

7 7 7 3 4 4 4 5

4.95

AN 0.740 1.000 0.595 0.401

4 6 7 1 1 4 1 6

3.86

WBO 0.746 0.595 1.000 0.774

1 6 6 1 1 3 3 7

4.34

WBN 0.594 0.401 0.774 1.000

Figure 9.7 Data and Summary Measures for Soft-Drink Cans

© C

e n g

a g

e L

e a rn

in g

can. Also, you might expect the ratings for a given consumer to be correlated. This turns out to be the case, as shown by the relatively large positive correlations in Figure 9.7. These large positive correlations indicate that if you want to examine differences between survey items, a paired-sample procedure will make the most efficient use of the data. Of course, a paired- sample procedure also makes sense because each consumer answers each item on the form. (If this is confusing, think about the following alternative setup, where there are four separate groups of consumers. The first group responds to item 1 only, the second group responds to item 2 only, and so on. Then the responses to the various items are in no way paired, and an independent-sample procedure would be used instead. However, this experimental design is not as efficient as the paired design in terms of making the best use of a given amount of data.)

There are several differences of interest. The two most obvious are the difference between the attractiveness ratings of the two styles and the difference between the likeli- hoods of buying the two styles—that is, column B minus column C and column D minus column E. A third difference of interest is the difference between the attractiveness rat- ings of the new style and the likelihoods of buying the new can—that is, column C minus column E. This difference indicates whether perceptions of the new-style can are likely to translate into actual sales. Finally, a fourth difference that might be of interest is the differ- ence between the third difference (column C minus column E) and the similar difference for the old style (column B minus column D). This checks whether the translation of per- ceptions into sales is any different for the two styles of cans.

All of these differences appear next to the original data in Figure 9.8.

1 2 3 4 5 6

179 180 181

A BA B C DC D E FE F G HG H I JI J Consumer AO AN WBO WO WBN AO−AN WBO−WBN AN−WBN AO−WBO (AN−WBN)−(AO−WBO)

1 4 1 –2 3 6 1 5 2 6 6 0 0 1 1 0 3 7 6 –1 1 1 2 4 1 1 –2 0 2 0 2 5 1 1 –1

1 2–11 2

–1

0 3 2 1 178 4 3 1 1 1 1 0 179 1 3 –1

–1 1 2

180 6 7 –2 –2

–2 –3 1

5 71 45 71 45 71 45 71 4 2 67 72 6

6 73 76 73 76 73 76 73 7 1 34 11 34 11 34 11 34 1 3 45 13 45 13 45 13 45 1 5 4 3 4 3 5

O WO W 1 4 3 6 1 5 2 6 6 0 0 1 1 0 3 7 6 –1 1 1 2 4 1 1 –2 0 2 0 5 1 1 – 0 3 2 1

4 3 1 1 1 1 1 3 1 2 6 7

5 71 45 71 4 2 67 72 6

6 73 76 73 7 1 34 11 34 1 3 45 13 45 1 5 4 3 4 3 5

Figure 9.8 Original and Difference Variables for Soft-Drink Can Data ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

382 Chapter 9 Hypothesis Testing

For each of the differences, you can test the mean difference over all potential con- sumers with a paired-sample analysis. (You actually run the one-sample procedure on the difference variables.) Exactly as in the previous chapter, each difference variable is treated as a single sample and the same t test as in Section 9-3 is run on this sample. In each case t test as in Section 9-3 is run on this sample. In each case t the hypothesized difference, D0, is 0. The only question is whether to run one-tailed or two-tailed tests. This depends on the prior beliefs of the company. We have run them all as two-tailed tests. In any case, you can change two-tailed p-values to one-tailed p-values by dividing by 2.

The results for all five differences appear in Figure 9.9. Here are some comments on the results.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

L

Null mean

Alterna�ve type

Sample size

Sample mean

Sample std dev

Std error of mean

t-value test sta�s�c

Degrees of freedom

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

M NM N O PO P Q RQ R T UT U VS

AO–AN

0

not equal

180

–0.539

1.351

0.101

–5.351

179

0.0000

Yes

Yes

Yes

WBO–WBN

0

not equal

180

–0.478

1.347

0.100

–4.758

179

0.0000

Yes

Yes

Yes

AN–WBN

0

not equal

180

0.611

2.213

0.165

3.705

179

0.0003

Yes

Yes

Yes

Formulas in column M, copied across

=COUNT(F2:F181)

=AVERAGE(F2:F181)=AVERAGE(F2:F181)=A

=STDEV.S(F2:F181)=STDEV.S(F2:F181)=STDEV

=M8/SQRT(M6)

=(M7–M3)/M9

=M6–1

=2*T.DIS=2*T.DIS=2*T T.RT(ABS(M10),M11)

=IF(M12<=0.1,“Yes”“Yes”“Y ,es”,es”“No”)

=IF(M12<=0.05,“Yes”,s”,s”“No”)

=IF(M12<=0.01,“Yes”,s”,s”“No”)

AO–WBO

0

not equal

180

0.550

1.309

0.098

5.639

179

0.0000

Yes

Yes

Yes

(AN–WBN)–( AO–WBO)

0

not equal

180

0.061

2.045

0.152

0.401

179

0.6889

No

No

No

Excel-only hypothesis tests of various differences

These are the usual “one-sample” tests on the differences in columns F–J.

Figure 9.9 Analysis of Differences

© C

e n g

a g

e L

e a rn

in g

■ From the output for AO – AN, there is overwhelming evidence that consumers, on average, rate the attractiveness of the new design higher than the attractiveness of the current design. The t-distributed test statistic is −5.351, calculated as

−0.539 − 0 0.101

= −5.351

The corresponding p-value for a two-tailed test of the mean difference is (to four decimal places) 0.0000. A 99% con�dence interval (not shown) for the mean differ- ence extends from −0.801 to −0.277. Note that this 99% con�dence interval does not include the hypothesized value 0. This is consistent with the fact that the two-tailed p-value is less than 0.01. (Recall the relationship between con�dence intervals and two-tailed hypothesis tests from Section 9-2g.)

■ The results are basically the same for the difference between consumers’ likeli- hoods of buying the product with the two styles, WBO − WBN. Again, consumers are de�nitely more likely, on average, to buy the product with the new-style can. A 99% con�dence interval for the mean difference (not shown) extends from −0.739 to −0.216, which is again all negative.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 383

■ The company’s hypothesis that consumers’ ratings of attractiveness of the new-style can are greater, on average, than their likelihoods of buying the product with this style can is con�rmed. In this case, the relevant difference is AN − WBN. Although the results are shown for a two-tailed test, the results for a one-tailed “greater than” test are easy to infer. You simply divide the p-value in cell O12 by 2.

■ There is no evidence that the difference between attractiveness ratings and the likeli- hood of buying is any different for the new-style can than for the current-style can. Here the relevant difference is (AN − WBN) − (AO − WBO). The test statistic for a two-tailed test of this difference is 0.401 and the corresponding p-value, 0.689, isn’t even close to any of this traditional signi�cance levels. Furthermore, a 99% con�- dence interval for this mean difference (not shown) extends from a negative value, −0.336, to a positive value, 0.458.

These results are further supported by histograms of the difference variables, such as those shown in Figures 9.10 and 9.11. (Box plots could be used instead.) The histogram in Figure 9.10 shows many more negative differences than positive differences. This leads to the large negative test statistic and the all-negative confidence interval. In contrast, the histogram in Figure 9.11 is almost perfectly symmetric around 0 and hence provides no evidence that this mean difference is not zero.not zero.not

This example illustrates once again how hypothesis tests and confidence intervals provide complementary information, although the confidence intervals are arguably more useful here. The hypothesis test for the first difference, for example, shows that the aver- age rating for the new style is undoubtedly larger than for the current style. This is useful

Figure 9.10 Histogram of the AO-AN Variable

Figure 9.11 Histogram of the (AN-WBN)- (AO-WBO) Variable

40

50

60

Histogram of AO−AN

0

10

20

30

≤–3 (–2,–1)(–3,–2) (–1,0) (0,1) (1,2) >2 © C

e n g

a g

e L

e a rn

in g

40

45

50

Histogram of (AN−WBN)−(AO−WBO)

5

10

0

20

25

15

30

35

≤–5 (–5, –4) (–4, –3) (–3, –2) (–2, –1) (–1, 0) (0, 1) (1, 2) (2, 3) (3, 4) > 4 © C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

384 Chapter 9 Hypothesis Testing

information, but it is even more useful to know how much larger the average for the new style is. A confidence interval provides this information.

We conclude this example by recalling the distinction between practical significance and statistical significance. Due to the extremely low p-values, the results in columns M to P of Figure 9.9, leave no doubt as to statistical significance. But this could be due to the large sample size. That is, if the true mean differences are even slightly different from 0, large samples will almost surely discover this and report small p-values. The soft-drink company, on the other hand, is more interested in knowing whether the observed differ- ences are of any practical importance. This is not a statistical question. It is a question of what differences are important for the business. We suspect that the company would indeed be quite impressed with the observed differences in the sample—and might very well switch to the new-style can. ■

Significance and Sample Size in Tests of Differences The contrast between statistical and practical sig- nificance is especially evident in tests of differences between means. If the sample sizes are relatively small, it is likely that no statistical significance will statistical significance will statistical be found, even though the real difference between

means, if they could be estimated more accurately with more data, might be practically significant. On the practically significant. On the practically other hand, if the sample sizes are very large, then just about any difference between sample means is likely to be statistically significant, even though the real statistically significant, even though the real statistically difference between means might be of no practical importance.

F u n da m e n ta l I n s i g h t

The following example illustrates the independent two-sample independent two-sample independent t test. You can tell that t test. You can tell that t a paired-sample procedure is not appropriate because there is no attempt to match the observations in the two samples in any way. Indeed, this is obvious because the sample sizes are not equal.

E X A M P L E 9.4 PRODUCTIVITY DUE TO EXERCISE AT INFORMATRIX SOFTWARE COMPANY

Many companies have installed exercise facilities at their plants. The goal is not only to provide a bonus (free use of exercise equipment) for their employees, but to make the employees more productive by getting them in better shape. One such (fictional) company, Informatrix Software Company, installed exercise equipment on site a year ago. To check whether it has had a beneficial effect on employee productivity, the company gathered data on a sample of 80 randomly chosen employees, all between the ages of 30 and 40 and all with similar job titles and duties. The company observed which of these employees use the exercise facility regularly (at least three times per week on average). This group included 23 of the 80 employees in the sample. The other 57 employees were asked whether they exer- cise regularly elsewhere, and 6 of them replied that they do. The remaining 51, who admitted to being nonexercisers, were then compared to the combined group of 29 exercisers.

The comparison was based on the employees’ productivity over the year, as rated by their supervisors. Each rating was on a scale of 1 to 25, 25 being the best. To increase the validity of the study, neither the employees nor the supervisors were told that a study was in progress. In particular, the supervisors did not know which employees were involved in the study or which were exercisers. The data from the study (with many hidden rows) appear in Figure 9.12. (See the file Exercise & Productivity.xlsx.) Do these data support the company’s (alternative) hypothesis that exercisers outperform nonexercisers on aver- age? Can the company infer that any difference between the two groups is due to exercise?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 385

Objective To use a two-sample t test for the difference between means to see whether regular exercise increases worker productivity.

Solution To see whether there is any indication of a difference between the two groups, a good first step is to create side-by-side box plots of the Rating variable. These appear in Figure 9.13.

1 2 3 4 5 6

79 80 81

A BA B C Employee Exerciser Ra�ng

1 Yes 2 No 3 No 4 Yes 5 No

78 No 79 No 80 No

14 7

15 15 13 13 19 12

1 Y 2 N 3 N 4 Y 5 N

Figure 9.12 Exercise Data

Box Plot of Ra�ngs by Exerciser

25

20

15

10

5

0 Yes No

Figure 9.13 Box Plots for Exercise Data

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Although there is a great deal of overlap between the two distributions, the distribution for the exercisers is somewhat higher than that for the nonexercisers. Also, the variances of the two distributions appear to be roughly the same, although there is slightly more variation in the nonexerciser distribution.

A formal test of the mean difference uses the hypotheses H0H0H :μ1 − μ2 ≤ 0 versus HaHaH :μ1 − μ2 > 0, where μ1 and μ2 are the mean ratings for the exerciser and nonexerciser populations. It makes sense to use a one-tailed test, with the alternative of the “greater than” variety, because the company expects higher ratings, on average, for the exercis- ers. The output for this test appears in Figure 9.14. The top section shows summary sta- tistics for the two groups. How would you calculate these? You might start by using the COUNTIF and AVERAGEIF functions for the counts and sample means. However, there is no STDEVIF function for the sample standard deviations. So instead we used a simple pivot table, shown in Figure 9.15, to calculate all of these summary statistics.

Side-by-side box plots are typically a good way to begin the analysis when comparing two populations.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

386 Chapter 9 Hypothesis Testing

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

E

Null mean

Alterna�ve type

Summary stats

Sample size

Sample mean

Sample std dev

Mean difference

Pooled std dev

Std error of mean diff

t-value test sta�s�c

Degrees of freedom

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

Excel-only test of equal variances

Ra�o of sample variances

Degrees of freedom numerator

Degrees of freedom denominator

p-value

Excel-only hypothesis test of Ra ng difference (Yes - No)

F GF G H IH I LJ KJ K

0

greater than

Yes

29

16.862

4.103

2.725

4.909

1.142

2.387

78

0.0097

Yes

Yes

Yes

0.598

28

50

0.145

=F7–G7

=SQRT( ((F6–1)*F8^2+(G6–1) *G8^2)/( F6+G6–2))

=F11*SQRT(1/F6+1/G6)

=(F10–F2)/F12

=F6+G6–2

=T.DIST.RT(F13,F14)

From pivot table on next sheet

=(F8/G8)^2

=F6–1

=G6–1

=F.DIST(F21,F22,F23,TRUE)+F.DIST.RT(1/F21,F23,F22)

No

51

14.137

5.307

Figure 9.14 Analysis of Exercise Data

© C

e n g

a g

e L

e a rn

in g

Figure 9.15 Summary Statistics for Two Groups

1 2 3 4 5 6 7

A

29 16.86206897 4.103344785

B

51 14.1372549

5.306673564

80 15.125

5.052571723

C DC D

Values Count of Ra�ng Average of Ra�ng StdDev of Ra�ng

Exerciser Yes No Grand Total

© C

e n g

a g

e L

e a

rn in

g

If the population standard deviations are at least approximately equal (and the values in cells F8 and G8 suggest that this assumption is plausible), the output in rows 10–18, which follows directly from Equations (9.4) and (9.5), is relevant. It shows that the observed sample mean difference, 2.725, is indeed positive. That is, the exercisers in the sample out- performed the nonexercisers by 2.725 rating points on average. The output also shows that (1) the standard error of the sample mean difference is 1.142, (2) the test statistic is 2.387, and (3) the p-value for a one-tailed test is slightly less than 0.01. In words, the data provide

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 387

enough evidence to reject the null hypothesis at the 1% significance level, as well as at the 5% and 10% levels. It is clear that exercisers perform better, in terms of mean ratings, than nonexercisers. A 95% confidence interval for this mean difference (not shown) is all nega- tive; it extends from −4.988 to −0.452.

This answers the first question we posed, but it doesn’t answer the second. There is no way to be sure that the higher ratings for the exercisers are a direct result of exercise. It is possible that employees who exercise are naturally more ambitious and hard-working people, and that this extra drive is responsible for both their exercising and their higher rat- ings. This study is an observational study. The company observes two randomly selected groups of employees and analyzes the results. It does not explicitly control for other fac- tors, such as personality, that might be responsible for differences in ratings. Therefore, the company can never be sure that there is a causal relationship between exercise and performance ratings. All the company can state is that exercisers appear, on average, to be more productive than nonexercisers—for whatever reason.

We are almost finished with this example, but not quite. What about the output at the bottom of Figure 9.14? The test we just performed (and the confidence interval we reported) are based on the assumption of equal population standard deviations (or var- iances). As we discussed in Section 8-7a, if this assumption is violated, then a slightly different form of analysis should be performed, where the population variances are not assumed to be equal. StatTools performs this alternative analysis automatically, and you can see the results in the finished version of the file. The resulting p-value is slightly lower, about 0.006, and a confidence interval for the mean difference is slightly narrower, but the basic conclusions still hold.

The test reported at the bottom of Figure 9.14 is a formal test of the hypothesis H0H0H :σ

2 1/σ

2 2 = 1 versus HaHaH :σ

2 1/σ

2 2 ≠ 1, where the parameter being tested is the ratio of the two

population variances. (The details behind this test are explained in the following subsec- tion.) If this null hypothesis can be rejected on the basis of a low p-value in cell F24, then the equal-variance assumption is almost certainly not valid, and the procedure that does not not valid, and the procedure that does not not assume equal variances should be used. The p-value in cell F24, 0.145, suggests that the evidence against equal population variances is far from overwhelming, so it is safe to use against equal population variances is far from overwhelming, so it is safe to use against equal-variance procedure for this example, as shown in the middle of Figure 9.14. ■

9-4c Hypothesis Test for Equal Population Variances

As we just explained, the two-sample procedure for a difference between population means depends on whether population variances are equal. Therefore, it is natural to test �rst for equal variances. This test, referred to as the F test for equality of two variances, is phrased in terms of the ratio of population variances, σ21/σ

2 2. The null hypothesis is that this

ratio is 1 (equal variances), whereas the alternative is that it is not 1 (unequal variances). The test statistic for this test is the ratio of sample variances:

F-value = s21/s 2 2

Assuming that the population variances are equal, this test statistic has an F distribution with n1 − 1 and n2 − 1 degrees of freedom.

The F distribution, named after the famous statistician R. A. Fisher, is another sam- pling distribution that arises frequently in statistical studies. (It will appear again in the next two chapters on regression.) Because it always describes a ratio, there are two degrees of freedom parameters, one for the numerator and one for the denominator, and the numerator degrees of freedom is always quoted �rst.

Tables of the F distribution, for selected degrees of freedom, appear in many statistics books, but the necessary information can be obtained more easily with Excel’s F.DIST,

The F distribution is a distribution of positive values and is always skewed to the right. It typically appears in tests of equal variances.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

388 Chapter 9 Hypothesis Testing

To run the test, you �rst calculate the ratio of variances. (See cell F21 in Figure 9.14.) It then implements the F test to calculate the corresponding F test to calculate the corresponding F p-value (in cell F24). For our purposes, the most important thing is the p-value from the test. A small p-value provides strong evidence that the population variances are not equal. Otherwise, an equal-variance not equal. Otherwise, an equal-variance not assumption is reasonable. The p-value for the exercise data, 0.145, provides some evidence of unequal variances, but the evidence is certainly not overwhelming.

9-4d Hypothesis Tests for Differences between Population Proportions

One of the most common uses of hypothesis testing is to test whether two population pro- portions are equal. The following z test for difference between proportions can then be used. Let p1 and p2 be the two population proportions, and let p̂1 and p̂2 be the correspond- ing sample proportions, based on sample sizes n1 and n2. The goal is to test whether the sample proportions differ enough to conclude that the population proportions are not equal. As usual, a test on the difference p̂1 − p̂2, requires a standard error. If the null hypothesis is true, so that p1 = p2, then it can be shown that the standard error of p̂1 − p̂2 is given by Equation (9.6), where p̂c is the pooled proportion from the two samples combined. For example, if p̂1 = 20/85 and p̂2 = 34/115, then p̂c = (20 + 34)/(85 + 115) = 54/200. The reason for using this pooled estimate is that if the null hypothesis is true and the two popu- lation proportions are equal, it makes sense to base an estimate of this common proportion on the combined sample of data.combined sample of data.combined

Given this standard error, the rest is straightforward. Assuming that the sample sizes are reasonably large, the test statistic in Equation (9.7) has (approximately) a standard nor- mal distribution. The test can be run as illustrated in the following example.

F.DIST.RT, F.INV, and F.INV.RT functions. These functions are completely analogous to the CHI functions shown in Figure 8.9, so we refer you to that �gure for details.

CHANGES IN EXCEL 2010

These F functions were changed considerably in Excel 2010. There are now F.DIST and F.INV functions for left tails, and F.DIST has a last “cum” argument just like NOleft tails, and F.DIST has a last “cum” argument just like NOleft RM.DIST, T.DIST, and CHISQ.DIST. Also, there are two functions, F.DIST.RT and F.INV.RT and F.INV.R RT, for RT, for R right tails.right tails.right

Standard Error for Difference between Sample Proportions

SE(p(p(^1 − p̂2) = "p"p"^c(1 − p̂c) (1/n1 + 1/n2)" (9.6)

Test Statistic for Difference between Proportions

z-value = p̂1 − p̂2

SE(p(p(^1 − p̂2) (9.7)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 389

E X A M P L E 9.5 EMPLOYEE EMPOWERMENT AT ARMCO COMPANY

ArmCo Company, a large manufacturer of automobile parts, has several plants in the United States. For years, ArmCo employees have complained that their suggestions for improvements in the manufacturing processes have been ignored by upper manage- ment. In the spirit of employee empowerment, ArmCo management at the Midwest plant decided to initiate a number of policies to respond to employee suggestions. For exam- ple, a mailbox was placed in a central location, and employees were encouraged to drop suggestions into this box. No such initiatives were taken at the other ArmCo plants. As expected, there was a great deal of employee enthusiasm at the Midwest plant shortly after the new policies were implemented, but the question was whether life would revert to nor- mal and the enthusiasm would dampen with time.

To check this, 100 randomly selected employees at the Midwest plant and 300 employ- ees from other plants were asked to fill out a questionnaire six months after the implemen- tation of the new policies at the Midwest plant. Employees were instructed to respond to each item on the questionnaire by checking either a “yes” box or a “no” box. Two specific items on the questionnaire were the following:

■ Management at this plant is generally responsive to employee suggestions for improvements in the manufacturing processes.

■ Management at this plant is more responsive to employee suggestions now than it used to be.

The results of the questionnaire for these two items appear in rows 5 and 6 of Figure 9.16. (See the file Empowerment.xlsx.) Does it appear that the policies at the

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

A BA B

Category

Yes

No

Totals

Midwest

39

61

100

C DC D

Other

93

207

300

Employee empowerment results

Excel-only hypothesis test on difference (Midwest - Other) of Yest - Other) of Yest - Other) of Y

Hypothesized difference

Alterna�ve type

Sample propor�ons

Sample difference

Pooled propor�on

Std error of difference (under null)

z-value test sta�s�c

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

Excel-only confidence interval for difference (Midwest - Other)

Std error of difference

Confidence level

z mul�ple

Lower limit

Upper limit

0

greater than

0.39

0.08

0.33

0.054

1.473

0.070

Yes

No

No

0.056

95%

1.960

–0.029

0.189

0.31

E

Midwest

68

32

100

F G H I J KG H I J KG H I J K

Other

159

141

300

0

greater than

0.68

0.15

0.5675

0.057

2.622

0.004

Yes

No

No

0.055

95%

1.960

0.043

0.257

0.53

Item 1: Management responds

Category

Yes

No

Totals

Excel-only hypothesis test on difference (Midwest - Other) of Yest - Other) of Yest - Other) of Y

Hypothesized difference

Alterna�ve type

Sample propor�ons

Sample difference

Pooled propor�on

Std error of difference (under null)

z-value test sta�s�c

p-value of test

Reject at 10% level

Reject at 5% level

Reject at 1% level

Excel-only confidence interval for difference (Midwest - Other)

Std error of difference

Confidence level

z mul�ple

Lower limit

Upper limit

Item 2: Things have improved

=SUM(F5:G5)/SUM(F7:G7)

=SQRT( F16*(1–F16) *( 1/F7+1/G7))

=F14/F17

=1–NORM.S.DIST(F18,TRUE)

=SQRT(F13*(1–F13)/F7+G13*(1–G13)/G7)

Figure 9.16 Results for Employee Empowerment Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

390 Chapter 9 Hypothesis Testing

Midwest plant are appreciated? Should ArmCo implement these policies in its other plants?

Objective To use a test for the difference between proportions to see whether a program of accepting employee suggestions is appreciated by employees.

Solution For either questionnaire item, let p1 be the proportion of “yes” responses that would be obtained at the Midwest plant if the questionnaire were given to all of its employees, and define p2 similarly for the other plants. Management certainly hopes to find a larger pro- portion of “yes” responses (to either item) at the Midwest plant than at the other plants, so the appropriate test is one-tailed, with the hypotheses set up as H0H0H : p1 − p2 ≤ 0 versus HaHaH : p1 − p2 > 0. (These could also be written as H0H0H : p1 ≤ p2 versus H0H0H : p1 > p2, but this has no effect on the test.)

Using the counts in rows 5 and 6, the test for either difference follows directly from Equations (9.5) and (9.6). In fact, given our setup, the formulas in column B and C are copyable to columns F and G. (The test can also be implemented in StatTools, as illustrated in the finished version of the file.)

As shown in Figure 9.16, the p-values for the two tests (row 19) are 0.070 and 0.004. These results should be fairly good news for management. There is moderate, but not over- whelming, support for the hypothesis that management at the Midwest plant is more respon- sive than at the other plants, at least as perceived by employees. There is convincing support for the hypothesis that things have improved more at the Midwest plant than at the other plants. Corresponding 95% confidence intervals for the differences between proportions appear in rows 28 and 29. Because they are almost completely positive, they support the hypothesis-test findings. Moreover, they provide a range of plausible values for the differ- ences between the population proportions.

The only real downside to these findings, from Midwest management’s point of view, is the sample proportion p̂1 for the first item. Only 39% of the sampled employees at the Midwest plant believe that management generally responds to their suggestions, even though 68% believe things are better than they used to be. A reasonable conclusion by ArmCo management is that they are on the right track at the Midwest plant, and the policies initiated there ought to be initiated at other plants, but more must be done at all plants. ■

P R O B L E M S

Level A 9. In the past, 60% of all undergraduate students enrolled

at State University earned their degrees within four years of matriculation. A random sample of 95 students from the class that matriculated in the fall of 2012 was recently selected to test whether there has been a change in the proportion of students who graduate within four years. Administrators found that 40 of these 95 students graduated in the spring of 2016 (i.e., four academic years after matriculation).

a. Given the sample outcome, calculate a 95% confidence interval for the relevant population proportion. Does this interval estimate suggest that there has been a change in the proportion of students who graduate within four years? Why or why not?

b. Suppose now that State University administrators want to test the claim made by faculty that the proportion of students who graduate within four years at State University has fallen below the historical value of 60% this year. Use this sample

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 391

proportion to test their claim. Report a p-value and interpret it.

10. Suppose a well-known baseball player states that, at this stage of his career, he is a “300 hitter” or better. That is, he claims that he gets a hit in at least 30% of his at-bats. Over the next month of the baseball season, this player has 105 at-bats and gets 33 hits. a. Identify the null and alternative hypotheses from

the player’s point of view. b. Is there enough evidence from this month’s data

to reject the null hypothesis at the 5% significance level?

c. We might raise two issues with this test. First, does the data come from a random sample from some population? Second, what is the relevant population? Discuss these issues. Do you think the test in part b is valid? Is it meaningful?

11. The director of admissions of a distinguished (i.e., top-20) MBA program is interested in studying the proportion of entering students in similar graduate business programs who have achieved a composite score on the Graduate Management Admissions Test (GMAT) in excess of 630. In particular, the admissions director believes that the proportion of students entering top-rated programs with such composite GMAT scores is now 50%. To test this hypothesis, he has collected a random sample of MBA candidates entering his program in the fall of 2016. He believes that these students’ GMAT scores are indicative of the scores earned by their peers in his program and in competitors’ programs. The GMAT scores for these 125 individuals are given in the Data 2016 sheet of the file P09_11.xlsx. (You can ignore the data in the Data 2006 sheet for now.) Test the admission director’s claim at the 5% significance level and report your findings. Does your conclusion change when the significance level is increased to 10%?

12. A market research consultant hired by a leading soft- drink company wants to determine the proportion of consumers who favor its low-calorie drink over the leading competitor’s low-calorie drink in a particular urban location. A random sample of 250 consumers from the market under investigation is provided in the file P08_18.xlsx. a. Calculate a 95% confidence interval for the

proportion of all consumers in this market who prefer this company’s drink over the competitor’s. What does this confidence interval tell us?

b. Does the confidence interval in part a support the claim made by one of the company’s marketing managers that more than half of the consumers in this urban location favor its drink over the competitor’s? Explain your answer.

c. Comment on the sample size used in this study. Specifically, is the sample unnecessarily large? Is it too small? Explain your reasoning.

13. The CEO of a medical supply company is committed to expanding the proportion of highly qualified women in the organization’s staff of salespersons. He claims that the proportion of women in similar sales positions across the country in 2016 is less than 50%. Hoping to find support for his claim, he directs his assistant to collect a random sample of salespersons employed by his company, which is thought to be representative of sales staffs of competing organizations in the industry. These data are listed in the Data 2016 sheet of the file P09_13.xlsx. (You can ignore the data in the Data 2011 sheet for now.) Test this manager’s claim using the given sample data and report a p-value. Is there statistical support for his hypothesis that the proportion of women in similar sales positions across the country is less than 50%?

14. Management of a software development firm would like to establish a wellness program during the lunch hour to enhance the physical and mental health of its employees. Before introducing the wellness program, management must first be convinced that a sufficiently large majority of its employees are not already exercising at lunchtime. Specifically, it plans to initiate the program only if less than 40% of its personnel take time to exercise prior to eating lunch. To make this decision, management has surveyed a random sample of 100 employees regarding their midday exercise activities. The results of the survey are given in the Before sheet of the file P09_14.xlsx. Is there sufficient evidence at the 10% significance level for managers of this organization to initiate a corporate wellness program? Why or why not? What about at the 1% significance level?

15. The managing partner of a major consulting firm is trying to assess the effectiveness of expensive computer skills training given to all new entry-level professionals. In an effort to make such an assessment, she administers a computer skills test immediately before and after the training program to each of 40 randomly chosen employees. The pretraining and posttraining scores of these 40 individuals are recorded in the file P09_15.xlsx. Do the given sample data support the claim at the 10% significance level that the organization’s training program is increasing the new employee’s working knowledge of computing? What about at the 1% significance level?

16. A large buyer of household batteries wants to decide which of two equally priced brands to purchase. To do this, he takes a random sample of 100 batteries of each brand. The lifetimes, measured in hours, of the randomly chosen batteries are recorded in the file P09_16.xlsx. a. Using the given sample data, calculate a 95%

confidence interval for the difference between the mean lifetimes of brand 1 and brand 2 batteries.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

392 Chapter 9 Hypothesis Testing

Based on this confidence interval, which brand would you advise the buyer to purchase? Would you even need a confidence interval to make this recommendation? Explain.

b. Repeat part a with a 99% confidence interval. c. How are your results in parts a and b related to

hypothesis testing? Be specific.

17. The managers of a chemical manufacturing plant want to determine whether recent safety training workshops have reduced the weekly number of reported safety violations at the facility. The management team has randomly selected weekly safety violation reports for each of 25 weeks prior to the safety training and 25 weeks after the safety workshops. These data are provided in the file P09_17.xlsx. Given this evidence, is it possible to conclude that the safety workshops have been effective in reducing the number of safety violations reported per week? Report a p-value and interpret your findings for the management team.

18. A real estate agent has collected a random sample of 75 houses that were recently sold in a suburban com- munity. She is particularly interested in comparing the appraised value and recent selling price of the houses in this particular market. The values of these two vari- ables for each of the 75 randomly chosen houses are provided in the file P08_24.xlsx. Using these sample data, test whether there is a statistically significant mean difference between the appraised values and sell- ing prices of the houses sold in this suburban commu- nity. Report a p-value. For which levels of significance is it appropriate to conclude that no difference exists between these two values? Which is more appropri- ate, a one-tailed test or a two-tailed test? Explain your reasoning.

19. The owner of two submarine sandwich shops located in a particular city would like to know how the mean daily sales of the first shop (located in the downtown area) compares to that of the second shop (located on the southwest side of town). In particular, he would like to determine whether the mean daily sales levels of these two restaurants are essentially equal. He records the sales (in dollars) made at each location for 30 randomly chosen days. These sales levels are given in the file P09_19.xlsx. Calculate a 95% confidence level for the mean difference between the daily sales of restaurant 1 and restaurant 2. Based on this confidence interval, is it possible to conclude that there is a statistically significant mean difference at the 5% level of significance? Explain why or why not. Can you infer from this confidence interval whether there is a statistically significant mean difference at the 10% level? What about at the 1% level? Again, explain why or why not.

20. Suppose that an investor wants to compare the risks associated with two different stocks. One way to measure the risk of a given stock is to measure the

variation in the stock’s daily price changes. The investor obtains a random sample of 25 daily price changes for stock 1 and 25 daily price changes for stock 2. These data are provided in the file P09_20.xlsx. Explain why this investor can compare the risks associated with the two stocks by testing the null hypothesis that the vari- ances of the stocks’ price changes are equal. Perform this test, using a 10% significance level, and interpret the results.

21. A manufacturing company wants to determine whether there is a difference between the variance of the num- ber of units produced per day by one machine operator and the similar variance for another machine operator. The file P09_21.xlsx contain the number of units pro- duced by operator 1 and operator 2, respectively, on each of 25 days. Note that these two sets of days are not necessarily the same, so you can assume that the two samples are independent of one another.independent of one another.independent a. Identify the null and alternative hypotheses in this

situation. b. Do these sample data indicate a statistically

significant difference at the 10% level? Explain your answer. With your conclusion, which possible error could you be making, a type I or type II error?

c. At which significance levels could you not reject not reject not the null hypothesis?

22. A large buyer of household batteries wants to decide which of two equally priced brands to purchase. To do this, he takes a random sample of 100 batteries of each brand. The lifetimes, measured in hours, of the batteries are recorded in the file P09_16.xlsx. Before testing for the difference between the mean lifetimes of these two batteries, he must first determine whether the underlying population variances are equal. a. Perform a test for equal population variances.

Report a p-value and interpret its meaning. b. Based on your conclusion in part a, which test

statistic should be used in performing a test for the difference between population means? Perform this test and interpret the results.

23. Do undergraduate business students who major in finance earn, on average, higher annual starting sala- ries than their peers who major in marketing? Before addressing this question through a statistical hypoth- esis test, you should determine whether the variances of annual starting salaries of the two types of majors are equal. The file P09_23.xlsx contains (hypotheti- cal) starting salaries of 50 randomly selected finance majors and 50 randomly chosen marketing majors. a. Perform a test for equal population variances.

Report a p-value and interpret its meaning. b. Based on your conclusion in part a, which test

statistic should you use in performing a test for the existence of a difference between population means? Perform this test and interpret the results.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-4 Hypothesis Tests for Other Parameters 393

24. The CEO of a medical supply company is committed to expanding the proportion of highly qualified women in the organization’s large staff of salespersons. Given the recent hiring practices of his human resources director, he claims that the company has increased the proportion of women in sales positions throughout the organization between 2011 and 2016. Hoping to find support for his claim, he directs his assistant to collect random samples of the salespersons employed by the company in 2011 and 2016. These data are listed in the file P09_13.xlsx. Test the CEO’s claim using the sample data and report a p-value. Is there statistical support for the claim that his strategy is effective?

25. The director of admissions of a top-20 MBA program is interested in studying the proportion of entering students in similar graduate business programs who have achieved a composite score on the Graduate Management Admissions Test (GMAT) in excess of 630. In particular, the admissions director believes that the proportion of students entering top-rated programs with such composite GMAT scores is higher in 2016 than it was in 2006. To test this hypothesis, he has collected random samples of MBA candidates enter- ing his program in the fall of 2016 and in the fall of 2006. He believes that these students’ GMAT scores are indicative of the scores earned by their peers in his program and in competitors’ programs. The GMAT scores for the randomly selected students entering in each year are listed in the file P09_11.xlsx. Test the admission director’s claim at the 5% significance level and report your findings. Does your conclusion change when the significance level is increased to 10%?

26. Managers of a software development firm have estab- lished a wellness program during the lunch hour to enhance the physical and mental health of their employees. Now, they would like to see whether the wellness program has increased the proportion of employees who exercise regularly during the lunch hour. To make this assessment, the managers surveyed a random sample of 100 employees about their noon- time exercise habits before the wellness program was initiated. Later, after the program was initiated, after the program was initiated, after another 100 employees were independently chosen and sur- veyed about their lunchtime exercise habits. The results of these two surveys are given in the file P09_14.xlsx. a. Calculate a 95% confidence interval for the

difference in the proportions of employees who exercise regularly during their lunch hour before and after the implementation of the corporate wellness program.

b. Does the confidence interval found in part a support the claim that the wellness program has increased the proportion of employees who exercise regularly during the lunch hour? If so, at which levels of significance is this claim supported?

c. Would your results in parts a and b differ if the same 100 employees surveyed before the program were also surveyed after the program? Explain.

27. An Environmental Protection Agency official asserts that more than 80% of the plants in the northeast region of the United States meet air pollution standards. An antipollution advocate is not convinced by the EPA’s claim. She takes a random sample of 64 plants in the northeast region and finds that 56 meet the federal government’s pollution standards. a. Does the sample information support the EPA’s

claim at the 5% level of significance? b. For which values of the sample proportion (based

on a sample size of 64) would the sample data support the EPA’s claim, using a 5% significance level?

c. Would the conclusion found in part a change if the sample proportion remained constant but the sample size increased to 124? Explain why or why not.

Level B 28. A television network decides to cancel one of its

shows if it is convinced that less than 14% of the viewing public are watching this show. a. If a random sample of 1500 households with

televisions is selected, what sample proportion values will lead to this show’s cancellation, assuming a 5% significance level?

b. What is the probability that this show will be cancelled if 13.4% of all viewing households are watching it? That is, what is the probability that a sample will lead to rejection of the null hypothesis? You can assume that 13.4% is the population proportion (even though it wouldn’t be known to the network).

29. An economic researcher wants to know whether he can reject the null hypothesis, at the 10% significance level, that no more than 20% of the households in Pennsylvania make more than $70,000 per year. a. If 200 Pennsylvania households are chosen at

random, how many of them would have to be earning more than $70,000 per year to allow the researcher to reject the null hypothesis?

b. Assuming that the true proportion of all Pennsylvania households with annual incomes of at least $70,000 is 0.217, find the probability of not rejecting a false null hypothesis when the sample size is 200.

30. Senior partners of an accounting firm are concerned about recent complaints by some female managers that they are paid less than their male counterparts. In response to these charges, the partners ask their human resources director to record the salaries of female and

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

394 Chapter 9 Hypothesis Testing

male managers with equivalent education, work experi- ence, and job performance. A random sample of these pairs of managers is provided in the file P09_30.xlsx. That is, each male-female pair is matched in terms of education, work experience, and job performance. a. Do these data support the claim made by the

female managers? Report and interpret a p-value. b. Assuming a 5% significance level, which values

of the sample mean difference between the female and male salaries would support the claim of discrimination against female managers?

31. Do undergraduate business students who major in finance earn, on average, higher annual starting sala- ries than their peers who major in marketing? Address this question through a statistical hypothesis test. The file P09_23.xlsx contains the (hypothetical) starting salaries of 50 randomly selected finance majors and 50 randomly selected marketing majors. a. Is it appropriate to perform a paired-comparison

t test with these data? Explain why or why not. b. Perform an appropriate hypothesis test with a 5%

significance level. Summarize your findings. c. How large would the difference between the mean

starting salaries of finance and marketing majors have to be before you could conclude that finance majors earn more on average? Employ a 5% significance level in answering this question.

32. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. Test for the exist- ence of a significant difference between the mean debt levels of the households in the first (i.e., SW) and second (i.e., NW) sectors of this community. Perform similar hypothesis tests for the differences between the mean debt levels of households from all other pairs of locations (i.e., first and third, first and fourth, second and third, second and fourth, and third and fourth). Summarize your findings.

33. Elected officials in a Florida city are preparing the annual budget for their community. They want to determine whether their constituents living across town are typically paying the same amount in real estate taxes each year. Given that there are over 20,000 homeowners in this city, they have decided to sample a representative subset of taxpayers and thoroughly study their tax payments. A randomly selected set of 170 homeowners is given in the file P09_33.xlsx. Specifically, the officials want to test whether there is a difference between the mean real estate tax bill paid by residents of the first neighborhood of this town and first neighborhood of this town and first each of the remaining five neighborhoods. That is, each pair referenced below is from neighborhood pair referenced below is from neighborhood pair 1 and one of the other neighborhoods. a. Before conducting any hypothesis tests on

the difference between various pairs of mean real estate tax payments, perform a test for

equal population variances for each pair of neighborhoods. For each pair, report a p-value and interpret its meaning.

b. Based on your conclusions in part a, which test statistic should be used in performing a test for a difference between population means in each pair?

c. Given your conclusions in part b, perform an appropriate test for the difference between mean real estate tax payments in each pair of neighborhoods. For each pair, report a p-value and interpret its meaning.

34. Suppose that you sample two normal populations inde- pendently. The variances of these two populations are σ21 and σ

2 2. You take random samples of sizes n1 and n2

and observe sample variances of s21 and s 2 2.

a. If n1 = n2 = 21, how large must the fraction s1/s2 be before you can reject the null hypothesis that σ21 is no greater than σ22 at the 5% significance level?

b. Answer part a when n1 = n2 = 41. c. If s1 is 25% greater than s2, approximately how

large must n1 and n2 be if you are able to reject the null hypothesis in part a at the 5% significance level? Assume that n1 and n2 are equal.

35. Two teams of workers assemble automobile engines at a manufacturing plant in Michigan. Quality con- trol personnel inspect a random sample of the teams’ assemblies and judge each assembly to be acceptable or unacceptable. A random sample of 127 assemblies from team 1 shows 12 unacceptable assemblies. A similar random sample of 98 assemblies from team 2 shows 5 unacceptable assemblies. a. Calculate a 95% confidence interval for the

difference between the proportions of unacceptable assemblies from the two teams.

b. Based on the confidence interval found in part a, is there sufficient evidence to conclude, at the 5% significance level, that the two teams differ with respect to their proportions of unacceptable assemblies?

c. For which values of the difference between these two sample proportions could you conclude that a statistically significant difference exists at the 5% level?

36. A market research consultant hired by a leading soft- drink company is interested in determining whether there is a difference between the proportions of female and male consumers who favor the company’s low- calorie brand over the leading competitor’s low-calorie brand in a particular urban location. A random sample of 250 consumers from the market under investigation is provided in the file P08_18.xlsx. a. After separating the 250 randomly selected

consumers by gender, perform the statistical test and report a p-value. At which levels of α will the market research consultant conclude that there is

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-5 Tests for Normality 395

9-5 TESTS FOR NORMALITY In this section we discuss several tests for normality.3 As you have already seen, many statistical procedures are based on the assumption that population data are normally dis- tributed. The tests in this section allow you to test this assumption. The null hypothesis is that the population is normally distributed, whereas the alternative is that the population distribution is not normal. Therefore, the burden of proof is on showing that the popula- tion distribution is not normal. Unless there is suf�cient evidence to this effect, the normal not normal. Unless there is suf�cient evidence to this effect, the normal not assumption will continue to be accepted.

The �rst test we discuss is called a chi-square goodness-of-�t test. It is quite intuitive. A histogram of the sample data is compared to the expected bell-shaped histogram that expected bell-shaped histogram that expected would be observed if the data were normally distributed with the same mean and standard deviation as in the sample. If the two histograms are suf�ciently similar, the null hypothesis of normality is accepted. Otherwise, it can be rejected.

The test is based on a numerical measure of the difference between the two histograms. Let C be the number of categories in the histogram, and let Oi be the observed number of

The chi-square test for normality makes a comparison between the observed histogram and a histogram based on normality.

essentially no difference between the proportions of female and male consumers who prefer this company’s brand to the competitor’s brand in this urban area?

b. Marketing managers at this company have asked their market research consultant to explore further the potential differences in the proportions of women and men who prefer drinking the company’s brand to the competitor’s brand. Specifically, the company’s managers wants to know whether the potential difference between the proportions of female and male consumers who favor the company’s brand varies by the age of the consumers. Using the same random sample of consumers as in part a, assess whether this difference varies across the four given age categories: under 20, between 20 and 40, between 40 and 60, and over 60. Specifically, run the test in part a four times, one for each age group. Are the results the same for each age group?

37. The employee benefits manager of a large public university wants to determine whether differences exist in the proportions of various groups of full- time employees who prefer adopting the second (i.e., plan B) of three available health care plans in the com- ing annual enrollment period. A random sample of the university’s employees and their tentative health care preferences is given in the file P08_17.xlsx. a. Perform tests for differences in the proportions of

employees within respective classifications who favor plan B in the coming year. For instance, the first such test should examine the difference

between the proportion of administrative employees who favor plan B and the proportion of the support staff who prefer plan B.

b. Report a p-value for each of your hypothesis tests and interpret your results. How might the benefits manager use the information you have derived from these tests?

38. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. Researchers would like to use the available sample information to test whether home ownership rates vary by household location. For example, is there a nonzero difference between the proportions of individuals who own their homes (as opposed to those who rent their homes) in households located in the first (i.e., SW) and second (i.e., NW) sectors of this community? Use the sample data to test for a difference in home ownership rates in these two sectors as well as for those of other pairs of household locations. In each test, use a 5% significance level. Interpret and summarize your results. (You should perform and interpret a total of six hypothesis tests.)

39. For testing the difference between two proportions, "p"p"^c(1 − p̂c) (1/n1 + 1/n2)" is used as the approximate standard error of p̂1 − p̂2, where p̂c is the pooled sample proportion. Explain why this is reasonable when the null-hypothesized value of p1 − p2 is zero. Why would this not be a good approximation when the null-hypothesized value of p1 − p2 is a nonzero number? What would you recommend using for the standard error of p̂1 − p̂2 in that case?

3The tests in this section could (with a lot of work) be implemented with Excel-only formulas. However, it is much easier to implement them with StatTools, as we will do here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

396 Chapter 9 Hypothesis Testing

Test Statistic for Chi-Square Test of Normality

χ2-value = aC i = 1

(Oi − Ei) 2/E/E/ i (9.8)

observations in category i. Also, let Ei be the expected number of observations in category i if the population were normal with the same mean and standard deviation as in the sample. Then the goodness-of-�t measure in Equation (9.8) is used as a test statistic. If the null hypothesis of normality is true, this test statistic has (approximately) a chi-square distribu- tion with C − 3 degrees of freedom. Because large values of the test statistic indicate a poor �t—the Oi’s do not match up well with the Ei’s—the p-value for the test is the probability to the right of the test statistic in the chi-square distribution with C − 3 degrees of freedom.

(Here, x is the Greek letter chi.) Although it is possible to perform this test with Excel-only formulas, it is certainly

preferable to use StatTools, as illustrated in Example 9.6.

E X A M P L E 9.6 DISTRIBUTION OF METAL STRIP WIDTHS IN MANUFACTURING

Acompany manufactures strips of metal that are supposed to have width of 10 centimeters. For purposes of quality control, the manager plans to run some statis- tical tests on these strips. However, realizing that these statistical procedures assume nor- mally distributed widths, he first tests this normality assumption on 90 randomly sampled strips. How should he proceed?

Objective To use the chi-square goodness-of-fit test to see whether a normal distribution of the metal strip widths is reasonable.

Solution The sample data appear in Figure 9.17, where each width is measured to three decimal places. (See the file Testing Normality.xlsx.) A histogram of the widths is also shown.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

A

Part

1

2

3

4

5

6

7

8

9

10

11

12

13

Width

9.990

10.031

9.985

9.983

10.004

10.000

9.992

9.996

9.997

9.993

9.991

9.991

10.006

B C D E F G H I J

35

Histogram of width

0

(9 .9

70 , 9

.9 78

)

20

15

25

30

10

5

(9 .9

78 , 9

.9 85

)

(9 .9

85 , 9

.9 93

)

(9 .9

93 , …

)

(1 0.

00 0,

… )

(1 0.

00 8,

… )

(1 0.

01 6,

… )

(1 0.

02 3,

… )

(1 0.

03 1,

… )

Figure 9.17 Data for Testing Normality

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-5 Tests for Normality 397

To run the test, select Chi-Square Test from the StatTools Normality Tests dropdown list, which leads to basically the same dialog box as in StatTools’s Histogram procedure. As with the Histogram procedure, you can specify the bins, or you can accept StatTools’s default bins. For now, do the latter.4 As with the Histogram procedure, you can specify the bins, or you can accept StatTools’s

4 As with the Histogram procedure, you can specify the bins, or you can accept StatTools’s

The resulting histograms in Figure 9.18 provide visual evidence of the goodness of fit. The left bars represent the observed frequencies (the Ois), and the right bars represent the expected frequencies for a normal distribution (the Eis). The normal fit to the data appears to be quite good.

7 8

A BA B C DC D E FE F Width

Width DataChi-Square Test

9 10 11 12 13 14 15

Mean 9.999256 Std Dev 0.009728 Chi-Square Stat. 4.2027 p-Value 0.5206

Chi-Squared Bins BinMin BinMax Actual Normal Distance

9.983000 0.127416 17 18 19 20 21 22 23

Bin # 1 –Inf 5 4.2630 Bin # 2 9.983000 9.988167 6 7.1827 0.1948 Bin # 3 9.988167 9.993333 14 12.9751 0.0810 Bin # 4 9.993333 9.998500 20 17.7934 0.2736 Bin # 5 9.998500 10.003667 13 18.5249 1.6477 Bin # 6 10.003667 10.008833 19 14.6421 1.2970 Bin # 7 10.008833 10.014000 9 8.7859 0.0052 Bin # 8 10.014000 +Inf 4 5.8328 0.5759

Remember that the burden of proof is on showing that the distribu�on is not normal.not normal.not The high p-value here indicates that there is not enough evidence to reject the null hypothesis of normality, and this finding is confirmed on the next two sheets.

Figure 9.19 Chi-Square Test of Normality

25

15

20

10

Bi n

O cc

up a�

on

5

0

Bi n

#1

Bi n

#2

Bi n

#3

Bi n

#4

Bi n

#5

Bi n

#6

Bi n

#7

Bi n

#8

Chi-Square Test for Width/Width Data

Width Normal

Figure 9.18 Observed and Normal Histograms

4You might try de�ning the bins differently and rerunning the test. The category de�nitions can make a difference in the results. This is a disadvantage of the chi-square test.

The StatTools output in Figure 9.19 confirms this statistically. Each value in column E is an Ei, calculated as the total number of observations multiplied by the normal probabil- ity of being in the corresponding category. Column F contains the individual (Oi − Ei)

2/E/E/ i

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

398 Chapter 9 Hypothesis Testing

terms, and cell B11 contains their sum, the chi-square test statistic. The corresponding p-value in cell B12 is 0.5206.

This large p-value provides no evidence whatsoever of non-normality. It implies that if this procedure were repeated on many random samples, each taken from a population known to be normal, a fit at least this poor would occur in over 50% of the samples. Stated differently, fewer than 50% of the fits would be better than the one observed here. Therefore, better than the one observed here. Therefore, better the manager can feel comfortable in making a normal assumption for this population. ■

We make several comments about this chi-square procedure. First, the test does depend on which (and how many) bins you use for the histogram. Reasonable choices are likely to lead to the same conclusion, but this is not guaranteed. Second, the test is not very effective unless the sample size is large: at least 80 or 100, say. Only then can you begin to see the true shape of the histogram and judge accurately whether it is normal. Finally, the test tends to be too sensitive if the sample size is really large. In this case any little “bump” on the observed histogram is likely to lead to a conclusion of non-normality. This is one more example of practical versus statistical signi�cance. With a large sample size you might be able to reject normality with a high degree of certainty, but the practical difference between the observed and normal histograms could very well be unimportant.

The chi-square test of normality is an intuitive one because it is based on histograms. However, it suffers from the �rst two points discussed in the previous paragraph. In par- ticular, it is not as powerful as other available tests. This means that it is often unable to powerful as other available tests. This means that it is often unable to powerful distinguish between normal and non-normal distributions, and hence it often fails to reject the null hypothesis of normality when it should be rejected. A more powerful test is called the Lilliefors test.5 the null hypothesis of normality when it should be rejected. A more powerful test is called

5 the null hypothesis of normality when it should be rejected. A more powerful test is called

This test is based on the cumulative distribution function (cdf), which shows the probability of being less than or equal to any particular value. Speci�cally, the Lilliefors test compares two cdfs: the cdf from a normal distribution and the f from a normal distribution and the f cdf corre- sponding to the given data. This latter cdf, called the empirical cdfdfd , shows the fraction of observations less than or equal to any particular value. If the data come from a normal dis- tribution, the normal and empirical cdfs should be quite close. Therefore, the Lilliefors test compares the maximum vertical distance between the two cdfs and compares it to specially tabulated values. If this maximum vertical distance is suf�ciently large, the null hypothesis of normality can be rejected.

To run the Lilliefors test for the Width variable in Example 9.6, select Lilliefors Test from the StatTools Normality Tests dropdown list. StatTools then shows the numer- ical outputs in Figure 9.20 and the corresponding graph in Figure 9.21 of the normal

The Lilliefors test is based on a comparison of the cdf from the data and a normal cdf .

7 8

A BA B Width

Lilliefors Test Results Width Data

9 10 11 12 13 14 15

Sample Size 90 Sample Mean 9.999256 Sample Std Dev 0.009728 Test Sta�s�c 0.0513 CVal (15% Sig. Level) 0.0810 CVal (10% Sig. Level) 0.0856 CVal (5% Sig. Level) 0.0936 CVal (2.5% Sig. Level) 0.099816

17 CVal (1% Sig. Level) 0.1367

Figure 9.20 Lilliefors Test Results

5This is actually a special case of the more general and widely known Kolmogorov-Smirnoff (or K-S) test.Kolmogorov-Smirnoff (or K-S) test.Kolmogorov-Smirnoff

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-5 Tests for Normality 399

and empirical cdfs. The numeric output indicates that the maximum vertical distance between the two curves is 0.0513. It also provides a number of “CVal” values for com- parison. If the test statistic is larger than any of these, the null hypothesis of normal- ity can be rejected at the corresponding signi�cance level. In this case, however, the test statistic is relatively small—not nearly large enough to reject the normal hypoth- esis at any of the usual signi�cance levels. This conclusion agrees with the one based on the chi-square goodness-of-�t test (as well as the closeness of the two curves in Figure 9.21). Nevertheless, you should be aware that the two tests do not agree on all data sets.

We conclude this section with a popular, but informal, test of normality. This is based on a plot called a quantile-quantile (or Q-Q) plot. Although the technical details for form- ing this plot are somewhat complex, it is basically a scatterplot of the standardized values from the data set versus the values that would be expected if the data were perfectly nor- mally distributed (with the same mean and standard deviation as in the data set). If the data are, in fact, normally distributed, the points in this plot tend to cluster around a 45° line. Any large deviation from a 45° line signals some type of non-normality. Again, however, this is not a formal test of normality. A formal test of normality. A formal Q-Q plot is usually used only to obtain a general idea of whether the data are normally distributed and, if they are not, what type of non- normality exists. For example, if points on the right of the plot are well above a 45° line, this is an indication that the largest observations in the data set are larger than would be expected from a normal distribution. Therefore, these points might be high-end outliers and/or a signal of positive skewness.

To obtain a Q-Q plot for the Width variable in Example 9.6, select Q-Q Normal Plot from the StatTools Normality Tests dropdown list and check each option at the bottom of the dialog box. The Q-Q plot for the Width data in Example 9.6 appears in Figure 9.22. Although the points in this Q-Q plot do not all lie exactly on a 45° line, they are about as close to doing so as can be expected from real data. Therefore, there is no reason to ques- tion the normal hypothesis for these data—the same conclusion as from the chi-square and Lilliefors tests. (Note that in the StatTools Q-Q plot dialog box, you can elect to plot standardized Q-values. This option was used in Figure 9.22. The plot with unstandardized Q-values, not shown here, provides virtually the same information. The only difference is in the scale of the vertical axis.)

0.7

0.8

0.9

1.0 Normal and Empirical Cumula�ve Distribu�ons of Width/Width Data

0.0

0.1

0.2

0.3

0.4

0.5

0.6

–3.0 –2.0 –1.0 0.0 1.0 2.0 3.0

Figure 9.21 Normal and Empirical Cumulative Distribution Functions

If data are normally distributed, the points on the corresponding Q-Q plot should be close to a 45° line.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

400 Chapter 9 Hypothesis Testing

1.5

2.5

3.5 Q-Q Normal Plot of Width/Width Data

–3.5

–2.5

–1.5

–0.5–0.5

0.5

–3.5 –2.5 –1.5 –0.5–0.5–0.5–0.5–0.5–0.5–0.5–0.5–0.5–0.5–0.5–0.5 0.5 1.5 2.5 3.5

St an

da rd

iz ed

Q -V

al ue

Z-Value

Figure 9.22 Q-Q Plot with Standardized Q-Values

P R O B L E M S

Level A 40. The file P02_11.xlsx contains data on 148 houses sold

in a certain suburban region. a. Create a histogram of the selling prices. Is there

any visual evidence that the distribution of selling prices is not normal?not normal?not

b. Test the selling prices for normality using the chi-square test. Is there enough evidence at the 5% significance level to conclude that selling prices are not normally distributed? If so, what is there about not normally distributed? If so, what is there about not the distribution that is not normal?

c. Use the Lilliefors test and the Q-Q plot to check for normality of selling prices. Do these suggest the same conclusion as in part b? Explain.

41. The file P09_33.xlsx contains real estate taxes paid by a sample of 170 homeowners in a Florida city. a. Create a histogram of the taxes paid. Is there any

visual evidence that the distribution of taxes paid is not normal?not normal?not

b. Test the taxes paid for normality using the chi-square test. Is there enough evidence at the 5% significance level to conclude that taxes paid are not normally distributed? If so, what is there about not normally distributed? If so, what is there about not the distribution that is not normal?

c. Use the Lilliefors test and the Q-Q plot to check for normality of taxes paid. Do these suggest the same conclusion as in part b? Explain.

42. The file P09_42.xlsx contains many years of monthly percentage changes in the Dow Jones Industrial Average (DJIA). (This is the same data set that was used for Example 2.6 in Chapter 2.)

a. Create a histogram of the percentage changes in the DJIA. Is there any visual evidence that the distribution of the Dow percentage changes is not normal?

b. Test the percentage changes of the DJIA for normality using the chi-square test. Is there enough evidence at the 5% significance level to conclude that the Dow percentage changes are not normally not normally not distributed? If so, what is there about the distri- bution that is not normal?

c. Use the Lilliefors test and the Q-Q plot to check for normality of percentage changes. Do these suggest the same conclusion as in part b? Explain.

d. Repeat parts a–c, but use data only from 1995 on. Do you get the same results as for the full data set?

Level B 43. Will the chi-square test ever conclude, at the

5% significance level, that data are not normally distributed when you know that they are? Check this with simulation. Specifically, generate n normally distributed numbers with mean 100 and standard deviation 15. You can do this with the formula =NORM.INV(RAND(),100,12). Do not freeze them; not freeze them; not keep them random. Then run the chi-square normality test on the random numbers. Because the chi-square results are linked to the data, you will get new chi- square results every time you press F9 to recalculate. a. Using n = 150, do you ever get a p-value less than

0.05? If so, what does such a p-value mean? Would you expect to get a few such expect to get a few such expect p-values? Explain.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-6 Chi-Square Test for Independence 401

9-6 CHI-SQUARE TEST FOR INDEPENDENCE The test we discuss in this section, like one of the tests for normality from the previous section, uses the name “chi-square.” However, this test, called the chi-square test for inde- pendence, has an entirely different objective. It is used in situations where a population is categorized in two different ways. For example, people might be characterized by their smoking habits and their drinking habits. The question then is whether these two attributes are independent in a probabilistic sense. They are independent if information on a person’s independent if information on a person’s independent drinking habits is of no use in predicting the person’s smoking habits (and vice versa). In this particular example, however, you might suspect that the two attributes are dependent. In particular, you might suspect that heavy drinkers are more likely (than non-heavy drink- ers) to be heavy smokers, and you might suspect that nondrinkers are more likely (than drinkers) to be nonsmokers. The chi-square test for independence enables you to test this empirically.

The null hypothesis for this test is that the two attributes are independent. Therefore, statistically signi�cant results are those that indicate some sort of dependence. As always, this puts the burden of proof on the alternative hypothesis. In the smoking–drinking exam- ple, we will continue to believe that smoking and drinking habits are unrelated—that is, independent—unless there is suf�cient evidence from the data that they are dependent. Furthermore, even if we are able to conclude that they are dependent, the test itself does not indicate the form of dependence. It could be that heavy drinkers tend to be nonsmokers, and nondrinkers tend to be heavy smokers. Although this is unlikely, it is de�nitely a form of dependence. The only way we can decide which form of dependence exists is to look closely at the data.

b. Repeat part a using n = 1000. Do the results change in any qualitative way?

c. Repeat parts a and b, but use the Lilliefors test instead of the chi-square test. Do you get the same basic results?

44. Repeat the previous problem but with a non-normal population. Specifically, generate n random numbers from a fifty-fifty mixture of two normal distributions with respective means 90 and 110 and common standard deviation 10. You can do this with the formula =IF(RAND()<0.5,NORM.INV(RAND(),90,10), NORM.INV(RAND(),110,10)) (This is not a normal not a normal not distribution because it has two peaks.)

45. The file P09_45.xlsx contains measurements of ounces in randomly selected cans from a soft-drink filling machine. These cans reportedly contain 12 ounces, but because of natural variation, the actual amounts differ slightly from 12 ounces. a. Can the company legitimately state that the

amounts in cans are normally distributed? b. Assuming that the distribution is normal with the

mean and standard deviation found in this sample,

calculate the probability that at least half of the next 100 cans filled will contain less than 12 ounces.

c. If the test in part a indicated that the data are not normally distributed, how might you calculate the probability requested in part b?

46. The chi-square test for normality discussed in this section is far from perfect. If the sample is too small, the test tends to accept the null hypothesis of normality for any population distribution even remotely bell-shaped; that is, it is not powerful in powerful in powerful detecting non-normality. On the other hand, if the sample is very large, it will tend to reject the null hypothesis of normality for any data set.6 sample is very large, it will tend to reject the null

6 sample is very large, it will tend to reject the null

Check this by using simulation. First, simulate data from a normal distribution using a large sample size. Is there a good chance that the null hypothesis will (wrongly) be rejected? Then simulate data from a non-normal distribution (uniform, say, or the mixture in Problem 44) using a small sample size. Is there a good chance that the null hypothesis will (wrongly) not be rejected? Summarize your findings in a short report.

6Actually, all of the tests for normality suffer from this latter problem.

Rejecting independence does not indicate the form of dependence. To see this, you must look more closely at the data.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

402 Chapter 9 Hypothesis Testing

E X A M P L E 9.7 RELATIONSHIP BETWEEN DEMANDS FOR DESKTOPS AND LAPTOPS AT BIG OFFICE

Big Office, a chain of large office supply stores, sells a variety of Windows and Mac laptops. Company executives want to know whether the demands for these two types of computers are related in any way. They might act as complementary products, where high demand for Windows laptops accompanies high demand for Mac laptops (comput- ers in general are hot), they might act as substitute products (demand for one takes away demand for the other), or their demands might be unrelated. Because of limitations in its information system, Big Office does not have the exact demands for these products. However, it does have daily information on categories of demand, listed in aggregate (that is, over all stores). These data appear in Figure 9.23. (See the file Laptop Demand. xlsx.) Each day’s demand for each type of computer is categorized as Low, Medium Low, Medium High, or High. The table is based on 250 days, so that the counts add to 250. The individual counts show, for example, that demand was high for both Windows and Mac and Mac and laptops on 11 of the 250 days. For convenience, the row and column totals are provided in the margins. Based on these data, can Big Office conclude that demands for these two products are independent?

The data for this test consist of counts in various combinations of categories. These are usually arranged in a rectangular contingency table, also called a cross-tabs, or, using Excel terminology, a pivot table. For example, if there are three smoking categories and three drinking categories, the table will have three rows and three columns, for a total of nine cells. The count in a cell is the number of observations in that particular combination of categories. The following example illustrates this data setup and the resulting analysis.

The chi-square test for independence is based on the counts in a contingency (or cross-tabs) table. It tests whether the row variable is probabilistically independent of the column variable.

Objective To use the chi-square test of independence to test whether demand for Windows laptops is independent of demand for Mac laptops.

1 2 3 4 5 6 7 8 9

A BA B C DC D E FE F G Demands at Big Office

Windows laptops Low Medium Low Medium High High

Mac laptops Low 4 17 17 5 43 Medium Low 8 23 22 27 80 Medium High 16 20 14 20 70 High 10 17 19 11 57

38 77 72 63 250

w Mw M w 4 5 4

w 8

Figure 9.23 Laptop Demand Data

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-6 Chi-Square Test for Independence 403

Solution The idea of the test is to compare the actual counts in the table with what would be expected under independence. If the actual counts are sufficiently far from the expected counts, the null hypothesis of independence can be rejected. The distance measure used to check how far apart they are, shown in Equation (9.9), is essentially the same chi-square statistic used in the chi-square test for normality. Here, Oijiji is the actual count in cell i, j (row i, column j), Eijiji is the expected count for this cell assuming independence, and the sum is over all cells in the table. If this test statistic is sufficiently large, the independence hypothesis can be rejected. (We provide more details of the test shortly.)

Expected Counts Assuming Row and Column Independence

Eijiji = RiCjCjC / N (9.10)

Test Statistic for Chi-Square Test for Independence

chi-square test st st tatistic = aijiji (Oijiji − Eijiji )2/E/E/ ijiji (9.9)

You can perform the calculations for the test easily with StatTools. This is one StatTools procedure that does not require a data set to be defined. You simply select not require a data set to be defined. You simply select not Chi-Square Independence Test from the StatTools Statistical Inference dropdown list and then select the range of the contingency table. This range can include the row and column category labels (row 4 and column B).

Alternatively, Excel-only formulas can be used, as illustrated in Figure 9.24. These formulas follow directly from Equations (9.9) and (9.10). The p-value of the test, 0.045, can be interpreted in the usual way. Specifically, the null hypothesis of independence can be rejected at the 5% or 10% significance levels, but not at the 1% level. There is a fairly strong evidence that the demands for the two products are not independent.not independent.not

If the alternative hypothesis of dependence is accepted, the output in Figure 9.25 can be used to examine its form. These two tables show the counts as percentages of row totals and as percentages of column totals. If the demands were independent, the rows of this

Tables of counts expressed as percent- ages of rows or of columns are useful for judging the form (and extent) of any possible dependence.

What is expected under independence? The totals in row 9 indicate that demand for Windows laptops was low on 38 of the 250 days. Therefore, if you had to estimate the prob- ability of low demand for Windows laptops, your estimate would be 38/250 = 0.152. Now, if demands for the two products were independent, you should arrive at this same estimate from the data in any of rows 5 through 8. That is, a probability estimate for Windows laptops should be the same regardless of the demand for Mac laptops. The probability estimate of low Windows demand from row 5, for example, is 4/43 = 0.093. Similarly, for rows 6, 7, and 8 it is 8/80 = 0.100, 16/70 = 0.229, and 10/57 = 0.175, respectively. These calculations provide some evidence that Windows and Mac laptops act as substitute products—the probability of low Windows demand is larger when Mac demand is medium high or high than when it is low or medium low.

This reasoning is the basis for calculating the Eijiji s. Specifically, it can be shown that the relevant formula for Eijiji is given by Equation (9.10), where Ri is the row total in row i, Ci is the total in column j, and N is the number of observations. For example, E11 for these data is 431382/250 = 6.536, which is slightly larger than the corresponding observed count, O11 = 4.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

404 Chapter 9 Hypothesis Testing

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

A

Excel-only test of independence

Expected counts assuming independence

Low

Medium Low

Medium High

High

Low

6.536

12.16

10.64

8.664

Medium High

12.384

23.04

20.16

16.416

High

10.836

20.16

17.64

14.364

Formula in cell C15

(copied to table)

=$G5*C$9/$G$9

Formula in cell C22

(copied to table)

=(C15–C5)^2/C15

Medium Low

13.244

24.64

21.56

17.556

Low

0.98398

1.423158

2.70015

0.206013

Medium High

1.720563307

0.046944444

1.882222222

0.406740741

High

3.143124

2.320714

0.315737

0.787837

Medium Low

1.065202054

0.109155844

0.112875696

0.017608567

Low

Medium Low

Medium High

High

17.242

9

0.045

Yes

Yes

No

=SUM(C22:F25)

=(4–1)*(4–1)

=CHISQ.DIST.RT(B27,B28)

Table of (O–E)^2/E vTable of (O–E)^2/E vT alues

Test sta�s�c

Degrees of freedom

p-value

Reject at 10% level

Reject at 5% level

Reject at 1% level

B C D E F G H I

Figure 9.24 Output for Chi-Square Test

© C

e n g

a g

e L

e a rn

in g

3

4

5

6

7

8

Counts as % of rows

Low Medium Low Medium High High

Low 9.3%

10.0% 22.9% 17.5%

Medium High 39.5% 27.5% 20.0% 33.3%

High 11.6% 33.8% 28.6% 19.3%

Medium Low 39.5% 28.8% 28.6% 29.8%

I J K L M N O P QP Q R SR S

Counts as % of columns

Low Medium Low Medium High High

Low 10.5% 21.1% 42.1% 26.3%

Medium High 23.6% 30.6% 19.4% 26.4%

High 7.9%

42.9% 31.7% 17.5%

Medium Low 22.1% 29.9% 26.0% 22.1%

Figure 9.25 Counts Shown as Percentages

first table should be identical, and the columns of the second table should be identical. This is because each row in the first table shows the distribution of Windows demand for a given category of Mac demand, whereas each column in the second table shows the dis- tribution of Mac demand for a given category of Windows demand. A close study of these percentages again provides some evidence that the two products act as substitutes, but the evidence is not overwhelming. ■

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

9-6 Chi-Square Test for Independence 405

P R O B L E M S

Level A 47. The file P08_49.xlsx contains data on 400 orders

placed to ElecMart company over a period of several months. For each order, the file lists the time of day, the type of credit card used, the region of the country where the customer resides, and others. (This is the same data set used in Example 3.4 of Chapter 3.) Use a chi-square test for independence to see whether the following variables are independent. If the variables appear to be related, discuss the form of dependence you see. a. Time and Region b. Region and Buy Category c. Gender and Card Type

48. The file P08_18.xlsx categorizes 250 randomly selected consumers on the basis of their gender, their age, and their preference for our brand or a competi- tor’s brand of a low-calorie soft drink. Use a chi- square test for independence to see whether the drink preference is independent of gender, and then whether it is independent of age. If you find any dependence, discuss its nature.

49. The file P02_11.xlsx contains data on 148 houses that were recently sold. Two variables in this data set are

the selling price of the house and the number of bed- rooms in the house. We want to use a chi-square test for independence to see whether these two variables are independent. However, this test requires categori- cal variables, and Selling Price is essentially continu-cal variables, and Selling Price is essentially continu-cal ous. Therefore, to run the test, first divide the prices into several categories: less than 120, 120 to 130, 130 to 140, and greater than 140. Then run the test and report your results.

Level B 50. The file P03_50.xlsx contains annual salaries for all

NBA basketball players in each of five seasons. a. Using only the data for the most recent season

(2008–2009), check whether there is independence between position and salary. To do this, first change any hyphenated position such as C-F to the first listed, in this case C. (Presumably, this is the player’s primary position.) Then make Salary categorical with four categories: the first is all salaries below the first quartile, the second is all salaries from the first quartile to the median, and so on. Explain your findings.

b. Repeat part a but with a Yes/No playoff team categorization instead of position. The playoff

Count Married 0 1 Grand Total

Grand Total

Own Home

0 1

307 177 484

191 325 516

498 502

1000

Figure 26 Using a Pivot Table for a Chi-Square Test

© C

e n g

a g

e L

e a rn

in g

Finally, it is worth noting that the table of counts necessary for the chi-square test of independence can be a pivot table. For example, the pivot table in Figure 9.26 shows counts of the Married and Own Home attributes. (For Married, 1 means married, 0 means unmarried, and for Own Home, 1 means a home owner, 0 means not a home owner. This pivot table is based on the data in the Catalog Marketing.xlsx �le from Chapter 2.) To see whether these two attributes are independent, the chi-square test would be performed on the table of counts. You might want to check that the p-value for the test is 0.000 (to three decimals), so that Married and Own Home are de�nitely not independent.not independent.not

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

406 Chapter 9 Hypothesis Testing

9-7 CONCLUSION The concepts and procedures in this chapter form a cornerstone in both applied and theoret- ical statistics. Of particular importance is the interpretation of a p-value, especially because p-values are reported in virtually all statistical software packages. A p-value summarizes the evidence in support of an alternative hypothesis, which is usually the hypothesis an analyst is trying to prove. Small p-values provide support for the alternative hypothesis, whereas large p-values provide little or no support for it.

Although hypothesis testing continues to be an important tool for analysts, it is important to note its limitations, particularly in business applications. First, given a choice between a con�dence interval for some population parameter and a test of this parameter, we generally favor the con�dence interval. For example, a con�dence inter- val not only indicates whether a mean difference is 0, but it also provides a plausible range for this difference. Second, many business decision problems cannot be handled adequately with hypothesis-testing procedures. Either they ignore important cost infor- mation or they treat the consequences of incorrect decisions (type I and type II errors) in an inappropriate way. Finally, the statistical signi�cance at the core of hypothesis testing is sometimes quite different from the practical signi�cance that is of most interest to business managers.

Summary of Key Terms

teams in that season were Atlanta, Boston, Chicago, Cleveland, Dallas, Denver, Detroit, Houston, Los Angeles Lakers, Miami, New Orleans, Orlando, Philadelphia, Portland, San Antonio, and Utah.

51. The file P09_51.xlsx contains data on 1000 randomly selected Walmart customers. The data set includes demographic variables for each customer as well as their salaries and the amounts they have spent at Walmart during the past year. a. A lookup table in the file suggests a way to

categorize the salaries. Use this categorization and chi-square tests of independence to see whether Salary is independent of (1) Age, (2) Gender, (3) Home, or (4) Married. Discuss any types of dependence you find.

b. Repeat part a, replacing Salary with Amount Spent. First you must categorize Amount Spent. Create

four categories for Amount Spent based on the four quartiles. The first category is all values of Amount Spent below the first quartile of Amount Spent, the second category is between the first quartile and the median, and so on.

52. The file C07_01.xlsx (the file that accompanies the case for Chapter 7) contains data on close to 10,000 customers from several large cities in the United States. The variables include the customers’ gender and their first choice among several types of movies. Perform chi-square tests of inde- pendence to test whether the following variables are related. If they are, discuss the form of dependence you see. a. State and First Choice b. City and First Choice c. Gender and First Choice

Term Explanation Excel Pages Equation

Null hypothesis Hypothesis that represents the current thinking or status quo

365

Alternative hypothesis Typically, the hypothesis the analyst is trying to prove or research hypothesis

365

One-tailed test Test where values in only one direction will lead to rejection of the null hypothesis

367

Two-tailed test Test where values in both directions will lead to rejection of the null hypothesis

367

Type I error Error committed when null hypothesis is true but is rejected

367

(continued)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

P R O B L E M S

Conceptual Questions C.1. Suppose you are testing the null hypothesis that a

mean equals 75 versus a two-tailed alternative. If the true (but unknown) mean is 80, what kind of error might you make? When will you might you make? When will you might not make this error?not make this error?not

C.2. Suppose you hear the claim that a given test, such as the chi-square test for normality, is not very powerful. What exactly does this mean? If another test, such as the Lilliefors test, is claimed to be more powerful, how is it better than the less powerful test?

Term Explanation Excel Pages Equation

Type II error Error committed when null hypothesis is false but is not rejected

367

Significance level The probability of a type I error an analyst chooses

368

Rejection region Sample results that lead to rejection of null hypothesis

368

Statistically significant results

Sample results that lead to rejection of null hypothesis

368

p-value Probability of observing a sample result at least as extreme as the one actually observed

369

Power Probability of correctly rejecting the null when it is false

371

t test for a population mean

Test for a mean from a single population

Excel formulas or StatTools

372 9.1

z test for a population proportion

Test for a proportion from a single population

Excel formulas or StatTools

377 9.2

t test for difference between means from paired samples

Test for the difference between two population means when samples are paired in a natural way

Excel formulas or StatTools

379 9.3

t test for difference between means from independent samples

Test for the difference between two population means when samples are independent

Excel formulas or StatTools

379 9.4, 9.5

F test for equality of two variances

Test for equality of two population variances, used to check an assumption of two-sample t test for difference between means

Excel formulas or StatTools

387

F distribution Skewed distribution useful for testing equality of variances

F.DIST, F.INV, and other F functions

387

z test for difference between proportions

Test for difference between similarly defined proportions from two populations

Excel formulas or StatTools

388 9.6, 9.7

Tests for normality Tests to check whether a population is normally distributed; possibilities include chi-square test, Lilliefors test, and Q-Q plot

StatTools/Normality Tests 395 9.8

Chi-square test for independence

Test to check whether two attributes are probabilistically independent

Excel formulas or StatTools

402 9.9, 9.10

Summary of Key Terms (Continued)

9-7 Conclusion 407 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

408 Chapter 9 Hypothesis Testing

C.3. Explain exactly what it means for a test statistic to fall in the rejection region.

C.4. Give an example of when a one-sided test on a population mean would make more sense than a two- tailed test. Give an example of the opposite. In gen- eral, why do we say that there is no statistical way statistical way statistical to decide whether a test should be run as a one-tailed test or a two-tailed test?

C.5. For any given hypothesis test, that is, for any specification of the null and alternative hypotheses, explain why you could make only a type I error or a type II error, but not both. When would you make a type I error? When would you make a type II error? Answer as generally as possible.

C.6. What are the null and alternative hypotheses in the chi-square or Lilliefors test for normality? Where is the burden of proof? Might you argue that it should go in the other direction? Explain.

C.7. We didn’t discuss the role of sample size in this chapter as thoroughly as we did for confidence intervals in the previous chapter, but more advanced books do include sample size formulas for hypoth- esis testing. Consider the situation where you are testing the null hypothesis that a population mean is less than or equal to 100 versus a one-tailed alter- native. A sample size formula might indicate the sample size needed to make the power at least 0.90 when the true mean is 103. What are the trade-offs here? Essentially, what is the advantage of a larger sample size?

C.8. Suppose that you wish to test a researcher’s claim that the mean height in meters of a normally dis- tributed population of rosebushes at a nursery has increased from its commonly accepted value of 1.60. To carry out this test, you obtain a random sample of size 150 from this population. This sample yields a mean of 1.80 and a standard deviation of 1.30. What are the appropriate null and alternative hypotheses? Is this a one-tailed or two-tailed test?

C.9. Suppose that you wish to test a manager’s claim that the proportion of defective items generated by a particular production process has decreased from its long-run historical value of 0.30. To carry out this test, you obtain a random sample of 300 items pro- duced through this process. The test indicates a p-value of 0.01. What exactly is this p-value telling you? At what levels of significance can you reject the null hypothesis?

C.10. Suppose that a 99% confidence interval for the pro- portion p of all Lakeside residents whose annual income exceeds 80,000 extends from 0.10 to 0.18. The confidence interval is based on a random sample of 150 Lakeside residents. Using this information and a 1% significance level, you wish to test H0H0H : p = 0.08

versus HaHaH : p ≠ 0.08. Based on the given information, are you able to reject the null hypothesis? Why or why not?

C.11. Suppose that you are performing a one-tailed hypoth- esis test. “Assuming that everything else remains constant, a decrease in the test’s level of significance (α) leads to a higher probability of rejecting the null hypothesis.” Is this statement true or false? Explain your reasoning.

C.12. Can pleasant aromas help people work more effi- ciently? Researchers conducted an investigation to answer this question. Fifty students worked a paper-and-pencil maze ten times. On five attempts, the students wore a mask with floral scents. On the other five attempts, they wore a mask with no scent. The 10 trials were performed in random order and each used a different maze. The researchers found that the subjects took less time to complete the maze when wearing the scented mask. Is this an example of an observational study or a controlled experiment? Explain.

Level A 53. The file P09_53.xlsx contains the number of days

44 mothers spent in the hospital after giving birth (in the year 2005). Before health insurance rules were changed (the change was effective January 1, 2005), the average number of days spent in a hospital by a new mother was two days. For a 5% level of signifi- cance, do the data in the file indicate (the research hypothesis) that women are now spending less time in the hospital after giving birth than they were prior to 2005? Explain your answer in terms of the p-value for the test.

54. Eighteen readers took a speed-reading course. The file P09_54.xlsx contains the number of words that they could read before and after the course. Test the alternative hypothesis at the 5% significance level that reading speeds have increased, on average, as a result of the course. Explain your answer in terms of the p-value. Do you need to assume that reading speeds (before and after) are normally distributed? Why or why not?

55. Statistics have shown that a child 0 to 4 years of age has a 0.0002 probability of getting cancer in any given year. Assume that during each of the last seven years there have been 100 children ages 0 to 4 years whose parents work in a university’s business school. Four of these children have gotten cancer. Use this evidence to test whether the incidence of childhood cancer among children ages 0 to 4 years whose parents work at this business school exceeds the national average. State your hypotheses and determine the appropriate p-value.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

56. African Americans in a St. Louis suburb sued the city claiming they were discriminated against in school- teacher hiring. Of the city’s population, 5.7% were African American; of 405 teachers in the school sys- tem, 15 were African American. Set up appropriate hypotheses and determine whether African Americans are underrepresented. Does your answer depend on whether you use a one-tailed or two-tailed test? In discrimination cases, the Supreme Court always uses a two-tailed test at the 5% significance level. (Source: U.S. Supreme Court Case, Hazlewood v. City of St. Louis)

57. We hear that teenagers in today’s world spend too much time playing video games. Does this have a sig- nificant effect on the grades they earn at school? You could test by this dividing students into two groups, those whose current high school grade-point aver- age (GPA) is 3.0 or above and those whose GPA is below 3.0. Then you could sample students from each of these groups, discover the numbers of hours per week spent playing video games, and run a test to see whether high-GPA students average less time play- ing video games than low-GPA students. Run such a test on the (fictional) data in the file P09_57.xlsx and report the results. If the results are significant, does this prove that too many hours spent playing video games causes lower GPAs? Explain.

58. Sixty people have rated a new beer on a taste scale of 0 to 100. Their ratings are in the file P09_58.xlsx. Marketing has determined that the beer will be a suc- cess if the average taste rating exceeds 75. Using a 5% significance level, is there sufficient evidence to conclude that the beer will be a success? Discuss your result in terms of a p-value. Assume ratings are at least approximately normally distributed.

59. Fifty people were asked to rate a competitive beer on a taste scale of 0 to 100. Another 50 people were asked to rate our beer on the same taste scale. The file P09_59.xlsx contains the results. Do these data provide sufficient evidence to conclude, at the 1% sig- nificance level, that people believe our beer tastes bet- ter than the competitor’s? Assume ratings are at least approximately normally distributed. Would you reach the same conclusion if only the data from the first 10 people in each group were used?.

60. Callaway is thinking about entering the golf ball mar- ket. The company will make a profit if its market share is more than 20%. A market survey indicates that 140 of 624 golf ball purchasers will buy a Callaway golf ball. a. Is this enough evidence to persuade Callaway to

enter the golf ball market? b. How would you make the decision if you were

Callaway management? Would you use hypothesis testing?

61. Sales of a new product will be profitable if the average of sales per store exceeds 100 per week. The product was test-marketed for one week at 10 stores, with the results listed in the file P09_61.xlsx. Assume that sales at each store are at least approximately normally distributed. a. Is this enough evidence to persuade the company to

market the new product? b. How would you make the decision if you were

deciding whether to market the new product? Would you use hypothesis testing?

62. A recent study concluded that children born to moth- ers who take Prozac tend to have more birth defects than children born to mothers who do not take Prozac. a. What do you think the null and alternative

hypotheses were for this study? b. If you were a spokesperson for Eli Lilly (the

company that produces Prozac), how might you rebut the conclusions of this study?

Level B 63. Suppose that you are the state superintendent of a

state’s public schools. You want to know whether decreasing the class size in grades 1 through 3 will improve student performance. Explain how you would set up a test to determine whether decreased class size improves student performance. What hypotheses would you use in this experiment? (This was actually done and smaller class size did help, particularly with minority students.)

64. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. Economic researchers would like to test for a significant differ- ence between the mean annual income levels of the first household wage earners in the first (i.e., SW) and second (i.e., NW) sectors of this community. In fact, they intend to perform similar hypothesis tests for the differences between the mean annual income levels of the first household wage earners from all other pairs of locations (i.e., first and third, first and fourth, second and third, second and fourth, and third and fourth). a. Before conducting any hypothesis tests on the

difference between various pairs of mean income levels, perform a test for equal population variances in each pair of locations. For each pair, report a p-value and interpret its meaning.

b. Based on your conclusions in part a, which test statistic should be used in performing a test for the existence of a difference between population means?

c. Given your conclusions in part b, perform a test for the existence of a difference in mean annual income levels in each pair of locations. For each pair, report a p-value and interpret its meaning.

9-7 Conclusion 409 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

410 Chapter 9 Hypothesis Testing

65. A group of 25 husbands and wives were chosen ran- domly. Each person was asked to indicate the most he or she would be willing to pay for a new car (assum- ing each had decided to buy a new car). The results are shown in the file P09_65.xlsx. Can you accept the alternative hypothesis that the husbands are willing to spend more, on average, than the wives at the 5% significance level? What is the associated p-value? Is it appropriate to use a paired-sample or independent- sample test? Does it make a difference? Explain your reasoning.

66. A company is concerned with the high cholesterol levels of many of its employees. To help combat the problem, it opens an exercise facility and encour- ages its employees to use this facility. After a year, it chooses a random 100 employees who claim they use the facility regularly, and another 200 who claim they don’t use it at all. The cholesterol levels of these 300 employees are checked, with the results shown in the file P09_66.xlsx. a. Is this sample evidence “proof” that the exercise

facility, when used, tends to lower the mean cholesterol level? Phrase this as a hypothesis- testing problem and do the appropriate analysis. Do you feel comfortable that your analysis answers the question definitively (one way or the other)? Why or why not?

b. Repeat part a, but replace “mean cholesterol level” with “percentage with level over 215.” (The company believes that any level over 215 is dangerous.)

c. What can you say about causality? Could you ever conclude from such a study that the exercise causes low cholesterol? Why or why not?

67. Suppose that you are trying to compare two popula- tions on some variable (GMAT scores of men versus women, for example). Specifically, you are testing the null hypothesis that the means of the two populations are equal versus a two-tailed hypothesis. Are the fol- lowing statements correct? Why or why not? a. A given difference (such as five points) between

sample means from these populations will probably not be considered statistically significant if the sample sizes are small, but it will probably be considered statistically significant if the sample sizes are large.

b. Virtually any difference between the population means will lead to statistically significant sample results if the sample sizes are sufficiently large.

68. Continuing the previous problem, analyze part b in Excel as follows. Start with hypothetical population mean GMAT scores for men and women, along with population standard deviations. Enter these at the top of a worksheet. You can make the two means as close as you like, but not identical. Simulate a sample of

men’s GMAT scores with your mean and standard deviation in column A. Do the same for women in col- umn B. The sample sizes do not have to be the same, but you can make them the same. Then run the test for the difference between two means. (The point of this problem is that if the population means are fairly close and you pick relatively small sample sizes, the sample mean differences probably won’t be signifi- cant. If you find this, generate new samples of a larger sample size and redo the test. Now they might be significant. If not, try again with a still larger sample size. Eventually, you should get statistically significant differences.)

69. This problem concerns course scores (on a 0−100 scale) for a large undergraduate computer pro- gramming course. The class is composed of both underclassmen (freshmen and sophomores) and upper- classmen (juniors and seniors). Also, the students can be categorized according to their previous mathemati- cal background from previous courses as “low” or “high” mathematical background. The data for these students are in the file P09_69.xlsx. The variables are:

■ Score: score on a 0−100 scale ■ Upper Class: 1 for an upperclassman, 0 otherwise ■ High Math: 1 for a high mathematical background, 0 otherwise

For the following questions, assume that the students in this course represent a random sample from all college students who might take the course. This latter group is the population. a. Calculate a 90% confidence interval for the

population mean score for the course. Do the same for the mean of all upperclassmen. Do the same for the mean of all upperclassmen with a high mathematical background.

b. The professor believes he has enough evidence to “prove” the research hypothesis that upperclassmen score at least five points better, on average, than lowerclassmen. Do you agree? Answer by running the appropriate test.

c. If a “good” grade is one that is at least 80, is there enough evidence to reject the null hypothesis that the fraction of good grades is the same for students with low math backgrounds as those with high math backgrounds? Which do you think is more appropriate, a one-tailed or two-tailed test? Explain your reasoning.

70. A cereal company wants to see which of two pro- motional strategies, supplying coupons in a local newspaper or including coupons in the cereal pack- age itself, is more effective. (In the latter case, there is a label on the package indicating the presence of the coupon inside.) The company randomly chooses 80 Kroger’s stores around the country—all of approximately the same size and overall sales

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 9.1 REGRESSION TOWARD THE MEAN

In Chapters 10 and 11, you will study regression, a method for relating one variable to other explanatory variables. However, the term regression has sometimes been used in a slightly different way, meaning “regression toward the mean.” The example often cited is of male heights. If a father is unusually tall, for example, his son will typically be taller than average but not as tall as the father. Similarly, if a father is unusually short, the son will typically be shorter than average but not as short as the father. We say that the son’s height tends to regress toward the mean. This case illustrates how regression toward the mean can occur.

Suppose a company administers an aptitude test to all of its job applicants. If an applicant scores below some value, he or she cannot be hired immediately but is allowed to retake a similar exam at a later time. In the interim the applicant can presumably study to prepare for the second exam. If we focus on the applicants who fail the exam the

first time and then take it a second time, we would probably expect them to score better on the second exam. One plausible reason is that they are more familiar with the exam the second time. However, we will rule this out by assuming that the two exams are sufficiently different from one another. A second plausible reason is that the applicants have studied between exams, which has a beneficial effect. However, we will argue that even if studying has no beneficial effect whatsoever, these applicants will tend to do better the second time around. The reason is regression toward the mean. All of these applicants scored unusually low on the first exam, so they will tend to regress toward the mean on the second exam—that is, they will tend to score higher.

You can employ simulation to demonstrate this phenomenon, using the following model. Assume that the scores of all potential applicants all potential applicants all are normally distributed with mean μ and standard deviation σ. Because we are assuming that any

volume—and promotes its cereal one way at 40 of these sites, and the other way at the other 40 sites. (All are at different geographical locations, so local newspaper ads for one of the sites should not affect sales at any other site.) Unfortunately, as in many business experiments, there is a factor beyond the company’s control, namely, whether its main com- petitor at any particular site happens to be running a promotion of its own. The file P09_70.xlsx has 80 observations on three variables:

■ Sales: number of boxes sold during the first week of the company’s promotion

■ Promotion Type:1 if coupons are in local paper, 0 if coupons are inside box

■ Competitor Promotion:1 if main competitor is run- ning a promotion, 0 otherwise

a. Based on all 80 observations, calculate (1) the difference in sample mean sales between stores running the two different promotional types (and indicate which sample mean is larger), (2) the standard error of this difference, and (3) a 90% confidence interval for the population mean difference.

b. Test whether the population mean difference is Test whether the population mean difference is T zero (the null hypothesis) versus a two-tailed alternative. State whether you should accept or reject the null hypothesis, and why.

c. Repeat part b, but now restrict the population to stores where the competitor is not running a promotion of its own.

d. Based on data from all 80 observations, can you accept the (alternative) hypothesis, at the 5% level, that the mean company sales drop by at least 30 boxes when the competitor runs its own promotion (as opposed to not running its own promotion)?

e. We often use the term We often use the term W population without really thinking what it means. For this problem, explain in words exactly what the population mean refers to. What is the relevant population?

71. There is a lot of concern about “salary compression” in universities. This is the effect of paying huge salaries to attract newly-minted Ph.D. graduates to university tenure-track positions and not having enough left in the budget to compensate tenured faculty as fully as they might deserve. In short, it is faculty as fully as they might deserve. In short, it is f very possible for a new hire to make a larger salary than a person with many years of valuable experience. The file P09_71.xlsx contains (fictional but realistic) salaries for a sample of business school professors, some already tenured and some not yet through the tenure process. Formulate reasonable null and alterna- tive hypotheses and then test them with this data set. Write a short report of your findings.

Case 9.1 Regression Toward the Mean 411 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

studying between exams has no beneficial effect, this distribution of scores is the same on the second exam as on the first. An applicant fails the first exam if his or her score is below some cutoff value L. Now, we would certainly expect scores on the two exams to be positively correlated, with some correlation ρ. (This is the Greek letter “rho,” often used for a population correlation.) That is, if everyone took both exams, applicants who scored high on the first would tend to score high on the second, and those who scored low on the first would tend to score low on the second. (This isn’t regression to the mean, but simply that some applicants are better than others.)

Given this model, you can proceed by simulating many pairs of scores, one pair for each applicant. The scores for each exam should be normally distributed with parameters μ and σ, but the trick is to make them correlated. You can use our Binormal function to do this. (Binormal is short for bivariate normal.) This function is supplied in the file C09_01.xlsm. (Binormal is not a built-in not a built-in not

Excel function.) It takes a pair of means (both equal to μ), a pair of standard deviations (both equal to σ), and a correlation ρ as arguments, with the syntax =BINORMAL (means, stdevs, correlation). To enter the formula, highlight two adjacent cells such as B5 and C5, type the formula, and press Ctrl+Shift+Enter. Then copy and paste to generate similar values for other applicants.

Once you have generated pairs of scores for many applicants, you should ignore all pairs except for those where the score on the first exam is less than L. (Sorting is suggested here, but freeze the random numbers first.) For these pairs, test whether the mean score on the second exam is higher than higher than higher on the first, using a paired-samples test. If it is, you have demonstrated regression toward the mean. As you will probably discover, however, the results will depend on the values of the parameters you choose for μ, σ, ρ, and L. You should experiment with these. Assuming that you are able to demonstrate regression toward the mean, can you explain intuitively why it occurs?

C A S E 9.2 FRIDAY EFFECT IN THE STOCK MARKET

Many people believe that there is a “Friday effect” in the stock market. They don’t necessarily spell out exactly what they mean by this, but there is a sense that stock prices tend to be lower on Fridays than on other days. Because stock prices are readily available on the Web, it should be fairly easy to test this (alternative) hypothesis empirically.

Before collecting data and running a test, however, you must decide exactly which hypotheses you exactly which hypotheses you exactly want to test because there are several possibilities. Formulate at least two sets of null/alternative hypotheses. Then gather some stock price data and test your hypotheses. Can you conclude that there is a statistically significant Friday effect in the stock market?

C A S E 9.3 REMOVING VIOXX FROM THE MARKET

For years, the drug Vioxx, developed and marketed by Merck, was one of the blockbuster drugs on the market. One of a number of so-called Cox-2 anti-inflammatory drugs, Vioxx was considered by many people a miracle drug for alleviating the pain from arthritis and other painful afflictions. Vioxx was marketed heavily on television, prescribed by most physicians, and used by an estimated two million Americans.

All of that changed in October 2004, when the results of a large study were released. The study, which followed approximately 2600 subjects over a period of about 18 months, concluded that Vioxx use over a long period of time caused a significant increase in the risk of developing serious heart problems. Merck almost immediately pulled Vioxx from the American market and doctors stopped prescribing it. On the basis of the study, Merck faced

412 Chapter 9 Hypothesis Testing Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

413

not only public embarrassment but the prospect of huge financial losses.

More specifically, the study had 1287 patients use Vioxx for an 18-month period, and it had another 1299 patients use a placebo over the same period. After 18 months, 45 of the Vioxx patients had developed serious heart problems, whereas only 25 patients on the placebo developed such problems.

Given these results, would you agree with the conclusion that Vioxx caused a significant increase significant increase significant in the risk of developing serious heart problems? First, answer this from a purely statistical point of view, where significant means statistically significant. significant means statistically significant. significant What hypothesis should you test, and how should

you run the test? When you run the test, what is the corresponding p-value? Next, look at it from the point of view of patients. If you were a Vioxx user, would these results cause you significant worry? After all, some of the subjects who took placebos also developed heart problems, and 45 might not be considered that much larger than 25. Finally, look at it from Merck’s point of view. Are the results practically significant to the company? What does it stand to lose? Develop an estimate, no matter how wild it might be, of the financial losses Merck might incur. Just think of all of those American Vioxx users and what they might do.

Case 9.3 Removing Vioxx from the Market 413 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

PA RT

CHAPTER 10 Regression Analysis: Estimating Relationships

CHAPTER 11 Regression Analysis: Statistical Inference

CHAPTER 12 Time Series Analysis and Forecasting

Regression Analysis and Time Series Forecasting4

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

417

SITE LOCATION OF LA QUINTA MOTOR INNS

Regression analysis is an extremely flexible tool that can aid decision making in many areas. Kimes and Fitzsimmons (1990) describe how it has been used by La Quinta Motor Inns, a moderately priced hotel chain oriented toward serving the business traveler, to help make site location decisions. Location is one of the most important decisions for a lodging firm. All hotel chains search for ideal locations and often com- pete against each other for the same sites. A hotel chain that can select good sites more accurately and quickly than its competition has a distinct competitive advantage.

Kimes and Fitzsimmons, academics hired by La Quinta to model its site location decision process, used regression analysis. They collected data on 57 mature inns belonging to La Quinta during a three-year business cycle. The data included profitability for each inn (defined as operating margin percentage—profit plus depreciation and interest expenses, divided by the total revenue), as well as a number of potential explanatory variables that could be used to predict profitability. These explanatory variables fell into five categories: competitive characteristics (such as number of hotel rooms in the vicinity and average room rates); demand generators (such as hospitals and office buildings within a 4-mile radius that might attract customers to the area); demographic characteristics (such as local population, unemployment rate, and median family income); market awareness (such as years the inn has been open and state population per inn); and physical considerations (such as accessibility, distance to downtown, and sign visibility).

Regression Analysis: Estimating Relationships

C H A P T E R

10

D re

w M

ye rs

/C o rb

is

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

418 Chapter 10 Regression Analysis: Estimating Relationships

The analysts then determined which of these potential explanatory variables were most highly correlated (positively or negatively) with profitability and entered these variables into a regression equation for profitability. The estimated regression equation was

Predicted Profitability = 39.05 − 5.41StatePop + 5.81Price

–3.09!MedIncome! + 1.75ColStudents where StatePop is the state population (in 1000s) per inn, Price is the room rate for the inn, MedIncome is the median income (in $1000s) of the area, ColStudents is the number of college students (in 1000s) within four miles, and all variables in this equation are standardized to have mean 0 and standard deviation 1. This equation predicts that profitability will increase when room rate and the number of college students increase and when state population and median income decrease. The R2 value (to be discussed in this chapter) was a respectable 0.51, indicating a reasonable predictive ability. Using good statistical practice, the analysts validated this equation by feeding it explanatory variable data on a set of different inns, attempting to predict profitability for these new inns. The different inns, attempting to predict profitability for these new inns. The different validation was a success—the regression equation predicted profitability fairly accurately for this new set of inns.

La Quinta management, however, was not as interested in predicting the exact profitability of inns as in predicting which would be profitable and which would be unprofitable. A cutoff value of 35% for operating margin was used to divide the profitable inns from the unprofitable inns. (Approximately 60% of the inns in the original sample were profitable by this definition.) The analysts were still able to use the regression equation they had developed. For any prospective site, they used the regression equation to predict profitability, and if the predicted value was sufficiently high, they predicted that site would be profitable. They selected a decision rule—that is, how high was “sufficiently high”—from considerations of the two potential types of errors. One type of error, a false positive, was predicting that a site would be profitable when in fact it was headed for unprofitability. The opposite type of error, a false negative, was predicting that a site would be unprofitable (and rejecting the site) when in fact it would have been profitable. La Quinta management was more concerned about false positives, so it was willing to be conservative in its decision rule and miss a few potential opportunities for profitable sites.

Since the time of the study, La Quinta has implemented the regression model in spreadsheet form. For each potential site, it collects data on the relevant explanatory variables, uses the regression equation to predict the site’s profitability, and applies the decision rule on whether to build. Of course, the model’s recommendation is only that—a recommendation. Top management has the ultimate say on whether any site is used. As Sam Barshop, then chairman of the board and president of La Quinta Motor Inns stated, “We currently use the model to help us in our site-screening process and have found that it has raised the ‘red flag’ on several sites we had under consideration. We plan to continue using and updating the model in the future in our attempt to make La Quinta a leader in the business hotel market.” ■

10-1 INTRODUCTION Regression analysis is the study of relationships between variables. It is one of the most useful tools for a business analyst because it applies to so many situations. Some potential uses of regression analysis in business include the following:

■ How do wages of employees depend on years of experience, years of education, and gender?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-1 Introduction 419

■ How does the current price of a stock depend on its own past values, as well as the current and past values of a market index?

■ How does a company’s current sales level depend on its current and past advertising levels, the advertising levels of its competitors, the company’s own past sales levels, and the general level of the market?

■ How does the total cost of producing a batch of items depend on the total quantity of items that have been produced?

■ How does the selling price of a house depend on such factors as the appraised value of the house, the square footage of the house, the number of bedrooms in the house, and perhaps others?

Each of these questions asks how a single variable, such as selling price or employee wages, depends on other relevant variables. If we can estimate this relationship, then we can not only better understand how the world operates, but we can also do a better job of predicting the variable in question. For example, we can not only understand how a com- pany’s sales are affected by its advertising, but we can also use the company’s records of current and past advertising levels to predict future sales.

The branch of statistics that studies such relationships is called regression analysis, and it is the subject of this chapter and the next. Because of its generality and applica- bility, regression analysis is one of the most pervasive of all statistical methods in the business world. There are several ways to categorize regression analysis. One categori- zation is based on the overall purpose of the analysis. As suggested previously, there are two potential objectives of regression analysis: to understand how the world operates and to make predictions. Either of these objectives could be paramount in any particular application. If the variable in question is employee salary and we are using variables such as years of experience, level of education, and gender to explain salary levels, then the purpose of the analysis is probably to understand how the world operates—that is, to explain how the variables combine in any given company to determine salaries. More speci�cally, the purpose of the analysis might be to discover whether there is any gender discrimination in salaries, after allowing for differences in work experience and education level.

The primary objective of the analysis can also be prediction. A good example of this is when the variable in question is company sales, and variables such as advertising and past sales levels are used as explanatory variables. In this case it is certainly important for the company to know how the relevant variables impact its sales. But the company’s primary objective is probably to predict future sales levels, given current and past values of the explanatory variables. A company could even use a regression model for a what-if analysis, where it predicts future sales for many conceivable patterns of advertising and then selects its advertising level on the basis of these predictions.

Fortunately, the same regression analysis enables us to solve both problems simultane- ously. That is, it indicates how the world operates and it enables us to make predictions. So although the objectives of regression studies might differ, the same basic analysis always applies.

A second categorization of regression analysis is based on the type of data being ana- lyzed. There are two basic types: cross-sectional data and time series data. Cross-sectional data are usually data gathered from approximately the same period of time from a popu- lation. The housing and wage examples mentioned previously are typical cross-sectional studies. The �rst concerns a sample of houses, presumably sold during a short period of time, such as houses sold in Florida during the �rst couple of months of 2016. The second concerns a sample of employees observed at a particular point in time, such as a sample of automobile workers observed at the beginning of 2017.

Regression can be used to understand how the world operates, and it can be used for prediction.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

420 Chapter 10 Regression Analysis: Estimating Relationships

In contrast, time series data involve one or more variables that are observed at several, usually equally spaced, points in time. The stock price example mentioned previously �ts this description. We observe the price of a particular stock and possibly the price of a mar- ket index at the beginning of every week, say, and then try to explain the movement of the stock’s price through time.

Regression analysis can be applied equally well to cross-sectional and time series data. However, there are technical reasons for treating time series data somewhat differently. The primary reason is that time series variables are usually related to their own past values. This property of many time series variables is called autocorrelation, and it adds complications to the analysis that we will discuss only brie�y.

A third categorization of regression analysis involves the number of explanatory varia- bles in the analysis. First, we need to introduce some terms. In every regression study there is a single variable that we are trying to explain or predict, called the dependent variable (also called the response variable or the target variable). To help explain or predict the dependent target variable). To help explain or predict the dependent target variable, we use one or more explanatory variables (also called independent variables or independent variables or independent predictor variables).1 If there is a single explanatory variable, the analysis is called simple regression. If there are several explanatory variables, it is called multiple regression.

There are important differences between simple and multiple regression. The primary difference, as the name implies, is that simple regression is simpler. The calculations are simpler, the interpretation of output is somewhat simpler, and fewer complications can occur. We will begin with a simple regression example to introduce the ideas of regression. But simple regression is really just a special case of multiple regression, and there is little need to single it out for separate discussion—especially when computer software is avail- able to perform the calculations in either case.

A �nal categorization of regression analysis is of linear versus nonlinear models. The only type of regression analysis we study here is linear regression. Generally, this means linear regression. Generally, this means linear that the relationships between variables are straight-line relationships, whereas the term nonlinear implies curved relationships. By focusing on linear regression, it might appear nonlinear implies curved relationships. By focusing on linear regression, it might appear nonlinear that we are ignoring the many nonlinear relationships that exist in the business world. Fortunately, linear regression can often be used to estimate nonlinear relationships. As you will see, the term linear regression is more general than it appears. Admittedly, many of the relationships we study can be explained adequately by straight lines. But it is also true that many nonlinear relationships can be linearized by suitable mathematical transformalinearized by suitable mathematical transformalinearized - tions. Therefore, the only relationships we are ignoring in this book are those—and there are some—that cannot be transformed to linear. Such relationships can be studied, but only by advanced methods beyond the level of this book.

1The traditional terms used in regression are dependent and dependent and dependent independent variables. However, because these terms independent variables. However, because these terms independent can cause confusion with probabilistic independence, a completely different concept, there has been an increasing use of the terms response and explanatory (or predictor) variables. We tend to prefer the terms dependent and dependent and dependent explanatory, but this is largely a matter of taste.

Regression can be used to analyze cross- sectional data or time series data.

The dependent (or response or target) variable is the single variable being explained by the regression. The explanatory (or independent or predictor) variables are used to explain the dependent variable.

A simple regression analysis includes a single explanatory variable, whereas multiple regression can include any number of explanatory variables.

“Linear” regression allows you to estimate linear relationships as well as some nonlinear relationships.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-2 Scatterplots: Graphing Relationships 421

In this chapter we focus on line-�tting and curve-�tting; that is, on estimating equations that describe relationships between variables. We also discuss the interpretation of these equations, and we provide numerical measures that indicate the goodness of �t of the estimated equations. In the next chapter we extend the analysis to statistical inference of regression output.

10-2 SCATTERPLOTS: GRAPHING RELATIONSHIPS A good way to begin any regression analysis is to draw one or more scatterplots. As dis- cussed in Chapter 3, a scatterplot is a graphical plot of two variables, an X and a X and a X Y . If there is any relationship between the two variables, it is usually apparent from the scatterplot.

Example 10.1, which we will continue through the chapter, illustrates the usefulness of scatterplots. It is a typical example of cross-sectional data.

E X A M P L E 10.1 SALES VERSUS PROMOTIONS AT PHARMEX

Pharmex is a chain of drugstores that operates around the country. To see how effective its advertising and other promotional activities are, the company has collected data from 50 randomly selected metropolitan regions. In each region it has compared its own promotional expenditures and sales to those of the leading competitor in the region over the past year. There are two variables:

■ Promote: Pharmex’s promotional expenditures as a percentage of those of the leading competitor

■ Sales: Pharmex’s sales as a percentage of those of the leading competitor

Note that each of these variables is an index, not a dollar amount. For example, if Promote equals 95 for some region, this indicates that Pharmex’s promotional expenditures in that region are 95% as large as those for the leading competitor in that region. The company expects that there is a positive relationship between these two variables, so that regions with relatively larger expenditures have relatively larger sales. However, it is not clear what the nature of this relationship is. The data are listed in the file Drugstore Sales.xlsx. (See Figure 10.1 for a partial listing of the data.) What type of relationship, if any, is apparent from a scatterplot?

1 2 3 4 5 6 7

49 50

B CB C D ED E F GF G Promote Sales

77 85 110 103 110 102

93 109 90 85 95 103

100 98

A Region

1 2 3 4 5 6

48 49 95 108 50 96 8751

e S

Each value is a percentage of what the leading compe�tor did.

Figure 10.1 Data for Drugstore Example

Objective To use a scatterplot to examine the relationship between promotional expenses and sales at Pharmex.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

422 Chapter 10 Regression Analysis: Estimating Relationships

110

130

120

Sales versus Promote

80

90

100

60

70

60 70 80 90 100 110 120

Figure 10.2 Scatterplot of Sales versus Promote

Solution First, recall from Chapter 3 that there are two ways to create a scatterplot in Excel®. You can use Excel’s chart tools, or you can use the StatTools Scatterplot procedure. The advan- tages of the latter are that it is slightly easier to implement and it provides automatic for- matting of the chart. You will see examples of each in this chapter. Of course, you can use either method you prefer.

It is customary to put the explanatory variable on the horizontal axis and the dependent variable on the vertical axis. In this example the store believes large promotional expendi- tures tend to “cause” larger values of sales, so Sales is on the vertical axis and Promote is on the horizontal axis. The resulting scatterplot appears in Figure 10.2.

This scatterplot indicates that there is indeed a positive relationship between Promote and Sales—the points tend to rise from bottom left to top right—but the relationship is not perfect. If it were perfect, a given value of Promote would prescribe the value of Sales exactly. Clearly, this is not the case. For example, there are five regions with promotional values of 96 but all of them have different sales values. So the scatterplot indicates that while the variable Promote is helpful for predicting Sales, it does not lead to perfect predictions.

Finally, we briefly discuss causation. There is a tendency for an analyst (such as a drugstore manager) to say that larger promotional expenses cause larger sales values. However, unless the data are obtained in a carefully controlled experiment—which is cer- tainly not the case here—you can never be absolutely sure about causation. One reason is that you can’t always be sure which direction the causation goes. Does X cause Y , or does Y cause X? Another reason is that you can almost never rule out the possibility that some other variable is causing the variation in both of the observed variables. Although this is unlikely in this drugstore example, it is still a possibility. ■

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-2 Scatterplots: Graphing Relationships 423

Example 10.2 uses time series data to illustrate several other features of scatterplots. We will follow this example throughout the chapter as well.

Regression and Causation A successful regression analysis does not necessarily imply that the X variables X variables X cause Y to vary in a certain way. This is one possibility, but there are two others. First, even if a regression of Y versus X is promising,

it could very easily be that Y is causing X; that is, the causality could go in the opposite direction. Second and more common, there could be other variables (not included in the regression) that are causing both Y and the X variables to vary.X variables to vary.X

F u n da m e n ta l I n s i g h t

E X A M P L E 10.2 EXPLAINING OVERHEAD COSTS AT BENDRIX

Bendrix Company manufactures various types of parts for automobiles. The manager of the factory wants to get a better understanding of overhead costs. These overhead costs include supervision, indirect labor, supplies, payroll taxes, overtime premiums, depre- ciation, and a number of miscellaneous items such as insurance, utilities, and janitorial and maintenance expenses. Some of these overhead costs are fixed in the sense that they do not fixed in the sense that they do not fixed vary appreciably with the volume of work being done, whereas others are variable and do vary directly with the volume of work. The fixed overhead costs tend to come from the super- vision, depreciation, and miscellaneous categories, whereas the variable overhead costs tend to come from the indirect labor, supplies, payroll taxes, and overtime categories. However, it is not easy to draw a clear line between the fixed and variable overhead components.

The Bendrix manager has tracked total overhead costs for the past 36 months. To help explain these, he has also collected data on two variables that are related to the amount of work done at the factory. These variables are:

■ Machine Hours: number of machine hours used during the month

■ Production Runs: the number of separate production runs during the month

The first of these is a direct measure of the amount of work being done. To understand the second, we note that Bendrix manufactures parts in large batches. Each batch corresponds to a production run. Once a production run is completed, the factory must set up for the next production run. During this setup there is typically some downtime while the machin- ery is reconfigured for the part type scheduled for production in the next batch. Therefore, the manager believes that both of these variables could be responsible (in different ways) for variations in overhead costs. Do scatterplots support this belief?

Objective To use scatterplots to examine the relationships among overhead, machine hours, and production runs at Bendrix.

Solution The data appear in Figure 10.3 (with many hidden rows). (See the Overhead Costs.xlsx file.) Each observation (row) corresponds to a single month. The goal is to find possible relationships between the Overhead variable and the Machine Hours and Production Runs variables, but because these are time series variables, you should also be on the lookout for any relationships between these variables and the Month variable. That is, you should also investigate any time series behavior in these variables.

This data set illustrates, even with a modest number of variables, how the number of potentially useful scatterplots can grow quickly. At the very least, you should examine the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

424 Chapter 10 Regression Analysis: Estimating Relationships

100000

110000

130000

120000

Sca�erplot of Overhead vs Machine Hours

70000

80000

90000

1000 1100 1200 1300 1400 1500 1600 1700 1800 1900

O ve

rh ea

d

Machine Hours

Figure 10.4 Scatterplot of Overhead versus Machine Hours

100000

110000

130000

120000

Sca�erplot of Overhead vs Produc�on Runs

70000

80000

90000

10 20 30 40 50 7060

O ve

rh ea

d

Produc on Runs

Figure 10.5 Scatterplot of Overhead versus Production Runs

1 2 3 4 5 6

A BA B C DC D Month Machine Hours Produc�on Runs Overhead

1 1539 31 99798 2 1284 29 87804 3 1490 27 93681 4 1355 22 82262 5 1500 35 106968

35 36 37

34 1723 35 107828 35 1413 30 88032 36 1390 54 117943

h M s P Figure 10.3 Data for Bendrix Overhead Example

scatterplot between each potential explanatory variable (Machine Hours and Production Runs) and the dependent variable (Overhead). These appear in Figures 10.4 and 10.5. You can see that Overhead tends to increase as either Machine Hours increases or Production Runs increases. However, both relationships are far from perfect.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-2 Scatterplots: Graphing Relationships 425

To check for possible time series patterns, you can also create a time series graph for any of the variables. One of these, the time series graph for Overhead, is shown in Figure 10.6. It indicates a fairly random pattern through time, with no apparent upward trend or other obvious time series pattern. You can check that time series graphs of the Machine Hours and Production Runs variables also indicate no obvious time series patterns.

Finally, when there are multiple explanatory variables, you should check for relation- ships among them. The scatterplot of Machine Hours versus Production Runs appears in Figure 10.7. (Either variable could be chosen for the vertical axis.) This “cloud” of points indicates no relationship worth pursuing.

This is precisely the role of scatterplots: to pro- vide a visual represen- tation of relationships or the lack of relation- ships between variables.

100000

120000

140000

Time Series of Overhead

0

20000

40000

60000

80000

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35

Figure 10.6 Time Series Graph of Overhead versus Month

1500

1600

1700

1800

1900

Sca�erplot of Machine Hours vs Produc on Runs

1000

1100

1200

1300

1400

M ac

h in

e H

o u

rs

Produc�on Runs

10 20 30 40 50 60 70

Figure 10.7 Scatterplot of Machine Hours versus Production Runs

In summary, the Bendrix manager should continue to explore the positive relation- ship between Overhead and each of the Machine Hours and Production Runs variables. However, none of the variables appears to have any time series behavior, and the two potential explanatory variables do not appear to be related to each other. ■

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

426 Chapter 10 Regression Analysis: Estimating Relationships

60

70

80

90

Sca�erplot of Life Expectancy vs GNP per Capita of Country Data

0

10

20

30

40

50

0 5000 10000 15000 20000 25000 30000 35000

Li fe

E xp

ec ta

n cy

/C o

u n

tr y

D at

a

GNP per Capita/Country Data

Figure 10.8 Scatterplot of Life Expectancy versus GNP per Capita

10-2a Linear versus Nonlinear Relationships

Scatterplots are extremely useful for detecting behavior that might not be obvious other- wise. We illustrate some of these in the next few subsections. First, the typical relationship you hope to see is a straight-line, or linear, relationship. This doesn’t mean that all points lie on a straight line—this is too much to expect in real-world data—but that the points tend to cluster around a straight line. The scatterplots in Figures 10.2, 10.4, and 10.5 all exhibit linear relationships. At least, there is no obvious curvature.

The scatterplot in Figure 10.8, on the other hand, illustrates a relationship that is clearly nonlinear. The data in this scatterplot are 1990 data on more than 100 countries. The variables listed are life expectancy (of newborns, based on current mortality condi- tions) and GNP per capita. The obvious curvature in the scatterplot can be explained as follows. For poor countries, a slight increase in GNP per capita has a large effect on life expectancy. However, this effect decreases for wealthier countries. A straight-line relation- ship is de�nitely not appropriate for these data. However, as discussed previously, “linear” regression—after an appropriate transformation of the data—might still be applicable.

10-2b Outliers

Scatterplots are especially useful for identifying outliers, observations that lie outside the typical pattern of points. The scatterplot in Figure 10.9 shows annual salaries versus years of experience for a sample of employees at a particular company. There is a clear linear relationship between these two variables—for all employees except the point at the top right. A closer look at the data reveals that this one employee is the company CEO, whose salary is well above that of all the other employees.

Although scatterplots are good for detecting outliers, they do not necessarily indicate what you ought to do about any outliers you �nd. This depends entirely on the particular situation. If you are attempting to investigate the salary structure for typical employees at a company, then you should probably not include the company CEO. First, the CEO’s sal- ary is not determined in the same way as the salaries for typical employees. Second, if you do include the CEO in the analysis, it can greatly distort the results for the mass of typical

An outlier is an observation that falls outside of the general pattern of the rest of the observations.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-2 Scatterplots: Graphing Relationships 427

250000

200000

150000

100000

Sa la

ry /S

al ar

y D

at a

0

50000

0 5 10 15 20 25 YearYearY s Experience/Salary Data

Sca�erplot of Salary vs Yearerplot of Salary vs Yearerplot of Salary vs Y s Experience of Salary Data Figure 10.9 Scatterplot of Salary versus Years of Experience

employees. In other situations, however, it might not be appropriate to eliminate outliers not be appropriate to eliminate outliers not just to make the analysis come out more nicely.

It is dif�cult to generalize about the treatment of outliers, but the following points are worth noting.

■ If an outlier is clearly not a member of the population of interest, then it is probably best to delete it from the analysis. This is the case for the company CEO in Figure 10.9.

■ If it isn’t clear whether outliers are members of the relevant population, you can run the regression analysis with them and again without them. If the results are practically the same in both cases, then it is probably best to report the results with the outliers included. Otherwise, you can report both sets of results with a verbal explanation of the outliers.

10-2c Unequal Variance

Occasionally, there is a clear relationship between two variables, but the variance of the dependent variable depends on the value of the explanatory variable. Figure 10.10 illus- trates a common example of this. It shows the amount spent at a mail-order company versus salary for the customers in the data set. There is a clear upward relationship, but the variability of amount spent increases as salary increases. This is evident from the fan shape. As you will see in the next chapter, this unequal variance violates one of the assumptions of linear regression analysis, and there are techniques to deal with it.

10-2d No Relationship

A scatterplot can provide one other useful piece of information: It can indicate that there is no relationship between a pair of variables, at least none worth pursuing. This is usu- ally the case when the scatterplot appears as a shapeless swarm of points, as illustrated in Figure 10.11. Here the variables are an employee performance score and the number of overtime hours worked in the previous month for a sample of employees. There is virtually no hint of a relationship between these two variables in this plot, and if these are the only two variables in the data set, the analysis can stop right here. Many people who use statistics evidently believe that a computer can perform magic on a set of numbers and �nd relation- ships that were completely hidden. Occasionally this is true, but when a scatterplot appears as in Figure 10.11, the variables are not related in any useful way, and that’s all there is to it.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

428 Chapter 10 Regression Analysis: Estimating Relationships

10-3 CORRELATIONS: INDICATORS OF LINEAR RELATIONSHIPS Scatterplots provide graphical indications of relationships, whether they are linear, non- linear, or essentially nonexistent. Correlations are numerical summary measures that indicate the strength of linear relationships between pairs of variables.2

are numerical summary measures that 2

are numerical summary measures that A correlation

between a pair of variables is a single number that summarizes the information in a scat- terplot. A correlation can be very useful, but it has an important limitation: It measures the strength of linear relationships only. If there is a nonlinear relationship, as suggested by a linear relationships only. If there is a nonlinear relationship, as suggested by a linear scatterplot, the correlation can be completely misleading. With this important limitation in mind, let’s look a bit more closely at correlations.

2This section includes some material from Chapter 3 that we repeat here for convenience.

Sca�erplot of Amount Spent vs Salary of Spending Data

5000

6000

7000

0

1000

2000

3000

4000

0 20000 40000 60000 80000 100000 120000 140000 160000 180000

A m

o u

n t

Sp en

t/ Sp

en d

in g

D at

a

Salary/Spending Data

Figure 10.10 Unequal Variance of Dependent Variable in a Scatterplot

Figure 10.11 An Example of No Relationship

© C

e n g

a g

e L

e a rn

in g

Sca�erplot of Performance Score vs Over me Hours of Performance Data 120

80

0

20

40

60

0 5 10 15 20

Pe rf

or m

an ce

S co

re /P

er fo

rm an

ce D

at a

Over�me Hours/Performance Data

100

25

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-3 Correlations: Indicators of Linear Relationships 429

The usual notation for a correlation between two variables X and X and X Y is rXrXr Y. (The sub- scripts can be omitted if the variables are clear from the context.) The formula for rXrXr Y is given by Equation (10.1). Note that it is a sum of products in the numerator, divided by the product sXsXsX Y of the sample standard deviations of X and Y . This requires a considerable amount of computation, so correlations are almost always computed by software packages.

Formula for Correlation

rXrXr Y = Σ(XiXiX − X ) (YiYiY − Y )/(n − 1)

sXsXsX Y (10.1)

The magnitude of a covariance is difficult to interpret because it depends on the units of measurement.

A correlation close to –1 or +1 indicates a strong linear relation- ship. A correlation close to 0 indicates virtually no linear relationship.

The numerator of Equation (10.1) is also a measure of association between two variables X and Y , called the covariance between X and Y . Like a correlation, a covariance is a sin- gle number that measures the strength of the linear relationship between two variables. By looking at the sign of the covariance or correlation—plus or minus—you can tell whether the two variables are positively or negatively related. The drawback to a covariance, how- ever, is that its magnitude depends on the units in which the variables are measured.

To illustrate, the covariance between Overhead and Machine Hours in the Bendrix manufacturing data set is 1,333,138. (It can be found with Excel’s COVARIANCE.S function or with StatTools.) However, if each overhead value is divided by 1000, so that overhead costs are expressed in thousands of dollars, and each value of Machine Hours is divided by 100, so that machine hours are expressed in hundreds of hours, the covariance decreases by a factor of 100,000 to 13.33138. This is in spite of the fact that the basic rela- tionship between these variables has not changed and the revised scatterplot has exactly the same shape. For this reason it is dif�cult to interpret the magnitude of a covariance, and we concentrate instead on correlations.

Unlike covariances, correlations have the attractive property that they are completely unaffected by the units of measurement. The rescaling described in the previous paragraph has absolutely no effect on the correlation between Overhead and Machine Hours. In either case the correlation is 0.632. All correlations are between −1 and +1, inclusive. The sign of a correlation, plus or minus, determines whether the linear relationship between two vari- ables is positive or negative. In this respect, a correlation is just like a covariance. However, the strength of the linear relationship between the variables is measured by the absolute value, or magnitude, of the correlation. The closer this magnitude is to 1, the stronger the linear relationship is.

A correlation equal to 0 or near 0 indicates practically no linear relationship. A correlation with magnitude close to 1, on the other hand, indicates a strong linear relationship. At the extreme, a correlation equal to −1 or +1 occurs only when the linear relationship is perfect—that is, when all points in the scatterplot lie on a straight line. Although such extremes practically never occur in business applications, large correlations greater in magnitude than 0.9, for example, are not at all uncommon.

Looking back at the scatterplots for the Pharmex drugstore data in Figure 10.2, you can see that the correlation between Sales and Promote is positive—as the upward-sloping scatter of points suggests. It turns out to be 0.673. This is a moderately large correlation. It con�rms the pattern in the scatterplot, namely, that the points increase linearly from left to right but with considerable variation around any particular straight line.

Similarly, the scatterplots for the Bendrix manufacturing data in Figures 10.4 and 10.5 indicate moderately large positive correlations, 0.632 and 0.521, between Overhead and Machine Hours and between Overhead and Production Runs. However, the correlation indicated in Figure 10.7 between Machine Hours and Production Runs, −0.229, is quite small and indicates almost no relationship between these two variables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

430 Chapter 10 Regression Analysis: Estimating Relationships

You must be careful when interpreting the correlations in Figures 10.8 and 10.9. The scatterplot between life expectancy and GNP per capita in Figure 10.8 is obviously non- linear, and correlations are relevant descriptors only for linear relationships. If anything, linear relationships. If anything, linear the correlation in this example, 0.616, tends to underestimate the true strength of the rela- tionship—the nonlinear one—between life expectancy and GNP per capita. In contrast, the correlation between salary and years of experience in Figure 10.9 is large, 0.894, but it is not nearly as large as it would be if the outlier were omitted. (It is then 0.992.) This example illustrates the considerable effect a single outlier can have on a correlation.

An obvious question is whether a given correlation is “large.” This is a dif�cult ques- tion to answer directly. Clearly, a correlation such as 0.992 is quite large—the points tend to cluster very tightly around a straight line. Similarly, a correlation of 0.034 is quite small— the points tend to be a shapeless swarm. But there is a continuum of in-between values, as exhibited in Figures 10.2, 10.4, and 10.5. We give a more de�nite answer to this question when we examine the square of the correlation later in this chapter.

As for calculating correlations, there are two possibilities in Excel. To calculate a single correlation rXrXr Y between variables Y between variables Y X and X and X Y, you can use Excel’s CORREL function in the form

=CORREL(X-range,Y-range)

Alternatively, you can use StatTools to obtain a whole table of correlations between a set of variables.3 Alternatively, you can use StatTools to obtain a whole table of correlations between a set

3 Alternatively, you can use StatTools to obtain a whole table of correlations between a set

Finally, we reiterate the important limitation of correlations (and covariances), namely, that they apply only to linear relationships. If a correlation is close to zero, you cannot linear relationships. If a correlation is close to zero, you cannot linear automatically conclude that there is no relationship between the two variables. You should look at a scatterplot �rst. The chances are that the points are a shapeless swarm and that no relationship exists. But it is also possible that the points cluster around some curve. In this case the correlation is a misleading measure of the relationship.

10-4 SIMPLE LINEAR REGRESSION Scatterplots and correlations are very useful for indicating linear relationships and the strengths of these relationships. But they do not actually quantify the relationships. For example, it is clear from the scatterplot of the Pharmex drugstore data that sales are related to promotional expenditures. But the scatterplot does not specify exactly what this rela- tionship is. If the expenditure index for a given region is 95, what would you predict this region’s sales index to be? Or if one region’s expenditure index is 5 points higher than another’s, how much larger would you predict the sales index of the former to be? To answer these questions, the relationship between the dependent variable Sales and the explanatory variable Promote must be quanti�ed.

In this section we answer these types of questions for simple linear regression, where there is a single explanatory variable. We do so by �tting a straight line through the scatterplot of the dependent variable Y versus the explanatory variable Y versus the explanatory variable Y X and then basing the answers to X and then basing the answers to X the questions on the �tted straight line. But which straight line? We address this issue next.

10-4a Least Squares Estimation

The scatterplot between Sales and Promote, repeated in Figure 10.12, hints at a linear relationship between these two variables. It would not be dif�cult to draw a straight line through these points to produce a reasonably good �t. In fact, a possible linear �t is

3You might recall from Chapter 3 that there is also a fairly quick way to generate a whole table of correlations with Excel by using a combination of range names and the INDIRECT function. You can refer to the �nished version of the golf stats �le from Chapter 3 for the details.

Correlations can be misleading when variables are related nonlinearly.

Remember that “simple” linear regression does not mean “easy”; it means only that there is a single explanatory variable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 431

Figure 10.13 Fitted Values and Residuals

Sales vs Promote

100

110

120

130

60

70

80

90

60 70 80 90 100 110 120

Sa le

s

Promote

y = 0.7623x + 25.126y = 0.7623x + 25.126y R2 = 0.4529

Figure 10.12 Scatterplot with Trend Line Superimposed

indicated in the graph. But we proceed more systematically than simply drawing lines free- hand. Speci�cally, we choose the line that makes the vertical distances from the points to the line as small as possible, as explained next.

Consider the magni�ed graph in Figure 10.13. Several points in the scatterplot are shown, along with a line drawn through them. Note that the vertical distance from the horizontal axis to any point, which is just the value of Sales for that point, can be decom- posed into two parts: the vertical distance from the horizontal axis to the line, and the vertical distance from the line to the point. The �rst of these is called the �tted value, and the second is called the residual. The idea is very simple. By using a straight line to re�ect the relationship between Sales and Promote, you expect a given Sales to be at the height of the line above any particular value of Promote. That is, you expect Sales to equal the �tted value.

A fitted value is the predicted value of the dependent variable. Graphically, it is the height of the line above a given explanatory value. The corresponding residual is the difference between the actual and fitted values of the dependent variable.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

432 Chapter 10 Regression Analysis: Estimating Relationships

But the relationship is not perfect. Not all (perhaps not any) of the points lie exactly on the line. The differences are the residuals. They show how much the observed values differ from the �tted values. If a particular residual is positive, the corresponding point is above the line; if it is negative, the point is below the line. The only time a residual is zero is when the point lies directly on the line. The relationship between observed values, �tted values, and residuals is very general and is stated in Equation (10.2).

Fundamental Equation for Regression Observed Value = Fitted Value + Residual (10.2)

The least squares line is the line that minimizes the sum of the squared residuals. It is the line quoted in regression outputs.

Equation for Slope in Simple Linear Regression

b = Σ(XiXiX − X ) (YiYiY − Y )

Σ(XiXiX − X ) 2

= rXrXr Y sY sX

(10.3)

Equation for Intercept in Simple Linear Regression a = Y − bXbXb (10.4)

We can now explain how to choose the best-�tting line through the points in the scatter- plot. It is the line with the smallest sum of squared residuals. The resulting line is called the least squares line. Why do we use the sum of squared residuals? Why not minimize some squared residuals? Why not minimize some squared other measure of the residuals? First, it is not appropriate to simply minimize the sum of the residuals. This is because the positive residuals would cancel the negative residuals. In fact, the least squares line has the property that the sum of the residuals is always exactly zero. To adjust for this, we could minimize the sum of the absolute values of the residuals, and this is a perfectly reasonable procedure. However, for technical and historical reasons, it is not the procedure usually chosen. The minimization of the sum of squared residuals is deeply rooted in statistical tradition, and it works well.

The minimization problem itself is a calculus problem and is not discussed here. Virtually all statistical software packages perform this minimization automatically, so you do not need to be concerned with the technical details. However, we do provide the formu- las for the least squares line.

Recall from basic algebra that the equation for any straight line can be written as Y = a + bXbXb

Here, a is the Y -intercept of the line, the value of Y when X = 0, and b is the slope of the line, the change in Y when X increases by one unit. Therefore, the least squares line is spec- i�ed completely by its slope and intercept. These are given by Equations (10.3) and (10.4).

We have presented these formulas primarily for conceptual purposes, not for hand calculations—the software takes care of the calculations. From the formula on the right for b, you can see that it is closely related to the correlation between X and Y . Speci�cally, if the standard deviations, sX and X and X sY, of X and X and X Y are kept constant, the slope b of the least squares line varies directly with the correlation between the two variables. The effect of the formula for a is not quite as interesting. It simply forces the least squares line to go through the point of sample means, (X, Y ).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 433

It is easy to obtain the least squares line in Excel. We illustrate this in the following continuations of Examples 10.1 and 10.2.

E X A M P L E 10.1 SALES VERSUS PROMOTIONS AT PHARMEX (CONTINUED)

Find the least squares line for the Pharmex drugstore data, using Sales as the dependent variable and Promote as the explanatory variable. Objective To find the least squares line for sales as a function of promotional expenses at Pharmex.

Solution To find the least squares line in Excel, there are several ways you can proceed. First, when you superimpose a trend line on a scatterplot of Y versus Y versus Y X, you can request the equation of the line. We did this in Figure 10.12. It shows that the intercept is 25.126 and the slope is 0.7623.

A second method is to use Excel’s built-in INTERCEPT and SLOPE functions. Each of these takes two arguments: the range of the Y-values and the range of the Y-values and the range of the Y X-values. X-values. X These (along with other Excel functions to be discussed shortly) appear in Figure 10.14. Remember, though, that these functions apply only to simple regression, where there is a single X variable. They can’t be used when there are multiple X variable. They can’t be used when there are multiple X X variables.X variables.X

1

2

3

4

5

6

7

8

9

10

11

E

25.126

0.762

0.453

7.395

0.762

0.121

0.453

39.737

2172.88

F G H JH JH JH JI KI KH JI KH JH JI KH J L ML M

25.126

11.883

7.395

48

2624.74

=LINEST(C2:C51,B2:B51,TRUE,=LINEST(C2:C51,B2:B51,TRUE,=LINEST(C2:C51,B2:B51, TRUE)

(entered as an array func�on with Ctrl+Shi�+Enter)

=INTERCEPT(C2:C51,B2:B51)

=SLOPE(C2:C51,B2:B51)

=RSQ(C2:C51,B2:B51)

=STEYX(C2:C51,B2:B51)

Excel regression func�ons (one X variable only)

The func�ons used in rows 2-5 are limited in that they apply only when there is a single independent variable.

Figure 10.14 Excel’s Built-in Regression Functions

© C

e n g

a g

e L

e a rn

in g

A third method is to use Excel’s LINEST function, also illustrated in Figure 10.14. This is a truly strange function, and we don’t really recommend it, but it is available for simple or multiple regression. As explained in the finished version of the Pharmex file, or multiple regression. As explained in the finished version of the Pharmex file, or LINEST is an array function, so you must first select the range for the output, then type the function, and then press Ctrl+Shift+Enter. As you can see in Figure 10.14, the first row (of five rows) of the LINEST output contains the same slope and intercept as before.

A fourth option is to use the Regression tool in Excel’s built-in Analysis ToolPak add-in. We discussed this add-in briefly in Chapter 2, and we again mention that a description

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

434 Chapter 10 Regression Analysis: Estimating Relationships

of it is available at the first author’s website: http://kelley.iu.edu/albrightbooks/Free_ downloads.htm. Regression is arguably the best use for Analysis ToolPak, but it still has serious drawbacks, especially when you want to experiment with a number of regression equations. In short, it works, but it can be tedious to use. Specifically, it requires that all of the X variables for the regression be in contiguous columns. (The same is true for the X variables for the regression be in contiguous columns. (The same is true for the X LINEST function.) This can involve a lot of rearrangement of the data.

Unfortunately, if you want to perform serious regression with Excel, its built-in tools do not really suffice. For this reason, we will instead rely on StatTools in this chapter and the next chapter. StatTools is easy to use, it is powerful, and it provides the same types of regression output found in virtually all statistical software packages. (In addition, users of previous editions of the book will see improvements to StatTools that make it even easier to use.)

To perform the analysis, select Regression from the StatTools Regression and Classification dropdown list. Then fill in the resulting dialog box as shown in Figure 10.15. Specifically, select Multiple as the Regression Type (this type is used for both single and multiple regression in StatTools), and select Promote as the single I variable and Sales as I variable and Sales as I the single D variable. (Here, I and I and I D stand for independent and dependent. Remember that there is always a single D variable, but in multiple regression there can be several I variables.)

© C

e n g

a g

e L

e a rn

in g

Figure 10.15 StatTools Regression Dialog Box

Note that the StatTools Regression user interface has changed considerably since the previous version of the book. There is now a Wizard (not discussed here) that leads you through the building of a regression model, there is an option to include derived variables (discussed later in this chapter), and there are now three extra Regression tabs, shown in Figures 10.16, 10.17, and 10.18. These three tabs provide a number of options. Specifically, the options in Figure 10.17 allow you to request several diagnostic graphs. We typically request the graph of fitted values versus residuals, but you can request as many as you like.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 435

The regression output includes three parts. The first is the main regression output shown in Figure 10.19. The last two are a scatterplot of residuals and fitted values requested in the regression dialog box and a list of fitted values and residuals, a few of which are shown in Figure 10.20. (The list of fitted values and residuals is part of the output only if at least one of the optional graphs in Figure 10.17 is selected.)

© C

e n g

a g

e L

e a rn

in g

Figure 10.16 StatTools Regression Parameters Tab

© C

e n g

a g

e L

e a rn

in g

Figure 10.17 StatTools Regression Graphs Tabb

© C

e n g

a g

e L

e a rn

in g

Figure 10.18 StatTools Regression Options Tab

A B C D F G

SummarySummarySummar

Explained

Unexplained

ANOANOVA Tabl Tabl T e

Mul�ple Regression for Sales

Regression Tablgression Tablgression T e Coefficient

Standard t-Value-Value-V p-Value-Value-V

Lower

Confidence Interval 95%

UpperError

Constant

Promote

Mul�ple

R

0.6730 0.4529 0.4415 7.394732934

F Mean of

Squares

Sum of

Squares

Degrees of

Freedom

1 2172.880392 2172.880392 39.73661179 < 0.0001

< 0.0001

2624.739608

25.12642006 11.8825852 2.114558377 0.0397 1.234881256 49.01795886

1.0054394380.5191535326.3036982630.1209284540.762296485

54.6820751648

p-Value-Value-V

Adjusted Std. Err. of. Err. of. Err

Es�mate

0

Rows

Ignored R-Square

R-square

8

9

10

11

12

13

14

15

16

17

18

19

20

E F GC DA B Figure 10.19 StatTools Regression Output for Drugstore Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

436 Chapter 10 Regression Analysis: Estimating Relationships

© C

e n g

a g

e L

e a rn

in g

5.0

10.0

15.0

20.0

Sca�erplot of Residual vs Fit

−15.0

−10.0

−5.0

0.0 80.0 85.0 90 90.0 95.0 100.100.0 105.005.0 110.0 115.0115.0 120.0

R es

id u

al s

−20.0 Fit

Graph Data

1

2 3

Sales

85

103 102

Fit

83.8232949

108.9790334 108.9790334

Residuals

1.176750604

–5.979033397 –6.979033397

80.0

Figure 10.20 StatTools Scatterplot and Partial List of Residuals versus Fitted Values

We will eventually interpret all of the output in Figure 10.19, but for now, we focus on only a small part of it. Specifically, the intercept and slope of the least squares line appear under the Coefficient label in cells B19 and B20. They imply that the equation for the least squares line is4 a small part of it. Specifically, the intercept and slope of the least squares line appear under the

4 a small part of it. Specifically, the intercept and slope of the least squares line appear under the

Predicted Sales = 25.1264 + 0.7623Promote

The regression equation for this example can be interpreted as follows. The slope, 0.7623, indicates that the sales index tends to increase by about 0.76 for each one-unit increase in the promotional expenses index. Alternatively, if two regions are compared, where the sec- ond region spends one unit more than the first region, the predicted sales index for the sec- ond region is 0.76 larger than the sales index for the first region. The interpretation of the intercept is less important. It is literally the predicted sales index for a region that does zero promotions. However, no region in the sample has anywhere near a zero promotional value. Therefore, in a situation like this, where the range of observed values for the explanatory var- iable does not include zero, it is best to think of the intercept term as simply an “anchor” for the least squares line that enables predictions of Y values for the range of observed Y values for the range of observed Y X values.X values.X

A useful graph in almost any regression analysis is a scatterplot of residuals (on the vertical axis) versus fitted values. This scatterplot for the Pharmex data appears in Figure 10.20 (along with a few of the residuals and fitted values used to create the chart). You typically examine such a scatterplot for any obvious patterns. A good fit not only has small residuals, but it has residuals scattered randomly around zero with no apparent pattern. This appears to be the case for the Pharmex data. ■

StatTools Tip: Educational Comments StatTools provides optional cell comments to help you learn its outputs (regression or other- wise). To enable these comments, open the Applications Settings dialog box from the StatTools Utilities dropdown list and switch the Educational Comments setting from False (the default) to True.

In many applications, it makes no sense to have the explanatory variable(s) equal to zero. Then the intercept term has no practical or economic meaning.

A shapeless swarm of points in a scatterplot of residuals versus fitted values is typically good news. It means that no regression assumptions are violated.

4We always report the left side of the estimated regression equation as the predicted value of the dependent varipredicted value of the dependent varipredicted - able. It is not the actual value of the dependent variable because the observations do not all lie on the estimated actual value of the dependent variable because the observations do not all lie on the estimated actual regression line.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 437

E X A M P L E 10.2 EXPLAINING OVERHEAD COSTS AT BENDRIX (CONTINUED)

© C

e n g

a g

e L

e a rn

in g

8 9

10 11 12 13 14 15 16 17 18 19 20

A BA B C DC D E FE F G Std. Err. ofAdjustedMul�ple

Summary Mul�ple Regression for Overhead

R-squareR Es�mate

F

0.5205 0.2710 0.2495

Rows Ignored

09457.239463

Degrees of Sum of Mean of ANOVA Table Freedom Squares Squares Explained 1 1130247999 1130247999 12.6370288 0.0011 Unexplained 34 3040938861 89439378.26

Standard Regression Table UpperLowerError Constant 75605.51571 6808.610629 11.10439704 Produc�on Runs 655.0706602 184.2746779 3.554859885

< 0.0001 61768.75415 89442.27728 0.0011 280.5794579 1029.561862

R-Square

p-Value

t-ValueCoefficient p-Value Confidence Interval 95%

Figure 10.22 StatTools Regression Output for Overhead versus Production Runs ©

C e n g

a g

e L

e a rn

in g

8 9

10 11 12 13 14 15 16 17 18 19 20

A BA B C DC D E FE F G Std. Err. ofAdjusted Rows

Ignored Mul ple

Summary Mul�ple Regression for Overhead

R-squareR ER-squareR ER-square s mate

F

0.6319 0.3993 0.3816 8584.739353 0

Degrees of Sum of Mean of ANOVA Table Freedom Squares Squares Explained 1 1665463368 1665463368 22.59856473 < 0.0001 Unexplained 34 2505723492 73697749.75

Standard Regression Table UpperLowerError Constant 48621.35463 10725.3327 4.533319013 Machine Hours 34.70223642 7.299902097 4.753794772

< 0.0001 26824.85615 70417.85312 < 0.0001 19.86705047 49.53742238

R-Square R E

R-Square R E

p-Value

t-ValueCoefficient p-Value Confidence Interval 95%

Figure 10.21 StatTools Regression Output for Overhead versus Machine Hours

The Bendrix manufacturing data set has two potential explanatory variables, Machine Hours and Production Runs. Eventually, we will estimate a regression equation with both of these variables included. However, if we include only one at a time, what do they tell us about overhead costs?

Objective To regress overhead expenses at Bendrix against machine hours and then against To regress overhead expenses at Bendrix against machine hours and then against T production runs.

Solution The regression output for Overhead with Machine Hours as the single explanatory variable appears in Figure 10.21. The output when Production Runs is the only explanatory variable appears in Figure 10.22. The two least squares lines are therefore

Predicted Overhead = 48621 + 34.7Machine Hours (10.5)

and

Predicted Overhead = 75606 + 655.1Production Runs (10.6)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

438 Chapter 10 Regression Analysis: Estimating Relationships

Clearly, these two equations are quite different, although each effectively breaks Overhead into a fixed component and a variable component. Equation (10.5) implies that the fixed component of overhead is about $48,621. Bendrix can expect to incur this amount even if zero machine hours are used. The variable component is the 34.7Machine Hours term. It implies that the expected overhead increases by about $35 for each extra machine hour. Equation (10.6), on the other hand, breaks overhead down into a fixed component of $75,606 and a variable component of about $655 per each production run.

The difference between these two equations can be attributed to the fact that neither tells the whole story. If the manager’s goal is to split overhead into a fixed compo- nent and a variable component, the variable component should include both of the meas- ures of work activity (and maybe others) to give a more complete explanation of overhead. We will explain how to do this when this example is reanalyzed with multiple regression. ■

43 44 45 46 47 48 49 50 51 52 53

A BA B C DC D Graph Data Sales Fit Residuals

1 2 3 4 5 6 7 8 9 10

85 103 102 109 85

103 110 86 92 87

83.8232494 108.9790334 108.9790334 96.01999315 93.7331037

97.54458612 101.3560685 89.92162127 98.30688261 88.3970283

1.176750604 –5.979033397 –6.979033397 12.98000685

–8.733103699 5.455413876 8.643931452

–3.921621275 –6.306882608 –1.397028305

Figure 10.23 StatTools Fitted Values and Residuals for Pharmex Example

10-4b Standard Error of Estimate

We now examine �tted values and residuals to see how they lead to a useful summary measure for a regression equation. In a typical simple regression model, the expression a + bXbXb is the �tted value of Y . Graphically, it is the height of the estimated line above the value X. The �tted value is often denoted as Ŷ (pronounced Y -hat):5

. Graphically, it is the height of the estimated line above the 5

. Graphically, it is the height of the estimated line above the

Ŷ = a + bXbXb

Then a typical residual, denoted by e, is the difference between the observed value Y and the �tted value Ŷ . The following is a restatement of Equation (10.2):

e = Y − Ŷ

A few of the �tted values and associated residuals for the Pharmex drugstore example are shown in Figure 10.23. (Recall that these columns are inserted automatically by StatTools’s Regression procedure when you request the optional scatterplot of residuals versus �tted values.)

The magnitudes of the residuals provide a good indication of how useful the regression line is for predicting Y values from X values. However, because there are numerous residuals, it is useful to summarize them with a single numerical measure. This measure, called the standard error of estimate and denoted se, is essentially the standard deviation of the residuals. It is given by Equation (10.7).

5We could also write Predicted Y instead of Ŷ, but the latter notation is common in the statistics literature.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 439

Actually, because the average of the residuals from a least squares �t is always zero, this is identical to the standard deviation of the residuals except for the denominator n − 2, not the usual n − 1. As you will see in more generality later on, the rule is to subtract the number of parameters being estimated from the sample size n to obtain the denominator. Here there are two parameters being estimated: the intercept a and the slope b.

The usual empirical rules for standard deviations can be applied to the standard error of estimate. For example, about two-thirds of the residuals are typically within one standard error of their mean (which is zero). Stated another way, about two-thirds of the observed Y values are typically within one standard error of the corresponding �tted Ŷ values. Similarly, about 95% of the observed Y values are typically within two standard errors of the corresponding �tted Ŷ values.6

The standard error of estimate se is included in all StatTools regression outputs. Alternatively, it can be calculated directly with Excel’s STEYX function (when there is only one X variable) in the formX variable) in the formX

=STEYX(Y-range,X-range)

The standard error for the Pharmex data appears in cell E10 of Figure 10.19. (It also appears in cells E5 and F9 of Figure 10.14 from built-in Excel functions.) Its value, approximately 7.39, indicates the typical magnitude of error when using promotional expenses, via the regression equation, to predict sales. More speci�cally, if the regression equation is used to predict sales for many regions, about two-thirds of the predictions will be within 7.39 of the actual sales values, and about 95% of the predictions will be within two standard errors, or 14.78, of the actual sales values.

Is this level of accuracy good? One measure of comparison is the standard devia- tion of the sales variable, namely, 9.90. (This is obtained by the usual STDEV.S function applied to the observed sales values.) It can be interpreted as the standard deviation of the residuals around a horizontal line positioned at the mean value of Sales. This is the relevant horizontal line positioned at the mean value of Sales. This is the relevant horizontal regression line if there are no explanatory variables—that is, if Promote is ignored. In other words, it is a measure of the prediction error if the sample mean of Sales is used as the prediction for every region and Promote is ignored. Unfortunately, the standard error of estimate, 7.39, is not much less than 9.90. This means that the Promote variable adds a relatively small amount to prediction accuracy. Predictions with it are not much better than predictions without it. A standard error of estimate well below well below well 9.90 would certainly be preferred.

The standard error of estimate can often be used to judge which of several poten- tial regression equations is the most useful. In the Bendrix manufacturing example we estimated two regression lines, one using Machine Hours and one using Production Runs. From Figures 10.21 and 10.22, their standard errors are approximately $8585 and $9457. These imply that Machine Hours is a slightly better predictor of overhead. The predic- tions based on Machine Hours will tend to be slightly more accurate than those based on Production Runs. Of course, the predictions based on both predictors should yield even more accurate predictions, as you will see when we discuss multiple regression for this example.

Formula for Standard Error of Estimate

se = Å Σei

2

n − 2Å (10.7)

About two-thirds of the fitted Ŷ values are typically within one standard error of the actual Y values. About 95% are within two standard errors.

In general, the standard error of estimate indicates the level of accuracy of predictions made from the regres- sion equation. The smaller it is, the more accurate predictions tend to be.

6This requires that the residuals be at least approximately normally distributed, a requirement discussed in the next chapter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

440 Chapter 10 Regression Analysis: Estimating Relationships

10-4c The Percentage of Variation Explained: R-Square We now discuss another important measure of the goodness of �t of the least squares line: R2 (pronounced “R-square”). Along with the standard error of estimate se, it is the most frequently quoted measure in applied regression analysis. With a value always between 0 and 1, R2 always has exactly the same interpretation: It is the fraction of variation of the dependent variable explained by the regression line. (It is often expressed as a percentage, so you hear about the percentage of variation explained by the regression line.)

To see more precisely what this means, we look brie�y into the derivation of R2. In the previous section we suggested that one way to measure the regression equation’s abil- ity to predict is to compare the standard error of estimate, se, to the standard deviation of the dependent variable, sY. The idea is that se is (essentially) the standard deviation of the residuals, whereas sY is the standard deviation of the residuals from a horizontal regres- sion line at height Y , the sample mean of the dependent variable. Therefore, if se is small compared to sY (that is, if se/sY is small), the regression line is evidently doing a good job of explaining the variation of the dependent variable.

The R2 measure is based on this idea. It is de�ned by Equation (10.8). (This value is obtained automatically with StatTools’s regression procedure, or it can be calculated with Excel’s RSQ function when there is a single X variable.) Equation (10.8) indicates that when X variable.) Equation (10.8) indicates that when X the residuals are small, R2 will be close to 1, but when they are large, R2 will be close to 0.

Formula for R2

R2 = 1 − Σei

2

Σ(YiYiY − Y ) 2

(10.8)

R2 measures the good- ness of a linear fit. The better the linear fit is, the closer R2 is to 1.

In simple linear regres- sion, R2 is the square of the correlation between the dependent variable and the explanatory variable.

R2 is the percentage of variation of the dependent variable explained by the regression.

You can see from cell C10 of Figure 10.19 that the R2 measure for the Pharmex drugstore data is 0.453. (This value also appears in cells E4 and E9 of Figure 10.14 from built-in Excel functions, and it is available as a trend-line option, as illustrated in Figure 10.12.) In words, the single explanatory variable Promote is able to explain only 45.3% of the variation in the Sales variable. This is not particularly good—the same conclusion we made when we based goodness of �t on se. There is still 54.7% of the variation left unexplained. Of course, we would like R2 to be as close to 1 as possible. Usually, the only way to increase it is to use better and/or more explanatory variables.

Analysts often compare equations on the basis of their R2 values. You can see from Figures 10.21 and 10.22 that the R2 values using Machine Hours and Production Runs as single explanatory variables for the Bendrix overhead data are 39.9% and 27.1%, respec- tively. These provide one more piece of evidence that Machine Hours is a slightly better predictor of Overhead than Production Runs. Of course, they also suggest that the percent- age of variation of Overhead explained could be increased by including both variables in a single equation. This is true, as you will see shortly.

There is a good reason for the notation R2. It turns out that R2 is the square of the cor- relation between the observed Y values and the �tted Ŷ values. This correlation appears in all regression outputs as the multiple R. For the Pharmex data it is 0.673, as seen in cell B10 of Figure 10.19. Aside from rounding, the square of 0.673 is 0.453, which is the R2

value right next to it. In the case of simple linear regression, when there is only a single explanatory variable in the equation, the correlation between the Y variable and the �tted

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-4 Simple Linear Regression 441

Ŷ values is the same as the absolute value of the correlation between the Y variable and the explanatory X variable. For the Pharmex data you already saw that the correlation between Sales and Promote is indeed 0.673.

This interpretation of R2 as the square of a correlation helps to clarify the issue of when a correlation is “large.” For example, if the correlation between two variables Y and X is X is X ±0.8, the regression of Y on X will have an R2 of 0.64; that is, the regression with X as the only explanatory variable will explain 64% of the variation in Y . If the correlation drops to ±0.7, this percentage drops to 49%; if the correlation increases to ±0.9, the percentage increases to 81%. The point is that before a single variable X can explain a large percentage of the variation in some other variable Y , the two variables must be highly correlated—in either a positive or negative direction.either a positive or negative direction.either

P R O B L E M S Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Explore the relationship between the selling prices

(Y ) and the appraised values (X ) of the 148 homes in the file P02_11.xlsx by estimating a simple lin- ear regression model. Interpret the standard error of estimate se and R

2 and the least squares line for these data. a. Is there evidence of a linear relationship between linear relationship between linear

the selling price and appraised value? If so, characterize the relationship. Is it positive or negative? Is it weak or strong?

b. For which of the three remaining variables, the size of the home, the number of bedrooms, and the number of bathrooms, is the relationship with the home’s selling price stronger? Justify your choice with additional simple linear regression models.

2. The file P02_10.xlsx contains midterm and final exam scores for 96 students in a corporate finance course. Each row contains the two exam scores for a given student, so you might expect them to be positively correlated. a. Create a scatterplot of the final exam score (Y )

versus the midterm score (X ). Based on the visual evidence, would you say that the scores for the two exams are strongly related? Is the relationship a linear one?

b. Superimpose a trend line on the scatterplot, and use the option to display the equation and the R2

value. What does this equation indicate in terms of predicting a student’s final exam score from his or her midterm score? Be specific.

c. Run a regression to confirm the trend-line equation from part b. What does the standard error of estimate say about the accuracy of the prediction requested in part b?

3. A company produces electric motors for use in home appliances. One of the company’s production manag- ers is interested in examining the relationship between inspection costs in a month (X ) and the number of motors produced that month that were returned by dissatisfied customers (Y ). He has collected the data in the file P10_03.xlsx for the past 36 months. Estimate a simple linear regression equation using the given data and interpret it for this production manager. Also, interpret se and R

2 for these data.

4. The owner of Original Italian Pizza restaurant chain wants to understand which variable most strongly influences the sales of his specialty deep-dish pizza. He has gathered data on the monthly sales of deep-dish pizzas at his restaurants and observations on other potentially relevant variables for each of several outlets in central Indiana. These data are provided in the file P10_04.xlsx. Estimate a simple linear regres- sion equation between the quantity sold (Y ) and each of the following candidates for the best explanatory variable: average price of deep-dish pizzas, monthly advertising expenditures, and disposable income per household in the areas surrounding the outlets. Which variable is most strongly associated with the number most strongly associated with the number most of pizzas sold? Explain your choice.

5. The human resources manager of DataCom, Inc., wants to examine the relationship between annual salaries (Y ) and the number of years employees have worked at DataCom (X ). These data have been collected for a sample of employees and are given in columns B and C of the file P10_05.xlsx. a. Estimate the relationship between Y and X.

Interpret the least squares line. b. How well does the estimated simple linear

regression equation fit the given data? Provide evidence for your answer.

6. The file P02_02.xlsx contains information on over 200 movies that were released during 2006 and 2007.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

442 Chapter 10 Regression Analysis: Estimating Relationships

a. Create two scatterplots and corresponding correlations, one of Total US Gross (Y ) versus 7-day Gross (X ) and one of Total US Gross (Y ) versus 14-day Gross (X ). Based on the visual evidence, is it possible to predict the total U.S. gross of a movie from its first week’s gross or its first two weeks’ gross?

b. Run two simple regressions corresponding to the two scatterplots in part a. Explain exactly what they tell you about the movie business. How accurate would the two predictions requested in part a tend to be? Be as specific as possible.

7. Examine the relationship between the average utility bills for homes of a particular size (Y ) and the average monthly temperature (X ). The data in the file P10_07.xlsx include the average monthly bill and temperature for each month of the past year. a. Use the given data to estimate a simple linear

regression equation. Interpret the least squares line. b. How well does the estimated regression equation

fit the given data? How might you do a better job of explaining the variation of the average utility bills for homes of a certain size?

8. The file P10_08.xlsx contains data on the top 200 professional golfers in 2014. (The same data set, covering multiple years, was used in Example 3.4 in Chapter 3.) a. Create a new variable, Earnings per Round, and

the ratio of Earnings to Rounds. Then create five scatterplots and corresponding correlations, each with Earnings per Round on the Y axis. The Y axis. The Y X-axis variables are those that most golf enthusiasts probably think are related to Earnings per Round: Yards/Drive, Driving Accuracy, Greens in Regulation, Putting Average, and Sand Save Pct. Comment on the results. Are any of these highly related to Earnings per Round? Do the correlations have the signs you would expect (positive or negative)?

b. For the two most highly correlated variables with Earnings per Round (positive or negative), run the regressions corresponding to the scatterplots. Explain exactly what they tell you about predicting Earnings per Round. How accurate do you think these predictions would be?

9. Management of a home appliance store wants to understand the growth pattern of the monthly sales of Blu-ray disc players over the past two years. The managers have recorded the relevant data in the file P10_09.xlsx. Have the sales of this product been growing linearly over these months? Using simple lin- ear regression, explain why or why not.

10. Do the selling prices of houses in a given community vary systematically with their sizes (as measured in square feet)? Answer this question by estimating a simple regression equation where the selling price of

the house is the dependent variable and the size of the house is the explanatory variable. Use the sample data given in the file P10_10.xlsx. Interpret your estimated equation and the associated R2.

11. The file P10_11.xlsx contains annual observations of the American minimum wage. Has the minimum wage been growing at roughly a constant rate over constant rate over constant this period? Use simple linear regression analysis to address this question. Explain the results you obtain. (You can ignore the data in column C for now.)

12. Based on the data in the file P02_23.xlsx from the U.S. Department of Agriculture, explore the relationship between the number of farms (X ) and the average size of a farm (Y ) in the United States. Specifically, estimate a simple linear regression equation and interpret it.

13. Estimate the relationship between monthly electrical power usage (Y ) and home size (X ) using the data in the file P10_13.xlsx. Interpret your results. How well does a simple linear regression equation explain the variation in monthly electrical power usage?

14. The file P02_12.xlsx includes data on the 50 top graduate programs in the United States, according to a recent U.S. News & World Report survey. Columns U.S. News & World Report survey. Columns U.S. News & World Report B, C, and D contain ratings: an overall rating, a rating by peer schools, and a rating by recruiters. The other columns contain data that might be related to these ratings. a. Find a table of correlations between all of the

numerical variables. From these correlations, which variables in columns E–L are most highly correlated with the various ratings?

b. For the Overall rating, run a regression using it as the dependent variable and the variable (from columns E–L) most highly correlated with it. Interpret this equation. Could you have guessed the value of R2 before running the regression? Explain. What does the standard error of estimate indicate?

c. Repeat part b with the Peers rating as the dependent variable. Repeat again with the Recruiters rating as the dependent variable. Discuss any differences among the three regressions in parts b and c.

Level B 15. If you haven’t already done Problem 6 on 2006–2007

movies, do it now. The scatterplots of Total US Gross versus 7-day Gross or 14-day Gross indicate some possible outliers at the right—the movies that did great during their first week or two. Identify these outliers (you can decide how many qualify) and move them out of the data set. Then redo Problem 6 without the outliers. Comment on whether you get very different results. Specifically, do these outliers affect the slope of either regression line? Do they affect the standard error of estimate or R2?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-5 Multiple Regression 443

10-5 MULTIPLE REGRESSION In general, there are two possible approaches to obtaining improved �ts in regression. The �rst is to examine a scatterplot of residuals for nonlinear patterns and then make appro- priate modi�cations to the regression equation. We will discuss this approach later in the chapter. The second approach is much more straightforward: Add more explanatory vari- ables to the regression equation. In the Bendrix manufacturing example, we deliberately included only a single explanatory variable in the equation at a time to keep the equations simple. But because scatterplots indicate that both explanatory variables are also related to Overhead, it makes sense to try including both in the regression equation. With any luck, the linear �t should improve.

When you include several explanatory variables in the regression equation, you move into the realm of multiple regression. Some of the concepts from simple regression carry over naturally to multiple regression, but some change considerably. The following list provides a starting point that we expand on throughout this section.

Characteristics of Multiple Regression

■ Graphically, you are no longer �tting a line to a set of points. If there are exactly two explanatory variables, you are �tting a plane to the data in three-dimensional space. There is one dimension for the dependent variable and one for each of the two explanatory variables. Although you can imagine a �at plane passing through a swarm of points, it is dif�cult to graph this on a two-dimensional screen. And if there are more than two explanatory variables, you can only imagine the regression plane; drawing in four or more dimensions is impossible.

■ The regression equation is still estimated by the least squares method—that is, by mini- mizing the sum of squared residuals. However, it is de�nitely not practical to implement this method by hand. A statistical software package such as StatTools is required.

■ Simple regression is actually a special case of multiple regression—that is, an equa- tion with a single explanatory variable can be considered a “multiple” regression equation. This explains why it is possible to use StatTools’s Multiple Regression procedure for simple regression.

■ There is a slope term for each explanatory variable in the equation. The interpreta- tion of these slope terms is somewhat different than in simple regression, as will be explained shortly.

■ The standard error of estimate and R2 summary measures are almost exactly the same as in simple regression, as explained in Section 10-5b.

■ Many types of explanatory variables can be included in the regression equation, as explained in Section 10-6. To a large part, these are responsible for the wide applica- bility of multiple regression in the business world. However, the burden is on you to choose the best set of explanatory variables. This is generally not easy.best set of explanatory variables. This is generally not easy.best

10-5a Interpretation of Regression Coefficients

If Y is the dependent variable and X1 through XkXkX are the explanatory variables, then a typical k are the explanatory variables, then a typical k multiple regression equation has the form shown in Equation (10.9), where a is again the Y -intercept, and b1 through bk are the slopes. Collectively, a and the b’s in Equation (10.9) are called the regression coef�cients. The intercept a is the expected value of Y when all of the X’s equal zero. (Of course, this makes sense only if it is practical for all of the X’s to equal zero, which is seldom the case.) Each slope coef�cient is the expected change in

A typical slope term measures the expected change in Y when the corresponding X increases by one unit.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

444 Chapter 10 Regression Analysis: Estimating Relationships

Y when this particular X increases by one unit and the other X’s in the equation remain constant. For example, b1 is the expected change in Y when X1 increases by one unit and the other X’s in the equation, X2X2X through XkXkX , remain constant.

This extra proviso, “when the other X’s in the equation remain constant,” is crucial for the  interpretation of the regression coef�cients. In particular, it means that the estimates of the b’s depend on which other X’s are included in the regression equation. We illustrate these ideas in the following continuation of Example 10.2.

General Multiple Regression Equation Predicted Y = a + b1X1 + b2X2X2 2X2X + · · · + bk XkXkX (10.9)

E X A M P L E 10.2 EXPLAINING OVERHEAD COSTS AT BENDRIX (CONTINUED)

Estimate and interpret the equation for Overhead when both explanatory variables, Machine Hours and Production Runs, are included in the regression equation. Objective To estimate the equation for overhead costs at Bendrix as a function of machine hours and production runs.

Solution To obtain the regression output with StatTools, select Regression from the StatTools Regression and Classification dropdown list and fill out the resulting dialog box as shown in Figure 10.24. As before, choose the Multiple option, specify the single D variable and the two I variables, and check any optional graphs you want to see. (We selected the first and third graph options. Refer to Figure 10.17.)

Figure 10.24 StatTools Multiple Regression Dialog Box

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-5 Multiple Regression 445

The main regression output appears in Figure 10.25. The coefficients in the range B19:B21 indicate that the estimated regression equation is

The estimated coefficient of any explanatory variable typically depends on which other explana- tory variables are included in the equation.

The interpretation of Equation (10.10) is that if the number of production runs is held con- stant, the overhead cost is expected to increase by $43.54 for each extra machine hour, and if the number of machine hours is held constant, the overhead cost is expected to increase by $883.62 for each extra production run. The Bendrix manager can interpret the intercept, $3997, as the �xed component of overhead. The slope terms involving Machine Hours and Production Runs are the variable components of overhead.

Figure 10.25 StatTools Multiple Regression Output for Bendrix Example A B C D E F G

Summary

Explained Unexplained

ANOVA Table

Mul�ple Regression for Overhead

Regression Table Coefficient

Standard t-Value p-Value-Value-V

Lower Confidence Interval 95%

UpperError

Constant Machine Hours Produc�on Runs

Mul�ple R

0.9308 0.8664 0.8583 4108.99309

F Mean of

Squares

Sum of

Squares

Degrees of

Freedom

2 3614020661 1807010330 107.0261279 < 0.0001

< 0.0001 < 0.0001

557166199.1

3996.678209 43.53639812

6603.650932 0.605222512 0.5492 –9438.550632 36.23353862

17431.90705 50.83925761

716.2761784 1050.959672 12.128874723.5894837

883.6179252 82.25140753 10.74289124

16883824.2233

p-Value

Adjusted Std. Err. ofStd. Err. ofStd. Err Es�mate

0

Rows Ignored

R-Square R-square

8 9

10 11 12 13 14 15 16 17 18

19 20 21

A B C D E F

© C

e n g

a g

e L

e a rn

in g

Predicted Overhead = 3997 + 43.54Machine Hours + 883.62Production Runs (10.10)

It is interesting to compare Equation (10.10) with the separate equations for Overhead involving only a single variable each. From the previous section these are

Predicted Overhead = 48621 + 34.7Machine Hours and

Predicted Overhead = 75606 + 655.1Production Runs

Note that the coefficient of Machine Hours has increased from 34.7 to 43.5 and the coef- and the coef- and the coef ficient of Production Runs has increased from 655.1 to 883.6. Also, the intercept is now lower than either intercept in the single-variable equations. In general, it is difficult to guess the changes that will occur when more explanatory variables are included in the equation, but it is likely that changes will occur.will occur.will

The reasoning is that when Machine Hours is the only variable in the equation, Production Runs is not being held constant—it is being ignored—so in effect the coefnot being held constant—it is being ignored—so in effect the coefnot - being held constant—it is being ignored—so in effect the coef- being held constant—it is being ignored—so in effect the coef ficient 34.7 of Machine Hours indicates the effect of Machine Hours and the omitted and the omitted and Production Runs on Overhead. But when both variables are included, the coefficient 43.5 of Machine Hours indicates the effect of Machine Hours only, holding Production Runs constant. Because the coefficients of Machine Hours in the two equations have different meanings, it is not surprising that they have different numerical estimates. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

446 Chapter 10 Regression Analysis: Estimating Relationships

Multiple Regression, Correlations, and Scatterplots When there are multiple potential X’s for a regression on Y, it is useful to calculate correlations and scatter-, it is useful to calculate correlations and scatter-, it is useful to calculate correlations and scatter plots of Y versus each Y versus each Y X. But remember that correla- tions and scatterplots are for two variables only; they

do not necessarily tell the whole story. Sometimes, as in this overhead example, a multiple regression can turn out quite differently than might be expected from correlations and scatterplots alone. Specifically, the R2

value for the multiple regression can be considerably smaller or larger than might be expected.or larger than might be expected.or

F u n da m e n ta l I n s i g h t

10-5b Interpretation of Standard Error of Estimate and R-Square

The multiple regression output in Figure 10.25 is very similar to simple regression out- put. In particular, cells C10 and E10 again show R2 and the standard error of estimate se . Also, the square root of R2 appears in cell B10. The interpretation of these quantities is almost exactly the same as in simple regression. The standard error of estimate is essentially the standard deviation of residuals, but it is now given by Equation (10.11), where n is the number of observations and k is the number of explanatory variables in the equation.

Formula for Standard Error of Estimate in Multiple Regression

se = Å Σei

2

n − k − 1Å (10.11)

R2 is always the square of the correlation between the actual and fitted Y values—in both simple and multiple regression.

Fortunately, you can interpret se exactly as before. It is a measure of the typical prediction error when the multiple regression equation is used to predict the dependent variable. In this example, about two-thirds of the predictions should be within one standard error, or $4109, of the actual overhead cost. By comparing this with the standard errors from the single-variable equations for Overhead, $8585 and $9457, you can see that the multiple regression equation will tend to provide predictions that are more than twice as accurate as the single-variable equations—a big improvement.

The R2 value is again the percentage of variation of the dependent variable explained by the combined set of explanatory variables. In fact, it even has the same formula as before [see Equation (10.8)]. For the Bendrix data you can see that Machine Hours and Production Runs combine to explain 86.6% of the variation in Overhead. This is a big improvement over the single-variable equations that were able to explain only 39.9% and 27.1% of the variation in Overhead. Remarkably, the combination of the two explanatory variables explains a larger percentage than the sum of their individual effects. This is not common, but this example shows that it is possible.

The square root of R2 shown in cell B10 of Figure 10.25 (the multiple R) is again the correlation between the �tted values and the observed values of the dependent variable. For the Bendrix data the correlation between them is 0.931, quite high. A graphical indi- cation of this high correlation can be seen in one of the requested scatterplots, the plot of �tted versus observed values of Overhead. This scatterplot appears in Figure 10.26. If the regression equation gave perfect predictions, all of the points in this plot would lie on a perfect predictions, all of the points in this plot would lie on a perfect 45°

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-5 Multiple Regression 447

Sca�erplot of Fit vs Overhead

120000.0

110000.0

100000.0

90000.0

80000.0

60000.0

130000.0

60000.0 80000.0 90000.0 100000.0 110000.0 120000.0 130000.0 Fi

t

Overhead

70000.0

70000.0

Figure 10.26 StatTools Scatterplot of Fitted Values versus Observed Values of Overhead

© C

e n g

a g

e L

e a rn

in g

line—each �tted value would equal the corresponding observed value. Although a perfect equal the corresponding observed value. Although a perfect equal �t virtually never occurs, the closer the points are to a 45° line, the better the �t is, as indi- cated by R2 or its square root.

Although the R2 value is one of the most frequently quoted values from a regression analysis, it does have one serious drawback: R2 can only increase when extra explanatory variables are added to an equation. This can lead to “�shing expeditions,” where you keep adding variables to an equation, some of which have no conceptual relationship to the dependent variable, just to in�ate the R2 value. To avoid adding extra variables that do not really belong, an adjusted R2 value is typically listed in regression outputs. This adjusted value appears in cell D10 of Figure 10.25. Although it has no direct interpretation as “per- centage of variation explained,” it can decrease when unnecessary explanatory variables are added to an equation. Therefore, it serves as an index that you can monitor. If you add variables and the adjusted R2 decreases, the extra variables are essentially not pulling their weight and should probably be omitted. We will say much more about this issue in the next chapter.

Adjusted R2 is a measure that adjusts R2 for the number of explanatory variables in the equation. It is used primarily to monitor whether extra explanatory variables really belong in the equation.

R2, Adjusted R2, and Standard Error of Estimate Sometimes a regression equation is “built” by suc- cessively adding explanatory variables to an equation. As more variables are added, it is a mathematical fact that R2 must increase; it cannot decrease. must increase; it cannot decrease. must However,

the standard error of estimate can increase, and the adjusted R2 can decrease, each signaling that the extra variables are not useful and should probably be omit- ted from the equation. In fact, the purpose of adjusted R2 is to monitor whether the equation is getting bet- ter or worse as more variables are added.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

448 Chapter 10 Regression Analysis: Estimating Relationships

P R O B L E M S

Level A 16. A trucking company wants to predict the yearly main-

tenance expense (Y ) for a truck using the number of miles driven during the year (X1) and the age of the truck (X2X2X , in years) at the beginning of the year. The company has gathered the data given in the file P10_16. xlsx, where each observation corresponds to a particular truck. a. Estimate a multiple regression equation using the

given data. Interpret each of the estimated regression coefficients. Why is the magnitude of the Miles Driven coefficient so much lower than the magnitude of the Age of Truck coefficient? Is it because Miles Driven is not as important in predicting Maintenance Expense?

b. Interpret the standard error of estimate se and R 2 for

these data.

17. DataPro is a small but rapidly growing firm that pro- vides electronic data-processing services to commercial firms, hospitals, and other organizations. For each of the past several months, DataPro has tracked the num- ber of contracts sold, the average contract price, adver- tising expenditures, and personal selling expenditures. These data are provided in the file P10_17.xlsx. Using the number of contracts sold as the dependent vari- able, estimate a multiple regression equation with three explanatory variables. Interpret each of the estimated regression coefficients, the standard error of estimate, and R2.

18. An antique collector believes that the price received for a particular item increases with its age and with the number of bidders. The file P10_18.xlsx contains data on these three variables for several recently auctioned comparable items. a. Estimate a multiple regression equation using the

given data. Interpret each of the estimated regression coefficients. Is the antique collector correct in believing that the price received for the item increases with its age and with the number of bidders?

b. Interpret the standard error of estimate se and R 2.

Does it appear that predictions of price from this equation will be very accurate?

19. Stock market analysts are continually looking for reliable predictors of stock prices. Consider the problem of mod- eling the price per share of electric utility stocks (Y ). Two variables thought to influence this stock price are return on average equity (X1) and annual dividend rate (X2X2X ). The stock price, returns on equity, and dividend rates on a randomly selected day for several electric utility stocks are provided in the file P10_19.xlsx.

a. Estimate a multiple regression equation using the given data. Interpret each of the estimated regression coefficients.

b. Interpret the standard error of estimate se, R 2, and the

adjusted R2. Does it appear that predictions of price from this equation will be very accurate?

20. The manager of a commuter rail transportation system was recently asked by her governing board to determine which factors have a significant impact on the demand for rides in the large city served by the transportation network. The system manager collected data on vari- ables thought to be possibly related to the number of weekly riders on the city’s rail system. The file P10_20. xlsx contain these data. a. What do you expect the signs of the coefficients of

the explanatory variables in this multiple regression equation to be? Why? (Answer this before running the regression.)

b. Estimate a multiple regression equation using the given data. Interpret each of the estimated regression coefficients. Are the signs of the estimated coefficients consistent with your expectations in part a?

c. What proportion of the total variation in the number of weekly riders is not explained by this estimated not explained by this estimated not multiple regression equation?

21. Consider the enrollment data for Business Week’s top U.S. graduate business programs in the file P10_21.xlsx. Use the data in the MBA Data sheet to estimate a multiple regression equation to assess whether there is a relationship between the total number of full-time students (Enrollment) and the following explanatory variables: (a) the proportion of female students, (b) the proportion of minority students, and (c) the proportion of international students enrolled at these business schools. a. Interpret the coefficients of the estimated regression

equation. Do any of these results surprise you? Explain.

b. How well does the estimated regression equation fit the given data?

22. A regional express delivery service company recently conducted a study to investigate the relationship between the cost of shipping a package (Y ), the pack- age weight (X1), and the distance shipped (X2X2X ). Several packages were randomly selected from among the large number received for shipment, and a detailed analysis of the shipping cost was conducted for each pack- age. These sample observations are given in the file P10_22.xlsx.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 449

a. Estimate a simple linear regression equation involving shipping cost and package weight. Interpret the slope coefficient of the least squares line and the R2 value.

b. Add another explanatory variable, distance shipped, to the regression model in part a. Estimate and interpret this expanded equation. How does the R2 value for this multiple regression equation compare to that of the simple regression equation in part a? Explain any difference between the two R2 values. Interpret the adjusted R2 value for the revised equation.

Level B 23. The owner of a restaurant in Bloomington, Indiana,

has recorded sales data for the past several years. He has also recorded data on potentially relevant vari- ables. The data are listed in the file P10_23.xlsx. a. Estimate a simple linear regression equation

involving annual sales (the dependent variable) and the size of the population residing within 10 miles of the restaurant (the explanatory variable). Interpret the R2 value.

b. Add another explanatory variable—annual advertising expenditures—to the regression equation in part a. Estimate and interpret this expanded equation. How does the R2 value for this equation compare to the equation in part a? Explain any difference between the two R2 values. What, if anything, does the adjusted R2 value for the revised equation indicate?

c. Add one more explanatory variable to the multiple regression equation estimated in part b. In particular, estimate and interpret the coefficients of a multiple regression equation that includes the previous year’s advertising expenditure. How does the inclusion of this third explanatory variable affect the R2 and adjusted R2 values, in comparison to the corresponding values for the equation of part b? Explain any changes in these values.

24. Continuing Problem 8 on the 2014 golfer data in the file P10_08.xlsx, the simple linear regressions for Earnings per Round were perhaps not as good as you expected. Explore several multiple regressions for Earnings per Round, using the variables in columns I–M and R. Proceed as follows. a. Create a table of correlations for these variables. b. Run a regression of Earnings per Round versus the

most highly correlated variable (positive or negative) with Earnings per Round. Then run a second regression with the two most highly correlated variables with Earnings per Round. Then run a third with the three most highly correlated, and so on until all six explanatory variables are in the equation.

c. Comment on the changes you see from one equation to the next. Does the coefficient of a variable entered earlier change as you enter more variables? How much better do the equations get, in terms of standard error of estimate and R2, as you enter more variables? Does adjusted R2 ever indicate that an equation is worse than the one before it?

d. The bottom line is whether these variables, as a whole, do a very good job of predicting Earnings per Round. Would you say they do? Why or why not?

25. Using the sample data given in the file P10_10.xlsx, use multiple regression to predict the selling price of houses in a given community. Proceed as follows. a. Add one explanatory variable at a time and

estimate each regression equation along the way. Report and explain changes in the standard error of estimate se, R

2, and adjusted R2 as each explanatory variable is added to the model. Does it matter in which order you add the variables? Try at least two different orderings to answer this question.

b. Interpret each of the estimated regression coefficients in the full equation, that is, the equation with all explanatory variables included.

c. What proportion of the total variation in the selling price is explained by the multiple regression equation that includes all four explanatory variables?

10-6 MODELING POSSIBILITIES Once you move from simple to multiple regression, the �oodgates open. All types of explanatory variables are potential candidates for inclusion in the regression equation. In this section we examine several new types of explanatory variables. These include dummy variables, interaction variables, and nonlinear transformations. The techniques in this section provide you with many alternative approaches to modeling the relationship between a dependent variable and potential explanatory variables. In many applications these techniques produce much better �ts than you could obtain without them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

450 Chapter 10 Regression Analysis: Estimating Relationships

7This example and the accompanying data set are based on a real case from 1995. Only the bank’s name has been changed.

A dummy variable is a variable with possible values 0 and 1. It equals 1 if the observation is in a particular category and 0 if it is not.

Modeling Possibilities As the title of this section suggests, these tech- niques are modeling possibilities. They provide a wide variety of explanatory variables to choose from. However, this does not mean that it is wise to include all or even many of these new types of explanatory variables in any particular regression equation. The

chances are that only a few, if any, will significantly improve the fit. Knowing which explanatory variables to include requires a great deal of practical experi- ence with regression, as well as a thorough under-ence with regression, as well as a thorough under-ence with regression, as well as a thorough under standing of the data in its context. The material in this section should not be an excuse for a mindless fishing expedition.

F u n da m e n ta l I n s i g h t

10-6a Dummy Variables

Some potential explanatory variables are categorical and cannot be measured on a quantita- tive scale. However, these categorical variables are often related to the dependent variable, so you need a way to include them in a regression equation. The trick is to use dummy var- iables, also called indicator or 0–1 variables. Dummy variables are variables that indicate the category a given observation is in. If a dummy variable for a given category equals 1, the observation is in that category; if it equals 0, the observation is not in that category.

Categorical variables are used in two situations. The �rst and perhaps most common situation is when a categorical variable has only two categories. A good example of this is a gender variable that has the two categories “male” and “female.” In this case only a single dummy variable is required, and you have the choice of assigning the 1’s to either category. If the dummy variable is called Gender, you can code Gender as 1 for males and 0 for females, or you can code Gender as 1 for females and 0 for males. You just need to be consistent and specify explicitly which coding scheme you are using.

The other situation is when there are more than two categories. A good example of this is when you have quarterly time series data and you want to treat the quarter of the year as a categorical variable with four categories, 1 through 4. Then you can create four dummy variables, Q1 through Q4. For example, Q2 equals 1 for all second-quarter observations and 0 for all other observations. Although you can create four dummy variables, only three of them—any three—should be used in a regression equation, as we will explain shortly.

Example 10.3 illustrates how to create, use, and interpret dummy variables in regres- sion analysis.

E X A M P L E 10.3 POSSIBLE GENDER DISCRIMINATION IN BANK SALARIES

Fifth National Bank of Springfield is facing a gender discrimination suit. 7 The charge

is that its female employees receive substantially smaller salaries than its male employees. The bank’s employee data are listed in the file Bank Salaries.xlsx. For each of its 208 employees, the data set includes the following variables:

■ Education: education level, a categorical variable with categories 1 (�nished high school), 2 (�nished some college courses), 3 (obtained a bachelor’s degree), 4 (took some graduate courses), 5 (obtained a graduate degree)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 451

1

2

3

4

5

6

7

8

9

10

11

Employee

A

1

2

3

4

5

6

7

8

9

10

Educa�on

B

3

1

1

2

3

3

3

3

1

3

Grade

C

1

1

1

1

1

1

1

1

1

1

YearYearY s 1

D

3

14

12

8

3

3

4

8

4

9

YearYearY s 2

E

1

1

0

7

0

0

0

2

0

0

Age

F

26

38

35

40

28

24

27

33

62

31

$32,000

$39,100

$33,200

$30,600

$29,000

$30,500

$30,000

$27,000

$34,000

$29,500

Gender

G

Male

Female

Female

Female

Male

Female

Female

Male

Female

Female

PC Job Salary

H IH I

No

No

No

No

No

No

No

No

No

No

Figure 10.27 Selected Data for Bank Example

© C

e n g

a g

e L

e a rn

in g

■ Grade: a categorical variable indicating the current job level, the possible levels being  1 through 6 (6 is highest)

■ Years1: years of experience with this bank

■ Years2: number of years of work experience at another bank prior to working at Fifth National

■ Age: employee’s current age

■ Gender: a categorical variable with values “Female” and “Male”

■ PC Job: a categorical yes/no variable depending on whether the employee’s current job is computer-related

■ Salary: current annual salary

Figure 10.27 lists a few of the observations. Do these data provide evidence that there is discrimination against females in terms of salary?

Objective To analyze whether the bank discriminates against females in terms of salary.

Solution A naive approach to this problem is to compare the average female salary to the average male salary. This can be done with a pivot table, as in Chapter 3, or with a more formal hypothesis test, as in Chapter 9. Using these methods, you can check that the average of all salaries is $39,922, the female average is $37,210, the male average is $45,505, and the difference between the male and female averages is statistically significant at any reason- able level of significance. In short, the females definitely earn less. But perhaps there is a reason for this. They might have lower education levels, they might have been hired more recently, and so on. The question is whether the difference between female and male sala- ries is still evident after taking these other attributes into account. This is a perfect task for regression.

The first task is to create dummy variables for the various categorical variables. You can do this manually with IF functions or you can use the StatTools Dummy procedure. To do it manually, create a dummy variable Female based on Gender in any blank column by entering the formula

=IF(F2="Female",1,0)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

452 Chapter 10 Regression Analysis: Estimating Relationships

and copying it down. Note that females are coded as 1’s and males as 0’s. (Remember that the quotes are necessary when a text value is used in an IF function.)

The StatTools Dummy procedure is somewhat easier, especially when there are multiple categories. For example, to create five dummies for the education levels, select Dummy from the StatTools Data Utilities dropdown menu, select the Create One Dummy Variable for Each Distinct Category option, and select the Education varia- ble to base the dummies on. This creates five dummy columns with variable names Education=1 through Education=5 (which you can then rename if you like).

Sometimes you might want to collapse several categories. For example, you might want to collapse the five education categories into three categories: 1, (2,3), and (4,5). The new second category includes employees who have taken undergraduate courses or have completed a bachelor’s degree, and the new third category includes employees who have taken graduate courses or have completed a graduate degree. It is easy to do this. You can again use IF functions, or you can simply add the Educ2 and Educ3 columns to get the dummy for the new second category. Similarly, you add the Educ4 and Educ5 columns for the new third category. (Do you see why this works?)

Once the dummies have been created, you can run a regression analysis with Salary as the dependent variable, using any combination of numerical and dummy explanatory variables. Indeed, this is the procedure that must be used with most statistical software packages: create dummy variables and then run regressions that include the dummies. However, StatTools now lets you avoid the first step of creating explicit dummies in explicit dummies in explicit new columns. It lets you run regressions with implicit dummies. This keeps the origiimplicit dummies. This keeps the origiimplicit - nal data set intact (no need for a lot of extra columns), and it is much quicker and less tedious.

First, however, there are two general rules you should always follow, regardless of the statistical software being used:

1. You shouldn’t use any of the original categorical variables, such as Education, that the original categorical variables, such as Education, that the original dummies are based on.

2. You should always use one fewer dummy than the number of categories for any cat- egorical variable.

This second rule is a technical one. If you violate it, the statistical software (StatTools or most other packages) will display an error message. For example, if you want to use education level as an explanatory variable, you should enter only four of the five dummies Educ1 through Educ5. Any four of these can be used. The omitted dummy then corre- sponds to the reference category. The interpretation of any dummy variable coefficient is relative to this reference category. When there are only two categories, as with the gender variable, the common procedure is to name the variable with the category, such as Female, that corresponds to the 1’s. If you create the dummy variables manually, you probably will not even bother to create a dummy for males. In this case “Male” automatically becomes the reference category.

To explain dummy variables in regression, it is useful to proceed in several steps in this example. (After you get used to the procedure, you can combine all of these steps into a single step. Alternatively, you can use a stepwise procedure, as explained in the next chapter.) Each step will have a dummy for Female and one or more additional explanatory variables.

The first regression will include a dummy for Female and the experience variables, Years1 and Years2. To run this regression, you should fill out the StatTools Regression dialog box as shown in Figure 10.28. Note that each variable has a Data Type: Numeric or Category. StatTools chooses this type automatically, based on whether the column is totally numeric. If you check a Category variable such as Gender, StatTools implicitly

It is also possible to add dummies to effectively collapse categories.

Always include one fewer dummy than the number of categories. The omitted dummy corresponds to the reference category.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 453

creates a dummy variable for all but one of its categories and then uses these in the regres- sion. (StatTools chooses the reference category as the last one in alphabetical order, in this case, Male.)

The resulting StatTools output appears in Figure 10.29. As usual, the Coefficient col- umn lists the coefficients of the regression equation. To help with interpretation, StatTools provides the option of listing the regression equations for the various categories. (Refer to the Display Regression Equation option in Figure 10.18.) Specifically, the Female and Male equations appear in rows 26 and 27. They are identical except that the intercept of the Male equation is about $8080 larger than the intercept of the Female equation, and this difference is precisely the coefficient of the Gender dummy in row 22.

You can interpret the coefficient −8080 of the Female dummy variable as the aver- age salary disadvantage for females relative to males after controlling for job experience. Therefore, gender discrimination still appears to be a very plausible conclusion. However, note that the R2 value is only 49.2%. Perhaps there is still more to the story.

The next step is to add education level to the equation by including four of the five education level dummies. To do this, you should fill out the StatTools Regression dialog box as shown in Figure 10.30. Note that the Data Type for Education is originally Numeric, but it is more appropriate to change this to Category, as shown. After all, the values for Education are codes, not really numbers. Then when you check Education, dummies for the first four education levels are created implicitly and included in the regression equation. (The reference category, education level 5, is again the last in alpha- betical order.)

Figure 10.28 StatTools Regression Dialog Box for Including Gender

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

454 Chapter 10 Regression Analysis: Estimating Relationships

A B C D E F G

Summary

Explained

Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Salary

Regression Tablgression Tablgression T e Coefficient

Gender

Standard t-Valu-Valu-V e p-Valu-Valu-V e

Lower Confidence Interval 95%

UpperError

Constant

YeaYeaY rs1 YeaYeaY rs2 Gender (Female)

Mul�ple

R

0.7016 0.4923 0.4848 8079.397428

F Mean of

Squares

Sum of

Squares

Degrees of

Freedom

3 12910668018 4303556006 65.92794149 < 0.0001

< 0.0001 32847.62127 38135.70067

1147.556538 488.0566166 –5717.82695

828.4308231 –225.3807836 –10442.5973

< 0.0001

< 0.0001 0.4687

13316439212

35491.66097 1341.021528 26.4661381

12.20828286 0.72593288

–6.74379369

80.92814461 180.9229477 1198.170124

987.9936807 131.3379165

–8080.212123

65276662.81204

p-Valu-Valu-V e

Adjusted Std. Err. ofd. Err. ofd. Err

Es�mate

0

Row

Ignored R-Square

R-square

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

Regression Equa�ongression Equa�ongression E

A B C D E F

23

24

25

26

27

Female

Male

Salary = 27411.44884291 + 987.99368068 Years1 + 131.33791653 Years2

Salary = 35491.66096617 + 987.99368068 Years1 + 131.33791653 Years2

Figure 10.29 StatTools Regression Output with Experience and Gender Variables Included

© C

e n g

a g

e L

e a rn

in g

Figure 10.30 StatTools Regression Dialog box with Education Included

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 455

The resulting output, with the equations again spelled out at the bottom, appears in Figure 10.31. There is an equation for each combination of Gender and Education cat- egories, or 10 equations in all. As before, only the intercepts differ. In particular, you can check that the difference between the Female and Male intercepts, for any specific edu- cation level, is always the Gender coefficient in row 26. In this case, we would say that even after controlling for experience and education, there is a $4501 “penalty” for being a female.

A B C D E F G

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Salarygression for Salarygression for Salar Mul�ple R

0.8030

Degrees of Freedom

7 200

38383.56442 �11770.20898 �11609.96717 �7005.652529 �4450.367963 1032.930137 362.2341784

�4501.322074

Educa�on 1 1 2 2 3 3 4 4 5 5

0.6449

Sum of Squares

16912692100 9314415131

Standard Error

1256.726747 1510.213706 1526.771671 1232.284246 2561.737956 69.60252669 158.1233928 1085.767439

Gender Female Male

Female Male

Female Male

Female Male

Female Male

Salary = 22112.03336304 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 26613.35543724 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 22272.27517399 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 26773.59724819 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 26876.58981424 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 31377.91188844 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 29431.87437998 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 33933.19645418 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 33882.24234286 + 1032.93013654 Years1 + 362.23417837 Years2 Salary = 38383.56441706 + 1032.93013654 Years1 + 362.23417837 Years2

Adjusted R-square 0.6324

Mean of Squares

2416098871 46572075.65

30.54249025 �7.793737359 �7.604258965 �5.685094615 �1.737245589 14.84041148 2.290832317

�4.145751578

Std. Err. ofd. Err. ofd. Err Es�mate

6824.373646

51.87870279

< 0.0001 < 0.0001 < 0.0001 < 0.0001 0.0839

< 0.0001 0.0230

< 0.0001

Rows Ignored

0

< 0.0001

Confidence Interval 95% Lower

35905.42969 �14748.19368 �14620.60246 �9435.589179 �9501.849364

895.681177 50.43125717

�6642.342787

al 95% Upper

40861.69914 �8792.224276 �8599.331876 �4575.715878 601.1134383 1170.179096 674.0370996

�2360.301361

Regression Tablgression Tablgression T e Constant Educa�on (1) Educa�on (2) Educa�on (3) Educa�on (4) Years1 Years2 Gender (Female)

8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

y R-squar Ignor

Squar Squar

Uppergression T

Regression gression EqEqua�on

A B C D E F

Salary = 38383.56441706 + 1032.93013654

R-Square

F p-Value-Value-V

Coefficient t-Value-Value-V p-Value-Value-V

Figure 10.31 StatTools Regression Output with Education Dummies Included

© C

e n g

a g

e L

e a rn

in g

The coefficients of the Education dummies in rows 20–23 are all relative to the refer- ence category, education level 5. Because these coefficients are all negative, they indicate how much less the average salary for that education level is, relative to level 5, after control- ling for experience and gender. For example, a person with education level 4 tends to be paid about $4450 less than a similar person with education level 5.

Note that the R2 value is now 64.5%, quite a bit larger than when the education dum- mies were not included. We appear to be getting closer to the truth. In particular, you can see that there appears to be gender discrimination in salaries, even after accounting for job experience and education level.

One further explanation for gender differences in salary might be job grade. Perhaps females tend to be in lower job grades, which would help explain why they get lower salaries on average. One way to check this is with a pivot table, as in Figure 10.32, with

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

456 Chapter 10 Regression Analysis: Estimating Relationships

10-6b Interaction Variables 8

Consider the following regression equation for a dependent variable Y versus a numerical variable X and a dummy variable X and a dummy variable X D. If the estimated equation is of the form

Generic Equation with No Interaction Ŷ = a + b1X + b2D (10.12)

The regression indicates that being in lower job grades implies lower salaries, but it doesn’t explain why females are in the lower job grades in the first place.

then this equation can be written as two separate equations:

Ŷ = (a + b2) + b1X

and

Ŷ = a + b1X

The �rst corresponds to D = 1, and the second corresponds to D = 0. The only difference between these two equations is the intercept term; the slope for each is b1. Geometrically,

job grade in the row area, gender in the column area, and counts, displayed as percentages of columns in the values area. Clearly, females tend to be concentrated at the lower job grades. For example, 28.85% of all employees are at the lowest job grade, but 34.29% of all females are at this grade and only 17.65% of males are at this grade. The opposite is true at the higher job grades. This certainly helps to explain why females get lower salaries on average.

It is possible to go one step further to see the effect of job grade on salary. As with the education dummies, dummies for job grade could be entered in the regression. The StatTools output, not shown here, is available in the Regression 3 sheet of the finished version of the file. It indicates that there is still a penalty for being a female, but this pen- alty has been reduced to about $2563 due to controlling for job grade.

However, using job grade to “explain” gender discrimination is not really appropriate. The real question is why females are predominantly in the low job grades in the first place. Perhaps this is the real source of gender discrimination. Perhaps management is not advanc- ing the females as quickly as it should, which naturally results in lower salaries for females. In a sense, job grade is not really an explanatory variable; it is a dependent variable.

We conclude this example for now, but we will say more about it in the next two subsections. ■

13 14 15 16 17 18 19 20 21

1 2 3 4 5 6

34.29% 20.71% 25.71% 12.14%

6.43% 0.71%

100.00%

17.65% 19.12% 10.29% 16.18% 17.65% 19.12%

100.00%

28.85% 20.19% 20.67% 13.46% 10.10%

6.73% 100.00%

Count of Employee Grade

Gender Female Male Grand Total

Grand Total

A BA B C DC DFigure 10.32 Pivot Table of Job Grade Counts for Bank Data

© C

e n g

a g

e L

e a rn

in g

8This subsection is somewhat advanced and can be omitted without any loss of continuity.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 457

An interaction variable is the product of two explanatory variables. You can include such a variable in a regression equation if you believe the effect of one explanatory variable on Y depends on the value of another explanatory variable.

they correspond to two parallel lines that are a vertical distance parallel lines that are a vertical distance parallel b2 apart. For example, if D corresponds to gender, there is a female line and a parallel male line. The effect of X on X on X Y is the same for females and males. When X increases by one unit, X increases by one unit, X Y is expected to change by b1 units for males or females.

In effect, when you include only a dummy variable in a regression equation, as in Equation (10.12), you are allowing the intercepts of the two lines to differ (by an amount b2), but you are forcing the lines to be parallel. To be more realistic, you might want to allow them to have different slopes, in addition to possibly different intercepts. You can do this by including an interaction variable. Algebraically, an interaction variable is the product of two variables. Its inclusion allows the effect of one of the variables on Y to depend on the value of the other variable.

Suppose you create the interaction variable XDXDX (the product of X and X and X D) and then estimate the equation

Ŷ = a + b1X + b2D + b3XDXDX As usual, this equation can be rewritten as two separate equations, depending on whether D = 0 or D = 1. If D = 1, terms can be combined to write

Ŷ = (a + b2) + (b1 + b3)X If D = 0, the dummy and interaction variables drop out and the equation becomes

Ŷ = a + b1X The notation is not important. The important part is that the interaction term, b3XDXDX , allows the slope of the regression line to differ between the two categories.

The following continuation of Example 10.3 illustrates one possible use of interaction variables.

Earlier we estimated an equation for Salary using the numerical explanatory variables Years1 and Years2 and the dummy variable for Female. If we drop the Years2 variable from this equation (for simplicity) and rerun the regression, we obtain the equation

E X A M P L E 10.3 POSSIBLE GENDER DISCRIMINATION IN BANK SALARIES (CONTINUED)

Predicted Salary With No Interactions Predicted Salary = 35824 + 981Years1 − 8012Female (10.13)

The R2 value for this equation is 49.1%. If an interaction variable between Years1 and Female is added to this equation, what is its effect?

Objective To use multiple regression with an interaction variable to see whether the effect of years of experience on salary is different across the two genders.

Solution As with dummy variables, most statistical software packages require you to create explicit interaction variables before including them in a regression. This can be done with Excel

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

458 Chapter 10 Regression Analysis: Estimating Relationships

product formulas or with the StatTools Data Utilities tools. However, with the current ver- sion of StatTools, explicit interaction variables are not necessary. StatTools will again cre- ate them implicitly

To do this, you should first check the Include Derived Variables box at the bottom of the Regression dialog box and then click the resulting Add button. This opens the dialog box shown in Figure 10.33, where several types of derived variables can be specified. In this case, we checked the Years1 and Gender variables and selected the Interaction with Category Variable option. This creates the product of Years1 and the Female dummy, which appears in the regression dialog box in Figure 10.34. Now you can check the derived variable (as an independent variable), along with the other usual variables.

Figure 10.34 StatTools Regression Dialog Box with Derived Variable

Figure 10.33 StatTools Add Derived Variable Dialog Box

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 459

The multiple regression output appears in Figure 10.35. The coefficients of the Female dummy and the interaction appear in cells B21 and B22, and the Female and Male equa- tions are spelled out in rows 26 and 27. Note that the intercepts are different, and because of the interaction term, the slopes are also different.

100000

90000

80000

70000

60000

50000

40000

30000

20000

10000

0 0 10 20 30 40 50

Male Salary Female Salary

Years1

Sa la

ry

Figure 10.36 Nonparallel Female and Male Salary Lines

Figure 10.35 StatTools Regression Output with an Interaction Variable

A B C D E F G

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Salary Mul�ple R

0.7991

Degrees of Freedom

3 204

Coefficient

30430.02774 1527.761719 4098.251879 1247.798369

Gender Female Male

R-Square

0.6386

Sum of Squares

16748875071 9478232160

Standard Error

1216.574332 90.46033769 1665.842019 136.6757036

Salary = 34528.27961831 + 279.96335081 YearSalary = 34528.27961831 + 279.96335081 YearSalary = 34528.27961831 + 279.96335081 Y s1 Salary = 30430.02773957 + 1527.76171939 YearSalary = 30430.02773957 + 1527.76171939 YearSalary = 30430.02773957 + 1527.76171939 Y s1

Adjusted R-square Es�mate

0.6333

Mean of Squares

5582958357 46461922.35

t-Value

25.01287998 16.88874659 2.46016839 9.129628276

Std. Err. ofd. Err. ofd. Err

6816.298288

120.1620182

p-Value

< 0.0001 < 0.0001 0.0147 < 0.0001

Rows Ignored

0

p-ValueF

< 0.0001

Confidence Interv p-Value Confidence Interv

p-Value al 95%

Lower 28031.35571 1349.40461

813.7763213 1517.276508

al 95% Upper

32828.69977 1706.118829 7382.727436

978.3202292

Regression Tablgression Tablgression T e Constant Years1 Gender (Female) Gender (Female) * Yearemale) * Yearemale) * Y s1

8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

Uppergression T

Regression gression EqEqua�on

A B C D E F

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Graphically, these equations appear as in Figure 10.36. The Y-intercept for the female line is slightly higher—females with no experience with Fifth National tend to start out slightly higher than males—but the slope of the female line is much smaller. That is, males tend to move up the salary ladder much more quickly than females. Again, this provides another argu- ment, although a somewhat different one, for gender discrimination against females. Notice that the R2 value with the interaction variable has increased from 49.1% to 63.9%. The inter- action variable has definitely added to the explanatory power of the equation. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

460 Chapter 10 Regression Analysis: Estimating Relationships

You typically include nonlinear transforma- tions in a regression equation because of economic considerations or curvature detected in scatterplots.

There are clearly pros and cons to adding inter- action variables. On the plus side, they allow for more complex and interesting models, and they can lead to signi�cantly better �ts. On the minus side, they can become dif�cult to interpret correctly. Therefore, we recommend that you add them only when there is good economic and statistical justi�- cation for doing so.

Postscript to Example 10.3 When regression analysis is used in a legal case, as it was in the bank gender discrimination example, it can uncover multiple versions of the “truth.” That is,

by including or omitting various variables, the resulting equations can imply quite different things about the issue in question, in this case, gender discrimination. If one side claims, for example, that the equation

Predicted Salary = 35492 + 988Years1 + 131Years2 − 8080Female

is the true equation for explaining how salaries are determined at the bank, it is ludicrous for them to claim that the bank literally does it this way. No one believes that bank execu- tives sit down and say: “We will start everyone at $35,492. Then we will add $988 for every year of experience with our bank and $131 for every year of prior work experience at another bank. Finally, we will subtract $8080 from this total if the person is female.” All the analysts can claim is that the given regression equation is consistent, to a greater or lesser extent, with the observed data. If a number of regression equations, such as the ones estimated in this example, all point to lower salaries for females after controlling for other factors, then it doesn’t matter whether management is deliberately discriminating against females according to some preconceived formula; the regression analysis indicates that females are compensated less than males with the same quali�cations. Without a smoking gun, it is very dif�cult for either side to prove anything, but regression analysis permits either side to present evidence that is most consistent with the data.

10-6c Nonlinear Transformations 9

The general linear regression equation has the form

Predicted Y = a + b1X1 + b2X2X2 2X2X + · · · + bkXkXk kXkX

It is linear in the sense that the right side of the equation is a constant plus a sum of products linear in the sense that the right side of the equation is a constant plus a sum of products linear of constants and variables. However, there is no requirement that the dependent variable Y or the explanatory variables X1 through XkXkX be the k be the k original variables in the data set. Most original variables in the data set. Most original often they are, but they can also be transformations of original variables. You already saw one example of this in the previous section with interaction variables. They are not original variables but are instead products of original (or even transformed) variables. The software treats them in the same way as original variables; only the interpretation differs. In this sec- tion we look at several possible nonlinear transformations of variables. These are often used because of curvature detected in scatterplots. They can also arise because of economic considerations. That is, economic theory often leads to particular nonlinear transformations.

You can transform the dependent variable Y or any of the explanatory variables, the X’s. You can also do both. In either case there are a few nonlinear transformations that are

Interaction Variables Interaction variables can make a regression quite dif-Interaction variables can make a regression quite dif-Interaction variables can make a regression quite dif ficult to interpret, and they are certainly not always necessary. However, without them, the effect of each X on X on X Y is independent of the values of the other independent of the values of the other independent X’s. If you believe, for example, that the effect of years of experience on salary is different for males than it is for females, the only way to capture this behavior is to only way to capture this behavior is to only include an interaction variable between years of expe- rience and gender.

F u n da m e n ta l I n s i g h t

9This subsection is somewhat advanced and can be omitted without any loss of continuity.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 461

typically used. These include the natural logarithm, the square root, the reciprocal, and the square. The purpose of each of these is usually to “straighten out” the points in a scatter- plot. If several different transformations straighten out the data equally well, the one that is easiest to interpret is preferred.

We begin with Example 10.4, where only the X variable needs to be transformed.X variable needs to be transformed.X

E X A M P L E 10.4 DEMAND VERSUS COST FOR ELECTRICITY

Public Service Electric Company produces different quantities of electricity each month, depending on the demand. The file Cost of Power.xlsx lists the number of units of electricity produced (Units) and the total cost of producing these (Cost) for a 36-month period. The data appear in Figure 10.7 (with several hidden rows). How can regression be used to analyze the relationship between Cost and Units?

Cost versus Units

40000

45000

50000

25000

30000

35000

0 200 400 600 800 1000

C o

st

Units

Figure 10.38 Scatterplot of Cost versus Units for Electricity Example

1 2 3 4 5 6

35 36 37

A BA B C Month Cost Units

1 45623 601 2 46507 738 3 43343 686 4 46495 736 5 47317 756

34 46295 667 35 45218 705 36 45357 637

Figure 10.37 Data for Electric Power Example

Objective To see whether the cost of supplying electricity is a nonlinear function of demand, and, if it is, what form the nonlinearity takes.

Solution A good place to start is with a scatterplot of Cost versus Units. This appears in Figure 10.38. It indicates a definite positive relationship and one that is nearly linear. However, there is also some evidence of curvature in the plot. The points increase slightly less rapidly as Units increases from left to right. In economic terms, there might be economies of scale, so that the marginal cost of electricity decreases as more units of electricity are produced.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

462 Chapter 10 Regression Analysis: Estimating Relationships

Note that the residuals to the far left and the far right are all negative, whereas the majority of the residuals in the middle are positive. Admittedly, the pattern is far from perfect—there are several negative residuals in the middle—but this plot certainly suggests nonlinear behavior.

This negative–positive–negative behavior of residuals suggests a parabola—that is, a quadratic relationship with the square of Units included in the equation. The next step is to create a new variable (Units)^2 in the data set. You can do this manually (with the formula =C4^2 in cell D4, copied down) or by selecting Transform in the StatTools Data Utilities dropdown menu. Alternatively, you can create the squared variable implicitly as a StatTools derived variable in the Regression dialog box. Then you can use multiple regres- sion to estimate the equation for Cost with both explanatory variables, Units and (Units)^2, included. The resulting equation is shown in Figure 10.40. Note that R2 has increased to 82.2% and se has decreased to $2281.

8 A BA B C DC D E FE F G

Std. Err. of Es�mate

Adjusted R-squareSummary

Mul�ple Regression for Cost R-Square

Mul�ple R9

10 11 12 13 14 15 16

0.9064 0.8216 0.8108 2280.799771

Rows Ignored

0

Degrees of Freedom

Sum of Squares

Mean of SquaresANOVA Table

Explained 2 790511518.3 395255759.1 75.98080405 < 0.0001 Unexplained 33 171667570.7 5202047.597

Standard Error

F p-Value

Confidence Interval 95% 16161616 17 18 19 20 21

Regression Table UpperLower

Constant 4763.058499 1.216192975 0.2325 –3897.717092 15483.31367 Units 17.23690011 5.705804997 < 0.0001 63.28165383 133.4191277 Units^2

5792.798287 98.35039079

–0.059972929 0.015066406 –3.980573026 0.0004 –0.090625763 –0.029320096

t-Value p-ValueCoefficient

Figure 10.40 Regression Output with Squared Term Included

A scatterplot of residu- als versus fitted values often indicates the need for a nonlinear transformation.

Sca�erplot of Residual vs Fit

2000.0

4000.0

6000.0

–6000.0

–4000.0

–2000.0

0.0 50000.0 55000.0R

es id

u al

Fit

25000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.025000.0 30000.0 35000.0 40000.0 45000.0

Figure 10.39 Residuals from a Straight-Line Fit

© C

e n g

a g

e L

e a rn

in g

Nevertheless, you can first use regression to estimate a linear relationship between linear relationship between linear Cost and Units. The resulting regression equation is

Predicted Cost = 23651 + 30.53Units The corresponding R2 and se are 73.6% and $2734. It is always a good idea to request a scatterplot of the residuals versus the fitted values. This scatterplot is shown in Figure 10.39.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 463

One way to see how this regression equation fits the scatterplot of Cost versus Units (in Figure 10.38) is to use Excel’s Trendline option. To do so, activate the scatterplot, right- click on any point, select Add Trendline, and select the Polynomial type or order 2, that is, a quadratic. A graph of the best-fitting quadratic is superimposed on the scatterplot, as shown in Figure 10.41. It shows a reasonably good fit, plus an obvious curvature.

The main downside to a quadratic regression equation is that there is no easy way to interpret the coefficients of Units and (Units)^2. For example, you can’t conclude from the 98.35 coefficient of Units that Cost increases by 98.35 dollars when Units increases by one. The reason is that when Units increases by one, (Units)^2 doesn’t stay constant; it also increases. All you can say is that the terms in the quadratic combine to explain the nonlinear relationship between units produced and total cost.

Note that the coefficient of (Units)^2, about −0.06, is a small negative value. First, the fact that it is negative makes the parabola bend downward. This produces the decreasing marginal cost behavior, where every extra unit of electricity incurs a smaller cost. Actually, the curve in Figure 10.41 eventually goes downhill for large values of Units, but this part of downhill for large values of Units, but this part of downhill the curve is irrelevant because the company evidently never produces such large quantities. Second, you should not be fooled by the small magnitude of this coefficient. Remember that it is the coefficient of Units squared, which is a large quantity. Therefore, the effect of the product −0.0600 (Units)^2 is sizable.

There is at least one other possibility you can examine. Rather than a quadratic fit, you can try a logarithmic fit. In this case you need to create a new variable, Log(Units), the natural logarithm of Units, and then regress Cost against the single variable Log(Units). To create the new variable, you can use a formula with Excel’s LN function, you can use the Transform option from StatTools Data Utilities, or you can create a derived “log” variable in the StatTools Regression dialog box. Also, you can superimpose a logarithmic curve on the scatterplot of Cost versus Units by using Excel’s Trendline feature with the logarithm option. This curve appears in Figure 10.42. To the naked eye, it appears to be similar, and about as good a fit, as the quadratic curve in Figure 10.41.

Excel’s Trendline option allows you to super- impose a number of different curves on a scatterplot.

Cost versus Units Quadra�c trend line

50000

25000 0 200 400 600 800 1000

C o

st

Units

30000

35000

40000

45000

y = –0.06xy = –0.06xy 2 + 98.35x + 5792.8 R2 = 0.8216

Figure 10.41 Quadratic Fit in Electricity Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

464 Chapter 10 Regression Analysis: Estimating Relationships

The resulting regression equation is listed in Figure 10.42. Its R2 and se values (the latter not shown) are 79.8% and 2393. These latter values indicate that the logarithmic fit is not quite as good as the quadratic fit. However, the advantage of the logarithmic equation is that it is easier to interpret. In fact, one reason logarithmic transforma- tions of variables are used so widely in regression analysis is that they have a meaning- ful interpretation.

In the present case, where the log of an explanatory variable is used, you can interpret its coefficient as follows. Suppose that Units increases by 1%, for example, from 600 to 606. Then the equation in Figure 10.42 implies that the expected Cost will increase by approxi- mately 0.01(16654) = 166.54 dollars. In words, every 1% increase in Units is accompa- nied by an expected $166.54 increase in Cost. Note that for larger values of Units, a 1% increase represents a larger absolute increase (from 700 to 707 instead of from 600 to 606, say). But each such 1% increase entails the same increase in Cost. This is another way of describing the decreasing marginal cost property. ■

Figure 10.42 Logarithmic Fit to Electricity Data

Cost versus Units Logarithmic trend line

50000

25000 0 200 400 600 800 1000

C o

st

Units

30000

35000

40000

45000

y = 16654ln(x) – 63993y = 16654ln(x) – 63993y R2 = 0.7977

In general, if b is the coefficient of the log of X, the expected change in Y when X increases by 1% is approximately 0.01 times b.

The electricity example has shown two possible nonlinear transformations of the explanatory variable (or variables) that you can use. All you need to do is create the transformed Xs and run the regression. The interpretation of statistics such as R2 and se is exactly the same as before; only the interpretation of the coef�cients of the transformed X’s changes. It is also possible to transform the dependent variable Y , as discussed next.

Constant Elasticity Relationships A particular type of nonlinear relationship that has �rm grounding in economic theory is called a constant elasticity relationship. It is also called a multiplicative relationship. It has the form shown in Equation (10.14).

Formula for Multiplicative Relationship Predicted Y = aXaXa 1

bXbX 1 X2X2X bXbX 2 · · · XbXbX kkXkX (10.14)

One property of this type of relationship is that the effect of a one-unit change in any X on X on X Y depends on the levels of the other X’s in the equation. This is not true for the additive relationships of the form

Predicted Y = a + b1X1 + b2X2X2 2X2X + · · · + bkXkXk kXkX

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 465

In a multiplicative (or constant elasticity) relationship, the dependent variable is expressed as a product of explanatory variables raised to powers. When any explanatory product of explanatory variables raised to powers. When any explanatory product variable X changes by X changes by X 1%, the predicted value of the dependent variable changes by a constant percentage, regardless of the value of this X or the values of the other X or the values of the other X Xs.

The term constant elasticity comes from economics. Economists de�ne the elasticity of Y with respect to X as the percentage change in X as the percentage change in X Y that accompanies a 1% increase in X. Often this is in reference to a demand–price relationship. Then the price elasticity is the percentage decrease in demand when price increases by 1%. Usually, the elasticity depends on the current value of X. For example, the price elasticity when the price is $35 might be different than when the price is $50. However, if the relationship is of the form

Predicted Y = aXaXa bXbX

then the elasticity is constant, the same for any value of X. In fact, it is approximately equal to the exponent b. For example, if Predicted Y = 2X2X2 − 1.5, the constant elasticity is approximately −1.5, so that when X increases by 1%, the predicted value of Y decreases by approximately 1.5%.

The constant elasticity property carries over to the multiple-X relationship in X relationship in X Equation (10.14). Then each exponent is the approximate elasticity for its X. For example, if Predicted Y = 2X2X2 1

−1.5X2X2X 0X0X .7, you can make the following statements:

■ When X1 increases by 1%, the predicted value of Y decreases by approximately 1.5%, regardless of the current values of X1 and X2X2X .

■ When X2X2X increases by 1%, the predicted value of Y increases by approximately 0.7%, regardless of the current values of X1 and X2X2X .

You can use linear regression to estimate the nonlinear relationship in Equation (10.14) by taking natural logarithms of all variables. Here two properties of logarithms are used: all variables. Here two properties of logarithms are used: all (1) the log of a product is the sum of the logs, and (2) the log of XbXbX is b times the log of X. Therefore, taking logs of both sides of Equation (10.14) gives

Predicted Log(Y ) = Log(a) + b1Log(X1) + · · · + bkLkLk og(XkXkX )

This equation is linear in the log variables Loglinear in the log variables Loglinear (X1) through Log(XkXkX ), so you can estimate it in the usual way with multiple regression. You can then interpret the coef�cients of the explanatory variables directly as elasticities.

The constant elas- ticity for any X is approximately equal to the exponent of that X.

Using Logarithmic Transformations in Regression If scatterplots suggest nonlinear relationships, there are an unlimited number of nonlinear transformations of Y and/or the X’s that could be tried in a regression analysis. The reason that logarithmic transformations

are arguably the most frequently used nonlinear transformations, besides the fact that they often pro- duce good fits, is that they can be interpreted natu- rally in terms of percentage changes. In real studies, this interpretability is an important advantage over other potential nonlinear transformations.

F u n da m e n ta l I n s i g h t

that we have been discussing. For additive relationships, when any X increases by one unit, the predicted value of Y changes by the corresponding b units, regardless of the levels of the other X’s. However, multiplicative relationships have the following nice property.

One example of a multiplicative relationship is the learning curve model. A learning curve relates the unit production time (or cost) to the cumulative volume of output since that production process �rst began. Empirical studies indicate that production times tend to decrease by a relatively constant percentage every time cumulative output doubles. To

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

466 Chapter 10 Regression Analysis: Estimating Relationships

model this phenomenon, let Y be the time required to produce a unit of output, and let X be the cumulative amount of output that has been produced so far. If we assume that the relationship between Y and X is of the constant elasticity formX is of the constant elasticity formX

Predicted Y = aXaXa bXbX

then it can be shown that whenever X doubles, the predicted value of X doubles, the predicted value of X Y decreases to a con- stant percentage of its previous value. This constant is often called the stant percentage of its previous value. This constant is often called the stant learning rate. For example, if the learning rate is 80%, then each doubling of cumulative production yields a 20% reduction in unit production time. It can be shown that the learning rate satis�es the following equation.

Equation for Learning Rate b = LN(learning rate)/LN(2) (10.15)

(where LN refers to the natural logarithm). So once you estimate b, you can use Equation (10.15) to estimate the learning rate.

The following example illustrates a typical application of the learning curve model.

E X A M P L E 10.5 THE LEARNING CURVE FOR PRODUCTION OF A NEW PRODUCT

Presario Company produces a variety of small industrial products. It has just finished producing 22 batches of a new product (new to Presario) for a customer. The file Learning Curve.xlsx contains the times (in hours) to produce each batch. These data are listed in Figure 10.43. Clearly, the times have tended to decrease as Presario has gained more experience in making the product. Does the multiplicative learning model apply to these data, and what does it imply about the learning rate?

Figure 10.43 Data for Learning Curve Example

1 2 3 4 5 6 7

20 21 22 23

A B C D Batch Time

1 125.00 2 110.87 3 105.35 4 103.34 5 98.98 6 99.90

19 82.06 20 82.81 21 76.52 22 78.45

Log(Batch) Log(Time) 0

0.693147181 1.098612289 1.386294361 1.609437912 1.791759469 2.944438979 2.995732274 3.044522438 3.091042453

4.828313737 4.708358344

4.65728814 4.638024523

4.59491781 4.604169686 4.407450687 4.416548827 4.337552145 4.362461479

A B C D

© C

e n g

a g

e L

e a rn

in g

Objective To use a multiplicative regression equation to estimate the learning rate for production time.

Solution One way to check whether the multiplicative learning model is reasonable is to create the log variables Log(Time) and Log(Batch) in the usual way (with Excel’s LN func- tion) and then see whether a scatterplot of Log(Time) versus Log(Batch) is approximately

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 467

Figure 10.44 Scatterplot of Log Variables with Linear Trend Superimposed 4.7

4.8

4.9

Log(Time) versus Log(Batch)

4.3

4.4

4.5

4.6

0 0.5 1 1.5 2 2.5 3 3.5

Lo g(

Ti m

e)

Log(Batch)

y = –0.155x + 4.834y = –0.155x + 4.834y

© C

e n g

a g

e L

e a rn

in g

There are a couple of ways to interpret this equation. First, because it is a constant elasticity relationship, the coefficient −0.155 can be interpreted as an elasticity. That is, when Batch increases by 1%, Time tends to decrease by approximately 0.155%.

Although this interpretation is correct, it is not as useful as the “doubling” interpreta- tion discussed previously. Equation (10.15) states that the estimated learning rate satisfies

−0.155 = LN(learning rate)/LN(2)

Solving for the learning rate [multiply through by LN(2) and then take antilogs], you can see that it is 0.898, or approximately 90%. In words, whenever cumulative production dou- bles, the time to produce a batch decreases by about 10%.

Presario could use this regression equation to predict future production times. For example, suppose the customer places an order for 15 more batches of the same product. Note that Presario is already partway up the learning curve, that is, these batches are numbers 23 through 37, and the company already has experience producing the product. You can use the equation shown in Figure 10.44 to predict the log of production time for each batch. Then you can take their antilogs and sum them to obtain the total production time. The calculations are shown in rows 24 through 39 of Figure 10.45. You enter the batch numbers and calculate their logs in columns A and C. Then you substitute the values of Log(Batch) in column C into the regression equation to obtain the predicted values of Log(Time) in column E. Finally, you use Excel’s EXP function to calculate the antilogs of these predictions in column B, and you cal- culate their sum in cell B39. The total predicted time to finish the order is about 1115 hours. ■

linear. The multiplicative model implies that it should be. Such a scatterplot appears in Figure 10.44, along with a superimposed linear trend line and the corresponding equation. The fit appears to be quite good.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

468 Chapter 10 Regression Analysis: Estimating Relationships

P R O B L E M S

Level A 26. In a study of housing demand, a county assessor

is interested in developing a regression model to estimate the selling price of residential properties within her jurisdiction. She randomly selects several houses and records the selling price in addition to the following values: the size of the house (in square feet), the total number of rooms in the house, the age of the house, and an indication of whether the house has an attached garage. These data are stored in the file P10_26.xlsx. a. Estimate and interpret a multiple regression

equation that includes the four potential explanatory variables. How do you interpret the coefficient of the Attached Garage variable?

b. Evaluate the estimated regression equation’s goodness of fit.

c. Use the estimated equation to predict the sales price of a 3000-square-foot, 20-year-old home that has seven rooms but no attached garage. How accurate is your prediction?

27. A manager of boiler drums wants to use regression analysis to predict the number of worker-hours needed to erect the drums in future projects. Data for several randomly selected boilers have been collected. In addition to worker-hours (Y ), the variables measured include boiler capacity, boiler design pressure, boiler

type, and drum type. All of these measurements are listed in the file P10_27.xlsx. a. Estimate an appropriate multiple regression

equation to predict the number of worker-hours needed to erect boiler drums.

b. Interpret the estimated regression coefficients. c. According to the estimated regression equation,

what is the difference between the mean number of worker-hours required for erecting industrial and utility field boilers?

d. According to the estimated regression equation, what is the difference between the mean number of worker-hours required for erecting boilers with steam drums and those with mud drums?

e. Given the estimated regression equation, predict the number of worker-hours needed to erect a utility-field, steam-drum boiler with a capacity of 550,000 pounds per hour and a design pressure of 1400 pounds per square inch. How accurate is your prediction?

f. Given the estimated regression equation, predict the number of worker-hours needed to erect an industrial-field, mud-drum boiler with a capacity of 100,000 pounds per hour and a design pressure of 1000 pounds per square inch. How accurate is your prediction?

28. Suppose that a regional express delivery service company wants to estimate the cost of shipping a

Figure 10.45 Using the Learning Curve Model for Predictions

22 23

24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

21 22

23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

A BA B C DC D E FE F 76.52 3.044522438 4.337552145 78.45 3.091042453 4.362461479

77.324 3.135494216 4.348009995 76.816 3.17805383 4.341413654 76.332 3.218875825 4.335086627 75.869 3.258096538 4.329007785 75.426 3.295836866 4.323158388 75.003 3.33220451 4.317521744 74.596 3.36729583 4.312082919 74.205 3.401197382 4.306828497 73.829 3.433987204 4.301746382 73.466 3.465735903 4.296825631 73.117 3.496507561 4.292056313 72.779 3.526360525 4.287429384 72.453 3.555348061 4.282936587 72.137 3.583518938 4.278570366 71.832 3.610917913 4.274323782

1115.183 Predicted �me for next 15 batches © C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-6 Modeling Possibilities 469

package (Y ) as a function of cargo type, where cargo type includes the following possibilities: fragile, semifragile, and durable. Costs for several randomly chosen packages of approximately the same weight and same distance shipped, but of different cargo types, are provided in the file P10_28.xlsx. a. Estimate an appropriate multiple regression equation

to predict the cost of shipping a given package. b. Interpret the estimated regression coefficients. You

should find that the estimated intercept and slope of the equation are sample means. Which sample means are they?

c. According to the estimated regression equation, which cargo type is the most costly to ship? Which most costly to ship? Which most cargo type is the least costly to ship?least costly to ship?least

d. How well does the estimated equation fit the given sample data? How do you think the model’s goodness of fit could be improved?

e. Given the estimated regression equation, predict the cost of shipping a package with semifragile cargo.

29. The file P10_11.xlsx contains annual observations (in column B) of the American minimum wage. The basic question here is whether the minimum wage has been growing at roughly a constant rate over this period.constant rate over this period.constant a. Create a time series graph for these data. Comment

on the observed behavior of the minimum wage over time.

b. Estimate a linear regression equation of the minimum wage versus time (the Year variable). What does the estimated slope indicate?

c. Analyze the residuals from the equation in part b. Are they essentially random? If not, return to part b and revise your equation appropriately. Then interpret the revised equation.

30. Estimate a regression equation that adequately estimates the relationship between monthly electrical power usage (Y)Y)Y and home size (X)X)X using the data in the file P10_13.xlsx. Interpret your results. How well does your model explain the variation in monthly electrical power usage?

31. An insurance company wants to determine how its annual operating costs depend on the number of home insurance (X1) and automobile insurance (X2X2X ) policies that have been written. The file P10_31.xlsx contains relevant information for several branches of the insur- ance company. The company believes that a multipli- cative model might be appropriate because operating costs typically increase by a constant percentage as the number of either type of policy increases by a given percentage. Use the given data to estimate a multiplicative model for this insurance company. Interpret your results. Does a multiplicative model pro- vide a good fit with these data? Answer by calculating

the appropriate standard error of estimate and R2 value, based on original units of the dependent original units of the dependent original variable.

32. Suppose that an operations manager is trying to deter- mine the number of labor hours required to produce the ith unit of a certain product. Consider the data pro- vided in the file P10_32.xlsx. For example, the second unit produced required 517 labor hours, and the 600th unit required 34 labor hours. a. Use the given data to estimate a relationship

between the total number of units produced and the labor hours required to produce the last unit in the total set. Interpret your findings.

b. Use your estimated relationship to predict the number of labor hours that will be needed to produce the 800th unit.

Level B 33. The human resources manager of DataCom, Inc.,

wants to predict the annual salaries of given employees using the potential explanatory variables in the file P10_05.xlsx. a. Estimate an appropriate multiple regression

equation to predict the annual salary of a given DataCom employee using all of the data in columns C–H.

b. Interpret the estimated regression coefficients. c. According to the estimated regression model,

is there a difference between the mean salaries earned by male and female employees at DataCom? If so, how large is the difference? According to your equation, does this difference depend on the values of the other explanatory variables? Explain.

d. According to the estimated regression model, is there a difference between the mean salaries earned by employees in the sales department and those in the advertising department at DataCom? If so, how large is the difference? According to your equation, does this difference depend on the values of the other explanatory variables? Explain.

e. According to the estimated regression model, in which department are DataCom employees paid the highest mean salary (after controlling highest mean salary (after controlling highest for other explanatory variables)? In which department are DataCom employees paid the lowest mean salary?lowest mean salary?lowest

f. Given the estimated regression model, predict the annual salary of a female employee who served in a similar department at another company for 10 years prior to coming to work at DataCom. This woman, a graduate of a four-year collegiate business program, has been supervising 12 subordinates in the purchasing department since joining the organization five years ago.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

470 Chapter 10 Regression Analysis: Estimating Relationships

34. Does the rate of violent crime acts vary across differ- ent regions of the United States? Answer this with the data in the file P10_34.xlsx as requested below. a. Estimate an appropriate regression model to

explain the variation in violent crime rate across the four given regions of the United States. Interpret the estimated equation. Rank the four regions from highest to lowest according to their mean violent crime rate. Could you have done this without regression? Explain.

b. How would you modify the regression model in part a to account for possible differences in the violent crime rate across the various subdivisions of the given regions? Estimate your revised regression equation and interpret your findings. Rank the nine subdivisions from highest to lowest according to their mean violent crime rate.

35. Continuing Problems 6 and 15 on the 2006–2007 movie data in the file P02_02.xlsx, create a new variable Total Revenue that is the sum of Total US Gross, International Gross, and US DVD Sales. How well can this new variable be predicted from the data in columns C–F? For Distributor, relabel the categories so that there are only two: Large Distributor and Small Distributor. The former is any distributor that had at least 12 movies in this period, and the latter is all the rest. For Genre, relabel the categories to be Comedy, Drama, Adventure, Action, Thriller/Suspense, and Other. (Other includes Black Comedy, Documentary, Horror, Musical, and Romantic Comedy.) Interpret the coefficients of the estimated regression equation. How would you explain the results to someone in the movie business? Do you think that predictions of total revenue from this regression equation will be very accurate? Why?

36. Continuing Problem 18, suppose that the antique collector believes that the rate of increase of the auction price with the age of the item will be driven upward by a large number of bidders. How

would you revise the multiple regression equation developed previously to model this feature of the problem? a. Estimate your revised equation using the data in

the file P10_18.xlsx. b. Interpret each of the estimated coefficients in your

revised model. c. Does this revised model fit the given data better

than the original multiple regression model? Explain why or why not.

37. Continuing Problem 19, revise the previous multiple regression equation to include an interaction term between the return on average equity (X1) and annual dividend rate (X2X2X ). a. Estimate your revised equation using the data

provided in the file P10_19.xlsx. b. Interpret each of the estimated coefficients in

your revised equation. In particular, how do you interpret the coefficient for the interaction term in the revised equation?

c. Does this revised equation fit the given data better than the original multiple regression equation? Explain why or why not.

38. Continuing Problem 22, suppose that one of the man- agers of this regional express delivery service com- pany is trying to decide whether to add an interaction term involving the package weight (X1) and the dis- tance shipped (X2X2X ) in the previous multiple regression equation. a. Why would the manager want to add such a term to

the regression equation? b. Estimate the revised equation using the data given

in the file P10_22.xlsx. c. Interpret each of the estimated coefficients in

your revised equation. In particular, how do you interpret the coefficient for the interaction term in the revised equation?

d. Does this revised equation fit the data better than the original multiple regression equation? Explain why or why not.

10-7 VALIDATION OF THE FIT

The �t from a regression analysis is often overly optimistic. When you use the least squares procedure on a given set of data, all of the idiosyncrasies of the particular data set are exploited to obtain the best possible �t. However, there is no guarantee that the �t will be as good when the estimated regression equation is applied to new data. In fact, it usually isn’t. This is particularly important when the goal is to use the regression equation to predict new values of the dependent variable. The usual situation is that you use a given data set to estimate a regression equation. Then you gather new data on the explanatory variables and use these, along with the already-estimated regression equation, to predict the new (but unknown) values of the dependent variable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-7 Validation of the Fit 471

One way to see whether this procedure will be successful is to split the original data set into two subsets: one subset for estimation and one subset for validation. A regression equation is estimated from the �rst subset. Then the values of explanatory variables from the second subset are substituted into this equation to obtain predicted values for the dependent variable. Finally, these predicted values are compared to the known values of the dependent variable in the second subset. If the agreement is good, there is reason to believe that the regression equation will predict well for new data. This procedure is called validating the �t.

This validation procedure is fairly simple to perform in Excel. We illustrate it for the Bendrix manufacturing data in Example 10.2. (See the �le Overhead Costs Validation.xlsx.)

There we used 36 monthly observations to regress Overhead on Machine Hours and Production Runs. For convenience, the regression output is repeated in Figure 10.46. In particular, it shows an R2 value of 86.6% and an se value of $4109.

Now suppose that this data set is from one of Bendrix’s two plants. The company would like to predict overhead costs for the other plant by using data on machine hours and production runs at the other plant. The �rst step is to see how well the regression from Figure 10.46 �ts data from the other plant. This validation on the 36 months of data is shown in Figure 10.47.

To obtain the results in this �gure, proceed as follows.

Procedure for Validating Regression Results 1. Copy old results. Copy the results from the original regression to the ranges A5:C5

and B9:B10.

2. Calculate �tted values and residuals. The �tted values are now the predicted values of overhead for the other plant, based on the original regression equation. Find these by substituting the new values of Machine Hours and Production Runs into the original equation. Speci�cally, enter the formula

=$A$5+SUMPRODUCT($B$5:$C$5,B13:C13)

Training and Validation Sets This practice of partitioning a data set into a set for estipartitioning a data set into a set for estipartitioning - mation and a set for validation is becoming much more common as larger data sets become available. It allows you to see how a given procedure such as regression works on a data set where you know the know the know YsYsY . If it works well, you have more confidence that it will work well on a new data set where you do not know the not know the not YsYsY . This partitioning is a routine part of data mining, the explo- ration of large data sets. In data mining, the first data set is usually called the training set, and the second data training set, and the second data training set is called the validation or testing set.testing set.testing

F u n da m e n ta l I n s i g h t

Figure 10.46 StatTools Regression Output for Bendrix Example

8

A BA B C DC D E FE F G

Adjusted R-square

Mul�ple R

Std. Err. ofd. Err. ofd. Err Es�mateSummary

R-Square 9

10 11 12 13 14 15

0.9308 0.8664 0.8583 4108.99309

Rows Ignored

0

Degrees of Freedom

Sum of Squares

Mean of SquaresANOVA OVA OV Table

Explained 2 3614020661 1807010330 107.0261279 < 0.0001 Unexplained 33 557166199.1 16883824.22

Standard Error

p-Value-Value-VF

Coefficient Confidence Interval 95% 16 17 18 19 20 21

Regression Tableegression Tableegression T UpperLower

Constant 3996.678209 6603.650932 0.605222512 0.5492 –9438.550632 17431.90705 Machine Hours 43.53639812 3.5894837 12.12887472 < 0.0001 36.23353862 50.83925761 Produc�on Runs 883.6179252 82.25140753 10.74289124 < 0.0001 716.2761784 1050.959672

t-Value-Value-V p-Value-Value-V

Mul�ple Regression for Overhead

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

472 Chapter 10 Regression Analysis: Estimating Relationships

in cell E13 and copy it down. Then calculate the residuals (prediction errors for the other plant) by entering the formula

=D13-E13

in cell F13 and copying it down.

3. Calculate summary measures. You can see how well the original equation �ts the new data by calculating R2 and se values. Recall that R

2 in general is the square of the correlation between observed and �tted values. Therefore, enter the formula

=CORREL(E13:E48,D13:D48)^2

in cell C9. The se value is essentially the average of the squared residuals, but it uses the denominator n − 3 (when there are two explanatory variables) rather than n − 1. Therefore, enter the formula

=SQRT(SUMSQ((F13:F48)/33)

in cell C10.

The results in Figure 10.47 are typical. The validation results are usually not as good as the original results. The value of R2 has decreased from 86.6% to 77.3%, and the value of se has increased from $4109 to $5257. Nevertheless, Bendrix might con- clude that the original regression equation is adequate for making future predictions at either plant.

Figure 10.47 Validation of Bendrix Regression Results

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 46 47 48

B C D E F Valida�on data

Coefficients from regression equa�on (based on original data) Constant Machine Hours

Machine Hours

Produc�on Runs 3996.6782 43.5364 883.6179

Comparison of summary measures Original Valida�on

R-square 0.8664 0.7733 StErr of Est 4108.99 5256.50

Produc�on Runs Overhead Fi�ed Residual 85023 7391

–8230

–5324

–1864 –7525

92814 –1957

1374 24 92414 1510 35 92433 100663 1213 21 81907 75362 6545 1629 27 93451 98775 1858 28 112203 109629 2574 1529 29 94325 96189 1389 47 98474 105999

A

Month 1 2 3 4 5

34 35 36 1350 34 90857

B C D E

d F

Excel’s SUMSQ function is often handy. It sums the squares of values in a range.

10-8 CONCLUSION In this chapter we have illustrated how to �t an equation to a set of points and how to inter- pret the resulting equation. We have also discussed two measures, R2 and se, that indicate the goodness of �t of the regression equation. Although the general technique is called

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-8 Conclusion 473

linear regression, it can be used to estimate nonlinear relationships through suitable translinear regression, it can be used to estimate nonlinear relationships through suitable translinear - formations of variables. We are not �nished with our study of regression, however. In the next chapter we make some statistical assumptions about the regression model and then discuss the types of inferences that can be made from regression output. In particular, we discuss the accuracy of the estimated regression coef�cients, the accuracy of predictions made from the regression equation, and the choice of explanatory variables to include in the regression equation.

Summary of Key Terms

Term Symbol Explanation Excel Page Equation

Regression analysis

A general method for estimating the relationship between a dependent variable and one or more explanatory variables

419

Dependent (or response) variable

Y The variable being estimated or predicted in a regression analysis

420

Explanatory (or independent) variables

X’s The variables used to explain or predict the dependent variable

420

Simple regression A regression model with a single explanatory variable

Excel’s INTERCEPT and SLOPE functions or StatTools

420

Multiple regression

A regression model with any number of explanatory variables

StatTools 420

Correlation rXYrXYr A measure of the strength of the linear relationship between two variables X and Y

Excel’s CORREL function or StatTools

428 10.1

Fitted value The predicted value of the dependent variable, found by substituting explanatory values into the regression equation

431 10.2

Residual The difference between the actual and fitted values of the dependent variable

431 10.2

Least squares line The regression equation that minimizes the sum of squared residuals

StatTools 432 10.3, 10.4

Standard error of estimate

se Essentially, the standard deviation of the residuals; indicates the magnitude of the prediction errors

Excel’s STEYX function (for a single X) or StatToolsX) or StatToolsX

438 10.7, 10.11

R-square R2 The percentage of variation in the response variable explained by the regression model

Excel’s RSQ function (for a single X) or X) or X StatTools

440 10.8

Adjusted R2 A measure similar to R2, but adjusted for the number of explanatory variables in the equation

447

Regression coefficients

a, b’s The constant and the coefficients of the explanatory variables in a regression equation

StatTools 443 10.9

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

474 Chapter 10 Regression Analysis: Estimating Relationships

Term Symbol Explanation Excel Page Equation

Dummy (or indicator) variables

Variables coded as 0 or 1, used to capture categorical variables in a regression analysis

450

Interaction variables

Products of explanatory variables, used when the effect of one on the dependent variable depends on the value of the other

457

Nonlinear transformations

Variables created to capture nonlinear relationships in a regression model

460

Quadratic relationship

A regression model with linear and squared explanatory variables

StatTools 462

Model with logarithmic transformations

A regression model using logarithms of Y and/or Xs

StatTools 464

Constant elasticity (or multiplicative) relationship

A relationship where predicted Y changes by a constant percentage when any X changes by X changes by X 1%; requires logarithmic transformations

StatTools 464 10.14

Learning curve A particular multiplicative relationship used to indicate how cost or time in production decreases over time

StatTools 465 10.15

Validation of fit Checks how well a regression model based on one sample predicts a related sample

471

P R O B L E M S

Conceptual Questions C.1. Consider the relationship between yearly wine

consumption (liters of alcohol from drinking wine, per person) and yearly deaths from heart disease (deaths per 100,000 people) in 19 developed countries. Suppose that you read a newspaper article in which the reporter states the following:

Researchers find that the correlation between yearly wine consumption and yearly deaths from heart disease is −0.84. Thus, it is reasonable to conclude that increased consumption of alcohol from wine causes fewer deaths from heart disease in industrialized societies.

Comment on the reporter’s interpretation of the correlation in this situation.

C.2. “It is generally appropriate to delete all outliers in a data set that are apparent in a scatterplot.” Do you agree with this statement? Explain.

C.3. How would you interpret the relationship between two numeric variables when the estimated least squares regression line for them is essentially horizontal (i.e., flat)?horizontal (i.e., flat)?horizontal

C.4. Suppose that you generate a scatterplot of residuals versus fitted values of the dependent variable for an estimated regression equation. Furthermore, you find the correlation between the residuals and fitted values to be 0.829. Does this provide a good indication that the estimated regression equation is satisfactory? Explain why or why not.

C.5. Suppose that you have generated three alternative multiple regression equations to explain the variation in a particular dependent variable. The regression output for each equation can be summarized as follows:

Equation 1 Equation 2 Equation 3 No. of Xs 4 6 9 R2 0.76 0.77 0.79

Adjusted R2 0.75 0.74 0.73

Which of these equations would you select as “best”? Explain your choice.

C.6. Suppose you want to investigate the relationship between a dependent variable Y and two potential explanatory variables X1 and X2X2X . Is the R

2 value

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

10-8 Conclusion 475

for the equation with both X variables included necessarily at least as large as the R2 value from each equation with only a single X? Explain why or why not. Could the R2 value for the equation with both X variables included be larger than the sum larger than the sum larger of the R2 values from the separate equations, each with only a single X included? Is there any intuitive explanation for this?

C.7. Suppose you believe that two variables X and X and X Y are related, but you have no idea which way the causality goes. Does X cause X cause X Y or vice versa (or maybe even neither)? Can you tell by regressing Y on X and then regressing X on X on X Y? Explain. Also, provide at least one real example where the direction of causality would be ambiguous.

C.8. Suppose you have two columns of monthly data, one on advertising expenditures and one on sales. If you use this data set, as is, to regress sales on advertising, will it adequately capture the behavior that advertising in one month doesn’t really affect sales in that month but only in that month but only in that future months? What should you do, in terms of regression, to capture this timing effect?

C.9. Suppose you want to predict reading speed using, among other variables, the device the person is reading from. This device could be a regular book, an iPad, a Kindle, or others. Therefore, you create dummy variables for device. How, exactly, would you do it? If you use regular book as the reference category and another analyst uses, say, Kindle as the reference category, will you get the same regression results? Explain.

C.10. Explain the benefits of using natural logarithms of variables, either of Y or of the X’s, as opposed to other possible nonlinear functions, when scatterplots (or possibly economic considerations) indicate that nonlinearities should be taken into account. Explain exactly how you interpret regression coefficients if logs are taken only of Y, only of the X’s, or of both Y and the X’s.

C.11. The number of cars per 1000 people is known for virtually every country in the world. For many countries, however, per capita income is not known. How might you estimate per capita income for countries where it is unknown?

Level A 39. Many companies manufacture products that are at

least partially produced using chemicals (e.g., paint, gasoline, and steel). In many cases, the quality of the finished product is a function of the temperature and pressure at which the chemical reactions take place. Suppose that a particular manufacturer wants to model the quality (Y)Y)Y of a product as a function of the

temperature (X1) and the pressure (X2X2X ) at which it is produced. The file P10_39.xlsx contains data obtained from a carefully designed experiment involving these variables. Note that the assigned quality score can range from a minimum of 0 to a maximum of 100 for each manufactured product. a. Estimate a multiple regression equation that

includes the two given explanatory variables. Does the estimated equation fit the data well?

b. Add an interaction term between temperature and pressure and run the regression again. Does the inclusion of the interaction term improve the model’s goodness of fit?

c. Interpret each of the estimated coefficients in the two equations. How are they different? How do you interpret the coefficient for the interaction term in the second equation?

40. A power company located in southern Alabama wants to predict the peak power load (i.e., the maximum amount of power that must be generated each day to meet demand) as a function of the daily high temperature (X ). A random sample of summer days is chosen, and the peak power load and the high temperature are recorded each day. The file P10_40.xlsx contains these observations. a. Create a scatterplot for these data. Comment on the

observed relationship between Y and Y and Y X. b. Estimate an appropriate regression equation

to predict the peak power load for this power company. Interpret the estimated regression coefficients.

c. Analyze the estimated equation’s residuals. Do they suggest that the regression equation is adequate? If not, return to part b and revise your equation. Continue to revise the equation until the results are satisfactory.

d. Use your final equation to predict the peak power load on a summer day with a high temperature of 100 degrees.

41. Management of a home appliance store would like to understand the growth pattern of the monthly sales of Blu-ray disc players over the past two years. Managers have recorded the relevant data in the file P10_09.xlsx. a. Create a scatterplot for these data. Comment on

the observed behavior of monthly sales at this store over time.

b. Estimate an appropriate regression equation to explain the variation of monthly sales over the given time period. Interpret the estimated regression coefficients.

c. Analyze the estimated equation’s residuals. Do they suggest that the regression equation is adequate? If not, return to part b and revise your

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

476 Chapter 10 Regression Analysis: Estimating Relationships

equation. Continue to revise the equation until the results are satisfactory.

42. A small computer chip manufacturer wants to forecast monthly operating costs as a function of the number of units produced during a month. The company has collected several months of data in the file P10_42.xlsx. a. Determine an equation that can be used to predict

monthly production costs from units produced. Are there any outliers?

b. How could the regression line obtained in part a be used to determine whether the company was efficient or inefficient during any particular month?

43. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. a. Create a recoded version of Education, where 0

or 2 is recoded as 1, 4 is recoded as 2, and 6 or 8 is recoded as 3. Then create dummy variables for these three categories.

b. Use pivot tables to explore whether average salary depends on gender, and whether it depends on the recoded Education. Then use scatterplots to explore whether salary is related to age, prior experience, and Beta experience. Briefly state your results.

c. Run a regression of salary versus gender, age, prior experience, Beta experience, and any two of the education dummies, and interpret the results.

d. If any of the potential explanatory variables seems to be unrelated to salary, based on the results from part b, run one or more regressions without such a variable. Comment on whether it makes much of a difference in the regression outputs.

44. The file P10_44.xlsx contains data that relate the unit cost of producing a fuel pressure regulator to the cumulative number of fuel pressure regulators produced at an automobile production plant. For example, the 4000th unit cost $13.70 to produce. a. Fit a learning curve to these data. b. You would predict that doubling cumulative

production reduces the cost of producing a regulator by what amount?

45. The beta of a stock is found by running a regression with the monthly return on a market index as the explanatory variable and the monthly return on the stock as the dependent variable. The beta of the stock is then the slope of this regression line. a. Explain why most stocks have a positive beta. b. Explain why a stock with a beta with absolute

value greater than one is more volatile than the market index and a stock with a beta less than one (in absolute value) is less volatile than the market index.

c. Use the data in the file P10_45.xlsx to estimate the beta for each of the four companies listed: Caterpillar, Goodyear, McDonalds, and Ford. Use the S&P 500 as the market index.

d. For each of these companies, what percentage of the variation in its returns is explained by the variation in the market index? What percentage is unexplained by variation in the market index?

e. Verify (using Excel’s COVAR and R and R VARP functions) P functions) P that the beta for each company is given by

Covariance between Company and Market

Variance of Market

Also, verify that the correlation between each company’s returns and the market’s returns is the square root of R2.

46. Continuing the previous problem, explore whether the beta for these companies changes through time. For example, are the betas based on 1990s data different from those based on 2000s data? Or are data based on only five years of data different from those based on longer time periods?

47. The file Catalog Marketing.xlsx contains recent data on 1000 HyTex customers. (This is the same data set used in Example 2.7 in Chapter 2.) a. Create a pivot table of average amount spent versus

the number of catalogs sent. Is there any evidence that these two variables are related? Would it make sense to enter Catalogs, as is, in a regression equation for Amount Spent, or should dummies be used? Explain.

b. Create a pivot table of average amount spent versus History. Is there any evidence that these two variables are related? Would it make sense to enter History, as is, in a regression equation for Amount Spent, or should dummies be used? Explain.

c. Answer part b with History replaced by Age. d. Base on your results from parts a through c,

estimate an appropriate regression equation for Amount Spent, using the appropriate forms for Catalogs, History, and Age, plus the variables Gender, Own Home, Married, and Close. Interpret this equation and comment on its usefulness in predicting Amount Spent.

48. A common complaint of university students is that tenure-track instructors care a lot more about their research than their teaching and general availability to students. The file P10_48.xlsx contains hypotheti- cal data on 75 tenure-track instructors where you can check whether these complaints are justified. The explanatory variables are (1) whether the instructor holds regular office hours, (2) average teaching evalu- ation on a 1–6 scale, and (3) number of published articles. The dependent variable is the instructor’s cur- rent annual salary. Use regression on this data set and comment on the results. In particular, can Salary be explained almost as well by the number of articles as by all three explanatory variables combined?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

49. The file P10_49.xlsx contains the amount of money spent advertising a product and the number of units sold for several months. a. Assume that the only factor influencing monthly

sales is advertising. Fit the following three curves to these data: linear (Y = a + bXbXb )X)X , exponential (Y = abX)X)X , and multiplicative (Y = aXaXa bXbX ). Which equation fits the data best?

b. Interpret the best-fitting equation. c. Using the best-fitting equation, predict sales during

a month in which $60,000 is spent on advertising.

50. A golf club manufacturer is trying to determine how the price of a set of clubs affects the demand for clubs. The file P10_50.xlsx contains the price of a set of clubs and the monthly sales. a. Assume the only factor influencing monthly sales

is price. Fit the following three curves to these data: linear (Y = a + bXbXb )X)X , exponential (Y = abX)X)X , and multiplicative (Y = aXaXa bXbX ). Which equation fits the data best?

b. Interpret your best-fitting equation. c. Using the best-fitting equation, predict sales during

a month in which the price is $470.

51. The file P03_55.xlsx lists the average salary for each Major League Baseball (MLB) team from 2004 to 2011, along with the number of team wins in each of these years. a. Rearrange the data so that there are four long

columns: Team, Year, Salary, and Wins. There should be 8*30 values for each.

b. Create a scatterplot of Wins (Y ) versus Salary (X ). Is there any indication of a relationship between these two variables? Is it a linear relationship?

c. Run a regression of Wins versus Salary. What does it say, if anything, about teams buying their way to success?

52. Repeat the previous problem with the basketball data in the file P03_56.xlsx. (Now there will be 6*30 rows in the rearranged data set.)

53. Repeat Problem 51 with the football data in the file P03_57.xlsx. (Now there will be 8*32 rows in the rearranged data set.)

54. Baker Company wants to develop a budget to predict how overhead costs vary with activity levels. Management is trying to decide whether direct labor hours (DLH) or units produced is the better measure of activity for the firm. Monthly data for the preceding 24 months appear in the file P10_54.xlsx. Use regression analysis to determine which measure, DLH or Units (or both), should be used for the budget. How would the regression equation be used to obtain the budget for the firm’s overhead costs?

55. The auditor of Kiely Manufacturing is concerned about the number and magnitude of year-end adjustments that are made annually when the financial

statements of Kiely Manufacturing are prepared. Specifically, the auditor suspects that the management of Kiely Manufacturing is using discretionary write-offs to manipulate the reported net income. To check this, the auditor has collected data from 25 companies that are similar to Kiely Manufacturing in terms of manufacturing facilities and product lines. The cumulative reported third-quarter income and the final net income reported are listed in the file P10_55.xlsx for each of these 25 companies. If Kiely Manufacturing reports a cumulative third-quarter income of $2,500,000 and a preliminary net income of $4,900,000, should the auditor conclude that the relationship between cumulative third-quarter income and the annual income for Kiely Manufacturing differs from that of the 25 companies in this sample? Explain why or why not.

56. The file P10_56.xlsx contains some interesting data on the U.S. presidential elections from 1880 through 2008. The variable definitions are on the Source sheet. The question is whether the Vote variable can be predicted very well from the other variables. a. Create pivot tables and/or scatterplots to check

whether Vote appears to be related to the other variables. Comment on the results.

b. Run a regression of Vote versus the other variables (not including Year). Do the coefficients go in the direction (positive or negative) you would expect? If you were going to use the regression equation to predict Vote for the next election and you had the relevant data for the explanatory variables for that year, how accurate do you think your prediction would be?

Level B 57. We stated in the beginning of the chapter that

regression can be used to understand the way the world works. That is, you can look at the regression coefficients (their signs and magnitudes) to see the effects of the explanatory variables on the dependent variable. However, is it possible that apparently small changes in the data can lead to very different-looking equations? The file P10_57.xlsx lets you explore this question. Columns K–R contain data on over 100 (fictional) homes that were recently sold. The regression equation for this original data set is given in the range T15:U21. (It was found with StatTools in the usual way.) Columns C–I contain slight changes to the original data, with the amount of change determined by the adjustable parameters in row 2. (Look at the formulas in columns C–I to see how the original data have been changed randomly.) The regression equation for the changed data appears in the range T6:U12. It has been calculated through special matrix functions (not StatTools), so that it changes automatically when the random data change. (These require the 1’s

10-8 Conclusion 477 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

478 Chapter 10 Regression Analysis: Estimating Relationships

in column B.) Experiment by pressing the F9 key or changing the adjustable parameters to see how much the two regression equations can differ. After experimenting, briefly explain how you think housing pricing works—or can you tell?

58. The file P02_35.xlsx contains data from a survey of 500 randomly selected households. For this problem, use Monthly Payment as the dependent variable in several regressions, as explained below. a. Beginning with Family Size, iteratively add one

explanatory variable and estimate the resulting regression equation to explain the variation in Monthly Payment. If adding any explanatory variable causes the adjusted R2 measure to fall, do not include that variable in subsequent versions of the regression model. Otherwise, include the variable and consider adding the next variable in the set. Which variables are included in the final version of your regression model? (Add dummies for Location in a single step, and use Total Income rather than First Income and Second Income separately.)

b. Interpret the final estimated regression equation you obtained through the process outlined in part a. Also, interpret the standard error of estimate se , R

2, and the adjusted R2 for the final estimated model.

59. (This problem is based on an actual court case in Philadelphia.) In the 1994 congressional election, the Republican candidate outpolled the Democratic candidate by 400 votes (excluding absentee ballots). The Democratic candidate outpolled the Republican candidate by 500 absentee votes. The Republican candidate sued (and won), claiming that vote fraud must have played a role in the absentee ballot count. The Republican’s lawyer ran a regression to predict (based on past elections) how the absentee ballot margin could be predicted from the votes tabulated on voting machines. Selected results are given in the file P10_59.xlsx. Show how this regression could be used by the Republican to “prove” his claim of vote fraud.

60. In the world of computer science, Moore’s law is famous. Although there are various versions of this law, they all say something to the effect that computing power doubles every two years. Several researchers estimated this law with regression using real data in 2006. Their paper can be found online at http://download.intel.com/pressroom /pdf/computertrendsrelease.pdf. For example, one interesting chart appears on page S1, backed up with regression results on another page. What exactly do these results say about doubling every two years (or do they contradict Moore’s law)?

61. (The data for this problem are fictitious, but they are not far off.) For each of the top 25 business schools, the file P10_61.xlsx contains the average salary of a professor. Thus, for Indiana University (number 15 in

the rankings), the average salary is $46,000. Use this information and regression to show that IU is doing a great job with its available resources.

62. Suppose the correlation between the average height of parents and the height of their firstborn male child is 0.5. You are also told that:

■ The average height of all parents is 66 inches.

■ The standard deviation of the average height of parents is 4 inches.

■ The average height of all male children is 70 inches.

■ The standard deviation of the height of all male children is 4 inches.

If a mother and father are 73 and 80 inches tall, respec- tively, how tall do you predict their son to be? Explain why this is called “regression toward the mean.”

63. As indicated by the opening vignette to this chapter, a motel chain could use regression to determine good locations for new motels from data on existing motels. The data in the file P10_63.xlsx provide one possibil- ity. The Existing Sites sheet contains data on 90 motels in the chain. The cell comments in row 1 explain the variables, and the last variable, Operating Margin, is used as the dependent variable. The Potential Sites sheet contains data on five potential sites, but the dependent variable for these sites is unknown. Run a regression on the first sheet and discuss the results. Then use the regression equation to predict Operating Margin for the potential sites. Where would you sug- gest the company should locate one or more new motels? Note that the data on Indoor Pool have been omitted for the potential sites. After all, the company gets to decide whether to build an indoor pool. How should you handle this variable in the predictions?

64. For each of the four data sets in the file P10_64.xlsx, calculate the least squares line. For which of these data sets would you feel comfortable in using the least squares line to predict Y?Y?Y

65. Suppose you run a regression on a data set of X and X and X Y values and obtain a least squares line of Y values and obtain a least squares line of Y Y = 12 − 3X. a. If you double each value of X, what is the new least

squares line? b. If you triple each value of Y, what is the new least

squares line? c. If you add 6 to each value of X, what is the new

least squares line? d. If you subtract 4 from each value of Y, what is the

new least squares line?

66. The file P10_66.xlsx contains monthly cost accounting data on overhead costs, machine hours, and direct material costs. This problem will help you explore the meaning of R2 and the relationship between R2 and correlations. a. Create a table of correlations between the

individual variables.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

b. If you ignore the two explanatory variables Machine Hours and Direct Material Cost and predict each Overhead Cost as the mean of Overhead Cost, then a typical “error” is Overhead Cost minus the mean of Overhead Cost. Find the sum of squared errors using this form of prediction, where the sum is over all observations.

c. Now run three regressions: (1) Overhead Cost (OHCost) versus Machine Hours, (2) OHCost versus Direct Material Cost, and (3) OHCost versus both Machine Hours and Direct Material Cost. (The first two are simple regressions, the third is a multiple regression.) For each, find the sum of squared residuals, and divide this by the sum of squared errors from part b. What is the relationship between this ratio and the associated R2 for that equation? (Now do you see why R2 is referred to as the percentage of variation explained?)

d. For the first two regressions in part c, what is the relationship between R2 and the corresponding correlation between the dependent and explanatory variable? For the third regression it turns out that the R2 can be expressed as a complicated function of all three correlations in part a. That is, the function involves not just the correlations between the dependent variable and each explanatory variable, but also the correlation between the explanatory variables. Note that this R2 is not just the sum of the R2 values from the first two regressions in part c. Why do you think this is true, intuitively? However, R2 for the multiple regression is still the square of a correlation—namely, the correlation between the observed and predicted values of OHCost. Verify that this is the case for these data.

67. The file P10_67.xlsx contains hypothetical starting salaries for MBA students directly after graduation. The file also lists their years of experience prior to the MBA program and their class rank in the MBA program (on a 0−100 scale). a. Estimate the regression equation with Salary as

the dependent variable and Experience and Class Rank as the explanatory variables. What does this equation imply? What does the standard error of estimate se tell you? What about R

2? b. Repeat part a, but now include the interaction

term Experience*Class Rank (the product) in the k (the product) in the k equation as well as Experience and Class Rank individually. Answer the same questions as in part a. What evidence is there that this extra variable (the interaction variable) is worth including? How do you interpret this regression equation? Why might you expect the interaction to be present in real data of this type?

68. In a simple regression of Y versus Y versus Y X, what is the relationship between the estimated slope, labeled b, and

the correlation between Y and Y and Y X, labeled r? Are they the same? Do they always have the same sign? Is it possible for r to be close to 1 and for r to be close to 1 and for r b to be close to 0? Is it possible for r to be close to 0 and for r to be close to 0 and for r b to be large? Explore this with simulation in the following way. Choose any values a and b for the intercept and slope of a linear relationship between X and X and X Y and choose any Y and choose any Y value s for the standard error of estimate. Then generate a set of X values randomly. It doesn’t really matter X values randomly. It doesn’t really matter X how you do this, but for this problem, generate them from a normal distribution with mean 100 and standard deviation 10. Then generate each Y value from the Y value from the Y equation Y = a + bXbXb + e, where the error e is normally distributed with mean 0 and standard deviation s. Given your generated data, calculate the estimated slope of estimated slope of estimated the regression line with Excel’s SLOPE function and calculate the correlation between Y and Y and Y X with Excel’s X with Excel’s X CORREL function. Once you have this setup, you can press the F9 key to get new results, or you can change your values of a, b, and s. Based on the simulated results, can you answer the original questions? [Hint: Remember Equation (10.3).]

69. Wilhoit Company has observed that there is a linear relationship between indirect labor expense and direct labor hours. Data for direct labor hours and indirect labor expense for 18 months are given in the file P10_69.xlsx. At the start of month 7, all cost categories in the Wilhoit Company increased by 10%, and they stayed at this level for months 7 through 12. Then at the start of month 13, another 10% across- the-board increase in all costs occurred, and the company operated at this price level for months 13 through 18. a. Plot the data. Verify that the relationship between

indirect labor expense and direct labor hours is approximately linear within each six-month period. Use regression (three times) to estimate the slope and intercept during months 1 through 6, during months 7 through 12, and during months 13 through 18.

b. Use regression to fit a straight line to all 18 data points simultaneously. What values of the slope and intercept do you obtain?

c. Perform a price level adjustment to the data and re-estimate the slope and intercept using all 18 data points. Assuming no cost increases for month 19, what is your prediction for indirect labor expense if there are 35,000 direct labor hours in month 19?

d. Interpret your results. What causes the difference in the linear relationship estimated in parts b and c?

70. Bohring Company manufactures a sophisticated radar unit that is used in a fighter aircraft built by Seaways Aircraft. The first 50 units of the radar unit have been completed, and Bohring is preparing to submit a proposal to Seaways Aircraft to manufacture the

10-8 Conclusion 479 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Firm Chair Company manufactures customized wood furniture and sells the furniture in large quantities to major furniture retailers. Jim Bolling has recently been assigned to analyze the company’s pricing policy. He has been told that quantity discounts were usually given. For example, for one type of chair, the pricing changed at quantities of 200 and 400—that is, these were the price breaks, where the marginal cost of the next chair changed.

For this type of chair, the file C10_01.xlsx contains the quantity and total price to the customer for 81 orders. Use regression to help Jim discover the pricing structure that Firm Chair evidently used. (Note: A linear regression of Total Price versus Quantity will give you a “decent” fit, but you can do much better by introducing appropriate variables into the regression.)

Sales of single-family houses have been brisk in Mid City this year. This has especially been true in older, more established neighborhoods, where housing is relatively inexpensive compared to the new homes being built in the newer neighborhoods. Nevertheless, there are also many families who are willing to pay a higher price for the prestige of living in one of the newer neighborhoods. The file C10_02.xlsx contains data on 128 recent

sales in Mid City. For each sale, the file shows the neighborhood (1, 2, or 3) in which the house is located, the number of offers made on the house, the square footage, whether the house is made primarily of brick, the number of bathrooms, the number of bedrooms, and the selling price. Neighborhoods 1 and 2 are more traditional neighborhoods, whereas neighborhood 3 is a newer, more prestigious neighborhood.

C A S E 10.1 QUANTITY DISCOUNTS AT FIRM CHAIR COMPANY

C A S E 10.2 HOUSING PRICE STRUCTURE IN MID CITY

480 Chapter 10 Regression Analysis: Estimating Relationships

next 50 units. Bohring wants to submit a competitive bid, but at the same time, it wants to ensure that all the costs of manufacturing the radar unit are fully covered. As part of this process, Bohring is attempting to develop a standard for the number of labor hours required to manufacture each radar unit. Developing a labor standard has been a continuing problem in the past. The file P10_70.xlsx lists the number of labor hours required for each of the first 50 units of production. Bohring accountants want to see whether regression analysis, together with the concept of learning curves, can help solve the company’s problem.

71. Sometimes it is instructive to generate random data that have a given relationship and then use regression on the generated data to see if the estimated regression

is basically the same as that used to generate the data in the first place. a. Let X be normally distributed with mean X be normally distributed with mean X 100 and

standard deviation 10, and let Y equal 100 + 5X plus a normally distributed random residual with mean 0 and standard deviation 40. Generate 50 observations.

b. Copy the random data and paste as values in another range of the worksheet. Then run the regression on the copy (the frozen values).

c. Repeat part b several times to see if you get basically the same regression results each time. That is, each run should be on a different set of different set of different frozen data.

d. Write a short report of your method and your findings.findings.f

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

481Case 10.4 Investing for Retirement 481

Financial advisors offer many types of advice to customers, but they generally agree that one of the best things people can do is invest as much as possible in tax-deferred retirement plans. Not only are the earnings from these investments exempt from income tax (until retirement), but the investment itself is tax-exempt. This means that if a person invests, say, $10,000 of his $100,000 income in a tax-deferred retirement plan, he pays income tax that year on only $90,000 of his income. This is probably the best method available to most people for avoiding tax payments. However, which group takes advantage of this attractive investment

opportunity: everyone, people with low salaries, people with high salaries, or who?

The file C10_04.xlsx lets you investigate this question. It contains data on 194 (hypothetical) couples: number of dependent children, combined annual salary of husband and wife, current mortgage on home, average amount of other (nonmortgage) debt, and percentage of combined income invested in tax-deferred retirement plans (assumed to be limited to 15%, which is realistic). Using correlations, scatterplots, and regression analysis, what can you conclude about the tendency of this group of people to invest in tax-deferred retirement plans?

C A S E 10.4 INVESTING FOR RETIREMENT

Howie’s Bakery is one of the most popular bakeries in town, and the favorite at Howie’s is French bread. Each day of the week, Howie’s bakes a number of loaves of French bread, more or less according to a daily schedule. To maintain its fine reputation, Howie’s gives away to charity any loaves not sold on the day they are baked. Although this occurs frequently, it is also common for Howie’s to run out of French bread on any given day—more demand than supply. In this case, no extra loaves are baked that day; the customers have to go elsewhere (or come back to Howie’s the next day) for their French bread. Although French bread at Howie’s is always popular, Howie’s stimulates demand by running occasional 10% off sales.

Howie’s has collected data for 20 consecutive weeks, 140 days in all. These data are listed in the

file C10_03.xlsx. The variables are Day (Monday– Sunday), Supply (number of loaves baked that day), On Sale (whether French bread is on sale that day), and Demand (loaves actually sold that day). Howie’s would like you to see whether regression can be used successfully to estimate Demand from the other data in the file. Howie reasons that if these other variables can be used to predict Demand, then he might be able to determine his daily supply (number of loaves to bake) in a more cost-effective way.

How successful is regression with these data? Is Howie correct that regression can help him determine his daily supply? Is any information missing that would be useful? How would you obtain it? How would you use it? Is this extra information really necessary?really necessary?really

C A S E 10.3 DEMAND FOR FRENCH BREAD AT HOWIE’S BAKERY

Use regression to estimate and interpret the pricing structure of houses in Mid City. Here are some considerations.

1. Do buyers pay a premium for a brick house, all else being equal?

2. Is there a premium for a house in neighborhood 3, all else being equal?

3. Is there an extra premium for a brick house in neighborhood 3, in addition to the usual premium for a brick house?

4. For purposes of estimation and prediction, could neighborhoods 1 and 2 be collapsed into a single “older” neighborhood?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

482

PREDICTING MOVIE REVENUES

In the opener for Chapter 3, we discussed the article by Simonoff and Sparrow (2000) that examined movie revenues for 311 movies released in 1998 and late 1997. We saw that movie revenues were related to several variables, including genre, Motion Picture Association of America (MPAA) rating, country of origin, number of stars in the cast, whether the movie was a sequel, and whether the movie was released during a few choice times. In Chapter 3, we were limited to looking at summary measures and charts of the data. Now that we are studying regression, we can look further into the analysis performed by Simonoff and Sparrow. Specifically, they examined whether these variables, plus others, are effective in predicting movie revenues.

The authors report the results from three multiple regression models. All of these used the logarithm of the total U.S. gross revenue from the film as the dependent variable. (They used the logarithm because the distribution of gross revenues is very positively skewed.) The first model used only the prerelease variables listed in the previous paragraph. The values of these variables were all known prior to the movie’s release. Therefore, the purpose of this model was to see how well revenues could be predicted before the movie was released.

The second model used the variables from model 1, along with two variables that could be observed after the first week of the movie’s release: the first weekend gross and the number of screens the movie opened on. (Actually, the logarithms of these latter two variables were used, again because of positive skewness. Also, the authors found it necessary to run two separate regressions at this stage—one for movies that opened on

Regression Analysis: Statistical Inference

C H A P T E R

11

iz u se

k/ Iz

a b

e la

H a b

u r/

iS to

c kp

h o to

.c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Regression Analysis: Statistical Inference 483

10 or fewer screens, and another for movies that opened on more than 10 screens.) The idea here was that the success or failure of many movies depends to a large extent on how they do right after they are released. Therefore, it was expected that this information would add significantly to the predictive power of the regression model.

The third model built on the second by adding an additional explanatory variable: the number of Oscar nominations the movie received for key awards (Best Picture, Best Director, Best Actor, Best Actress, Best Supporting Actor, and Best Supporting Actress). This information is often not known until well after a movie’s release, but it was hypothesized that Oscar nominations would lead to a significant increase in a movie’s revenues, and that a regression model with this information could lead to very different predictions of revenue.

Simonoff and Sparrow found that the coefficients of the first regression model were in line with the box plots shown earlier in Figure 3.1 of Chapter 3. For example, the variables that measured the number of star actors and actresses were both positive and significant, indicating that star power tends to lead to larger revenues. However, the predictive power of this model was poor. Given its standard error of prediction (and taking into account that the logarithm of revenue was the dependent variable), the authors stated that “the predictions of total grosses for an individual movie can be expected to be off by as much as a multiplicative factor of 100 high or low.” It appears that there is no way to predict which movies will succeed and which will fail based on prerelease data only.

The second model added considerable predictive power. The regression equations indicated that gross revenue is positively related to first weekend gross and negatively related to the number of opening screens, both of these variables being significant. As for prediction, the factor of 100 mentioned in the previous paragraph decreased to a factor of 10 (for movies with 10 or fewer opening screens) or 2 (for movies with more than 10 opening screens). This is still not perfect—predictions of total revenue made after the movie’s first weekend can still be fairly far off—but this additional information about initial success certainly helps.

The third model added only slightly to the predictive power, primarily because so few of the movies (10 out of 311) received Oscar nominations for key awards. However, the predictions for those that did receive nominations increased considerably. For example, the prediction for the multiple Oscar nominee Saving Private Ryan, based on the second model, was 194.622 (millions of dollars). Its prediction based on the third model increased to a whopping 358.237. (Interestingly, the prediction for this movie from the first model was only 14.791, and its actual gross revenue was 216.119. Perhaps the reason Saving Private Ryan did not make as much as the third model predicted was that the Oscar nominations were announced about nine months after its release—too long after release to do much good.)

Simonoff and Sparrow then used their third model to predict gross revenues for 24 movies released in 1999—movies that were not in the data set used to estimate the regression model. They found that 21 out of 24 of the resulting 95% prediction intervals captured the actual gross revenues, which is about what would be expected. However, many of these prediction intervals were extremely wide, and several of the predictions were well above or below the actual revenues. The authors conclude by quoting Tim Noonan, a former movie executive: “Since predicting gross is extremely difficult, you have to serve up a [yearly] slate of movies and know that over time you’ll have 3 or 4 to the left and 2 or 3 to the right. You must make sure you are doing things that mitigate your downside risk.” ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

484 Chapter 11 Regression Analysis: Statistical Inference

11-1 INTRODUCTION The previous chapter discussed how to �t a regression equation to a set of points by using the least squares method. The purpose of this regression equation is to provide a good �t to the points in the sample so that you can understand the relationship between a depend- ent variable and one or more explanatory variables. The entire emphasis of the discussion in the previous chapter was on �nding a regression model that �ts the observations in the sample. In this chapter we take a slightly different point of view. We assume that the observations in the sample are taken from some larger population. For example, the sam- ple of 50 regions from the Pharmex drugstore example could represent a sample of all the regions where Pharmex does business. In this case, we might be interested in the relation- ship between variables in the entire population, not just in the sample.

There are two basic problems we discuss in this chapter. The �rst has to do with a population regression model. We want to infer its characteristics—that is, its intercept and slope term(s)—from the corresponding terms estimated by least squares. We also want to know which explanatory variables belong in the equation. There are typically a large num- ber of potential explanatory variables, and it is often not clear which of these do the best potential explanatory variables, and it is often not clear which of these do the best potential job of explaining variation in the dependent variable. In addition, we would like to infer whether there is any population regression equation worth pursuing. It is possible that the potential explanatory variables provide very little explanation of the dependent variable.

The second problem we discuss in this chapter is prediction. We touched on the predic- tion problem in the previous chapter, primarily in the context of predicting the dependent variable for part of the sample held out for validation purposes. In reality, we had the values of the dependent variable for that part of the sample, so prediction was not really necessary. Now we go beyond the sample and predict values of the dependent variable for new obser- vations. There is no way to check the accuracy of these predictions, at least not right away, because the values of the dependent variable are not yet known. However, it is possible to calculate prediction intervals to measure the accuracy of the predictions.

11-2 THE STATISTICAL MODEL To perform statistical inference in a regression context, a statistical model is required; that is, we must �rst make several assumptions about the population. Throughout the analysis these assumptions remain exactly that—they are only assumptions, not facts. These assumptions rep- resent an idealization of reality, and as such, they are never likely to be entirely satis�ed for the population in any real study. From a practical point of view, all we can ask is that they represent a close approximation to reality. If this is the case, then the analysis in this chapter is valid. But if the assumptions are grossly violated, statistical inferences that are based on these assump- tions should be viewed with suspicion. Although we can never be entirely certain of the validity of the assumptions, there are ways to check for gross violations, and we discuss some of these.

Regression Assumptions

■ There is a population regression line. It joins the means of the dependent variable for all values of the explanatory variables. For any �xed values of the explanatory variables, the mean of the errors is zero.

■ For any values of the explanatory variables, the variance (or standard deviation) of the dependent variable is a constant, the same for all such values.

■ For any values of the explanatory variables, the dependent variable is normally distributed.

■ The errors are probabilistically independent.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-2 The Statistical Model 485

Because these assumptions are so crucial to the regression analysis that follows, it is impor- tant to understand exactly what they mean. Assumption 1 is probably the most important. It implies that for some set of explanatory variables, there is an exact linear relationship in the population between the means of the dependent variable and the values of the explana- tory variables.

More precisely, let Y be the dependent variable, and assume that there are k explana- tory variables, X1 through XkXkX . Let μY |X1, …, XkXkX be the mean of all Y ’s for any �xed values of the X ’s. Then assumption 1 implies that there is an exact linear relationship between the

1 s. Then assumption 1 implies that there is an exact linear relationship between the

1 k s. Then assumption 1 implies that there is an exact linear relationship between the

k

mean μY |X1, …, XkXkX and the X ’s. That is, it implies that there are coef�cients α and β1 through βk such that the following equation holds for all values of the

1 such that the following equation holds for all values of the

1 k such that the following equation holds for all values of the

k X ’s:

Population Regression Line Joining Means μY|Y|Y X1, …, XkXkX = α + β1X1 +

… + βkXkXk kXkX (11.1)

Population Regression Line with Error Y = α + β1X1 + … + βkXkXk kXkX + ε (11.2)

These explanatory variables could be original variables or variables you create, such as dummies, interactions, or nonlinear transformations.

It is common to use Greek letters to denote population para meters and regular letters for their sample estimates.

In the terminology of the previous chapter, α is the intercept term, and β1 through βk are the slope terms. We use Greek letters for these coef�cients to denote that they are unobservable population parameters. Assumption 1 implies the existence of a population regression equation and the corresponding α and β’s. However, it tells us nothing about the values of these parameters. They still need to be estimated from sample data, using the least squares method to do so.

Equation (11.1) says that the means of the Y ’s lie on the population regression line. However, it is clear from a scatterplot that most individual Y ’s do not lie on this line. The vertical distance from any point to the line is called an error. The error for any point, labeled ε, is the difference between Y and μY |X1, …, XkXkX , that is,

Y = μY |X1, …, XkXkX + ε

By substituting the assumed linear form for μY |X1, …, XkXkX , we obtain Equation (11.2). This equation states that each value of Y is equal to a �tted part plus an error. The �tted part is the

1 is equal to a �tted part plus an error. The �tted part is the

1 k is equal to a �tted part plus an error. The �tted part is the

k Y is equal to a �tted part plus an error. The �tted part is the Y

linear expression α + β1X1 + … + βkXkXk kXkX . The error ε is sometimes positive, in which case the point is above the regression line, and sometimes negative, in which case the point is below the regression line. The last part of assumption 1 states that these errors average to zero in the population, so that the positive errors exactly cancel the negative errors.

Note that an error ε is not quite the same as a residual e. An error is the vertical distance from a point to the (unobservable) population regression line. A residual is the vertical distance from a point to the estimated regression line. Residuals can be calculated from estimated regression line. Residuals can be calculated from estimated observed data; errors cannot.

Assumption 2 concerns variation around the population regression line. Speci�cally, it states that the variation of the Y ’s about the regression line is the same, regardless of the values of the X’s. A technical term for this property is homoscedasticity. A simpler term is constant error variance. In the Pharmex example (Example 10.1), constant error variance

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

486 Chapter 11 Regression Analysis: Statistical Inference

implies that the variation in Sales values is the same regardless of the value of Promote. As another example, recall the Bendrix manufacturing example (Example 10.2). There we related overhead costs (Overhead) to the number of machine hours (Machine Hours) and the number of production runs (Production Runs). Constant error variance implies that overhead costs vary just as much for small values of Machine Hours and Production Runs as for large values—or any values in between.

There are many situations where assumption 2 is questionable. The variation in Y often increases as X increases—a violation of assumption 2. We presented an example of this in Figure 10.10 (repeated here in Figure 11.1), which is based on customer spend- ing at a mail-order company. This scatterplot shows the amount spent versus salary for a sample of the company’s customers. Clearly, the variation in the amount spent increases as salary increases, which makes intuitive sense. Customers with small salaries have little disposable income, so they all tend to spend small amounts for mail-order items. Customers with large salaries have more disposable income. Some of them spend a lot of it on mail-order items and some spend only a little of it—hence, a larger variation. Scatterplots with this “fan” shape are not at all uncommon in real studies, and they exhibit a clear violation of assumption 2.1 Scatterplots with this “fan” shape are not at all uncommon in real studies, and they

1 Scatterplots with this “fan” shape are not at all uncommon in real studies, and they

We say that the data in this graph exhibit heteroscedasticity, or more simply, nonconstant error variance. These terms are sum- marized in the following box.

The easiest way to detect nonconstant error variance is through a visual inspection of a scatterplot. You create a scatterplot of the dependent variable versus an explanatory vari- able X and see whether the points vary more for some values of X and see whether the points vary more for some values of X X than for others. You can

1The fan shape in Figure 11.1 is probably the most common form of nonconstant error variance, but it is not the only possible form.

Homoscedasticity means that the variability of Y values is the same for all X values.

Heteroscedasticity means that the variability of Y values is larger for some X values than for others.

Sca�erplot of Amount Spent vs Salary of Spending Data

5000

6000

7000

0

1000

2000

3000

4000

0 20000 40000 60000 80000 100000 120000 140000 160000 180000

A m

o u

n t

Sp en

t/ Sp

en d

in g

D at

a

Salary/Spending Data

Figure 11.1 Illustration of Nonconstant Error Variance

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-2 The Statistical Model 487

also examine the residuals with a residual plot, where residual values are on the vertical axis and some other variable (Y or one of the X’s) is on the horizontal axis. If the residual plot exhibits a fan shape or other evidence of nonconstant error variance, this also indicates a violation of assumption 2.

Assumption 3 is equivalent to stating that the errors are normally distributed. You can check this by forming a histogram (or a Q-Q plot) of the residuals. If assumption 3 holds, the histogram should be approximately symmetric and bell-shaped, and the points in the Q-Q plot should be close to a 45° line.2 the histogram should be approximately symmetric and bell-shaped, and the points in the

2 the histogram should be approximately symmetric and bell-shaped, and the points in the

But if there is an obvious skewness, too many residuals more than, say, two standard deviations from the mean, or some other nonnormal property, this indicates a violation of assumption 3.

Finally, assumption 4 requires probabilistic independence of the errors. Intuitively, this assumption means that information on some of the errors provides no information on the values of other errors. For example, if you are told that the overhead costs for months 1 through 4 are all above the regression line (positive residuals), you cannot infer anything about the residual for month 5 if assumption 4 holds.

For cross-sectional data, there is generally little reason to doubt the validity of assumption 4 unless the observations are ordered in some particular way. For cross- sectional data assumption 4 is usually taken for granted. However, for time series data, assumption 4 is often violated. This is because of a property called autocorrelation. For now, we simply mention that one output given automatically in many regression packages is the Durbin–Watson statistic. The Durbin–Watson statistic is one measure of autocorrelation, so it is one measure of the extent to which assumption 4 is violated. We brie�y discuss this Durbin–Watson statistic toward the end of this chapter and in the next chapter.

One other assumption is important for numerical calculations. No explanatory variable can be an exact linear combination of any other explanatory variables. Another way of statexact linear combination of any other explanatory variables. Another way of statexact - ing this is that there should be no exact linear relationship between any set of explanatory variables. This would be violated, for example, if one variable were an exact multiple of another, or if one variable were equal to the sum of several other variables. More generally, the violation occurs if one of the explanatory variables can be written as a weighted sum of several of the others. This is called exact multicollinearity.

If exact multicollinearity exists, it means that there is redundancy in the data. One of the X’s could then be eliminated without any loss of information. Here is a simple exam- ple. Suppose that Machine Hours1 is machine hours measured in hours, and Machine Hours2 is machine hours measured in hundreds of hours. Then it is clear that these two variables contain exactly the same information, and either of them could (and should) be eliminated.

As another example, suppose that Ad1, Ad2, and Ad3 are the amounts spent on radio ads, television ads, and newspaper ads. Also, suppose that Total Ad is the amount spent on radio, television, and newspaper ads combined. Then there is an exact linear relationship among these variables:

Total Ad = Ad1 + Ad2 + Ad3

In this case there is no need to include Total Ad in the analysis because it contains no infor- mation that is not already contained in the variables Ad1, Ad2, and Ad3. Therefore, Total Ad should be eliminated from the analysis.

2A Q-Q (quantile-quantile) plot is used to detect nonnormality. It is available in StatTools from the Normality Tests dropdown list. Nonnormal data often produce a Q-Q plot that is close to a 45° line in the middle of the plot but deviates from this line in one or both of the tails.

Assumption 4 (independence of residuals) is usually in doubt only for time series data.

Exact multicollinearity means that at least one of the explanatory variables is redundant and is not needed in the regression equation.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

488 Chapter 11 Regression Analysis: Statistical Inference

Generally, it is fairly simple to spot an exact linear relationship such as these, and then to eliminate it by excluding the redundant variable from the analysis. However, if you do not spot the relationship and try to run the regression analysis with the redundant variable not spot the relationship and try to run the regression analysis with the redundant variable not included, regression packages will typically respond with an error message. If the package interrupts the analysis with an error message containing the words “exact multicollinearity” or “linear dependence,” you should look for a redundant explanatory variable.

Although this problem can be a nuisance, it is usually caused by an oversight and can be �xed easily by eliminating a redundant variable. A more common and serious problem is multicollinearity, where explanatory variables are highly, but not exactly, correlated. A typical example is an employee’s years of experience and age. Although these two vari- ables are not equal for all employees, they are likely to be highly correlated. If they are both included as explanatory variables in a regression analysis, the software will not issue any error messages, but the estimates it produces can be unreliable and dif�cult to interpret. We will discuss multicollinearity in more detail later in this chapter.

11-3 INFERENCES ABOUT THE REGRESSION COEFFICIENTS In this section we explain how to make inferences about the population regression coef-In this section we explain how to make inferences about the population regression coef-In this section we explain how to make inferences about the population regression coef �cients from sample data. We begin by making the assumptions discussed in the previous section. In particular, the �rst assumption states that there is a population regression line. Equation (11.2) for this line is repeated here:

Y = α + β1X1 + … + βkXkXk kXkX + ε

We refer to α and the β’s collectively as the regression coef�cients. Again, Greek letters are used to indicate that these quantities are unknown and unobservable. There is one other unknown constant in the model: the variance of the errors. Regression assumption 2 states that the errors have a constant variance, the same for all values of the X’s. We label this constant variance σ2. Equivalently, the common standard deviation of the errors is σ.

This is how it looks in theory. There is a �xed set of explanatory variables, and given these variables, the problem is to estimate α, the β’s, and σ. In practice, however, it is not usually this straightforward. In real regression applications, the choice of relevant explana- tory variables is almost never obvious. There are at least two guiding principles: relevance and data availability. You certainly want variables that are related to the dependent variable. The best situation is when there is an established economic or physical theory to guide you. For example, economic theory suggests that the demand for a product (dependent variable) is related to its price (possible explanatory variable). But there are not enough established theories to cover every situation. You often have to use the available data, plus some trial and error, to determine a useful set of explanatory variables. In this sense, it is usually useful set of explanatory variables. In this sense, it is usually useful pointless to search for one single “true” population regression equation. Instead, you typi- cally estimate several competing models, each with a different set of explanatory variables, and ultimately select one of them as being the most useful.

Deciding which explanatory variables to include in a regression equation is probably the most dif�cult part of any applied regression analysis. Available data sets frequently offer an overabundance of potential explanatory variables. In addition, it is possible and often useful to create new variables from original variables, such as their logarithms. So where do you stop? Is it best to include every conceivable explanatory variable that might be related to the dependent variable? One overriding principle is parsimony—explaining the most with the least. For example, if a dependent variable can be explained just as well (or nearly as well) with two explanatory variables as with 10 explanatory variables, the principle of parsimony says to use only two. Models with fewer explanatory variables are generally easier to interpret, so they are preferred whenever possible.

Typically, the most challenging part of a regression analysis is deciding which explanatory variables to include in the regression equation.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-3 Inferences About the Regression Coefficients 489

Before you can determine which equation has the best set of explanatory variables, however, you must be able to estimate the unknown parameters for a given equation. That is, for a given set of explanatory variables X1 through XkXkX , you must be able to estimate α, the β’s, and σ. Fortunately, you learned how to do this in the previous chapter. The estimates of α and the β’s are the least squares estimates of the intercept and slope terms. For example, the 36 months of overhead data in the Bendrix example were used to estimate the equation

Predicted Overhead = 3997 + 43.54Machine Hours + 883.62Production Runs

This implies that the least squares estimates of α, β1, and β2 are 3997, 43.54, and 883.62. Furthermore, because the residuals are really estimates of the errors, the standard error of estimate se is an estimate of σ. For the same overhead equation, this estimate is se = $4109.

However, you learned in Chapter 8 that there is more to statistical estimation than �nd- ing point estimates of population parameters. Each potential sample from the population typically leads to different point estimates. For example, if Bendrix estimates the equation different point estimates. For example, if Bendrix estimates the equation different for overhead from a different 36-month period (or possibly from another of its plants), the results will almost certainly be different. Therefore, we now discuss how these point esti- mates vary from sample to sample.

11-3a Sampling Distribution of the Regression Coefficients

The key idea is again sampling distributions. Recall that the sampling distribution of any esti- mate derived from sample data is the distribution of this estimate over all possible samples. This idea can be applied to the least squares estimate of a regression coef�cient. For example, the sampling distribution of b1, the least squares estimate of β1, is the distribution of b1’s you would see if you observed many samples and ran a least squares regression on each of them.

Fortunately, mathematicians have derived the required sampling distributions. We state the main result as follows. Let β be any of the β’s, and let b be the least squares estimate of β. If the regression assumptions hold, the standardized value (b − β)/sb has a t distribution t distribution t with n − k − 1 degrees of freedom. Here, k is the number of explanatory variables included k is the number of explanatory variables included k in the equation, and sb is the estimated standard deviation of the sampling distribution of b.

This result has three important implications. First, the estimate b is unbiased in the unbiased in the unbiased sense that its mean is β, the true but unknown value of the slope. If the b’s were estimated from repeated samples, some would underestimate β and others would overestimate β, but on average they would be on target.

Second, the estimated standard deviation of b is labeled sb. It is usually called the standard error of the regression coef�cient, or more simply, the standard error of b.

The principle of parsimony is to explain the most with the least. It favors a model with fewer explanatory variables, assuming that this model explains the dependent variable almost as well as a model with additional explanatory variables.

Sampling Distribution of a Regression Coefficient

Assuming that the regression assumptions are valid, the standardized value

t = b − β

sb

has a t distribution with t distribution with t n − k − 1 degrees of freedom.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

490 Chapter 11 Regression Analysis: Statistical Inference

This standard error is related to the standard error of estimate se, but it is not the same. Generally, the formula for sb is quite complicated, and it is not shown here, but its value is printed in all standard regression outputs, including those from StatTools. It measures how

much the b’s would vary from sample to sample. A small value of sb is preferred—it means that b is a more accurate estimate of the true coef�cient β.

Finally, the shape of the distribution of b is symmetric and bell-shaped. The relevant distribu- tion is the t distribution with n − k − 1 degrees of freedom.

We have stated this result for a typical coef�- cient of one of the X’s. These are usually the coef-’s. These are usually the coef-’s. These are usually the coef �cients of most interest. However, exactly the same result holds for the intercept term α. Now we illustrate how this sampling distribution is used.

Standard Errors in Regression There are two quite different standard errors in regres- sion outputs. The standard error of estimate, usually shown at the top of the output, is a measure of the error you are likely to make when you use the regres- sion equation to predict a value of Y. In contrast, the standard errors of the regression coefficients measure the accuracy of the individual coefficients.

F u n da m e n ta l I n s i g h t

E X A M P L E 11.1 EXPLAINING OVERHEAD COSTS AT BENDRIX

This example is a continuation of the Bendrix manufacturing example from the previous chapter. As before, the dependent variable is Overhead and the explanatory variables are Machine Hours and Production Runs. What inferences can be made about the regres- sion coefficients?

Objective To use standard regression output to make inferences about the regression coefficients of machine hours and production runs in the equation for overhead costs.

Solution The output from StatTools’s Regression procedure is shown in Figure 11.2. (See the file Overhead Costs.xlsx.) This output is practically identical to regression outputs from all other statistical software packages. The estimates of the regression coefficients appear

A B C D E F G

Summary

Explained

Unexplained

ANOVA TOVA TOV ablA TablA T e

Mul�ple Regression for Overhead

Regression Tablgression Tablgression T e Coefficient t-Value-Value-V p-Value-Value-V

Lower Confidence Interval 95%

Upper Standard

Error

Constant

Mul�ple R

0.9308 0.8664 0.8583 4108.99309

F Mean of Squares

Sum of Squares

Degrees of Freedom

2 3614020661 1807010330 107.0261279 <0.0001

557166199.1

3996.678209 6603.650932 0.605222512 0.5492 −9438.550632 17431.90705

Machine Hours <0.0001 50.8392576136.2335386212.128874723.589483743.53639812

16883824.2233

p-Value-Value-V

Std. Err. ofd. Err. ofd. Err Es�mate

0

Row Ignored

R-Square Adjusted R-square

8 9

10

11

12

13

14

15

16

17 18

19

20

21 Produc�on Runs <0.0001 1050.959672716.276178410.7428912482.25140753883.6179252

A B C D E F

Figure 11.2 StatTools Regression Output for Bendrix Example

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-3 Inferences About the Regression Coefficients 491

under the label Coefficient in the range B19:B21. These values estimate the true, but unob- servable, population coefficients. The next column, labeled Standard Error, shows the sb values. Specifically, 3.589 is the standard error of the coefficient of Machine Hours, and 82.251 is the standard error of the coefficient of Production Runs.

Each b represents a point estimate of the corresponding β, based on this particular sample. The corresponding sb indicates the accuracy of this point estimate. For example, the point estimate of β1, the effect on Overhead of a one-unit increase in Machine Hours (when Production Runs is held constant), is 43.536. You can be about 95% confident that the true β1 is within two standard errors of this point estimate, that is, from approximately 36.357 to 50.715. Similar statements can be made for the coefficient of Production Runs and the intercept (Constant) term. ■

As with any population parameter, the sample data can be used to obtain a con�dence interval for a regression coef�cient. For example, the preceding paragraph implies that an approximate 95% con�dence interval for the coef�cient of Machine Hours extends from approximately 36.357 to 50.715. More precisely, a con�dence interval for any β is of the form

b ± t-multiple × sb where the t-multiple depends on the con�dence level and the degrees of freedom (here n − k − 1). StatTools always provides these 95% con�dence intervals for the regression coef�cients automatically, as shown in the bottom right of Figure 11.2.

11-3b Hypothesis Tests for the Regression Coefficients and p-Values

There is another important piece of information in regression outputs: the t-values for the individual regression coef�cients. These are shown in the “t-Value” column of the regres- sion output in Figure 11.2. Each t-value is the ratio of the estimated coef�cient to its stand- ard error, as shown in Equation (11.3). Therefore, it indicates how many standard errors the regression coef�cient is from zero. For example, the t-value for Machine Hours is about 12.13, so the regression coef�cient of Machine Hours, 43.536, is more than 12 of its stand- ard errors to the right of zero. Similarly, the coef�cient of Production Runs is more than 10 of its standard errors to the right of zero.

A t-value can be used in an important hypothesis test for a regression coef�cient. To motivate this test, suppose that you want to decide whether a particular explanatory variable belongs in the regression equation. A sensible criterion for making this decision is to check whether the corresponding regression coef�cient is zero. After all, if a variable’s coef�cient is zero, there is no point in including this variable in the equation because the zero coef-is zero, there is no point in including this variable in the equation because the zero coef-is zero, there is no point in including this variable in the equation because the zero coef �cient will cancel its effect on the dependent variable.

Therefore, it is reasonable to test whether a variable’s coef�cient is zero. This is usu- ally tested versus a two-tailed alternative. The null and alternative hypotheses are of the two-tailed alternative. The null and alternative hypotheses are of the two-tailed form H0H0H :β = 0 versus HaHaH :β ≠ 0. If you can reject the null hypothesis and conclude that this coef�cient is not zero, you then have an argument for including the variable in the regresnot zero, you then have an argument for including the variable in the regresnot - sion equation. Conversely, if you cannot reject the null hypothesis, you might decide to eliminate this variable from the equation.

t-value for Test of Regression Coefficient

t-value = b/sb (11.3)

The test for whether a regression coefficient is zero can be run by looking at the corresponding p-value: Reject the “equals zero” hypoth esis if the p-value is small, say, less than 0.05.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

492 Chapter 11 Regression Analysis: Statistical Inference

The t-value for a variable allows you to run this test easily. You simply compare the t-value in the regression output with a tabulated t-value and reject the null hypothesis only if the t-value from the computer output is greater in magnitude than the tabulated t-value.

Most statistical packages, including StatTools, make this test even easier to run by reporting the corresponding p-value for the test. This eliminates the need for �nding the tabulated t-value. The p-value is interpreted exactly as in Chapter 9. It is the probability (in both tails) of the relevant t distribution beyond the listed t-value. For example, refer- ring again to Figure 11.2, the t-value for Machine Hours is 12.13, and the associated p-value is less than 0.0001. This means that there is virtually no probability beyond the observed t-value. In words, you are still not exactly sure of the true coef�cient of Machine Hours, but you are virtually sure it is not zero. The same can be said for the coef�cient of Production Runs.

In practice, you typically run a multiple regression with several explanatory variables and scan their p-values. If the p-value of a variable is low, then this variable should be kept in the equation; if the p-value is high, you might consider eliminating this variable from the equation. In Section 11-5, we will discuss this include/exclude decision in greater depth and provide rules of thumb for the meaning of “low” and “high” p-values.

11-3c A Test for the Overall Fit: The ANOVA Table

The t-values for the regression coef�cients allow you to see which of the potential explana- tory variables are useful in explaining the dependent variable. But it is conceivable that none of these variables does a very good job. That is, it is conceivable that the entire group of explanatory variables explains only an insigni�cant portion of the variability of the dependent variable. Although this is the exception rather than the rule in most real applica- tions, it can happen. An indication of this is that you obtain a very small R2 value. Because R2 is the square of the correlation between the observed values of the dependent variable and the �tted values from the regression equation, another indication of a lack of �t is that this correlation (the “multiple R”) is small. In this section we state a formal procedure for testing the overall �t, or explanatory power, of a regression equation.

Suppose that the dependent variable is Y and the explanatory variables are X1 through XkXkX . Then the proposed population regression equation is

Y = α + β1X1 + … + βk XkXkX + ε

To say that this equation has absolutely no explanatory power means that the same value of Y will be predicted regardless of the values of the X’s. In this case it makes no difference which values of the X’s are used, because they all lead to the same predicted value of Y . But the only way this can occur is if all of the β’s are 0. So the formal hypothesis test in this section is H0H0H :β1 = ⋯ = βk = 0 versus the alternative that at least one of the β’s is not zero. If the null hypothesis can be rejected, as it can in the majority of applications, this means that the explanatory variables as a group provide at least some explanatory power. These hypotheses are summarized as follows.

At �rst glance, it might appear that this null hypothesis can be tested by looking at the individual t-values. If they are all small (statistically insigni�cant), then the null hypothesis of no �t cannot be rejected; otherwise, it can be rejected. However, as you will see in the next section, it is possible, because of multicollinearity, to have all small t-values even though the variables as a whole have signi�cant explanatory power.signi�cant explanatory power.signi�cant

The null hypothesis is that all coefficients of the explanatory variables are zero. The alternative is that at least one of these coefficients is not zero.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-3 Inferences About the Regression Coefficients 493

The correct approach is to use an F test. This is sometimes referred to as the ANOVA (analysis of variance) test because the elements for calculating the required F-value are shown in an ANOVA table for regression. In general, an ANOVA table analyzes different sources of variation. In the case of regression, the variation in question is the variation of the dependent variable Y . The total variation of this variable is the sum of squared devia- tions about the mean and is labeled SST (sum of squares total).SST (sum of squares total).SST

SST = a (YiYiY − Y )2 The ANOVA table splits this total variation into two parts, the part explained by the regresexplained by the regresexplained - sion equation, and the part left unexplained. The unexplained part is the sum of squared residuals, usually labeled SSE (sum of squared errors):SSE (sum of squared errors):SSE

SSESES = a e2i = a (YiYiY − ŶiYiY )2 The explained part is then the difference between the total and unexplained variation. It is usually labeled SSR (sum of squares due to regression):

SSRSRS = SST − SSESES

The F test is a formal procedure for testing whether the explained variation is large com- pared to the unexplained variation. Speci�cally, each of these sources of variation has an associated degrees of freedom (dfdfd ). For the explained variation, dfdfd = k, the number of explanatory variables. For the unexplained variation, dfdfd = n − k − 1, the sample size minus the total number of coef�cients (including the intercept term). The ratio of either sum of squares to its degrees of freedom is called a mean square, or MSMSM . The two mean squares in this case are MSMSM RSRS and MSMSM ESES , given by

MSMSM RSRS = SSRSRS k

and

MSMSM ESES = SSESES n − k − 1

Note that MSMSM ESES is the square of the standard error of estimate, that is,

MSMSM ESES = s2e Finally, the ratio of these mean squares is the required F-ratio for the test:

F-ratio = MSMSM RSRS MSMSM ESES

When the null hypothesis of no explanatory power is true, this F-ratio has an F distribution with k and n − k − 1 degrees of freedom. If the F-ratio is small, the explained variation is small relative to the unexplained variation, and there is evidence that the regression equa- tion provides little explanatory power. But if the F-ratio is large, the explained variation is large relative to the unexplained variation, and you can conclude that the equation does have at least some explanatory power.

As usual, the F-ratio has an associated p-value that allows you to run the test easily. In this case the p-value is the probability to the right of the observed right of the observed right F-ratio in the appropriate F distribution. This p-value is reported in most regression outputs, along with the elements that lead up to it. If it is suf�ciently small, less than 0.05, say, then you can conclude that the explanatory variables as a whole have at least some explanatory power.

The ANOVA table is part of the StatTools output for any regression run. It appeared for the Bendrix example in Figure 11.2, which is repeated for convenience in Figure 11.3.

The MSE shown in the ANOVA table of regression output is always the square of the standard error of estimate.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

494 Chapter 11 Regression Analysis: Statistical Inference

The ANOVA table is in rows 13 through 15. The degrees of freedom are in column B, the sums of squares are in column C, the mean squares are in column D, the F-ratio is in cell E14, and its associated p-value is in cell F14. As predicted, this F-ratio is “off the charts,” and the p-value is practically zero.

This information wouldn’t be much comfort for the Bendrix manager who is trying to understand the causes of variation in overhead costs. This manager already knows that machine hours and production runs are related positively to overhead costs—everyone in the company knows that. What he really wants is a set of explanatory variables that yields a high R2 and a low se. The low p-value in the ANOVA tables does not guarantee these. All it guarantees is that Machine Hours and Production Runs are of some help in explaining variations in Overhead.

As this example indicates, the ANOVA table can be used as a screening device. If the explanatory variables do not explain a signi�cant percentage of the variation in the depend- ent variable, then you can either discontinue the analysis or search for an entirely new set of explanatory variables. But even if the F-ratio in the ANOVA table is extremely signi�cant (as it usually is), there is still no guarantee that the regression equation provides a good enough �t for practical uses. This depends on other measures such as se and R

2.

Reject the null hypothesis—and conclude that these X variables have at least some explanatory power—if the p-value from the ANOVA table is small.

A B C D E F G

Summary

Explained

Unexplained

ANOVA TOVA TOV ablA TablA T e

Mul�ple Regression for Overhead

Regression Tablgression Tablgression T e Coefficient t-Value-Value-V p-Valu-Valu-V e

Lower Confidence Interval 95%

Upper Standard

Error

Constant

Mul�ple R

0.9308 0.8664 0.8583 4108.99309

F Mean of Squares

Sum of Squares

Degrees of Freedom

2 3614020661 1807010330 107.0261279 <0.0001

557166199.1

3996.678209 6603.650932 0.605222512 0.5492 −9438.550632 17431.90705

Machine Hours <0.0001 50.8392576136.2335386212.128874723.589483743.53639812

16883824.2233

p-Valu-Valu-V e

Std. Err. ofd. Err. ofd. Err Es�mate

0

Rows Ignored

R-Square Adjusted R-square

8 9

10

11

12

13

14

15

16

17 18

19

20

21 Produc�on Runs <0.0001 1050.959672716.276178410.7428912482.25140753883.6179252

A B C D E F

Figure 11.3 StatTools Regression Output for Bendrix Example

P R O B L E M S ©

C e n g

a g

e L

e a rn

in g

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Explore the relationship between the selling prices

(Y ) and the appraised values (X ) of the 148 homes in the file P02_11.xlsx by estimating a simple linear regression equation. Find a 95% confidence interval for the model’s slope parameter (β1). What does this confidence interval tell you about the relationship between Y and X for these data?

2. The owner of the Original Italian Pizza restaurant chain would like to predict the sales of his specialty, deep-dish pizza. He has gathered data on the monthly sales of deep-dish pizzas at his restaurants and observations on other potentially relevant variables for each of his 15 outlets in central Indiana. These data are provided in the file P10_04.xlsx. a. Estimate a multiple regression model between the

quantity sold (Y ) and the explanatory variables in columns C–E.

b. Is there evidence of any violations of the key assumptions of regression analysis?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-3 Inferences About the Regression Coefficients 495

c. Which of the variables in this equation have regression coefficients that are statistically different from zero at the 5% significance level?

d. Given your findings in part c, which variables, if any, would you choose to remove from the equation estimated in part a? Why?

3. The file P02_10.xlsx contains midterm and final exam scores for 96 students in a corporate finance course. Based on a regression equation for the final exam score as a function of the midterm exam score, find a 95% confidence interval for the slope of the population regression line. State exactly what this confidence interval indicates.

4. A trucking company wants to predict the yearly maintenance expense (Y ) for a truck using the number of miles driven during the year (X1) and the age of the truck (X2X2X , in years) at the beginning of the year. The company has gathered the information given in the file P10_16.xlsx. Each observation corresponds to a particular truck. a. Estimate a multiple regression equation using the

given data. b. Find 95% confidence intervals for the regression

coefficients of X1 and X2X2X . Based on these interval estimates, which variable, if any, would you choose to remove from the equation estimated in part a? Why?

5. Based on the data in the file P02_23.xlsx from the U.S. Department of Agriculture, explore the relationship between the number of farms (X ) and the average size of a farm (Y ) in the United States. a. Use the given data to estimate a simple linear

regression model. b. Test whether there is sufficient evidence to

conclude that the slope parameter (β1) is less than zero. Use a 5% significance level.

c. Based on your finding in part b, is it possible to conclude that a linear relationship exists between the number of farms and the average farm size during the given time period? Explain.

6. An antique collector believes that the price received for a particular item increases with its age and the number of bidders. The file P10_18.xlsx contains data on these three variables for 32 recently auctioned comparable items. a. Estimate an appropriate multiple regression model

using the given data. b. Interpret the ANOVA table for this model. In

particular, does this set of explanatory variables provide at least some power in explaining the variation in price? Report a p-value for this hypothesis test.

7. The file P02_02.xlsx contains information on over 200 movies that were released during 2006–2007. Run

a regression of Total US Gross versus 7-day Gross, and then run a multiple regression of Total US Gross versus 7-day Gross and 14-day Gross. Report the 95% confidence interval for the coefficient of 7-day Gross in each equation. What exactly do these confidence intervals tell you about the effect of 7-day Gross on Total US Gross? Why are they not at all the same? What is the relevant population that this data set is a sample from?

8. The file P10_10.xlsx contains data on 150 homes that were sold recently in a particular community. a. Find a table of correlations between all of the

variables. Do the correlations between Price and each of the other variables have the sign (positive or negative) you would expect? Explain briefly.

b. Run a regression of Price versus Rooms. What does the 95% confidence interval for the coefficient of Rooms tell you about the effect of Rooms on Price for the entire population of such homes?

c. Run a multiple regression of Price versus Home Size, Lot Size, Rooms, and Bathrooms. What is the 95% confidence interval for the coefficient of Rooms now? Why do you think it can be so different from the one in part b? Based on this regression, can you reject the null hypothesis that the population regression coefficient of Rooms is zero versus a two-tailed alternative? What does this mean?

9. Suppose that a regional express delivery service company wants to estimate the cost of shipping a package (Y ) as a function of cargo type, where cargo type includes the following possibilities: fragile, semifragile, and durable. Costs for several randomly chosen packages of approximately the same weight and same distance shipped, but of different cargo types, are provided in the file P10_28.xlsx. a. Estimate an appropriate multiple regression equation

to predict the cost of shipping a given package. b. Interpret the ANOVA table for this model. In

particular, do the explanatory variables included in your equation in part a provide at least some power in explaining the variation in shipping costs? Interpret the p-value for this hypothesis test.

10. The file P10_05.xlsx contains salaries for a sample of DataCom employees, along with several variables that might be related to salary. Run a multiple regression of Salary versus Years Employed, Years Education, Gender, and Number Supervised. For each of these variables, explain exactly what the results in the Coefficient, Standard Error, t-value, and p-value columns mean. Based on the results, can you reject the null hypothesis that the population coefficient of any of these variables is zero versus a two-tailed alternative at the 5% significance level? If you can, what would you probably do next in the analysis?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

496 Chapter 11 Regression Analysis: Statistical Inference

Level B 11. A multiple regression with 36 observations and three

explanatory variables yields the ANOVA table in Table 11.1.

a. Complete this ANOVA table. b. Can you conclude at the 1% significance level that

these three explanatory variables have some power in explaining variation in the dependent variable?

12. Suppose you find the ANOVA table shown in Table 11.2 for a simple linear regression.

a. Find the correlation between X and X and X Y, assuming that the slope of the least squares line is negative.

b. Find the p-value for the test of the hypothesis of no explanatory power at all. What does it tell you in this particular case?

Table 11.1 ANOVA Table Degrees of Freedom Sum of Squares

Explained 1211 Unexplained Total 2567

Table 11.2 ANOVA Table Degrees of Freedom Sum of Squares

Explained 52 Unexplained 87 Total 1598

11-4 MULTICOLLINEARITY Recall that the coef�cient of any variable in a regression equation indicates the effect of this variable on the dependent variable, provided that the other variables in the equation remain constant. Another way of stating this is that the coef�cient represents the effect of this varia- ble on the dependent variable in addition to the effects of the other variables in the equation. In the Bendrix example, if Machine Hours and Production Runs are included in the equa- tion for Overhead, the coef�cient of Machine Hours indicates the extra amount Machine Hours explains about variation in Overhead, in addition to the amount already explained by Production Runs. Similarly, the coef�cient of Production Runs indicates the extra amount Production Runs explains about variation in Overhead, in addition to the amount already explained by Machine Hours. Therefore, the relationship between an explanatory variable X and the dependent variable X and the dependent variable X Y is not always accurately re�ected in the coef�cient of Y is not always accurately re�ected in the coef�cient of Y X; it depends on which other X’s are included or not included in the equation.

This is especially true when multicollinearity exists. By de�nition, multicollinearity is the presence of a fairly strong linear relationship between two or more explanatory vari- ables. Unfortunately, multicollinearity is quite common, and it can make regression output dif�cult to interpret.

Consider Example 11.2. It is a rather contrived example, but it is useful for illustrating the potential effects of multicollinearity.

E X A M P L E 11.2 HEIGHT VERSUS FOOT LENGTH

We want to explain a person’s height by means of foot length. The dependent variable is Height, and the explanatory variables are Right and Left, the length of the right foot and the length of the left foot, respectively. What can occur when Height is regressed on both Right and Left?

Objective To illustrate the problem of multicollinearity when both foot length variables are used in a regression for height.

Multicollinearity occurs when there is a fairly strong linear relationship among a set of explanatory variables.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-4 Multicollinearity 497

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

105

106

Parameters of foot size distribu�on

A

Mean Stdev1 Stdev2

Generic foot size 12.898 16.896 12.671 13.328

8.318 11.393

7.756 10.532 12.349 18.535

8.838 13.214 12.091 11.304 14.835

13.51 18.531 13.021 14.267 14.695 14.958

Le� 12.765 16.567 12.706 13.586

8.324 11.574

7.65 10.186 12.347 18.645

9.048 13.241 11.962

11.37 14.418 13.365

18.43 13.072 14.492 14.539 14.824

Right 12.867 16.779 12.528 13.139

8.275 11.426

8.034 10.524 12.245 18.558

9.074 13.129 11.818 11.198 14.899 13.697

18.44 13.026 14.327 14.871 15.226

Height 67.418 87.644 65.297

73.62 58.046 72.165 57.954 61.567 68.353

91.35 61.402 76.457 71.966 62.435 77.855 79.263 87.646 69.445 76.447 83.921 80.875

Le vs Right Le vs Height Right vs Height

Regression equa�on Variable Constant Le Right Sum of coeffs

SSE MSE StErr of est

R-square Mul�ple R

Correla�ons 0.996 0.935 0.941

Coeff 33.595 �0.902

3.996 3.094

1091.594 11.254

3.355

0.885 0.941

Squares

0.875 0.885

StErr 1.531 1.316 1.330

t-value 21.945 �0.685

3.005

p-value 0.0000 0.4949 0.0034

B CB C D ED E F GF G H JH JH JIH J

Parameters of regression, given generic foot size Intercept Slope StErr of Est

12.95 3.1 0.2

31.8 3.2 3.0

Figure 11.4 One Example of Height versus Foot Length

© C

e n g

a g

e L

e a rn

in g

Solution Clearly, there is no need to include both Right and Left in an equation for Height—either one of them suffices—but we include them both to make a point. It is likely that there is a large correlation between height and foot size, so you would expect this regression equation to do a good job. For example, the R2 value will probably be large. But what about the coef- value will probably be large. But what about the coef- value will probably be large. But what about the coef ficients of Right and Left? Here there is a problem. The coefficient of Right indicates the right foot’s effect on Height in addition to the effect of the left foot. This additional effect is probably minimal. That is, after the effect of Left on Height has been taken into account, the extra information provided by Right is probably minimal. But it goes the other way also. The extra effect of Left, in addition to that provided by Right, is probably also minimal.

To show what can happen numerically, we used simulation to generate a hypothetical data set of heights and left and right foot lengths. We did this so that, except for random error, height is approximately 31.8 plus 3.2 times foot length (all expressed in inches). (See Figure 11.4 and the file Heights Simulation.xlsx. (It is in the Finished Examples folder. There is no “unfinished” version of this file.) You can check the formulas in columns A–D

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

498 Chapter 11 Regression Analysis: Statistical Inference

to see how we generated the data with the desired properties.) It is clear that the correlation between Height and either Right or Left is quite large, and the correlation between Right and Left is very close to 1 (see cells G7 to G9).

The regression output when both Right and Left are entered in the equation for Height appears at the bottom right in Figure 11.4. (We entered our own matrix formulas for the regression because we wanted them to be “live,” unlike those in StatTools.) The output tells a somewhat confusing story. The multiple R and the corresponding R2 are about as expected, given the correlations between Height and either Right or Left. In particular, the multiple R is close to the correlation between Height and either Right or Left. Also, the se value is quite good. It implies that predictions of height from this regression equation will typically be off by only about three inches.

However, the coefficients of Right and Left are not at all what you might expect, given that the heights were generated as approximately 31.8 plus 3.2 times foot length. In fact, the coefficient of Left is the wrong sign—it is negative. Besides this “wrong” sign, the tip-off that there is a problem is that the t-value of Left is quite small and the cor- responding p-value is quite large. Judging by this, you might conclude that Height and Left are either not related or are related negatively. But you know from the correlation in cell G8 that both of these conclusions are wrong. In contrast, the coefficient of Right has the “correct” sign, and its t-value and associated p-value do imply statistical significance. However, this happened by chance. Slight changes in the data could change the results completely—the coefficient of Left could become negative and insignificant, or both coef-completely—the coefficient of Left could become negative and insignificant, or both coef-completely—the coefficient of Left could become negative and insignificant, or both coef ficients could become insignificant. For example, the random numbers in Figure 11.5, generated from the same model, lead to regression output where neither Right nor Left is neither Right nor Left is neither statistically significant (both of their p-values are fairly large).

Multicollinearity often causes regression coefficients to have the “wrong” sign, t-values to be too small, and p-values to be too large.

The problem is that although both Right and Left are clearly related to Height, it is impossible for the least squares method to distinguish their separate effects. Note that the regression equation does estimate the combined effect fairly well—the sum of the coeffi- cients of Right and Left in cell G16 in both figures is fairly close to the coefficient 3.2 that was used to generate the data. Also, the estimated intercept is fairly close to the intercept 31.8 that was used to generate the data. Therefore, the estimated equation will work well for predicting heights. It just does not produce reliable estimates of the individual coef- heights. It just does not produce reliable estimates of the individual coef- heights. It just does not produce reliable estimates of the individual coef ficients of Right and Left. ■

Multicollinearity typically causes unreliable estimates of regression coefficients, but it does not generally cause poor predictions.

11

12

13

14

15

16

17

18

19

20

21

22

23

Regression equa�on Variable Constant Le� Right Sum of coeffs

SSE MSE StErr of est

R-square Mul�ple R

F G HG H I JI J

Coeff 34.272

1.583 1.443 3.026

903.456 9.314 3.052

0.885 0.941

StErr 1.529 1.192 1.182

t-value 22.415

1.328 1.221

p-value 0.0000 0.1874 0.2250

Figure 11.5 Another Example of Height versus Foot Length

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-4 Multicollinearity 499

This example illustrates an extreme form of multicollinearity, where two explanatory variables are very highly correlated. In general, there are various degrees of multicollinearity. In each of them, there is a linear relationship between two or more explanatory variables, and this relationship makes it dif�cult to estimate the individual effects of the X’s on the dependent variable. The symptoms of multicollinearity can be “wrong” signs of the coef�cients, smaller-than-expected t-values, and larger-than-expected (insigni�cant) p-val- ues. In other words, variables that are really related to the dependent variable can look like they aren’t related, based on their p-values. The reason is that their effects on Y are already Y are already Y explained by other X’s in the equation.

Sometimes multicollinearity is easy to spot and treat. For example, it would be silly to include both Right and Left foot length in the equation for Height. They are obviously very highly correlated and either one suf�ces in the equation for Height. One of them—either one—should be excluded from the equation. However, multicollinearity is not usually this easy to treat or even diagnose.

Moderate to extreme multicollinearity poses a problem in many regression applications. Unfortunately, there are usually no easy remedies.

Effect of Multicollinearity Multicollinearity occurs when X’s are highly corre- lated with one another, and it is a problem in many real regression applications. It prevents you from separating the individual influences of the X’s on Y.

In short, it prevents you from seeing clearly how the world works. However, multicollinearity is not a probnot a probnot - lem if you simply want to use a regression equation as a “black box” for predictions.

F u n da m e n ta l I n s i g h t

Figure 11.6 StatTools Multicollinearity Options

© C

e n g

a g

e L

e a rn

in g

StatTools recently added optional regression output for detecting multicollinearity. (This type of output is available in many other statistical software packages as well.) These options appear on the Options tab of the Regression dialog box, as shown in Figure 11.6. If you check the Check Multicollinearity box, you will get two extra columns in the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

500 Chapter 11 Regression Analysis: Statistical Inference

Regression Table section of the regression output: VIF and R-Square. (You can also check the Display Correlation Matrix box to get the usual matrix of correlations for all variables in the regression.) The R-Square for any X variable is the usual R-square value from a X variable is the usual R-square value from a X regression with that X as the X as the X dependent variable and the other dependent variable and the other dependent X’s as the explanatory vari- ables. It indicates how related that X is to the other X is to the other X X’s. The VIF (variance in�ation factor) is then de�ned as 1/(1–R-square).

These measures are illustrated in Figure 11.7. (See the �le Salary Multicollinearity. xlsx.) This data set has salaries for 300 employees. The explanatory variables are Gender, Age, Experience (years of work experience in the industry), and Seniority (years with this company). The R-Square column (as well as the matrix of correlations at the bottom) indi- cates that Age, Experience, and Seniority are a de�nite source of multicollinearity. They are highly correlated, and any one of them can be explained by the other two. The VIF is basically the same as the R-Square in the sense that if one of them is large, the other is also large. The educational comment next to VIF states the following: “A VIF of 1 means that there is no correlation among the k-th predictor and the remaining predictor variables, and hence the variance of k-th regression coef�cient is not in�ated at all. The general rule of thumb is that VIFs exceeding 4 warrant further investigation, while VIFs exceeding 10 are signs of serious multicollinearity requiring correction.”

A B C D E F G H I

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Salary Mul�ple R

0.9755

Degrees of Freedom

4 295

49714.25538 �2967.636804 �309.744401 388.6414678 2997.963902

Salary 1.000

�0.093 0.857 0.882 0.973

0.9516

Sum of Squares

1.42789E+11 7269795846

Standard Error

3815.817909 616.5554185 148.1225902 190.5619471 94.86007243

Gender (Female) �0.093 1.000

�0.028 �0.026 �0.033

Adjusted R-square 0.9509

Mean of Squares

35697211405 24643375.75

13.02846639 �4.813252329 �2.091135462

2.0394495 31.60406507

Age 0.857

�0.028 1.000 0.984 0.884

Std. Err. ofd. Err. ofd. Err Es�mate

4964.209479

F

1448.552007

<0.0001 <0.0001 0.0374 0.0423

<0.0001

Experience 0.882

�0.026 0.984 1.000 0.905

Rows Ignored

0

p-Value-Value-V

< 0.0001

Confidence Interval 95% Lower

42204.5803 �4181.041368 �601.2553042 13.60829267 2811.275664

Seniority 0.973

�0.033 0.884 0.905 1.000

val 95 Upper

57223.93047 �1754.232241 �18.23349785 763.6746429 3184.65214

VIF

1.001383083 31.50365495 38.1530895

5.594548735

R-Square

0.001381173 0.968257651 0.973789803 0.821254573

Mul�collinearity CheckingMul�collinearity CheckingMul�collinearity Checking Regression Tablgression Tablgression T e Constant Gender (Female) Age Experience Seniority

Salary Gender (Female) Age Experience Seniority

8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

y R-squar

Correla�on Matrix

A B C D E F G H

R-Square

Coefficient t-Value-Value-V p-Value Confidence Int

alue Confidence Int

-Value-V

Figure 11.7 StatTools Regression Output with Multicollinearity Diagnostics

© C

e n g

a g

e L

e a rn

in g

According to these rules of thumb, this data set has a serious multicollinearity issue that requires correction. The most obvious correction would be to eliminate Age and/or Experience and rerun the regression. Unfortunately, it is not always this obvious how to deal with multicollinearity. The optional StatTools outputs discussed here allow you to detect multicollinearity, but they don’t provide a foolproof method for correcting it.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-4 Multicollinearity 501

P R O B L E M S

Level A 13. Using the data given in the file P10_10.xlsx,

estimate a multiple regression equation to predict the price of houses in a given community. Employ all available explanatory variables. Is there evidence of multicollinearity in this model? Explain why or why not.

14. Consider the data for Business Week’s top U.S. MBA programs in the MBA Data sheet of the file P10_21.xlsx. Use these data to estimate a multiple regression model to assess whether there is a relationship between the enrollment and the following explanatory variables: (a) the percentage of international students, (b) the percentage of female students, (c) the percentage of Asian American students, (d) the percentage of minority students, and (e) the resident tuition and fees at these business schools. a. Determine whether each of the regression

coefficients for the explanatory variables in this model is statistically different from zero at the 5% significance level. Summarize your findings.

b. Is there evidence of multicollinearity in this model? Explain why or why not.

15. The manager of a commuter rail transportation system was recently asked by her governing board to determine the factors that have a significant impact on the demand for rides in the large city served by the transportation network. The system manager has collected data on variables that might be related to the number of weekly riders on the city’s rail system. The file P10_20.xlsx contains these data. a. Estimate a multiple regression model using all of

the available explanatory variables. Perform a test of significance for each of the model’s regression coefficients. Are the signs of the estimated coefficients consistent with your expectations?

b. Is there evidence of multicollinearity in this model? Explain why or why not. If multicollinearity is present, explain what you would do to remedy this problem.

Level B 16. The file P10_05.xlsx contains salaries for a sample of

DataCom employees, along with several variables that might be related to salary. a. Estimate the relationship between Y (Salary) and X

(Years Employed) using simple linear regression. (For this problem, ignore the other potential explanatory variables.) Is there evidence to support the hypothesis that the coefficient for the number of years employed is statistically different from zero at the 5% significance level?

b. Estimate a multiple regression model to explain annual salaries of DataCom employees with X and X2X2X as explanatory variables. Perform relevant hypothesis tests to determine the significance of the regression coefficients of these two variables. Summarize your findings.

c. How do you explain your findings in part b in light of the results found in part a?

17. The owner of a restaurant in Bloomington, Indiana, has recorded sales data for the past several years. He has also recorded data on potentially relevant vari- ables. The data appear in the file P10_23.xlsx. a. Estimate a multiple regression equation that

includes annual sales as the dependent variable and the following explanatory variables: year, size of the population residing within 10 miles of the restaurant, annual advertising expenditures, and advertising expenditures in the previous year.

b. Which of the explanatory variables have significant effects on sales at the 10% significance level? Do any of these results surprise you? Explain why or why not.

c. Exclude all insignificant explanatory variables from the equation in part a and estimate the equation with the remaining variables. Comment on the significance of each remaining variable.

d. Based on your analysis of this problem, does multicollinearity appear to be present in the original or revised versions of the model? Explain.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

502 Chapter 11 Regression Analysis: Statistical Inference

11-5 INCLUDE/EXCLUDE DECISIONS In this section we make further use of the t-values of regression coef�cients. In particular, we explain how they can be used to make include/exclude decisions for explanatory vari- ables in a regression equation. Section 11-3 explained how a t-value can be used to test whether a population regression coef�cient is zero. But does this mean that you should

automatically include a variable if its t-value is sig- ni�cant and automatically exclude it if its t-value is insigni�cant? Unfortunately, the decision is not always this simple.

The goal is always to get the best �t possible, and the principle of parsimony suggests using the fewest number of variables. This presents a trade- off, where there are not always easy answers. On the one hand, more variables certainly increase R2, and they usually reduce the standard error of estimate se. On the other hand, fewer variables are better for parsimony. To help with the decision, we present several guidelines. These guidelines are not hard and fast rules, and they are sometimes contra- dictory. In real applications there are often several equations that are equally good for all practical pur- poses, and it is rather pointless to search for a single “true” equation.

Guidelines for Including/Excluding Variables in a Regression Equation

1. Look at a variable’s t-value and its associated p-value. If the p-value is above some accepted significance level, such as 0.05, this variable is a candidate for exclusion.

2. Check whether a variable’s t-value is less than 1 or greater than 1 in magnitude. If it is less than 1, then it is a mathematical fact that se will decrease (and adjusted R

2

will increase) if this variable is excluded from the equation. If it is greater than 1, the opposite is true. Because of this, some statisticians advocate excluding variables with t-values less than 1 and including variables with t-values greater than 1.

3. Look at t-values and p-values, rather than correlations, when making include/ exclude decisions. An explanatory variable can have a fairly high correlation with the dependent variable, but because of other variables included in the equation, it other variables included in the equation, it other might not be needed. This would be reflected in a low t-value and a high p-value, and this variable could possibly be excluded for reasons of parsimony. This often occurs in the presence of multicollinearity.

4. When there is a group of variables that are in some sense logically related, it is sometimes a good idea to include all of them or exclude all of them. In this case, their individual t-values are less relevant. Instead, a “partial F test” (not discussed in this book) can be used to make the include/exclude decision.

5. Use economic and/or physical theory to decide whether to include or exclude vari- ables, and put less reliance on t-values and/or p-values. Some variables might really belong in an equation because of their theoretical relationship with the dependent variable, and their low t-values, possibly the result of an unlucky sample, should not necessarily disqualify them from being in the equation. Similarly, a variable that has no economic or physical relationship with the dependent variable might have

Searching for the “True” Regression Equation Finding the best X’s (or the best form of the X’s) to include in a regression equation is undoubtedly the most difficult part of any real regression analysis. We offer two important things to keep in mind. First, it is rather pointless to search for the “true” regression equation. There are often several equations that, for all practical purposes, are equally useful for describing how useful for describing how useful the world works or making predictions. Second, the guidelines provided here for including and excluding variables are not ironclad rules. They typically involve choices at the margin, that is, between equations that are very similar and equally useful. In short, there is often no single “correct answer.”

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-5 Include/Exclude Decisions 503

E X A M P L E 11.3 EXPLAINING SPENDING AMOUNTS AT HYTEX

The file Catalog Marketing.xlsx contains data on 1000 customers who purchased mail-order products from HyTex Company in the current year. (This is a slightly dif-mail-order products from HyTex Company in the current year. (This is a slightly dif-mail-order products from HyTex Company in the current year. (This is a slightly dif ferent version of the file that was used in Chapter 2.) HyTex is a direct marketer of stereo equipment, personal computers, and other electronic products. HyTex advertises entirely by mailing catalogs to its customers, and all of its orders are taken over the telephone. The company spends a great deal of money on its catalog mailings, and it wants to be sure that this is paying off in sales. For each customer there are data on the following variables:

■ Age: age of the customer at the end of the current year

■ Gender: coded as 1 for males, 0 for females

■ Own Home: coded as 1 if customer owns a home, 0 otherwise

■ Married: coded as 1 if customer is currently married, 0 otherwise

■ Close: coded as 1 if customer lives reasonably close to a shopping area that sells similar merchandise, 0 otherwise

■ Salary: combined annual salary of customer and spouse (if any)

■ Children: number of children living with customer

■ Previous Customer: coded as 1 if customer purchased from HyTex during the previous year, 0 otherwise

■ Previous Spent: total amount of purchases made from HyTex during the previous year

■ Catalogs: number of catalogs sent to the customer this year

■ Amount Spent: total amount of purchases made from HyTex this year

Estimate and interpret a regression equation for Amount Spent based on all of these variables.

Objective To see which potential explanatory variables are useful for explaining current year spending amounts at HyTex with multiple regression.

a significant t-value just by chance. This does not necessarily mean that it should be included in the equation. You should not use statistical software blindly to hunt for “good” explanatory variables. You should have some idea, before running the soft- ware, of which variables belong and which do not belong.

Again, these guidelines can give contradictory signals. Speci�cally, guideline 2 bases the include/exclude decision on whether the magnitude of the t-value is greater or less than 1. However, analysts who base the decision on statistical signi�cance at the usual 5% level, as in guideline 1, typically exclude a variable from the equation unless its t-value is at least 2 (approximately). This latter approach is more stringent—fewer variables will be retained—but it is probably the more popular approach. However, either approach is likely to result in similar equations for all practical purposes.

In our experience, you should not agonize too much about whether to include or exclude a variable “at the margin.” If you decide to exclude a variable that doesn’t add much explanatory power, you get a somewhat cleaner equation, and you probably won’t see any dramatic shifts in R2 or se. On the other hand, if you decide to keep such a variable in the equation, the equation is less parsimonious and you have one more variable to inter- pret, but otherwise, there is no real penalty for including it.

We illustrate how these guidelines can be used in the following example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

504 Chapter 11 Regression Analysis: Statistical Inference

Solution With this much data, 1000 observations, it is possible to set aside part of the data set for validation, as discussed in Section 10-7. Although any split can be used, we decided to base the regression on the first 750 observations and use the other 250 for validation. Therefore, you should select only the range through row 751 when defining the StatTools data set.

You can begin by entering all of the potential explanatory variables. The goal is then to exclude variables that aren’t necessary, based on their t-values and p-values. The multiple regression output with all explanatory variables appears in Figure 11.8. It indicates a fairly good fit. The R2 value is 74.7% and se is about $491. Given that the actual amounts spent in the current year vary from a low of under $50 to a high of over $5500, with a median of about $950, a typical prediction error of around $491 is decent but not great.

From the p-value column, you can see that there are four variables, Age, Gender, Own Home, and Married, that have p-values well above 0.05. These are the obvious candidates for exclusion from the equation. You could rerun the equation with all four of these vari- ables excluded, but it is a better practice to exclude one variable at a time. It is possible that when one of these variables is excluded, another one of them will become significant (the Right–Left foot phenomenon).

A B C D E F G

SummarySummarySummar

Explained

Unexplained

ANOVA TVA TV ableA TableA T

Mul�ple Regression for Amount Spent

Regression Tableegression Tableegression T Coefficient Standard t-Value-Value-V p-Value-Value-V

Lower Confidence Interval 95%

UpperError

Mul�ple R

0.8643 0.7470 0.7435 491.4512858

F Mean of Squares

Sum of Squares

Degrees of Freedom

10 526916948.1 52691694.81 218.16306 <0.0001

178486506.7 241524.3663739

p-Value-Value-V

Adjusted Std. Err. ofd. Err. ofd. Err Es�mate

0

Rows Ignored

R-Square R-square

8 9

10

11

12

13

14

15

16

17

18

Constant 197.3915241 85.86360421 2.298896324 0.0218 28.82587637 365.957171919

3.074343236−1.8714519790.63320.4774745161.2596392220.601445629Age20

16.91646056−131.9012590.1297−1.5168608537.90222368−57.4923992121 Gender 102.5326082−55.919056870.56380.57753105740.3558828323.3067756822 Own Home

103.9872268−86.611868610.85800.17896697248.543477018.68767910723 Married

<0.0001 −329.9284227−507.5397431−9.25673058545.23563466−418.734082924 Close

<0.0001 0.0202125310.01567306315.519408590.0011561520.01794279725 Salary

<0.0001 −120.2544446−202.7204941−7.68871198921.00318878−161.487469426 Children

<0.0001 −421.3867032−670.6294978−8.60134621263.47937718−546.008100527 Previous Customer

<0.0001 0.3719349790.1648154855.0875818760.0527510390.26837523228 Previous Spent 29 <0.0001 49.5645675638.3279708215.355967042.86183664543.94626919Catalogs

A B C D E F

Figure 11.8 Regression Output with All Explanatory Variables Included

© C

e n g

a g

e L

e a rn

in g

Actually, this did not happen. We first excluded the variable with the largest p-value, Married, and reran the regression. At this point, Age, Gender, and Own Home still had large p-values, so we excluded Age, the variable with the largest remaining p-value, and reran the regression. Next, we excluded Own Home, the variable with the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-5 Include/Exclude Decisions 505

A B C D E F G

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Amount Spent

Regression Tablgression Tablgression T e Coefficient

Standard

Error t-Value-Value-V p-Value-Value-V

Lower

Confidence Interval 95%

Upper

Mul�ple Std. Err. ofd. Err. ofd. Err R

0.8636 0.7458 0.7438 491.2282666

F Mean of Squares

Sum of Squares

Degrees of Freedom

6 526113683.9 87685613.98 363.3805256 <0.0001 179289770.9 241305.2099743

p-Value-Value-V

R-square Es�mate Rows

0

Ignored R-Square8

9 10 11

12 13 14 15 16 17 18

Constant 205.0935974 70.31522685 2.9167736 0.0036 67.05342081 343.133773919 <0.0001 −504.7546341 −327.7377837−9.2325528345.0846279−416.2462089Close20

<0.0001 0.016194587 0.01974403319.87727840.0009040130.0179693121 Salary

<0.0001 −667.8606044 −419.329007−8.58775817763.29880215−543.594805723 Previous Customer <0.0001 0.1692309 0.3755052565.1843830770.0525362560.27236807824 Previous Spent

<0.0001 −201.368839 −120.9465626−7.86793603620.48284328−161.157700822 Children

<0.0001 49.4100103438.2034211815.348055592.85421925243.8067157625 Catalogs

E FC DA B Adjusted

Figure 11.9 Regression Output with Insignificant Variables Excluded

© C

e n g

a g

e L

e a rn

in g

largest remaining p-value, and finally, we excluded Gender because its p-value was still large. The resulting output appears in Figure 11.9. The R2 and se values of 74.6% and $491 are almost the same as they were with all variables included, and all of the p-values are very small.

Interpretation of Regression Equation This �nal regression equation can be interpreted as follows:

■ The coef�cient of Close implies that an average customer living close to stores with this type of merchandise spent about $416 less than an average customer living far from such stores.

■ The coef�cient of Salary implies that, on average, about 1.8 cents of every extra salary dollar was spent on HyTex merchandise.

■ The coef�cient of Children implies that about $161 less was spent for every extra child living at home.

■ The Previous Customer and Previous Spent terms are somewhat more dif�cult to interpret. First, both of these terms are zero for customers who didn’t purchase from HyTex in the previous year. For those who did, the terms become −544 + 0.27Previous Spent. The coef�cient 0.27 implies that each extra dollar spent the previous year can be expected to contribute an extra 27 cents in the current year. The −544 literally means that if you compare a customer who didn’t purchase from HyTex last year to another customer who purchased only a tiny amount, the latter is expected to spend about $544 less than the former this year. However, none of the latter customers were in the data set. A look at the data shows that of all customers who purchased from HyTex last year, almost all spent at least $100 and most spent considerably more. In fact, the median amount spent by these customers last year

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

506 Chapter 11 Regression Analysis: Statistical Inference

P R O B L E M S

Level A 18. The Undergraduate Data sheet of the file P10_21.xlsx

contains information on undergraduate business pro- grams in the United States, including various rank- ings by Business Week. Use multiple regression to explore the relationship between the median starting salary and the following set of potential explanatory variables: annual cost, full-time enrollment, faculty– student ratio, average SAT score, and average ACT score. Which explanatory variables should be included in a final version of this regression equation? Justify your choices. Is multicollinearity a problem? Why or why not?

19. A manager of boiler drums wants to use regression analysis to predict the number of worker-hours needed to erect the drums in future projects. Consequently, data for several randomly selected boilers were collected. In addition to worker- hours (Y ) , the variables measured include boiler capacity, boiler design pressure, boiler type, and drum type. All of these measurements are listed in the file P10_27.xlsx. Estimate an appropriate multiple regression model to predict the number of worker-hours needed to erect given boiler drums using all available explanatory variables. Which explanatory variables should be included in a final version of this regression model? Justify your choices.

20. The file P02_35.xlsx contains data from a survey of 500 randomly selected households.

a. In an effort to explain the variation in the size of the monthly home mortgage or rent payment, estimate a multiple regression equation that includes all of the potential household explanatory variables.

b. Using the regression output, determine which of the explanatory variables should be excluded from the regression equation. Justify your choices.

c. Do you obtain substantially different results if you combine First Income and Second Income into a Total Income variable and then use the latter as the only income explanatory variable?

21. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. a. Estimate a multiple regression equation to

explain the variation in employee salaries at Beta Technologies using all of the potential explanatory variables.

b. Using the regression output, determine which of the explanatory variables, if any, should be excluded from the regression equation. Justify your choices.

c. Regardless of your answer to part b, exclude the least significant variable (not counting the least significant variable (not counting the least constant) and estimate the resulting equation. Would you conclude that this equation and the one from part a are equally good? Explain.

22. Stock market analysts are continually looking for reli- able predictors of stock prices. Consider the problem of modeling the price per share of electric utility

was about $900 (the median of all positive values for the Previous Spent variable). If you substitute this median value into the expression −544 + 0.27Previous Spent, you obtain −298. Therefore, this “median” spender from last year can be expected to spend about $298 less this year than the previous year nonspender.

■ The coef�cient of Catalogs implies that each extra catalog can be expected to generate about $44 in extra spending.

We conclude this example with a couple of cautionary notes. First, if you vali- date this final regression equation on the other 250 customers, using the procedure from Section 10-7, you will find R2 and se values of 73.2% and $490. (This analysis is included in the finished version of the file.) These are very promising. They are very close to the values based on the original 750 customers. Second, we haven’t tried all possibilities yet. We haven’t tried nonlinear or interaction variables, nor have we looked at different coding schemes (such as treating Catalogs as a categorical variable and using dummy variables to represent it). Also, we haven’t checked for nonconstant error variance (Figure 11.1 is based on this data set) or looked at the potential effects of outliers. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-6 Stepwise Regression 507

11-6 STEPWISE REGRESSION 3

Multiple regression represents an improvement over simple regression because it allows any number of explanatory variables to be included in the analysis. Sometimes, however, the large number of potential explanatory variables makes it dif�cult to know which vari- ables to include. Many statistical packages provide some assistance by including auto- matic equation-building options. These options estimate a series of regression equations by successively adding (or deleting) variables according to prescribed rules. Generically, the methods are referred to as stepwise regression.

Before discussing how stepwise procedures work, consider a naive approach to the problem. You have already looked at correlation tables for indications of linear relation- ships. Why not simply include all explanatory variables that have large correlations with the dependent variable? There are two reasons for not doing this. First, although a vari- able is highly correlated with the dependent variable, it might also be highly correlated with other explanatory variables. Therefore, this variable might not be needed in the equation once the other explanatory variables have been included. This actually happens quite often.

Second, even if a variable’s correlation with the dependent variable is small, its con- tribution when it is included with a number of other explanatory variables can be greater than anticipated. Essentially, this variable can have something unique to say about the dependent variable that none of the other variables provides, and this fact might not be apparent from the correlation table. This behavior doesn’t happen as often, but it is cer- tainly possible.

For these reasons it is sometimes useful to let the software discover the best combi- nation of variables by means of a stepwise procedure. There are a number of procedures for building equations in a stepwise manner, but they all share a basic idea. Suppose there is an existing regression equation and you want to add another variable to this equation from a set of variables not yet included. At this point, the variables already in the equation have explained a certain percentage of the variation of the dependent vari- able. The residuals represent the part still unexplained. Therefore, in choosing the next variable to enter the equation, you should choose the one that is most highly correlated with the current residuals. If none of the remaining variables is highly correlated with the residuals, you can quit. This is the essence of stepwise regression. However, besides adding variables to the equation, a stepwise procedure might delete a variable. This is sometimes reasonable because a variable entered early in the procedure might no longer be needed, given the presence of other variables that have entered subsequently.

Many statistical packages have three types of equation-building procedures: forward, backward, and stepwise. A forward procedure begins with no explanatory variables in the forward procedure begins with no explanatory variables in the forward equation and successively adds one at a time until no remaining variables make a signi�cant

3This section can be omitted without any loss of continuity.

stocks (Y ). Two variables thought to influence such a stock price are return on average equity (X1) and annual dividend rate (X2X2X ). The stock price, returns on equity, and dividend rates on a randomly selected day for several electric utility stocks are provided in the file P10_19.xlsx. a. Estimate a multiple regression model using

the given data. Include linear terms as well

as an interaction term involving the return on average equity (X1) and annual dividend rate (X2X2X ).

b. Which of the three explanatory variables (X1, X2X2X , and X1X2X2X ) should be included in a final version of this regression model? Explain. Does your conclusion make sense in light of your knowledge of corporate finance?

Stepwise regression (and its variations) can be helpful in discovering a useful regression model, but it should not be used mindlessly.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

508 Chapter 11 Regression Analysis: Statistical Inference

Stepwise Regression The option to let the statistical software build the regression equation automatically makes the various versions of stepwise regression very popular with many users. However, keep in mind that it does nothing that can’t be done with multiple regression, where the choice of X’s is specified manually. And sometimes a careful manual selection of the X’s to include is better than letting the software make the selection mindlessly. Stepwise regression has its place, but it shouldn’t be a substitute for thoughtful analysis.

F u n da m e n ta l I n s i g h t

E X A M P L E 11.3 EXPLAINING SPENDING AMOUNTS AT HYTEX (CONTINUED)

The analysis of the HyTex mail-order data (for the first 750 customers in the data set) resulted in a regression equation that included all potential explanatory variables except for Age, Gender, Own Home, and Married. These were excluded because their t-values are large and their p-values are small (less than 0.05). Do forward, backward, and stepwise procedures produce the same regression equation for the amount spent in the current year?

Objective To use stepwise regression procedures to analyze the HyTex data.

Solution Each of these options is found in the StatTools Regression dialog box. It is just a matter of choosing the appropriate option from the Regression Type dropdown list, as shown in Figure 11.10. In each, specify Amount Spent as the dependent variable and select all of

contribution. A backward procedure begins with backward procedure begins with backward all potential explanatory variables in the all potential explanatory variables in the all equation and deletes them one at a time until further deletion would do more harm than good. Finally, a true stepwise procedure is much like a forward procedure, except that it also considers possible deletions along the way. All of these procedures have the  same basic objective—to �nd an equation with a small se and a large R

2 (or adjusted R2). There is no guarantee that they will all produce exactly the same �nal equation, but in most cases their �nal results are very similar. The important thing to realize is that the equations estimated along the way, including the �nal equation, are estimated exactly as before—by least squares. Therefore, none of these procedures produces any new results. They merely take the burden off the user of having to decide ahead of time which variables to include in the equation.

StatTools implements each of the forward, backward, and stepwise procedures. To use them, select the dependent variable and a set of potential explanatory variables. Then potential explanatory variables. Then potential specify the criterion for adding and/or deleting variables from the equation. This can be done in two ways, with an F-value or a p-value. (You make this choice in the Parameters tab of the StatTools Regression dialog box.) We suggest using p-values because they are easier to understand, but either method is easy to use. In the p-value method, you select a p-value such as the default value of 0.05. If the regression coef�cient for a potential enter-

ing variable would have a p-value less than 0.05 (if it were entered), then it is a candidate for enter- ing (if the forward or stepwise procedure is used). The procedure selects the variable with the smallest p-value as the next entering variable. Similarly, if any currently included variable has a p-value greater than some value such as the default value of 0.10, then (with the stepwise and backward procedures) it is a candidate for leaving the equation. The meth- ods stop when there are no candidates (according to their p-values) for entering or leaving the current equation.

The following is a continuation of the HyTex mail-order example and illustrates these stepwise procedures.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-6 Stepwise Regression 509

Figure 11.11 Request for Detailed Step Information

the other variables (besides Customer) as potential explanatory variables. Optionally, you potential explanatory variables. Optionally, you potential can also check the Include Detailed Step Information box in the Options tab, as shown in Figure 11.11. This provides a summary of the steps in the regression output.

Figure 11.10 StatTools Dialog Box for Stepwise Regression

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

510 Chapter 11 Regression Analysis: Statistical Inference

Stepwise regression or any of its variations can be very useful for narrowing down the set of all possible explanatory variables to a set that is useful for explaining a dependent variable. However, these procedures should not be used as a substitute for thoughtful analy- sis. With the availability of such procedures in statistical software, there is sometimes a ten- dency to turn the analysis over to the computer and accept its output. A good analyst does not just collect as much data as possible, throw it into a software package, and blindly report the results. There should always be some rationale, whether it is based on economic theory, business experience, or common sense, for the variables that are used to explain a given dependent variable. A thoughtless use of stepwise regression can sometimes capitalize on

It turns out that each stepwise procedure (stepwise, forward, and backward) pro- duces the same final equation that we obtained previously, with all variables except Age, Gender, Own Home, and Married included. This often happens, but not always. As Figure 11.12 indicates, the stepwise procedure adds the variables in the order Salary, Catalogs, Close, Children, Previous Customer, and Previous Spent. The forward pro- cedure (not shown) does exactly the same. The backward procedure (also not shown) starts with all variables in the equation and then eliminates variables in the order Age, Married, Own Home, and Gender. The final equation appears in the regression output. Again, however, this final equation’s output is exactly the same as when multiple regres- sion is used with these particular variables. ■

Figure 11.12 Regression Output from Stepwise Procedure

A B C D E F G

Summary

Explained Unexplained

ANOVA Table

Stepwise Regression for Amount Spent

Regression Table Coefficient Standard

Error t-Value p-Value

Lower Confidence Interval 95%

Upper

Mul�ple R

0.8636 0.7458 0.7438 491.2282666

FMean of Squares

Sum of Squares

Degrees of Freedom

6 526113683.9 87685613.98 363.3805256 <0.0001 179289770.9 241305.2099743

p-Value

Adjusted R-square Es�mate

R-Square 8 9

10 11 12 13 14 15 16 17 18

Constant 205.0935974 70.31522685 2.9167736 0.0036 67.05342081 0.016194587 0.019744033

49.41001034 −327.7377837 −120.9465626 −419.329007 0.375505256

38.20342118 −504.7546341 −201.368839

−667.8606044 0.1692309

343.133773919 <0.000119.87727840.0009040130.01796931Salary20 <0.000115.348055592.85421925243.8067157621 Catalogs

<0.0001−7.867936036 −8.587758177

20.48284328−161.1577008 −543.5948057

23 Previous Customer <0.000163.2988021524 Previous Spent

<0.0001−9.2325528345.0846279−416.246208922 Close

<0.00015.1843830770.0525362560.27236807825 26 27 28 29 30 31 32 33 34

Children

Salary Catalogs

Previous Customer Previous Spent

Close Children

A B C D E F

Step Informa�on Mul�ple

R 0.6837 0.7841 0.8192 0.8477 0.8583 0.8636

0.4674 0.6148 0.6710 0.7187 0.7366 0.7458

0.4667 0.6138 0.6697 0.7171 0.7349 0.7438

708.6821053 603.0853946 557.7263832 516.1356647 499.698203

491.2282666

Adjusted R-square

Std. Err. of Es�mate

Enter or Exit

Enter Enter Enter Enter Enter Enter

R-Square

Std. Err. of

0 Ignored

Rows

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-6 Stepwise Regression 511

P R O B L E M S

Level A 23. The Undergraduate Data sheet of the file P10_21.xlsx

contains information on undergraduate business programs in the United States, including various rankings by Business Week. Use forward, backward, and stepwise regression analysis to explore the relationship between the median starting salary and the following set of potential explanatory variables: annual cost, full-time enrollment, faculty–student ratio, average SAT score, and average ACT score. Do these three methods all lead to the same regression equation? If not, do you think any of the final equations are substantially better than any of the others?

24. The file P11_24.xlsx contains data on the top 200 professional golfers in each of the years 2003–2014. (The same data set was used in Example 3.3 in Chapter 3.) a. Create one large data set in a new sheet called All

Years that has the data for all 12 years stacked on top of one other. (This is possible because the variables are the same in each year.) In this combined data set, create a new column called Earnings per Round, the ratio of Earnings to Rounds. Similarly, create three other new variables, Eagles per Round, Birdies per Round, and Bogies per Round.

b. Using the data set from part a, run a forward regression of Earnings per Round versus the following potential explanatory variables: Age, Yards/Drive, Driving Accuracy, Greens in Regulation, Putting Average, Sand Save Pct, Eagles per Round, Birdies per Round, and Bogies per Round. Given the results, comment on what seems to be important on the professional tour in terms of earnings per round. For any variable that does not end up in the equation, is it omitted because it is not related to Earnings per Round or because its effect is explained by other variables in the equation?

c. Repeat part b with backward regression. Do you get the same, or basically the same, results?

25. In a study of housing demand, a county assessor is interested in developing a regression model to estimate the selling price of residential properties within her

jurisdiction. She randomly selects several houses and records the selling price in addition to the following values: the size of the house (in hundreds of square feet), the total number of rooms in the house, the age of the house, and an indication of whether the house has an attached garage. These data are listed in the file P10_26.xlsx. a. Use stepwise regression to decide which

explanatory variables should be included in the assessor’s statistical model. Use the p-value method with a cutoff value of 0.05 for entering and leaving. Summarize your findings.

b. How do the results in part a change when the critical p-value for entering and leaving is increased to 0.10? Explain any differences between the regression equation obtained here and the one found in part a.

26. Continuing Problem 2 with the data in the file P10_04.xlsx, employ stepwise regression to evalu- ate your conclusions regarding the specification of a regression model to predict the sales of deep-dish pizza by the Original Italian Pizza restaurant chain. Use the p-value method with a cutoff value of 0.05 for entering and leaving. Compare your conclusions in Problem 2 with those derived from a stepwise regression.

Level B 27. How sensitive are stepwise regression results to

small changes in the data? This problem allows you to explore this. The file P11_27.xlsm can be used to generate 100 randomly chosen observations from a given population. It contains macros that help you do this. Specifically, the means, standard deviations, and correlations for the population of 10 X’s and Y are given in rows 2–14. The macro has already been used to generate a “generic” row of data in row 16. It is done so that the X’s and Y are normally distributed with the given means, standard deviations, and cor- relations. Press the F9 key a few times to see how the data in row 16 change. There is also a button you can click. When you do so, the generic row 16 is copied to rows 20–119 to generate new random data, and the new random data are frozen. Click the button a few times to see how this works. Designate a StatTools data set in the range A19:L119 and run stepwise

chance to obtain an equation with a reasonably large R2 but no useful or practical interpre- tation. It is very possible that such an equation will not generalize well to new data.

Finally, keep in mind that if one stepwise procedure produces slightly different out- puts than another (for example, one might include a variable, the other might exclude it), the differences are typically very small and are not worth agonizing about. The two equations typically have very similar R2 values and standard errors of estimate, and they typically produce very similar predictions. If anything, most analysts prefer the smaller equation because of parsimony, but they realize that the differences are “at the margin.”

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

512 Chapter 11 Regression Analysis: Statistical Inference

11-7 OUTLIERS In all of the regression examples so far, we have ignored the possibility of outliers. Unfortunately, outliers cannot be ignored in many real applications. They are often present, and they can often have a substantial effect on the results. In this section we brie�y discuss outliers in the context of regression—how to detect them and what to do about them.

You probably tend to think of an outlier as an observation that has an extreme value for at least one variable. For example, if salaries in a data set are mostly in the $40,000 to $80,000 range, but one salary is $350,000, this observation is clearly an outlier with respect to salary. However, outliers are not always this obvious in a regression context. In fact, an observation can be considered an outlier for several reasons, and some types of outliers can be dif�cult to detect. An observation can be an outlier for one or more of the following reasons.

Potential Characteristics of an Outlier

■ It has an extreme value for at least one variable.

■ Its value of the dependent variable is much larger or smaller than predicted by the regression line, and its residual is abnormally large in magnitude. An example appears in Figure 11.13. The line in this scatterplot �ts most of the points, but it misses badly on the one obvious outlier. This outlier has a large positive residual, but its Y value is not abnormally large. Its Y value is only large relative to points with the same X value that it has.X value that it has.X

regression on the data. Then generate new data by clicking the button and run stepwise regression again. Repeat this a few times. Then explain the results. Do all of the stepwise regressions produce about the same results? Are they consistent with the param- eters in the top section, particularly the correlations involving Y in row 14?

28. Repeat the previous problem at least once, using means, standard deviations, and correlations of your

choice. The interesting thing you will discover is that you can’t arbitrarily enter just any correlations between −1 and +1. For many choices, the generic row will exhibit #VALUE! errors. This means that no population could possibly have the correlations you entered. Try to find correlations that do not produce not produce not the #VALUE! errors.

Outliers can come in several forms, as indicated in this list.

Sca�erplot of Y vs X

Outlier

1000

950

900

850

800

750

700 40 50 60 70 80 90

X 100 110 120 130 140

Y

Figure 11.13 Outlier with a Large Residual

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-7 Outliers 513

Sca�erplot of Y vs X

Outlier

Line with outlier

Line without outlier

2200

2000

1800

1600

1400

1200

1000

800

600 40 50 60 70 80 90

X 100 110 120 130 140

Y

Figure 11.14 Outlier That Tilts the Regression Line

■ Its residual is not only large in magnitude, but this point “tilts” the regression line toward it. An example appears in Figure 11.14. The two lines shown are the regression lines with the outlier and without it. The outlier makes a big difference in the slope and intercept of the regression line. This type of outlier is called an in�uential point, for the obvious reason.

■ Its values of individual explanatory variables are not extreme, but they fall outside the general pattern of the other observations. An example appears in Figure 11.15. Here, we assume that the two variables shown, Years (years of experience) and Rating (an employee’s performance rating) are both explanatory variables for some other dependent variable (Salary) that isn’t shown in the plot. The obvious outlier does not have an abnormal value of either Years or Rating, but it falls well outside the pattern of most employees.

Outlier

20

0

2

4

6

8

10

12

14

16

18

0 10 20 30 40 50

Ra�ng

60 70 80 90 100

Ye ar

s

Figure 11.15 Outlier Outside the Pattern of Explanatory Variables

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

514 Chapter 11 Regression Analysis: Statistical Inference

© C

e n g

a g

e L

e a rn

in g

Once outliers have been identi�ed, there is still the dilemma of what to do with them. In most cases the regression output will look “nicer” if you delete outliers, but this is not necessarily appropriate. If you can argue that the outlier isn’t really a member of the rel- evant population, then it is appropriate and probably best to delete it. But if no such argu- ment can be made, then it is not really appropriate to delete the outlier just to make the analysis come out nicer. Perhaps the best advice in this case is the advice we gave in the previous chapter: Run the analysis with the outliers and run it again without them. If the key outputs do not change much, then it does not really matter whether the outliers are included or not. If the key outputs change substantially, then report the results both with and without the outliers, along with a verbal explanation.

The following, a continuation of the bank discrimination example, illustrates this procedure.

E X A M P L E 11.4 POSSIBLE GENDER DISCRIMINATION IN BANK SALARIES

Recall from Example 10.3 of the previous chapter that Fifth National Bank has 208employees. The data for these employees are listed in the file Bank Salaries.xlsx. Are there any obvious outliers? In what sense are they outliers? Does it matter to the regres- sion results, particularly those concerning gender discrimination, whether the outliers are removed?

Objective To locate possible outliers in the bank salary data, and to see to what extent they affect the regression model.

Solution There are several places to look for outliers. An obvious place is the Salary variable. The box plot in Figure 11.16 shows that there are several employees making substantially more in salary than most of the employees. You could consider these outliers and remove them, arguing perhaps that these are senior managers who shouldn’t be included in the discrimination analysis. We leave it to you to check whether the regression results are any different with these high-salary employees than without them.

Box Plot of Salary $120,000

$100,000

$80,000

$60,000

$40,000

$20,000

$ 0

Figure 11.16 Box Plot of Salaries for Bank Data

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-7 Outliers 515

Another place to look is at a scatterplot of the residuals versus the fitted values. This type of plot (offered as an option by StatTools) shows points with abnormally large resid- uals. For example, we ran the regression with Female, Years1, the interaction between Female and Years1, and four education dummies, and we obtained the output and scat- terplot in Figures 11.17 and 11.18. This scatterplot has several points that could be

A B C D E F G

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Mul�ple Regression for Salary

Regression Tablgression Tablgression T e Coefficient

Standard Error

t-Value-Value-V p-Value-Value-V Lower

Confidence Interval 95% Upper

R

0.8552 0.7314 0.7220 5935.253768

FMean of Squares

Sum of Squares

Degrees of Freedom

7 19181659773 2740237110 77.78745429 35227237.297045447458200

<0.0001

p-Value-Value-V

Adjusted R-square Es�mate

R-Square 8 9

10 11 12 13 14 15 16 17 18

34209.08658 −9428.090372 −8881.541389 −5840.749067 −3565.196293 1456.387783 4898.656211

−1029.858414

1202.707811 1337.29233

1309.716821 1079.353005 2230.63457

79.76132092 1454.087118 121.9237374

28.44338939 −7.050134187 −6.781268474 −5.411342756 −1.598287923 18.25932377 3.368887703

−8.446742495

<0.0001 <0.0001 <0.0001 <0.0001 0.1116

<0.0001 0.0009

<0.0001

31837.47159 −12065.09207 −11464.16704 −7969.121182 −7963.776178 1299.106735 2031.347314

−1270.279372

36580.70157 −6791.088677 −6298.915735 −3712.376951 833.3835922 1613.66883

7765.965107 −789.4374568

Constant Educa�on (1) Educa�on (2) Educa�on (3) Educa�on (4) Years1 Gender (Female) Gender (Female) * Yearemale) * Yearemale) * Y s1

19 20 21

22 23 24

25 26

A B C D E F Std. Err. ofd. Err. ofd. Err

0

Ignored RowsMul�ple

Figure 11.17 StatTools Regression Output with Outlier Included

© C

e n g

a g

e L

e a rn

in g

20000.0

20000.0

Outlier

Fit

30000.030000.030000.030000.0 40000.040000.040000.040000.0 50000.050000.0 60000.060000.0 70000.0 80000.0 90000.0 100000.0

15000.0

10000.0

5000.0

Sca�erplot of Residuals vs Fit

−5000.0

−10000.0

−15000.0

−20000.0

−25000.0

0.0 0.0 10000.0

R es

id u

al s

−30000.0

0.0

Figure 11.18 Scatterplot of Residuals versus Fitted Values with Outlier Identified

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

516 Chapter 11 Regression Analysis: Statistical Inference

considered outliers, but we focus on the point identified in the figure. The residual for this point is approximately −23,000. Given that se for this regression is approximately 5900, this residual is about four standard errors below zero—quite extreme. If you examine this point more closely, you will see that it corresponds to employee 208, a 62-year-old female employee in the highest job grade. She has 33 years of experience with Fifth National, she has a graduate degree, and she earns only $30,000. She is clearly an unusual employee, and there are probably special circumstances that can explain her small salary, although we can only guess at what they are.

In any case, if you delete this employee and rerun the regression with the same variables, you will obtain the output in Figure 11.19.4

In any case, if you delete this employee and rerun the regression with the same 4

In any case, if you delete this employee and rerun the regression with the same Now, recalling that gender

discrimination is the key issue in this example, you can compare the coefficients of Female and the interaction term in the two outputs. The coefficient of Female has dropped from 4899 to 3774. In words, the Y -intercept for the female regression line used to be about $4900 higher than for the male line; now it is only about $3800 higher. More importantly, the coefficient of the interaction term has changed from −1030 to −858. This coefficient indicates how much less steep the female line for Salary versus Years1 is than the male line. So a change from −1030 to −858 indicates less discrimi- nation against females now than before. In other words, this unusual female employee accounts for a good bit of the discrimination argument—although a strong argument still exists even without her. ■

A B C D E F G

SummarySummarySummar

Explained Unexplained

ANOVA Tabl Tabl T e

Regression Tablgression Tablgression T e Coefficient

Standard Error

t-Value-Value-V p-Value-Value-V Lower Confidence Interval 95%

Upper

Mul�pe R

0.8690 0.7551 0.7465 5670.502581

F Mean of Squares

Sum of Squares

Degrees of Freedom

7 19729421790 2818488827 32154599.53

87.65429732 6398765306199

34604.09121 −10547.47488 −9769.932504 −6429.143193 −4180.841816 1449.596434 3774.31467

−858.2021956

1152.43008 1301.794181 1266.878732 1039.519952 2135.550618 76.21848953 1411.666835 122.6128115

30.02706351 −8.102259971 −7.711813498 −6.184723228 −1.957734826 19.01896039 2.673658244

−6.999286492

32331.54917 −13114.55644 −12268.16231 −8479.031366 −8392.054831 1299.296884 990.5690171

−1099.989332

36876.63324 −7980.393329 −7271.702698 −4379.255021 30.37120012 1599.895983 6558.060323

−616.4150594

<0.0001

<0.0001 <0.0001 <0.0001 <0.0001 0.0517

<0.0001 0.0081

<0.0001

p-Value-Value-V

Adjusted R-square

Std. Err. ofd. Err. ofd. Err Es�mate

0

Rows IgnoredR-Square

8 9

10 11 12 13 14 15 16 17 18

Constant Educa�on (1) Educa�on (2) Educa�on (3) Educa�on (4) Years1 Gender (Female) Gender (Female) * Yearemale) * Yearemale) * Y s1

19 20 21 22 23 24 25 26

A B C D E F Mul�ple Regression for Salary

Figure 11.19 StatTools Regression Output with Outlier Excluded

© C

e n g

a g

e L

e a rn

in g

4As it turns out, this employee is the last observation in the data set. An easy way to run the regression (with StatTools) without this employee is to rede�ne the StatTools data set so that it doesn’t include this last row.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-8 Violations of Regression Assumptions 517

P R O B L E M S

Level A 29. The file P11.29.xlsx contains data on the top 40 golfers

in 2008. (It is a subset of the data examined in earlier chapters.) This was the year when Tiger Woods won the U.S. Open in June and then had year-ending sur- gery directly afterward. Using all golfers, run a forward stepwise regression of Earnings per Round versus the potential explanatory variables in columns B–G. (Don’t use Earnings in column H.) Then create a second data set that omits Tiger Woods and repeat the regression on this smaller data set. Are the results about the same? Explain the effect, if any, of the Tiger Woods outlier on the regression.

30. The file P02_07.xlsx includes data on 204 employees at the (fictional) company Beta Technologies. a. Run a forward stepwise regression of Annual

Salary versus Gender, Age, Prior Experience, Beta Experience, and Education. Would you say this equation does a good job of explaining the variation in salaries?

b. Add a new employee to the end of the data set, a top-level executive. The values of Gender through Annual Salary for this person are, respectively, 0, 56, 10, 15, 6, and $500,000. Run the regression in part a again, including this executive. Are the results much different? Is it “fair” to exclude this executive when analyzing the salary structure at this company?

Level B 31. Statistician Frank J. Anscombe created a data set

to illustrate the importance of doing more than just examining the standard regression output. These data are provided in the file P10_64.xlsx. a. Regress Y1 on X. How well does the estimated

equation fit the data? Is there evidence of a linear relationship between Y1 and X at the 5% significance level?

b. Regress Y2Y2Y on X. How well does the estimated equation fit the data? Is there evidence of a linear relationship between Y2Y2Y and X at the 5% significance level?

c. Regress Y3Y3Y on X. How well does the estimated equation fit the data? Is there evidence of a linear relationship between Y3Y3Y and X at the 5% significance level?

d. Regress Y4Y4Y on X4X4X . How well does the estimated equation fit the data? Is there evidence of a linear relationship between Y4Y4Y and X4X4X at the 5% significance level?

e. Compare these four simple linear regression equations (1) in terms of goodness of fit and (2) in terms of overall statistical significance.

f. How do you explain these findings, considering that each of the regression equations is based on a different set of variables?different set of variables?different

g. What role, if any, do outliers have on each of these estimated regression equations?

11-8 VIOLATIONS OF REGRESSION ASSUMPTIONS Much of the theoretical research in the area of regression has dealt with violations of the regression assumptions discussed in Section 11-2. There are three issues: how to detect violations of the assumptions, what goes wrong if the violations are ignored, and what to do about them if they are detected. Detection is usually relatively easy. You can look at scatterplots, histograms, and time series graphs for visual signs of violations, and there are a number of numerical measures (many not covered here) that have been developed for diagnostic purposes. The second issue, what goes wrong if the violations are ignored, depends on the type of violation and its severity. The third issue is the most dif�cult to resolve. There are some relatively easy �xes and some that are well beyond the level of this book. In this section we brie�y discuss some of the most common violations and a few possible remedies for them.

11-8a Nonconstant Error Variance

The second regression assumption states that the variance of the errors should be constant for all values of the explanatory variables. This is a lot to ask, and it is almost always vio- lated to some extent. Fortunately, mild violations do not have much effect on the validity of the regression output, so you can usually ignore them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

518 Chapter 11 Regression Analysis: Statistical Inference

However, one particular form of nonconstant error variance occurs fairly often and should be dealt with. This is the fan shape shown earlier in the scatterplot of Amount Spent versus Salary in Figure 11.1. As salaries increase, the variability of amounts spent also increases. Although this fan shape appears in the scatterplot of the dependent variable Amount Spent versus the explanatory variable Salary, it also appears in the scatterplot of residuals versus �tted values if you regress Amount Spent versus Salary. If you ignore this nonconstant error variance, the standard error of the regression coef�cient of Salary is inaccurate, and a con�dence interval for this coef�cient or a hypothesis test concerning it can be misleading.

There are at least two ways to deal with this fan-shape phenomenon. The �rst is to use a different estimation method than least squares. It is called weighted least squares, and it is an option available in some statistical software packages. However, it is fairly advanced and it is not available with StatTools, so we will not discuss it here.

The second method is simpler. When you see a fan shape, where the variability increases from left to right in a scatterplot, you can try a logarithmic transformation of the dependent variable. The reason this often works is that the logarithmic transformation squeezes the large values closer together and pulls the small values farther apart. The scat- terplot of the log of Amount Spent versus Salary is in Figure 11.20. Clearly, the fan shape evident in Figure 11.1 is gone.

A fan shape can cause an incorrect value for the standard error of estimate, so that confidence intervals and hypothesis tests for the regression coefficients are not valid.

A logarithmic trans- formation of Y can sometimes cure the fan-shape problem.

This logarithmic transformation is not a magical cure for all instances of nonconstant error variance. For example, it appears to have introduced some curvature into the plot in Figure 11.20. However, when the distribution of the dependent variable is heavily skewed to the right, as it often is, the logarithmic transformation is worth exploring.

11-8b Nonnormality of Residuals

The third regression assumption states that the error terms are normally distributed. You can check this assumption fairly easily by forming a histogram of the residuals. You can

10

0 0 20000 40000 60000 80000 100000 120000 140000 160000 180000

Salary

1

2

3

4

Lo g(

A m

o u

n t

Sp en

t)

5

6

7

8

9

Sca�erplot of Log(Amount Spent) vs Salary Figure 11.20 Scatterplot without Fan Shape

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-8 Violations of Regression Assumptions 519

A Durbin–Watson statistic below 2 signals that nearby residuals are positively correlated with one another.

even perform a formal test of normality of the residuals by using the procedures discussed in Section 9-5 of Chapter 9. However, unless the distribution of the residuals is severely nonnormal, the inferences made from the regression output are still approximately valid. In addition, one form of nonnormality often encountered is skewness to the right, and this can often be remedied by the same logarithmic transformation of the dependent variable that remedies nonconstant error variance.

11-8c Autocorrelated Residuals

The fourth regression assumption states that the error terms are probabilistically independent. This assumption is usually valid for cross-sectional data, but it is often vio- lated for time series data. The problem with time series data is that the residuals are often correlated with nearby residuals, a property called autocorrelation of residuals. The most frequent type of autocorrelation is positive autocorrelation. For example, if residu- als separated by one month are correlated—called lag 1 autocorrelation—in a positive direction, then an overprediction in January, say, will likely lead to an overprediction in February, and an underprediction in January will likely lead to an underprediction in February. If this autocorrelation is large, serious prediction errors can occur if it isn’t dealt with appropriately.

A numerical measure has been developed to check for lag 1 autocorrelation. It is called the Durbin–Watson statistic (after the two statisticians who developed it), and it is quoted automatically in the regression output of many statistical software packages. The Durbin– Watson (DW) statistic is scaled to be between 0 and 4. Values close to 2 indicate very little lag 1 autocorrelation, values below 2 indicate positive autocorrelation, and values above 2 indicate negative autocorrelation.

Because positive autocorrelation is the usual culprit, the question becomes how much below 2 the DW statistic must be before you should react. There is a formal hypothesis test for answering this question, and a set of tables appears in some statistics texts. Without going into the details, we simply state that when the number of time series observations, n, is about 30 and the number of explanatory variables is fairly small, say, 1 to 5, then any DW statistic less than 1.2 should get your attention. If n increases to around 100, then you shouldn’t be concerned unless the DW statistic is below 1.5.

If ei is the ith residual, the formula for the DW statistic is

DW = ani = 2(ei − ei − 1)2

ani = 1e2i This is obviously not very attractive for hand calculation, so the StatDurbinWatson func- tion is included in StatTools. To use it, run any regression and check the option to create a graph of residuals versus �tted values. This automatically creates columns of �tted values and residuals. Then enter the formula

=StatDurbinWatson(ResidRange)

in any cell, substituting the actual range of residuals for “ResidRange.” The following continuation of Example 11.1 with the Bendrix manufacturing data—

the only time series data set we have analyzed with regression—checks for possible lag 1 autocorrelation.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

520 Chapter 11 Regression Analysis: Statistical Inference

E X A M P L E 11.1 EXPLAINING OVERHEAD COSTS AT BENDRIX (CONTINUED)

Is there any evidence of lag 1 autocorrelation in the Bendrix data when Overhead is regressed on Machine Hours and Production Runs? Objective To use the Durbin–Watson statistic to check whether there is any lag 1 auto- correlation in the residuals from the Bendrix regression model for overhead costs.

Solution You should run the usual multiple regression and check that you want a graph of residuals versus fitted values. The results are shown in Figure 11.21. The residuals are listed in col- umn D. Each represents how much the regression overpredicts (if negative) or underpre- dicts (if positive) the overhead cost for that month. You can check for lag 1 autocorrelation in two ways, with the DW statistic and by examining the time series graph of the residuals in Figure 11.22.

The DW statistic is calculated in cell F45 of Figure 11.21 with the formula

=StatDurbinWatson(D45:D80)

(Remember that StatDurbinWatson is not a built-in Excelnot a built-in Excelnot ® function. It is available only if StatTools is loaded.) Based on our guidelines for DW values, 1.3131 suggests positive

0

2000

4000

6000

8000 Time Series of Residuals

–12000

–10000

–8000

–6000

–4000

–2000

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 Figure 11.22 Time Series Graph of Residuals

44 45 46 47 48 49 50

A BA B C DC D E FE F Graph Data Durbin-Watson for residualsResidualsFitOverhead 1 2 3 4 5 6

1.3131406.649409 2281.666779 957.4046174 –166.0920107 6740.097234 55.60458249

98391.35059 85522.33322 92723.59538 82428.09201 100227.9028 107869.3954

99798 87804 93681 82262

106968 107925

Figure 11.21 StatTools Regression Output with Residuals and DW Statistic

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-9 Prediction 521

autocorrelation—it is less than 2—but not enough to cause concern.5 This general conclu- sion is supported by the time series graph. Serious autocorrelation of lag 1 would tend to show longer runs of residuals alternating above and below the horizontal axis—positives would tend to follow positives, and negatives would tend to follow negatives. There is some indication of this behavior in the graph but not an excessive amount. ■

What should you do if the DW statistic signals signi�cant autocorrelation? Unfor- tunately, the answer to this question would take us much more deeply into time series analy- sis than we can go in this book. Suf�ce it to say that time series analysis in the context of regression can become very complex, and there are no easy �xes for the autocorrelation that often occurs.

P R O B L E M S

Level A 32. A company produces electric motors for use in home

appliances. One of the company’s production managers is interested in examining the relationship between the dollars spent per month in inspecting finished motor products (X ) and the number of motors produced during that month that were returned by dissatisfied customers (Y ). He has collected the data in the file P10_03.xlsx to explore this relationship for the past 36 months. a. Estimate a simple linear regression equation using

the given data and interpret it. What does the ANOVA table indicate for this model?

b. Examine the residuals of the regression equation. Do you see evidence of any violations of the regression assumptions?

c. Conduct a Durbin–Watson test on the model’s residuals. Interpret the result of this test.

d. In light of your result in part c, do you recommend modifying the original regression model? If so, how would you revise it?

33. Examine the relationship between the average utility bills for homes of a particular size (Y ) and the average monthly temperature (X ). The data in the file P10_07.xlsx include P10_07.xlsx include P10_07.xlsx

the average monthly bill and temperature for each month of the past year. a. Use the given data to estimate a simple linear

regression equation. How well does the estimated regression model fit the given data? What does the ANOVA table indicate for this model?

b. Examine the residuals of the regression equation. Do you see evidence of any violations of the regression assumptions?

c. Conduct a Durbin–Watson test on the model’s residuals. Interpret the result of this test.

d. In light of your result in part c, do you recommend modifying the original regression model? If so, how would you revise it?

34. The manager of a commuter rail transportation system was recently asked by her governing board to predict the demand for rides in the large city served by the transportation network. The system manager has collected data on variables thought to be related to the number of weekly riders on the city’s rail system. The file P10_20.xlsx contains these data. a. Estimate a multiple regression equation using all of

the available explanatory variables. What does the ANOVA table indicate for this model?

b. Is there evidence of auto correlated residuals in this model? Explain why or why not.

11-9 PREDICTION Once you have estimated a regression equation from a set of data, you might want to use this equation to predict the value of the dependent variable for new observations. As an example, suppose that a retail chain is considering opening a new store in one of several proposed locations. It naturally wants to choose the location that will result in the largest revenues. The problem is that the revenues for the new locations are not yet known.

5A more formal test, using Durbin–Watson tables, supports this conclusion.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

522 Chapter 11 Regression Analysis: Statistical Inference

Regression can be used to predict Y for a single observation, or it can be used to predict the mean Y for many observations, all with the same X values.

They can be observed only after stores are opened in these locations, and the chain cannot afford to open more than one store at the current time. An alternative is to use regression analysis. Using data from existing stores, the chain can run a regression of the depend- ent variable revenue on several explanatory variables such as population density, level of wealth in the vicinity, number of competitors nearby, ease of access given the existing roads, and so on.

Assuming that the regression equation has a reasonably large R2 and, even more important, a reasonably small se, the chain can then use this equation to predict revenues for the proposed locations. Speci�cally, it will gather values of the explanatory variables for each of the proposed locations, substitute these into the regression equation, and look at the predicted revenue for each proposed location. All else being equal, the chain will prob- ably choose the location with the highest predicted revenue.

As another example, suppose that you are trying to explain the starting salaries for undergraduate college students. You want to predict the mean salary of all graduates with certain characteristics, such as all male marketing majors from state-supported universities. To do this, you �rst gather salary data from a sample of graduates from various universities. Included in this data set are relevant explanatory variables for each graduate in the sample, such as the type of university, the student’s major, GPA, years of work experience, and so on. You then use these data to estimate a regression equation for starting salary and substi- tute the relevant values of the explanatory variables into the regression equation to obtain the required prediction.

These two examples illustrate two types of prediction problems in regression. The �rst problem, illustrated by the retail chain example, is the more common of the two. Here the objective is to predict the value of the dependent variable for one or more individual members of the population. In this speci�c example you are trying to predict the future revenue for several potential locations of the new store. In the second problem, illustrated by the salary example, the objective is to predict the mean of the dependent variable for all members of the population with certain values of the explanatory variables. In the �rst problem you are predicting an individual value; in the second problem you are predicting a mean.

The second problem is inherently easier than the �rst in the sense that the resulting prediction is bound to be more accurate. The reason is intuitive. Recall that the mean of the dependent variable for any �xed values of the explanatory variables lies on the population regression line. Therefore, if you can accurately estimate this line—that is, if you can accu- rately estimate the regression coef�cients—you can accurately predict the required mean. In contrast, most individual points do not lie on the population regression line. Therefore, not lie on the population regression line. Therefore, not even if your estimate of the population regression line is perfectly accurate, you still cannot predict exactly where an individual point will fall.

Stated another way, when you predict a mean, there is a single source of error: the possibly inaccurate estimates of the regression coef�cients. But when you predict an indi- vidual value, there are two sources of error: the inaccurate estimates of the regression coef�cients and the inherent variation of individual points around the regression line. This second source of error often dominates the �rst.

We illustrate these comments in Figure 11.23. For the sake of illustration, the depend- ent variable is salary and the single explanatory variable is years of experience with the company. Let’s suppose that you want to predict either the salary for a particular employee with 10 years of experience or the mean salary of all employees with 10 years of experi- ence. The two lines in this graph represent the population regression line (which in real- ity is unobservable) and the estimated regression line. For each prediction problem the point prediction—the best guess—is the value above 10 on the estimated regression line. The error in predicting the mean occurs because the two lines in the graph are not the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-9 Prediction 523

Figure 11.23 Prediction Errors for an Individual Value and a Mean

To calculate a point prediction, substitute the given values of the X’s into the estimated regression equation.

It is more difficult to predict for extreme X’s than for X’s close to the mean. Trying to predict for X’s beyond the range of the data set (extrapolation) is quite risky.

same—that is, the estimated line is not quite correct. The error in predicting the individual value (the point shown in the graph) occurs because the two lines are not the same and also because this point does not lie on the population regression line.

One general aspect of prediction becomes apparent by looking at this graph. If we let X’s denote the explanatory variables, predictions for values of the X’s close to their means are likely to be more accurate than predictions for X’s far from their means. In the graph, the mean of YrsExper is about 7. (This is approximately where the two lines cross.) Because the slopes of the two lines are different, they get farther apart as YrsExper gets farther from 7 (on either side). As a result, predictions tend to become less accurate.

This phenomenon shows up as higher standard errors of prediction as the X’s get farther from their means. However, for extreme values of the X’s, there is another prob- lem. Suppose, for example, that all values of YrsExper in the data set are between 1 and 15, and you attempt to predict the salary for an employee with 25 years of experience. This is called extrapolation; you are attempting to predict beyond the limits of the sample.

The problem here is that there is no guarantee, and sometimes no reason to believe, that the relationship within the range of the sample is valid outside of this range. It is per- fectly possible that the effect of years of experience on salary is considerably different in the 25-year range than in the range of the sample. If it is, then extrapolation is bound to yield inaccurate predictions. In general, you should avoid extrapolation whenever possible. If you really want to predict the salaries of employees with 25-plus years of experience, you should include some employees of this type in the original sample.

We now discuss how to make predictions and how to estimate their accuracy, both for individual values and for means. To keep it simple, we �rst assume that there is a single explanatory variable X. We choose a �xed “trial” value of X, labeled X0X0X , and predict the value of a single Y or the mean of all Y ’s when X equals X equals X X0X0X . For both prediction problems the point prediction, or best guess, is found by substituting into the right side of the esti- mated regression equation. Graphically, this is the height of the estimated regression line above X0X0X .

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

524 Chapter 11 Regression Analysis: Statistical Inference

To measure the accuracy of these point predictions, you calculate a standard error for each prediction. These standard errors of prediction can be interpreted in the usual way. For example, you are about 68% certain that the actual values will be within one standard error of the point predictions, and you are about 95% certain that the actual values will be within two standard errors of the point predictions. For the individual prediction prob- lem, the standard error is labeled sind and is given by Equation (11.4). As indicated by the approximate equality on the right, when the sample size n is large and X0X0X is fairly close to X, the last two terms inside the square root are relatively small, and this standard error of prediction can be approximated by se, the standard error of estimate.

Standard Error of Prediction for an Individual Y

sind = se

ã 1 + 1

n +

(X0X0X − X ) 2

ani = 1(XiXiX − X )2ã ≃ se (11.4)

Standard Error of Prediction for the Mean Y

smean = se

ã

1 n

+ (X0X0X − X )

2

ani = 1(XiXiX − X )2ã ≃ se/!n!n!! (11.5)

E X A M P L E 11.1 PREDICTING OVERHEAD AT BENDRIX (CONTINUED)

We have already used regression to analyze overhead expenses at Bendrix, based on 36 months of data. Suppose Bendrix expects the values of Machine Hours and Production Runs for the next three months to be 1430, 1560, 1520, and 35, 45, 40, respectively. What are their point predictions and 95% prediction intervals for Overhead for these three months?

For the prediction of the mean, the standard error is labeled smean and is given by Equation (11.5). Here, if X0X0X is fairly close to X, the last term inside the square root is rela- tively small, and this standard error of prediction is approximately equal to the expression on the right.

These standard errors can be used to calculate a 95% prediction interval for an indi- vidual value and a 95% con�dence interval for a mean value. Exactly as in Chapter 8, you go out a t-multiple of the relevant standard error on either side of the point prediction. The t-multiple is the value that cuts off 0.025 probability in the right-hand tail of a t distribution t distribution t with n − 2 degrees of freedom.

The term prediction interval (rather than con�dence interval) is used for an individual prediction interval (rather than con�dence interval) is used for an individual prediction interval value because an individual value of Y is not a population parameter; it is an individual data point. However, the interpretation is basically the same. If you calculate a 95% predic- tion interval for many members of the population, you can expect their actual Y values to fall within the corresponding prediction intervals about 95% of the time.

To see how all of this can be implemented in Excel, we revisit the Bendrix example of predicting overhead expenses.

The standard error of prediction for a mean of Y’s is approximately equal to the standard error of estimate divided by the square root of the sample size.

The standard error of prediction for a single Y is approximately equal to the standard error of estimate.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-9 Prediction 525

Objective To predict Overhead at Bendrix for the next three months, given anticipated values of Machine Hours and Production Runs.

Solution StatTools has the capability to provide predictions, 95% prediction intervals (for individual values), and 95% confidence intervals (for the means), but you must set up a second data set to capture the results. This second data set can be placed next to (or below) the original data set. It should have the same variable name headings, and it should include values of the explanatory variable to be used for prediction. For this example we called the original data set Original Data and the new data set Data for Prediction. The regression dialog box and results in Data for Prediction appear in Figures 11.24 and 11.25. In Figure 11.24, note that the Prediction option is checked in the Options tab, and the second data set is specified in the corresponding dropdown list.

Figure 11.24 StatTools Regression Dialog Box for Including Predictions

© C

e n g

a g

e L

e a rn

in g

1

2

3

4

Month

F

37 38 39

Machine Hours

G

1430 1560 1520

Produc�on Runs

H

Overhead 97180.3549

111676.2659 105516.7204

I

Predic�onLowerLimit 95 88700.8002

103002.9487 96993.1614

J

Predic�onUpperLimit95 105659.9096 120349.5831 114040.2793

K

ConfidenceLowerLimit 95 95760.3419

109365.4175 103853.9981

L

ConfidenceUpperLimit95 98600.3679

113987.1143 107179.4426

M

35 45 40

Figure 11.25 Prediction of Overhead

© C

e n g

a g

e L

e a rn

in g

Referring to Figure 11.25, the second data set should initially contain the data in col- umns F to H and blanks below the Overhead label in column I. Then when the regression is run (with the Prediction option checked), the values in the Overhead column and the columns to its right will be filled in.

The Overhead values in column I are the point predictions for the next three months, and the LowerLimit95 and UpperLimit95 values in column J and K indicate the 95% pre- diction intervals for these individual months. (The confidence intervals in columns L and

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

526 Chapter 11 Regression Analysis: Statistical Inference

P R O B L E M S

M are not really relevant for this data set. For example, the confidence interval in row 2 would be for the mean Overhead of all months with the given values of Machine Hours all months with the given values of Machine Hours all and Production Runs in row 2.) You can see from the wide prediction intervals how much uncertainty remains. The reason is the relatively large standard error of estimate, se. If you could halve the value of se, the length of the prediction interval would be only half as large. Contrary to what you might expect, this is not a sample size problem. That is, a larger sample size would probably not produce a smaller value of not produce a smaller value of not se. The problem is that Machine Hours and Production Runs are not perfectly correlated with Overhead. The only way to decrease se and get more accurate predictions is to find other explanatory variables that are more closely related to Overhead. ■

Level A 35. The file P10_05.xlsx contains salaries for a sample of

DataCom employees, along with several variables that might be related to salary. a. Estimate an appropriate multiple regression

equation to predict the annual salary of a given DataCom employee.

b. Given the estimated regression model, predict the annual salary of a male employee who served in a similar department at another company for five years prior to coming to work at DataCom. This man, a graduate of a four-year collegiate business program, has been supervising six subordinates in the sales department since joining the organization seven years ago.

c. Find a 95% prediction interval for the salary earned by the employee in part b.

d. Find a 95% confidence interval for the mean salary earned by all DataCom employees sharing the characteristics provided in part b.

e. How can you explain the difference between the widths of the intervals in parts c and d?

36. The owner of a restaurant in Bloomington, Indiana, has recorded sales data for the past 19 years. He has also recorded data on potentially relevant variables. The data appear in the file P10_23.xlsx. a. Estimate a regression equation for sales as a function

of population, advertising in the current year, and advertising in the previous year. Can you expect predictions of sales in future years to be very accurate if they are based on this regression equation? Explain.

b. The company would like to predict sales in the next year (year 20). It doesn’t know what the population

will be in year 20, so it assumes no change from year 19. Its planned advertising level for year 20 is $30,000. Find a prediction and a 95% prediction interval for sales in year 20.

37. A power company located in southern Alabama wants to predict the peak power load (i.e., Y, the maximum amount of power that must be generated each day to meet demand) as a function of the daily high temperature (X ). A random sample of summer days is chosen, and the peak power load and the high temperature are recorded on each day. The file P10_40.xlsx contain these observations.P10_40.xlsx contain these observations.P10_40.xlsx a. Use the given data to estimate a simple linear

regression equation. How well does the regression equation fit the given data?

b. Examine the residuals of the estimated regression equation. Do you see evidence of any violations of the assumptions regarding the errors of the regression model?

c. Calculate the Durbin–Watson statistic on the model’s residuals. What does it indicate?

d. Given your result in part d, do you recommend modifying the original regression model in this case? If so, how would you revise it?

e. Use the final version of your regression equation to predict the peak power load on a summer day with a high temperature of 90 degrees.

f. Find a 95% prediction interval for the peak power load on a summer day with a high temperature of 90 degrees.

g. Find a 95% confidence interval for the average peak power load on all summer days with a high temperature of 90 degrees.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-10 Conclusion 527

11-10 CONCLUSION In these two chapters on regression, you have seen how useful regression analysis can be for a variety of business applications and how statistical software such as StatTools ena- bles you to obtain relevant output—both graphical and numerical—with very little effort. However, you have also seen that there are many concepts that you must understand well before you can use regression analysis appropriately. Given that user-friendly software is available, it is all too easy to generate enormous amounts of regression output and then misinterpret or misuse much of it.

At the very least, you should (1) be able to interpret the standard regression output, including statistics on the regression coef�cients, summary measures such as R2 and se, and the ANOVA table; (2) know what to look for in the many scatterplots available; (3) know how to use dummy variables, interaction terms, and nonlinear transformations to improve a �t; and (4) be able to spot clear violations of the regression assumptions. However, we haven’t covered everything. Indeed, many entire books are devoted exclusively to regres- sion analysis. Therefore, you should recognize when you don’t know enough to handle a don’t know enough to handle a don’t regression problem such as nonconstant error variance or autocorrelation appropriately. In this case, you should consult a statistical expert.

Summary of Key Terms C A S E

Term Symbol Explanation Excel Page Equation

Statistical model A theoretical model including several assumptions that must be satisfied, at least approximately, for inferences from regression output to be valid

484 11.1

Error ε The difference between the actual Y value and the predicted value from the population regression line

485

Homoscedasticity (and heteroscedasticity)

Equal (and unequal) variance of the dependent variable for different values of the explanatory variables

485, 486

Parsimony The concept of explaining the most with the least

489

Standard error of a regression coefficient

sb Measures how much the estimates of a regression coefficient vary from sample to sample

StatTools 489

Confidence interval for a regression coefficient

An interval likely to contain the population regression coefficient

StatTools 491

t-value for test of regression coefficient

t The ratio of the estimate of a regression coefficient to its standard error, used to test whether the coefficient is 0

StatTools 491 11.3

Hypothesis test for a regression coefficient

Typically a two-tailed test, where the null hypothesis is that the regression coefficient is 0

StatTools 491

ANOVA table for regression

Used to test whether the explanatory variables, as a whole, have any significant explanatory power

StatTools 493

(continued)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

528 Chapter 11 Regression Analysis: Statistical Inference

P R O B L E M S

Term Symbol Explanation Excel Page Equation

Multicollinearity Occurs when there is a fairly strong linear relationship between explanatory variables

496

Include/exclude decisions

Guidelines for deciding whether to include or exclude potential explanatory variables

502

Stepwise regression A class of automatic equation- building methods, where variables are  added (or deleted) in order of their importance

StatTools 507

Outliers Observations that lie outside the general pattern of points and can have a substantial effect on the regression model

512

Influential point A point that can “tilt” the regression line

513

Autocorrelation of residuals

Lack of independence in the series of residuals, especially relevant for time series data

519

Durbin–Watson statistic A measure of the autocorrelation between residuals, useful for time series data

StatDurbinWatson, a StatTools function

519

Point prediction The predicted value of Y from the regression equation

523

Standard errors of prediction

sind, smean Measures of the accuracy of prediction when predicting Y for an individual observation, or predicting the mean of all Y ’s, for fixed values of the explanatory variables

StatTools 524 11.4, 11.5

Conceptual Questions C.1. Suppose a regression output produces the following

99% confidence interval for one of the regression coefficients: [−32.47, −16.88]. Given this informa- tion, should an analyst reject the null hypothesis that this population regression coefficient is equal to zero? Explain your answer.

C.2. Explain why it is not possible to estimate a linear regression model that contains all dummy variables all dummy variables all associated with a particular categorical explanatory variable.

C.3. Suppose you have a data set that includes all of the all of the all professional athletes in a given sport over a given period of time, such as all NFL football all NFL football all players during the 2014–2016 seasons, and you use regres- sion to estimate a variable of interest. Are the inferences discussed in this chapter relevant? Recall

that we have been assuming that the data represent a random sample of some larger population. In this sports example, what is the larger population—or is there one?

C.4. Distinguish between the test of significance of an individual regression coefficient and the ANOVA test. When, if ever, are these two statistical tests essentially equivalent?

C.5. Which of these intervals based on the same estimated regression equation with fixed values of the explanatory variables would be wider: (1) a 95% prediction interval for an individual value of Y or (2) a 95% confidence interval for the mean value of Y? Explain your answer. How do you interpret the wider of these two intervals in words?

C.6. Regression outputs from virtually all statistical packages look the same. In particular, the section

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-10 Conclusion 529

on coefficients lists the coefficients, their standard errors, their t-values, their p-values, and (possibly) 95% confidence intervals for them. Explain how all of these are related.

C.7. If you are building a regression equation in a forward stepwise manner, that is, by adding one variable at a time, explain why it is useful to monitor the adjusted R2 and the standard error of estimate. Why is it not as useful to monitor R2?

C.8. You run a regression with two explanatory variables and notice that the p-value in the ANOVA table is extremely small but the p-values of both explanatory variables are larger than 0.10. What is the probable reason? Can you conclude that neither explanatory variable does a good job in predicting the dependent variable?

C.9. Why are outliers sometimes called influential observations? What could happen to the slope of a could happen to the slope of a could regression of Y versus a single X when an outlier X when an outlier X is included versus when it is not included? Will this necessarily happen when a point is an outlier? Answer by giving a couple of examples.

C.10. The Durbin-Watson test is for detecting lag 1 autocorrelation in the residuals. Which values of DW signal positive autocorrelation? If you observe such a DW value but ignore it, what might go wrong with predictions based on the regression equation? Specifically, if the data are time series data, and your goal is to predict the next six months, what might go wrong with the predictions?

Level A 38. For several consecutive weeks you have observed the

sales (in number of cases) of canned tomatoes at Mr. D’s supermarket. Each week you kept track of the following:

■ Was a promotional notice placed in all shopping carts for canned tomatoes?

■ Was a coupon given for canned tomatoes?

■ Was a price reduction (none, 1, or 2 cents off) given?

The file P11_38.xlsx contains these data. a. Use multiple regression to determine how these

factors influence sales. b. Discuss how you can tell whether autocorrelation,

heteroscedasticity, or multicollinearity might be a problem.

c. Predict sales of canned tomatoes during a week in which Mr. D’s uses a shopping cart notice, a coupon, and a one-cent price reduction.

39. The file P11_39.xlsx contains quarterly data on pork sales. Price is in dollars per hundred pounds, quantity sold is in billions of pounds, per capita income is in dollars, U.S. population is in millions, and GDP is in billions of dollars.

a. Use the data to develop a regression equation that could be used to predict the quantity of pork sold during future periods. Discuss how you can tell whether heteroscedasticity, autocorrelation, or multicollinearity might be a problem.

b. Suppose that during each of the next two quarters, price is 45, U.S. population is 240, GDP is 2620, and per capita income is 10,000. (These are in the units described previously.) Predict the quantity of pork sold during each of the next two quarters.

40. The file P11_40.xlsx contains monthly sales for a photography studio and the price charged per portrait during each month. Use regression to estimate an equation for predicting the current month’s sales from last month’s sales and the current month’s price. a. If the price of a portrait during month 21 is $30,

predict month 21 sales. b. Discuss how you can tell whether autocorrelation,

multicollinearity, or heteroscedasticity might be a problem.

41. The file P11_41.xlsx contains data on a motel chain’s revenue and advertising. Note that column C is simply column B “pushed down” a row. a. If the goal is to get the best-fitting regression

equation for Revenue, which of the Advertising variables should be used? Or is it better to use both?

b. Using the best-fitting equation from part a, make predictions for the motel chain’s revenues during the next four quarters. Assume that advertising during each of the next four quarters is $50,000.

c. Does autocorrelation of the residuals from the best-fitting equation appear to be a problem?

42. The file P11_42.xlsx contains the quarterly revenues (in millions of dollars) of a utility company for several years. The goal is to use these data to build a multiple regression model that can be used to forecast future revenues. a. Which variables should be included in the

regression? Explain your rationale for including or excluding variables. (Look at a time series graph for clues.)

b. Interpret the coefficients of your final equation. c. Make a forecast for revenues during the next

quarter. Also, estimate the probability that revenue in the next quarter will be at least $150 million. (Hint: Use the standard error of prediction and the fact that the errors are approximately normally distributed.)

43. The belief that larger majorities for a president in a presidential election help the president’s party increase its representation in the House and Senate is called the coattail effect. The file coattail effect. The file coattail P11_43.xlsx lists the percentage by which each president since 1948 won the election and the number of seats in the House and

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

530 Chapter 11 Regression Analysis: Statistical Inference

Senate gained (or lost) during each election by the elected president’s party. Are these data consistent with the idea of presidential coattails?

44. When potential workers apply for a job that requires extensive manual assembly of small intricate parts, they are initially given three different tests to measure their manual dexterity. The ones who are hired are then periodically given a performance rating on a 0 to 100 scale that combines their speed and accuracy in performing the required assembly operations. The file P11_44.xlsx lists the test scores and performance rat- ings for a randomly selected group of employees. It also lists their seniority (months with the company) at the time of the performance rating. a. Look at a matrix of correlations. Can you say with

certainty (based only on these correlations) that the R2 value for the regression will be at least 35%? Why or why not?

b. Is there any evidence (from the correlation matrix) that multicollinearity will be a problem? Why or why not?

c. Run the regression of Performance Rating versus all four explanatory variables. List the equation, the value of R2, and the value of se. Do all of the coefficients have the signs (negative or positive) you would expect? Briefly explain.

d. Referring to the equation in part c, if a worker (outside of the 80 in the sample) has 15 months of seniority and test scores of 57, 71, and 63, find a prediction and an approximate 95% prediction interval for this worker’s Performance Rating score.

e. One of the t-values for the coefficients in part c is less than 1. Explain briefly why this occurred. Does it mean that this variable is not related to Performance Rating?

f. Arguably, the three test measures provide overlapping (or redundant) information. For the sake of parsimony (explaining “the most with the least”), it might be sensible to regress Performance Rating versus only two explanatory variables, Seniority and Average Test, where Average Test is the average of the three test scores—that is, Average Test = (Test1 + Test2 + Test3)/3. Run this regression and report the same measures as in part c: the equation itself, R2, and se. Can you argue that this equation is just as good as the equation in part c? Explain briefly.

45. Nicklaus Electronics manufactures electronic compo- nents used in the computer and space industries. The annual rate of return on the market portfolio and the annual rate of return on Nicklaus Electronics stock for the last 36 months are listed in the file P11_45.xlsx. The company wants to calculate the systematic risk of systematic risk of systematic risk its common stock. (It is systematic in the sense that it

represents the part of the risk that Nicklaus shares with the market as a whole.) The rate of return YtYtY in period t on a security is hypothesized to be related to the rate of return mt on a market portfolio by the equation

YtYtY = α + βmt + εt Here, α is the risk-free rate of return, β is the security’s systematic risk, and εt is an error term. Estimate the systematic risk of the common stock of Nicklaus Electronics. Would you say that Nicklaus stock is a risky investment? Why or why not?

46. The auditor of Kaefer Manufacturing uses regression analysis during the analytical review stage of the firm’s annual audit. The regression analysis attempts to uncover relationships that exist between various account balances. Any such relationship is subsequently used as a preliminary test of the reasonableness of the reported account balances. The auditor wants to determine whether a relationship exists between the balance of accounts receivable at the end of the month and that month’s sales. The file P11_46.xlsx contains data on these two accounts for the last 36 months. It also shows the sales levels two months before month 1. a. Is there any statistical evidence to suggest a

relationship between the monthly sales level and accounts receivable?

b. Referring to part a, would the relationship be described any better by including this month’s sales and the previous month’s sales (called lagged sales) in the equation for accounts receivable? What about adding the sales from more than a month ago to the equation? For this problem, why might it make accounting sense to include lagged sales variables in the equation? How do you interpret their coefficients?

c. During month 37, which is a fiscal year-end month, the sales were $1,800,000. The reported accounts receivable balance was $3,000,000. Does this reported amount seem consistent with past experience? Explain.

47. A company gives prospective managers four separate tests for judging their potential. For a sample of 30 managers, the test scores and the subsequent job effectiveness ratings (Rating) given one year later are listed in the file P11_47.xlsx. a. Look at scatterplots and the table of correlations for

these five variables. Does it appear that a multiple regression equation for Rating, with the test scores as explanatory variables, will be successful? Can you foresee any problems in obtaining accurate estimates of the individual regression coefficients?

b. Estimate the regression equation that includes all four test scores, and find 95% confidence intervals for the coefficients of the explanatory variables. How can you explain the negative coefficient of

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-10 Conclusion 531

Test3, given that the correlation between Rating and Test3 is positive?

c. Can you reject the null hypothesis that these test scores, as a whole, have no predictive ability for job effectiveness at the 1% level? Why or why not?

d. If a new prospective manager has test scores of 83, 74, 65, and 77, what do you predict his job effectiveness rating will be in one year? What is the standard error of this prediction?

48. Confederate Express is attempting to determine how its monthly shipping costs depend on the number of units shipped during a month. The file P11_48.xlsx contains the number of units shipped and total shipping costs for the last 15 months. a. Use regression to determine a relationship between

units shipped and monthly shipping costs. b. Plot the errors for the predictions in order of time

sequence. Is there any unusual pattern? c. You have now been told that there was a trucking

strike during months 11 through 15, and you believe that this might have influenced shipping costs. How can the analysis in part a be modified to account for the effects of the strike? After accounting for the effects of the strike, does the unusual pattern in part b disappear?

49. The file P11_49.xlsx contains monthly data on fatal automobile crashes in the United States in each of eight three-hour intervals. Suppose you didn’t have the data on the midnight to 3am time interval. How well could multiple regression be used to predict the data for this interval? Which time intervals are most useful in this prediction? Is multicollinearity a problem?

Level B 50. You want to determine the variables that influence bus

usage in major American cities. For several cities, the following data are listed in the file P11_50.xlsx:

■ Bus travel (annual, in thousands of hours) ■ Income (average per capita income) ■ Population (in thousands) ■ Land area (in square miles)

a. Use these data to fit the multiplicative equation

BusTravel = αIncomeβ1Populationβ2LandAreaβ3

b. Are all variables significant at the 5% level? c. Interpret the estimated values of β1, β2, and β3.

51. The file P11_51.xlsx contains data on managers at a large (fictitious) corporation. The variables are Salary (current annual salary), Years Experience (years of experience in the industry), Years Here (years of expe- rience with this company), and Mgt Level (current level in the company, coded 1 to 4). You want to regress Salary on the potential explanatory variables.

What is the best way to do so? Specifically, how should you handle Mgt Level? Should you include both Years Experience and Years Here or only one of them, and if only one, which one? Present your results, and explain them and your reasoning behind them.

52. A toy company has assigned you to analyze the factors influencing the sales of its most popular doll. The number of these dolls sold during the last 23 years is given in the file P11_52.xlsx. The following factors are thought to influence sales of these dolls:

■ Was there a recession? ■ Were the dolls on sale at Christmas? ■ Was there an upward trend over time?

a. Determine an equation that can be used to predict annual sales of these dolls. Make sure that all variables in your equation are significant at the 10% level.

b. Interpret the coefficients in your equation. c. Are there any outliers? d. Is heteroscedasticity or autocorrelation of residuals

a problem? e. During the current year (year 24), a recession

is predicted and the dolls will be put on sale at Christmas. There is a 1% chance that sales of the dolls will exceed what value? You can assume here that heteroscedasticity and autocorrelation are not a problem. (not a problem. (not Hint: Use the standard error of prediction and the fact that the errors are approximately normally distributed.)

53. The file P11_53.xlsx shows the “yield curve” (at monthly intervals). For example, in January 1985 the annual rate on a three-month T-bill was 7.76% and the annual rate on a 30-year government bond was 11.45%. Use regression to determine which interest rates tend to move together most closely.

54. The file P03_63.xlsx contains 2009 data on R&D expenses and many financial variables for 85 U.S. publicly traded companies in the computer and electronic product manufacturing industry. The question is whether R&D expenses can be predicted from any combination of the potential variables. Use scatterplots, correlations (possibly on nonlinear transformations of variables) to search for promising relationships. Eventually, find a regression that seems to provide the best explanatory power for R&D expenses. Interpret this best equation and indicate how good a fit it provides.

55. The June 1997 issue of Management Accounting gave the following rule for predicting your current salary if you are a managerial accountant. Take $31,865. Next, add $20,811 if you are top management, add $3604 if you are senior management, or subtract $11,419 if you

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

532 Chapter 11 Regression Analysis: Statistical Inference

are entry management. Then add $1105 for every year you have been a managerial accountant. Add $7600 if you have a master’s degree or subtract $12,467 if you have no college degree. Add 11,257 if you have a professional certification. Finally, add $8667 if you are male. a. How do you think the journal derived this method

of predicting an accountant’s current salary? Be specific.

b. How could a managerial accountant use this information to determine whether he or she is significantly underpaid?

56. A business school committee was charged with studying admissions criteria to the school. Until that time, only juniors were admitted. Part of the committee’s task was to see whether freshman courses would be equally good predictors of success as freshman and sophomore courses combined. Here, we take “success” to mean doing well in I-core (the integrated core, a combination of the junior level finance, marketing, and operations courses, F301, M301, and P301). The file P11_56.xlsx contains data on 250 students who had just completed I-core. For each student, the file lists their grades in the following courses:

■ M118 (freshman)—finite math ■ M119 (freshman)—calculus ■ K201 (freshman)—computers ■ W131 (freshman)—writing ■ E201, E202 (sophomore)—micro- and

macroeconomics ■ L201 (sophomore)—business law ■ A201, A202 (sophomore)—accounting ■ E270 (sophomore)—statistics ■ Core (junior)—finance, marketing, and

operations

Except for Core, each value is a grade point for a specific course (such as 3.7 for an A−). For Core, each value is the average grade point for the three courses comprising Core. a. The Core grade point is the eventual dependent

variable in a regression analysis. Look at the correlations between all variables. Is multicollinearity likely to be a problem? Why or why not?

b. Run a multiple regression using all of the potential explanatory variables. Now, eliminate the variables as follows. (This is a reasonable variation of the procedures discussed in the chapter.) Look at 95% confidence intervals for their coefficients (as usual, not counting the intercept term). Any variable whose confidence interval contains the value zero is a candidate for exclusion. For all such candidates, eliminate the variable with the t-value lowest in magnitude. Then rerun the

regression, and use the same procedure to possibly exclude another variable. Keep doing this until 95% confidence intervals of the coefficients of all remaining variables do not include zero. Report not include zero. Report not this final equation, its R2 value, and its standard error of estimate se.

c. Give a quick summary of the properties of the final equation in part b. Specifically, (1) do the variables have the “correct” signs, (2) which courses tend to be the best predictors, (3) are the predictions from this equation likely to be much good, and (4) are there any obvious violations of the regression assumptions?

d. Redo part b, but now use as your potential explanatory variables only courses taken in the freshman year. As in part b, report the final equation, its R2, and its standard error of estimate se.

e. Briefly, do you think there is enough predictive power in the freshman courses, relative to the freshman and sophomore courses combined, to change to a sophomore admit policy? (Answer only on the basis of the regression results; don’t get into other merits of the argument.)

57. The file P11_57.xlsx has (somewhat old) data on several countries. The variables are listed here.

■ Country: name of country ■ GNP per Capita: GNP per capita ■ Population Growth: average annual percentage

change in population, 1980–1990 ■ Calories: daily per capita calorie content of food

used for domestic consumption ■ Life Expectancy: average life expectancy of

newborns given current mortality conditions ■ Fertility: births per woman given current fertility

rates

With data such as these, cause and effect are difficult to determine. For example, does low Life Expectancy cause GNP per Capita to be low, or vice versa? Therefore, the purpose of this problem is to experiment with the following sets of dependent and explanatory variables. In each case, look at scatterplots (and use economic reasoning) to find and estimate the best form of the equation, using only linear and logarithmic variables. Then interpret precisely what each equation is saying. a. Dependent: Life Expectancy; Explanatories:

Calories, Fertility b. Dependent: Life Expectancy; Explanatories: GNP

per Capita, Population Growth c. Dependent: GNP per Capita; Explanatories:

Population Growth, Calories, Fertility

58. Suppose that an economist has been able to gather data on the relationship between demand and price

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-10 Conclusion 533

for a particular product. After analyzing scatterplots and using economic theory, the economist decides to estimate an equation of the form Q = aPb, where Q is quantity demanded and P is price. An appropriate regression analysis is then performed, and the estimated parameters turn out to be a = 1000 and b = −1.3. Now consider two scenarios: (1) the price increases from $10 to $12.50; (2) the price increases from $20 to $25. a. Do you predict the percentage decrease in demand

to be the same in scenario 1 as in scenario 2? Why or why not?

b. What is the predicted percentage decrease in demand in scenario 1? What about scenario 2? Be as exact as possible. (Hint: Remember from economics that an elasticity shows directly what happens for a “small” percentage change in price. These changes aren’t that small, so you’ll have to do some calculating.)

59. A human resources analyst believes that in a particular industry, the wage rate ($/h/h/ r) is related to seniority by an equation of the form W = aebS, where W equals W equals W wage rate and S equals seniority (in years). However, S equals seniority (in years). However, S the analyst suspects that both parameters, a and b, might depend on whether the workers belong to a union. Therefore, the analyst gathers data on a number of workers, both union and nonunion, and estimates the following equation with regression:

ln(W ) = 2.14 + 0.027S + 0.12U + 0.006SU

Here ln(W ) is the natural log of W, U is U is U 1 for union workers and 0 for nonunion workers, and SU is the U is the U product of S and S and S U. a. According to this model, what is the predicted

wage rate for a nonunion worker with 0 years of seniority? What is it for a union worker with 0 years of seniority?

b. Explain exactly what this equation implies about the predicted effect of seniority on wage rate for a nonunion worker and for a union worker.

60. A company has recorded its overhead costs, machine hours, and labor hours for the past 60 months. The data are in the file P11_60.xlsx. The company decides to use regression to explain its overhead hours linearly as a function of machine hours and labor hours. However, recognizing good statistical practice, it decides to estimate a regression equation for the first 36 months and then validate this regression with the data from the last 24 months. That is, it will substitute the values of machine and labor hours from the last 24 months into the regression equation that is based on the first 36 months and see how well it does. a. Run the regression for the first 36 months. Explain

briefly why the coefficient of labor hours is not significant.

b. For this part, use the regression equation from part a with both variables still in the equation (even though one was insignificant). Fill in the fitted and residual columns for months 37 through 60. Then do relevant calculations to see whether the R2 (or multiple R) and the standard error of estimate se are as good for these 24 months as they are for the first 36 months. Explain your results briefly. (Hint: Remember the meaning of the multiple R and the standard error of estimate.)

61. Pernavik Dairy produces and sells a wide range of dairy products. Because most of the dairy’s costs and prices are set by a government regulatory board, most of the competition between the dairy and its competitors takes place through advertising. The controller of Pernavik has developed the sales and advertising levels for the last 52 weeks. These appear in the file P11_61.xlsx. Note that the advertising levels for the three weeks prior to week 1 are also listed. The controller wonders whether Pernavik is spending too much money on advertising. He argues that the company’s contribution-margin ratio is about 10%. That is, 10% of each sales dollar goes toward covering fixed costs. This means that each advertising dollar has to generate at least $10 of sales or the advertising is not cost-effective. Use regression to determine whether advertising dollars are generating this type of sales response. (Hint: It is very possible that the sales value in any week is affected not only by advertising this week, but also by advertising levels in the past one, two, or three weeks. These are called lagged values of advertising. Try regression models with lagged values of advertising included, and see whether you get better results.)

62. Pierce Company manufactures drill bits. The production of the drill bits occurs in lots of 1000 units. Due to the intense competition in the industry and the correspondingly low prices, Pierce has undertaken a study of the manufacturing costs of each of the products it manufactures. One part of this study concerns the overhead costs associated with producing the drill bits. Senior production personnel have determined that the number of lots produced, the direct labor hours used, and the number of production runs per month might help to explain the behavior of overhead costs. The file P11_62.xlsx contains the data on these variables for the past 36 months. a. How well can you can predict overhead costs on

the basis of these variables with a linear regression equation? Why might you be disappointed with the results?

b. A production supervisor believes that labor hours and the number of production run setups affect overhead because Pierce uses a lot of supplies when it is working on the machines and because

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

534 Chapter 11 Regression Analysis: Statistical Inference

the machine setup time for each run is charged to overhead. As he says, “When the rate of production increases, we use overtime until we can train the additional people that we require for the machines. When the rate of production falls, we incur idle time until the surplus workers are transferred to other parts of the plant. So it would seem to me that there will be an additional overhead cost whenever the level of production changes. I would also say that because of the nature of this rescheduling process, the bigger the change in production, the greater the effect of the change in production on the increase in overhead.” How might you use this information to find a better regression equation than in part a? (Hint: Develop a new explanatory variable, and assume that the number of lots produced in the month preceding month 1 was 5964.)

63. Danielson Electronics manufactures color television sets for sale in a highly competitive marketplace. Recently Ron Thomas, the marketing manager of Danielson Electronics, has been complaining that the company is losing market share because of a poor-quality image, and he has asked that the company’s major product, the 25-inch console model, be redesigned to incorporate a higher quality level. The company general manager, Steve Hatting, is considering the request to improve the product quality but is not convinced that consumers will be willing to pay the additional expense for improved quality. As the company controller, you are in charge of determining the cost-effectiveness of improving the quality of the television sets. With the help of the marketing staff, you have obtained a summary of the average retail price of the company’s television set and the prices of 29 competitive sets. In addition, you have obtained from The Shoppers’ Guide, a magazine that evaluates and reports on various consumer products, a quality rating of the television sets produced by Danielson Electronics and its competitors. The file P11_63.xlsx summarizes these data. According to The Shoppers’ Guide, the quality rating, which varies from 0 to 10 (10 being the highest level of quality), considers such factors as the quality of the picture, the frequency of repair, and the cost of repairs. Discussions with the product design group suggest that the cost of manufacturing this type of television set is 125 + Q2, where Q is the quality rating. a. Regress Average Price versus Quality Rating. Does

the regression equation imply that customers are willing to pay a premium for quality? Explain.

b. Given the results from part a, is there a preferred level of quality for this product? Assume that the quality level will affect only the price charged and not the level of sales of the product.

c. How might you answer part b if the level of sales is also affected by the quality level (or alternatively, if the level of sales is affected by price)?

64. The file P11_64.xlsx contains data on gasoline consumption and several economic variables. The variables are gasoline consumption for passenger cars (Gas Used), service station price excluding taxes (Station Price), retail price of gasoline including state and federal taxes (Retail Price), Consumer Price Index for all items (CPI), Consumer Price Index for public transportation (CPIT), number of registered passenger cars (Cars), average miles traveled per gallon (MPG), and real per capita disposable income (Income). a. Regress Gas Used linearly versus CPIT, Cars,

MPG, Income, and Deflated Price, where Deflated Price is the deflated retail price of gasoline (Retail Price divided by CPI). What signs would you expect the coefficients to have? Do they have these signs? Which of the coefficients are statistically significant at the 5% significance level?

b. Suppose the government makes the claim that for every one cent of tax on gasoline, there will be a $1 billion increase in tax revenue. Use the estimated equation in part a to support or refute the government’s claim.

65. On October 30, 1995, the citizens of Quebec went to the polls to decide the future of their province. They were asked to vote “Yes” or “No” on whether Quebec, a predominantly French-speaking province, should secede from Canada and become a sovereign country. The “No” side was declared the winner, but only by a thin margin. Immediately following the vote, however, allegations began to surface that the result was closer than it should have been. [Source: Cawley and Sommers (1996)]. In particular, the ruling separatist Parti Québécois, whose job was to decide which ballots were rejected, was accused by the “No” voters of systematic electoral fraud by voiding thousands of “No” votes in the predomi- nantly allophone and anglophone electoral divisions of Montreal. (An allophone refers to someone whose first language is neither English nor French. An anglophone refers to someone whose first language is English.) Cawley and Sommers examined whether electoral fraud had been committed by running a regression, using data from the 125 electoral divisions in the October 1995 referendum. The dependent variable was REJECT, the percentage of rejected ballots in the electoral division. The explanatory variables were as follows:

■ ALLOPHONE: percentage of allophones in the electoral division

■ ANGLOPHONE: percentage of anglophones in the electoral division

■ REJECT94: percentage of rejected votes from that electoral division during a similar referendum in 1994

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

11-10 Conclusion 535

■ LAVAL: dummy variable equal to 1 for electoral divisions in the Laval region, 0 otherwise

■ LAV_ALL: interaction (i.e., product) of LAVAL and ALLOPHONE

The estimated regression equation (with t-values in parentheses) is

Prediced REJECT = 1.112 (5.68)

+ 0.020 (4.34)

ALLOPHONE

+ 0.001 (0.12)

ANGLOPHONE + 0.223 (2.64)

REJECT94

− 3.773 (−8.61)

LAVAL + 0.387 (15.62)

LAV_ALL

The R2 value was 0.759. Based on this analysis, Cawley and Sommers state that, “The evidence presented here suggests that there were voting irregularities in the October 1995 Quebec referendum, especially in Laval.” Discuss how they came to this conclusion.

66. Suppose you are trying to explain variations in salaries for technicians in a particular field of work. The file P11_66.xlsx contains annual salaries for 200 technicians. It also shows how many years of experience each technician has, as well as his or her education level. There are four education levels, as explained in the comment in cell D1. Three suggestions are put forth for the relationship between Salary and these two explanatory variables:

■ You should regress Salary linearly versus the two given variables, Experience and Education.

■ All that really matters in terms of education is whether the person got a college degree or not. Therefore, you should regress Salary linearly versus Experience and a dummy variable indicating whether he or she got a college degree.

■ Each level of education might result in different jumps in salary. Therefore, you should regress Salary linearly versus Experience and dummy variables for the different education levels.

a. Run the indicated regressions for each of these three suggestions. Then (1) explain what each equation is saying and how the three are different (focus here on the coefficients), (2) which you prefer, and (3) whether (or how) the regression results in your preferred equation contradict the average salary results shown in the Pivot Table sheet of the file.

b. Consider the four workers shown on the Prediction sheet of the file. (These are four new workers, not among the original 200.) Using your preferred equation, calculate a predicted salary and a 95% prediction interval for each of these four workers.

c. It turns out (you don’t have to check this) that the interaction between years of experience and education level is not significant for this data set. not significant for this data set. not In general, however, argue why you might expect

an interaction between them for salary data of technical workers. What form of interaction would you suspect? (There is not necessarily one right answer, but argue convincingly one way or the other for a positive or a negative interaction.)

67. The file P03_55.xlsx contains baseball data on all MLB teams from during the years 2004–2011. For each year and team, the total salary and the number of(regular-season) wins are listed. a. Rearrange the data so that there are six columns:

Team, Year, Salary Last Year, Salary This Year, Wins Last Year, and Wins This Year. You don’t need rows for 2004 rows, because the data for 2003 isn’t available for Salary Last Year and Wins Last Year. Your ending data set should have 7*30 rows of data.

b. Run a multiple regression for Wins This Year versus the other variables (besides Team). Then run a forward stepwise regression with these same variables. Compare the two equations, and explain exactly what the coefficients of the equation from the forward method imply about wins.

c. The Year variable should be insignificant. Is it? should be insignificant. Is it? should Why would it be contradictory for the “true” coefficient of Year to be anything other than zero?

d. Statistical inference from regression equations is all about inferring from the given data to a larger population. Does it make sense to talk about a larger population in this situation? If so, what is the larger population?

68. Do the previous problem, but use the basketball data on all NBA teams in the file P03_56.xlsx.

69. Do the previous problem, but use the football data on all NFL teams in the file P03_57.xlsx.

70. The file P03_65.xlsx contains basketball data on all NBA teams for five seasons. The SRS (simple rating system) variable is a measure of how good a team is in any given year. (It is explained in more detail in the comment in cell F3.) a. Given the explanation of SRS, it makes sense to

use multiple regression, with PTS and O_PTS as the explanatory variables, to predict SRS. Do you get a good fit?

b. Suppose instead that the goal is to predict Wins. Try multiple regression, using the variables in columns G–AH or variables calculated from them. For example, instead of FG and FGA, you could try FG/FGA, the fraction of attempted field goals made. You will have to guard against exact multicollinearity. For example, PTS can be calculated exactly from FG, 3P, and FT. This is a good time to use some form of stepwise regression. How well is your best equation able to predict Wins?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

71. Do the preceding problem, but now use the football data in the file data in the file data in the f P03_66.xlsx. (This file contains offensive and defensive ratings in the OSRS and offensive and defensive ratings in the OSRS and of

DSRS variables, but you can ignore them for this problem. Focus only on the SRS rating in part a.)

C A S E 11.1 HEATING OIL AT DUPREE FUELS COMPANY6

Dupree Fuels Company is facing a difficult problem. Dupree sells heating oil to residential customers. Given the amount of competition in the industry, both from other home heating oil suppliers and from electric and natural gas utilities, the price of the oil supplied and the level of service are critical in determining a company’s success. Unlike electric and natural gas customers, oil customers are exposed to the risk of running out of fuel. Home heating oil suppliers therefore have to guarantee that the customer’s oil tank will not be allowed to run dry. In fact, Dupree’s service pledge is, “50 free gallons on us if we let you run dry.” Beyond the cost of the oil, however, Dupree is concerned about the perceived reliability of his service if a customer is allowed to run out of oil.

To estimate customer oil use, the home heating oil industry uses the concept of a degree-day, equal to the difference between the average daily temperature and 68 degrees Fahrenheit. So if the average temperature on a given day is 50, the degree-days for that day will be 18. (If the degree-day calculation results in a negative number, the degree-day number is recorded as 0.) By keeping track of the number of degree-days since the customer’s last oil fill, knowing the size of the customer’s oil tank, and estimating the customer’s oil consumption as a function of the number of degree-days, the oil supplier can estimate when the customer is getting low on fuel and then resupply the customer.

Dupree has used this scheme in the past but is disappointed with the results and the computational burdens it places on the company. First, the system requires that a consumption-per-degree-day figure be estimated for each customer to reflect that customer’s consumption habits, size of home, quality of home insulation, and family size. Because Dupree has more than 1500 customers, the computational burden of keeping track of all of these customers is enormous. Second, the system is crude and unreliable. The consumption per degree-day for each customer is computed by dividing the oil

consumption during the preceding year by the degree-days during the preceding year. Customers have tended to use less fuel than estimated during the colder months and more fuel than estimated during the warmer months. This means that Dupree is making more deliveries than necessary during the colder months and customers are running out of oil during the warmer months.

Dupree wants to develop a consumption estimation model that is practical and more reliable. The following data are available in the file C11_01.xlsx:

■ The number of degree-days since the last oil fill and the consumption amounts for 40 customers.

■ The number of people residing in the homes of each of the 40 customers. Dupree thinks that this might be important in predicting the oil consump- tion of customers using oil-fired water heaters because it provides an estimate of the hot-water requirements of each customer. Each of the cus- tomers in this sample uses an oil-fired water heater.

■ An assessment, provided by Dupree sales staff, of the home type of each of these 40 customers. The home type classification, which is a number between 1 and 5, is a composite index of the home size, age, exposure to wind, level of insulation, and furnace type. A low index implies a lower oil con- sumption per degree-day, and a high index implies a higher consumption of oil per degree-day. Dupree thinks that the use of such an index will allow them to estimate a consumption model based on a sam- ple data set and then to apply the same model to predict the oil demand of each of his customers.

Use regression to see whether a statistically reliable oil consumption model can be estimated from the data.

6Cases 11.1 through 11.3 are based on problems from Advanced Management Accounting, 2nd edition, by Robert S. Kaplan and Anthony A. Atkinson, 1989, Upper Saddle River, NJ: Prentice Hall. We thank them for allowing us to adapt their problems.

536 Chapter 11 Regression Analysis: Statistical Inference Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

537Case 11.2 Developing a Flexible Budget at the Gunderson Plant 537

C A S E 11.2 DEVELOPING A FLEXIBLE BUDGET AT THE GUNDERSON PLANT

The Gunderson Plant manufactures the industrial product line of FGT Industries. Plant management wants to be able to get a good, yet quick, estimate of the manufacturing overhead costs that can be expected each month. The easiest and simplest method to accomplish this task is to develop a flexible budget formula for the manufacturing overhead costs. The plant’s accounting staff has suggested that simple linear regression be used to determine the behavior pattern of the overhead costs. The regression data can provide the basis for the flexible budget formula. Sufficient evidence is available to conclude that manufacturing overhead costs vary with direct labor hours. The actual direct labor hours and the corresponding manufacturing overhead costs for each month of the last three years have been used in the linear regression analysis.

The three-year period contained various occurrences not uncommon to many businesses. During the first year, production was severely curtailed during two months due to wildcat strikes. In the second year, production was reduced in one month because of material shortages, and increased significantly (scheduled overtime) during two months to meet the units required for a one-time sales order. At the end of the second year, employee benefits were raised significantly as the result of a labor agreement. Production during the third year was not affected by any special circumstances. Various members of Gunderson’s accounting staff raised some issues regarding the historical data collected for the regression analysis. These issues were as follows.

■ Some members of the accounting staff believed that the use of data from all 36 months would provide a more accurate portrayal of the cost behavior. While they recognized that any of

the monthly data could include efficiencies and inefficiencies, they believed these efficiencies and inefficiencies, they believed these efficiencies and inefficiencies, inefficiencies would tend to balance out over a longer period of time.

■ Other members of the accounting staff suggested that only those months that were considered normal should be used so that the regression would not be distorted.

■ Still other members felt that only the most recent 12 months should be used because they were the most current.

■ Some members questioned whether historical data should be used at all to form the basis for a flexible budget formula.

The accounting department ran two regression analyses of the data—one using the data from all 36 months and the other using only the data from the last 12 months. The information derived from the two linear regressions is shown below (t-values shown in parentheses). The 36-month regression is

OHt = 123,810 + 1.60 (1.64)

DLHt, R 2 = 0.32

The 12-month regression is

OHt = 109,020 + 3.00 (3.01)

DLHt, R 2 = 0.48

Questions 1. Which of the two results (12 months versus 36

months) would you use as a basis for the flexible budget formula?

2. How would the four specific issues raised by the members of Gunderson’s accounting staff influ- ence your willingness to use the results of the statistical analyses as the basis for the flexible budget formula? Explain your answer.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

538 Chapter 11 Regression Analysis: Statistical Inference

C A S E 11.3 FORECASTING OVERHEAD AT WAGNER PRINTERS

Wagner Printers performs all types of printing, including custom work, such as advertising displays, and standard work, such as business cards. Market prices exist for standard work, and Wagner Printers must match or better these prices to get the business. The key issue is whether the existing market price covers the cost associated with doing the work. On the other hand, most of the custom work must be priced individually. Because all custom work is done on a job-order basis, Wagner routinely keeps track of all the direct labor and direct materials costs associated with each job. However, the overhead for each job must be estimated. The overhead is applied to each job using a predetermined (normalized) rate based on estimated overhead and labor hours. Once the cost of the prospective job is determined, the sales manager develops a bid that reflects both the existing market conditions and the estimated price of completing the job.

In the past, the normalized rate for overhead has been computed by using the historical average of overhead per direct labor hour. Wagner has become increasingly concerned about this practice for two reasons. First, it hasn’t produced accurate forecasts of overhead in the past. Second,

technology has changed the printing process, so that the labor content of jobs has been decreasing, and the normalized rate of overhead per direct labor hour has steadily been increasing. The file C11_03.xlsx shows the overhead data that Wagner has collected for its shop for the past 52 weeks. The average weekly overhead for the last 52 weeks is $54,208, and the average weekly number of labor hours worked is 716. Therefore, the normalized rate for overhead that will be used in the upcoming week is about $76(= 54208/716) per direct labor hour.

Questions 1. Determine whether you can develop a more

accurate estimate of overhead costs. 2. Wagner is now preparing a bid for an important Wagner is now preparing a bid for an important W

order that may involve a considerable amount of repeat business. The estimated requirements for this project are 15 labor hours, 8 machine hours, $150 direct labor cost, and $750 direct material cost. Using the existing approach to cost estima- tion, Wagner has estimated the cost for this job as $2040(= 150 + 750 + (76 × 15)). Given the existing data, what cost would you estimate for this job?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

539

C H A P T E R

Time Series Analysis and Forecasting12

REVENUE MANAGEMENT AT HARRAH’S CHEROKEE CASINO & HOTEL

Real applications of forecasting are almost never done in isolation. They are typically one part—a crucial part—of an overall quantitative solution to a business problem. This is certainly the case at Harrah’s Cherokee Casino & Hotel in North Carolina, as explained in an article by Metters et al. (2008). This particular casino uses revenue management (RM) on a daily basis to increase its revenue from its gambling customers. As customers call to request reservations at the casino’s hotel, the essential problem is to decide which reservations to accept and which to deny. The idea is that there is an opportunity cost from accepting early requests from lower-valued customers because higher-valued customers might request the same rooms later on.

As the article explains, there are several unique features about casinos, and this casino in particular, that make a quantitative approach to RM successful. First, the detailed behaviors of customers can be tracked, via electronic cards they use while placing bets in the electronic gambling machines, so that the casino can create a large database of individual customers’ gambling patterns. This allows the casino to segment the customers into different groups, based on how much they typically bet in a given night. For example, one segment might contain all customers who bet between $500 and $600 per night. When a customer calls for a room reservation and provides his card number, the casino can immediately look up his information in the database and see which segment he is in.

B le

n d

I m

a g

e s/

Jo n F

e in

g e rs

h /t h e A

g e n c y

C o lle

c tio

n /G

e tt

y Im

a g

e s

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

540 Chapter 12 Time Series Analysis and Forecasting

A second reason for the successful use of RM is that customers differ substantially in the price they are willing to pay for the same commodity, a stay at the casino’s hotel. Actually, many don’t pay anything for the room or the food—these are frequently complimentary from the casino—but they pay by losing money at gambling. Some customers typically gamble thousands of dollars per night while others gamble much less. (This is quite different from the disparities in other hotels or in air travel, where a business traveler might pay twice as much as a vacationer, but not much more.) Because some customers are much more valuable than others, there are real opportunity costs from treating all customers alike.

A third reason for the success of RM at this casino is that the casino can afford to hold out for the best-paying customers until the last minute. The reason is that a significant percentage of the customers from all segments wait until the last minute to make their reservations. In fact, they often make them while driving, say, from Atlanta to the casino. Therefore, the casino can afford to deny requests for reservations to lower- valued customers made a day or two in advance, knowing that last-minute reservations, very possibly from higher-valued customers, will fill up the casino’s rooms. Indeed, the occupancy rate is virtually always 98% or above.

The overall RM solution includes (1) data collection and customer segmentation, as explained above, (2) forecasting demand for reservations from each customer segment, (3) a linear programming (LP) optimization model that is run frequently to decide which reservations to accept, and (4) a customer relationship management model to entice loyal customers to book rooms on nights with lower demand. The forecasting model is very similar to the Winters’ exponential smoothing model discussed in this chapter. Specifically, the model uses the large volume of historical data to forecast customer demand by each customer segment for any particular night in the future. These forecasts include information about time-related or seasonal patterns (weekends are busier, for example) and any special events that are scheduled. Also, the forecasts are updated daily as the night in question approaches. These forecasts are then used in an LP optimization model to determine which requests to approve. For example, the LP model might indicate that, given the current status of bookings and three nights to go, requests for rooms on the specified night should be accepted only for the four most valuable customer segments. As the given night approaches and the number of booked rooms changes, the LP model is rerun many times and provides staff with the necessary information for real-time decisions. (By the way, a customer who is refused a room at the casino is often given a free room at another nearby hotel. After all, this customer can still be valuable enough to offset the price of the room at the other hotel.)

It is difficult to measure the effect of this entire RM system because it has always been in place since the casino opened. But there is no doubt that it is effective. Despite the fact that it serves no alcohol and has only electronic games, not the traditional gaming tables, the casino has nearly full occupancy and returns a 60% profit margin on gross revenue—double the industry norm. ■

12-1 INTRODUCTION Many decision-making applications depend on a forecast of some quantity. Here are sev- eral examples.

Examples of Forecasting Applications

■ When a service organization, such as a fast-food restaurant, plans its staf�ng over some time period, it must forecast the customer demand as a function of time. This might be done at a very detailed level, such as the demand in successive 15-minute periods, or at a more aggregate level, such as the demand in successive weeks.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-2 Forecasting Methods: An Overview 541

■ When a company plans its ordering or production schedule for a product it sells to the public, it must forecast the customer demand for this product so that it can stock appropriate quantities—neither too many nor too few.

■ When an organization plans to invest in stocks, bonds, or other �nancial instruments, it typically attempts to forecast movements in stock prices and interest rates.

■ When government of�cials plan policy, they attempt to forecast movements in macroeconomic variables such as in�ation, interest rates, and unemployment.

Unfortunately, forecasting is a very dif�cult task, both in the short run and in the long run. Typically, forecasts are based on historical data. Analysts search for patterns or rela- tionships in the historical data, and then make forecasts. There are two problems with this approach. The �rst is that it is not always easy to uncover historical patterns or relation- ships. In particular, it is often dif�cult to separate the noise, or random behavior, from the underlying patterns. Some forecasts can even overdo it, by attributing importance to pat- terns that are in fact random variations and are unlikely to repeat themselves.

The second problem is that there are no guarantees that past patterns will continue in the future. A new war could break out somewhere in the world, a company’s com- petitor could introduce a new product into the market, the bottom could fall out of the stock market, and so on. Each of these shocks to the system being studied could drasti- cally alter the future in a highly unpredictable way. This partly explains why forecasts are almost always wrong. Unless they have inside information to the contrary, analysts must assume that history will repeat itself. But we all know that history does not always not always not repeat itself. Therefore, there are many famous forecasts that turned out to be way off the mark, even though the analysts made reasonable assumptions and used standard forecast- ing techniques. Nevertheless, forecasts are required throughout the business world, so fear of failure is no excuse for not giving it our best effort.

12-2 FORECASTING METHODS: AN OVERVIEW There are many forecasting methods available, and all practitioners have their favorites. To say the least, there is little agreement among practitioners or academics as to the best fore- casting method. The methods can generally be divided into three groups: (1) judgmental methods, (2) extrapolation (or time series) methods, and (3) econometric (or causal) methods. The �rst of these is basically nonquantitative and will not be discussed here; the last two are quantitative. In this section we describe extrapolation and econometric methods in some generality. In the rest of the chapter, we go into more detail, particularly about the extrapolation methods.

12-2a Extrapolation Models

Extrapolation models are quantitative models that use past data of a time series variable—and nothing else, except possibly time itself—to forecast future values of the variable. The idea is that past movements of a variable, such as company sales or U.S. exports to Japan, can be used to forecast future values of the variable. Many extrapolation models are available, including trend-based regression, autoregression, moving averages, and exponential smoothing. Some of these models are relatively simple, both conceptually and in terms of the calculations required, whereas others are quite complex. Also, as the names imply, some of these models use the same regression methods from the previous two chapters, whereas others do not.

All of these extrapolation models search for patterns in the historical series and then extrapolate these patterns into the future. Some try to track long-term upward or downward trends and then project these. Some try to track the seasonal patterns (such as sales up in

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

542 Chapter 12 Time Series Analysis and Forecasting

November and December, down in other months) and then project these. Basically, the more complex the model, the more closely it tries to track historical patterns. Researchers have long believed that good forecasting models should be able to track the ups and downs—the zigzags on a graph—of a time series. This has led to voluminous research and increasingly complex methods. But is complexity always better?

Surprisingly, empirical evidence shows that complexity is not always better. This is not always better. This is not documented in a quarter-century review article by Armstrong (1986) and an article by Schnarrs and Bavuso (1986). (Admittedly, these reviews are old, but similar reviews done today would probably �nd similar results.) They document a number of empirical studies on literally thousands of time series forecasts where complex models fared no better, and sometimes even worse, than simple models. In fact, the Schnarrs and Bavuso article presents evidence that a naive forecast from a “random walk” model sometimes outperforms all of the more sophisticated extrapolation models. This naive model forecasts that next period’s value will be the same as this period’s value. So if today’s closing stock price is 51.375, it forecasts that tomorrow’s closing stock price will be 51.375. This model is certainly simple, and it sometimes works quite well. We discuss random walks in more detail in Section 12-5.

The evidence in favor of simpler models is not accepted by everyone, particularly not those who have spent years investigating complex models, and complex models continue to be studied and used. However, there is a very plausible reason why simple models can provide reasonably good forecasts. The whole goal of extrapolation models is to extrapo- late historical patterns into the future. But it is often dif�cult to determine which patterns are real and which represent noise—random ups and downs that are not likely to repeat themselves. Also, if something important changes (a competitor introduces a new product or there is an oil embargo, for example), it is certainly possible that historical patterns will change. A potential problem with complex models is that they can track a historical series too closely. That is, they sometimes track patterns that are really noise. Simpler models, on the other hand, track only the most basic underlying patterns and therefore can be more �exible and accurate in forecasting the future.

12-2b Econometric Models

Econometric models, also called causal or regression-based models, use regression to forecast a time series variable by using other explanatory time series variables. For exam- ple, a company might use a causal model to regress future sales on its advertising level, the population income level, the interest rate, and possibly others. In one sense, regression analysis involving time series variables is similar to the regression analysis discussed in the previous two chapters. The same least squares approach and the same multiple regression software can be used in many time series regression models.

However, causal regression models for time series data present new mathematical challenges that go well beyond the level of this book. To get a glimpse of the potential dif�culties, suppose a company wants to use a regression model to forecast its monthly sales for some product, using two other time series variables as predictors: its monthly advertising levels for the product and its main competitor’s monthly advertising levels for a competing product. The resulting regression equation has the form

Prediction from Regression Equation Predicted YtYtY = a + b1X1t + b2X2X2 2X2X t (12.1)

Here, YtYtY is the company’s sales in month t, and X1t and t and t X2X2X t are, respectively, the company’s t are, respectively, the company’s t and the competitor’s advertising levels in month t. This regression model might provide some useful results, but there are some issues that must be faced.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-2 Forecasting Methods: An Overview 543

One issue is that the appropriate “lags” for the regression equation must be deter- mined. Do sales this month depend only on advertising levels this month, as speci�ed in Equation (12.1), or also on advertising levels in the previous month, the previous two months, and so on? A second issue is whether to include lags of the sales variable in the regression equation as explanatory variables. Presumably, sales in one month might depend on the level of sales in previous months (as well as on advertising levels). A third issue is that the two advertising variables can be autocorrelated and cross-correlated. Autocorrelation means correlated with itself. For example, the company’s advertising level in one month might depend on its advertising levels in previous months. Cross-correlation means being correlated with a lagged version of another variable. For example, the company’s advertis- ing level in one month might be related to the competitor’s advertising levels in previous months, or the competitor’s advertising in one month might be related to the company’s advertising levels in previous months.

These are dif�cult issues, and the way in which they are addressed can make a big difference in the usefulness of the regression model. We will examine several regression- based models in this chapter, but we won’t discuss situations such as the one just described, where one time series variable Y is regressed on one or more time series of X’s.

12-2c Combining Forecasts

There is one other general forecasting method that is worth mentioning. In fact, it has attracted a lot of attention in recent years, and many researchers believe that it has potential for increasing forecast accuracy. The method is simple—it combines two or more forecasts to obtain the �nal forecast. The reasoning behind this method is also simple: The forecast errors from different forecasting methods might cancel one another. The forecasts that are combined can be of the same general type—extrapolation forecasts, for example—or they can be of different types, such as judgmental and extrapolation.

The number of forecasts to combine and the number of forecasts to combine and the number weights to use in combining them have been the subject of several research studies. Although the �ndings are not entirely consist- ent, it appears that the marginal bene�t from each individual forecast after the �rst two or three is minor. Also, there is not much evidence to suggest that the simplest weighting scheme—weighting each forecast equally, that is, averaging them—is any less accurate than more complex weighting schemes.

12-2d Components of Time Series Data

In Chapter 2 we discussed time series graphs, a useful graphical way of displaying time series data. We now use these time series graphs to help explain and identify four important components of a time series. These components are called the trend component, the trend component, the trend sea- sonal component, the sonal component, the sonal cyclic component, and the random (or noise) component.

We start by looking at a very simple time series. This is a time series where every observation has the same value. Such a series is shown in Figure 12.1. The graph in this �gure shows time (t) on the horizontal axis and the observed values (Y ) on the vertical axis. We assume that Y is measured at regularly spaced intervals, usually days, weeks, months, quarters, or years, with YtYtY being the value of the observation at time period t. As indicated in Figure 12.1, the individual observation points are usually joined by straight lines to make any patterns in the time series more apparent. Because all observations in this time series are equal, the resulting time series graph is a horizontal line. We refer to this time series as the base series. We will now illustrate more interesting time series built from this base series.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

544 Chapter 12 Time Series Analysis and Forecasting

If the observations increase or decrease regularly through time, we say that the time series has a trend. The graphs in Figure 12.2 illustrate several possible trends. The linear trend in Figure 12.2a occurs if a company’s sales increase by the same amount from period to period. This constant per period change is then the slope of the linear trend line. The curve in Figure 12.2b is an exponential trend. It occurs in a business such as the personal exponential trend. It occurs in a business such as the personal exponential computer business, where sales increased at a tremendous rate (at least during the 1990s, the boom years). For this type of curve, the percentage increase in YtYtY from period to period t from period to period t remains constant. The curve in Figure 12.2c is an S-shaped trend. This type of trend is -shaped trend. This type of trend is -shaped appropriate for a new product that takes a while to catch on, then exhibits a rapid increase in sales as the public becomes aware of it, and �nally tapers off to a fairly constant level because of market saturation. The series in Figure 12.2 all represent upward trends. Of upward trends. Of upward course, there are downward trends of the same types.downward trends of the same types.downward

Many time series have a seasonal component, that is, they exhibit seasonality. For example, a company’s sales of swimming pool equipment increase every spring, then stay relatively high during the summer, and then drop off until next spring, at which time the yearly pattern repeats itself. An important aspect of the seasonal component is that it tends to be predictable from one year to the next. That is, the same seasonal pattern tends to repeat itself every year.

Figure 12.3 illustrates two possible seasonal patterns. In Figure 12.3a there is nothing but the seasonal component. That is, if there were no seasonal variation, the series would be the base series in Figure 12.1. Figure 12.3b illustrates a seasonal pattern superimposed on a linear trend line.

The third component of a time series is the cyclic component. By studying past movements of many business and economic variables, it becomes apparent that there are

Figure 12.1 The Base Series

© C

e n g

a g

e L

e a rn

in g

Figure 12.2 Series with Trends

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-2 Forecasting Methods: An Overview 545

business cycles that affect many variables in similar ways. For example, during a reces- sion housing sales generally go down, unemployment goes up, stock prices go down, and so on. But when the recession is over, all of these variables tend to move in the opposite direction. Unfortunately, the cyclic component is more dif�cult to predict than the seasonal component. The reason is that seasonal variation is much more regular. For example, swim- ming pool supplies sales always start to increase during the spring. Cyclic variation, on the other hand, is more irregular because the length of the business cycle varies, sometimes considerably. A further distinction is that the length of a seasonal cycle is generally one year; the length of a business cycle is generally longer than one year and its actual length is dif�cult to predict.

The graphs in Figure 12.4 illustrate the cyclic component of a time series. In Figure 12.4a cyclic variation is superimposed on the base series in Figure 12.1. In Figure 12.4b this same cyclic variation is superimposed on the series in Figure 12.3b. The resulting graph has trend, seasonal variation, and cyclic variation.

The �nal component in a time series is called random variation, or simply noise. This unpredictable component gives most time series graphs their irregular, zigzag appearance. Usually, a time series can be determined only to a certain extent by its trend, seasonal, and cyclic components. Then other factors determine the rest. These other factors can be inherent randomness, unpredictable “shocks” to the system, the unpredictable behavior of human beings who interact with the system, and possibly others. These factors combine to create a certain amount of unpredictability in almost all time series.

Figures 12.5 and 12.6 show the effect that noise can have on a time series graph. The graph on the left of each �gure shows the random component only, superimposed on the base series. Then on the right of each �gure, the random component is superim- posed on the trend-with-seasonal-component graph from Figure 12.3b. The difference

Figure 12.3 Series with Seasonality

© C

e n g

a g

e L

e a rn

in g

Figure 12.4 Series with Cyclic Component

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

546 Chapter 12 Time Series Analysis and Forecasting

between Figures 12.5 and 12.6 is the relative magnitude of the noise. When it is small, as in Figure 12.5, the other components emerge fairly clearly; they are not disguised by the noise. But if the noise is large in magnitude, as in Figure 12.6, the noise makes it very dif- �cult to distinguish the other components.

12-2e Measures of Accuracy

We now introduce some notation and discuss aspects common to most forecasting meth- ods. In general, Y denotes the variable of interest. Then YtYtY denotes the observed value of t denotes the observed value of t Y at time t. Typically, the �rst observation (the most distant one) corresponds to period t = 1, and the last observation (the most recent one) corresponds to period t = T , where T denotes the number of historical observations of Y . The periods themselves might be days, weeks, months, quarters, years, or any other common unit of time.

Suppose that YtYtY − k has just been observed and you want to make a “k-period-ahead” forecast; that is, you want to use the information through time t − k to forecast YtYtY . The resulting forecast is denoted by FtFtF − k,t. The �rst subscript indicates the period in which the forecast is made, and the second subscript indicates the period being forecast. As an example, if the data are monthly and September 2016 corresponds to t = 67, then a forecast of Y6Y6Y 9, the value in November 2016, would be labeled F6F6F 7,69. The forecast error is the difference between the actual value and the forecast. It is denoted by E with appropriate subscripts. Speci�cally, the forecast error associated with FtFtF − k,t is

Et − k,t = YtYtY − FtFtF − k,t This double-subscript notation is necessary to specify when the forecast is being made and which period is being forecast. However, the former is often clear from context. Therefore,

Figure 12.5 Series with Noise

© C

e n g

a g

e L

e a rn

in g

Figure 12.6 Series with More Noise

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-2 Forecasting Methods: An Overview 547

to simplify the notation, we usually drop the �rst subscript and write FtFtF and Et to denote the t to denote the t forecast of YtYtY and the error in this forecast.

There are actually two steps in any forecasting procedure. The �rst step is to build a model that �ts the historical data well. The second step is to use this model to forecast the future. Most of the work goes into the �rst step. For any trial model, you see how well it “tracks” the known values of the time series. Speci�cally, the one-period-ahead forecasts, FtFtF (or more precisely, FtFtF − 1,t) are calculated from the model, and these are compared to the known values, YtYtY , for each t in the historical time period. The goal is to �nd a model that produces small forecast errors, Et. Presumably, if the model tracks the historical data well, historical data well, historical it will also forecast future data well. Of course, there is no guarantee that this is true, but it is often a reasonable assumption.

Forecasting software packages typically report several summary measures of the fore- cast errors. The most important of these are MAE (mean absolute error), RMSE (root mean square error), and MAPE (mean absolute percentage error). These are de�ned in Equations (12.2), (12.3), and (12.4). Fortunately, models that make any one of these measures small tend to make the others small, so you can choose whichever measure you want to minimize. In the following formulas, N denotes the number of terms in each sum. This value is typically slightly less than T, the number of historical observations, because it is usually not possible to provide a forecast for each historical period.

You first develop a model to fit the historical data. Then you use this model to forecast the future.

A model that makes any one of these error measures small tends to make the other two small as well.

Mean Absolute Error MAE = aaN

t = 1 0 Et 0 b N̂̂N̂ (12.2)

Root Mean Square Error

RMSE = Åaa N

t = 1 E2E2Et b N̂̂N̂Å (12.3)

Mean Absolute Percentage Error

MAPE = 100% × aaN t = 1 0 Et /YtYtY 0 b N̂̂N̂ (12.4)

RMSE is similar to a standard deviation in that the errors are squared. Because of the square root, it is in the same units as those of the forecast variable. The MAE is similar to the RMSE, except that absolute values of errors are used instead of squared errors. The MAPE is probably the most easily understood measure because it does not depend on the units of the forecast variable; it is always stated as a percentage. For example, the statement that the forecasts are off on average by 2% has a clear meaning, even if you do not know the units of the variable being forecast.

Some forecasting software packages choose the best model from a given class (such as the best exponential smoothing model) by minimizing MAE, RMSE, or MAPE. However, small values of these measures guarantee only that the model tracks the histori- cal observations well. There is still no guarantee that the model will forecast future values accurately.

One other measure of forecast errors is the average of the errors. Recall from the regression chapters that the residuals from any regression equation, which are analogous to

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

548 Chapter 12 Time Series Analysis and Forecasting

forecast errors, always average to zero. This is a mathematical property of the least-squares method. However, there is no such guarantee for forecasting errors based on nonregression methods. For example, it is very possible that most of the forecast errors, and the corre- sponding average, are negative. This would imply a bias, where the forecasts tend to be too high. Or the average of the forecast errors could be positive, in which case the forecasts tend to be too low. If you choose an “appropriate” forecasting method, based on the evi- dence from a time series graph, this type of bias is not likely to be a problem, but it is easy to check. Furthermore, if a company realizes that its forecasting method produces forecasts

that are consistently, say, 5% below the actual val- ues, it could simply multiply its forecasts by 1/0.95 to remove the bias.

We now examine a number of useful forecast- ing models. You should be aware that more than one of these models can be appropriate for any particular time series data. For example, a random walk model and an autoregression model could be equally effec- tive for forecasting stock price data. (Remember also that forecasts from more than one model can be combined to obtain a possibly better forecast.) We try to provide some insights into choosing the best type of model for various types of time series data, but ultimately the choice depends on the experience of the analyst.

12-3 TESTING FOR RANDOMNESS All forecasting models have the general form shown in Equation (12.5). The �tted value in this equation is the part calculated from past data and any other available information (such as the season of the year), and it is used as a forecast for Y . The residual is the forecast error, the difference between the observed value of Y and its forecast:

Extrapolation and Noise There are two important things to remember about extrapolation methods. First, by definition, all such methods try to extrapolate historical patterns into the future. If history doesn’t essentially repeat itself, for whatever reason, these methods are doomed to fail. In fact, if you know that something has changed fundaknow that something has changed fundaknow - mentally, you probably should not use an extrapolation method. Second, it does no good to track noise and then forecast it into the future. For this reason, most extrapolation methods try to smooth out the noise, so that the underlying pattern is more apparent.

F u n da m e n ta l I n s i g h t

In a time series context the terms residual and forecast error are used interchangeably.

Typical Forecasting Equation YtYtY = Fitted Value + Residual (12.5)

For time series data, there is a residual for each historical period, that is, for each value of t. We want this time series of residuals to be random noise, as discussed in Section 12-2d. The reason is that if this series of residuals is not noise, it can be modeled further. For example, if the residuals trend upwardly, the forecasting model can be modi�ed to include this trend component in the �tted value. The point is that the �tted value should include all compo�tted value. The point is that the �tted value should include all compo�tted - nents of the original series that can possibly be forecast, and the leftover residuals should be unpredictable noise.

We �rst discuss ways to determine whether a time series of residuals is random noise (which we usually abbreviate to “random”). The simplest method, but not always a reliable one, is to examine time series graphs of residuals visually. Nonrandom patterns are some- times easy to detect. For example, the time series graphs in Figures 12.7 through 12.11 illustrate some common nonrandom patterns. In Figure 12.7, there is an upward trend. In Figure 12.8, the variance increases through time (larger zigzags to the right). Figure 12.9 exhibits seasonality, where observations in certain months are consistently larger than those in other months. There is a meandering pattern in Figure 12.10, where large observations

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-3 Testing for Randomness 549

Time series plot of Series1

100

125

150

175

200

225

250

Se ri

es 1

32987654321 22212019181716151413121110

Figure 12.7 A Series with Trend

© C

e n g

a g

e L

e a rn

in g

Time series plot of Series2

0

25

50

75

100

125

150

Se ri

es 2

32987654321 22212019181716151413121110

Figure 12.8 A Series with Increasing Variance Through Time

© C

e n g

a g

e L

e a rn

in g

Time series plot of Series3

92

96

100

104

108

112

Se ri

es 3

32987654321 22212019181716151413121110

Figure 12.9 A Series with Seasonality ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

550 Chapter 12 Time Series Analysis and Forecasting

tend to be followed by other large observations, and small observations tend to be followed by other small observations. Finally, Figure 12.11 illustrates the opposite behavior, where there are too many zigzags—large observations tend to follow small observations and vice versa. None of the time series in these �gures is random.

12-3a The Runs Test

It is not always easy to detect randomness or the lack of it from the visual inspection of a graph. Therefore, we discuss two quantitative methods that test for randomness. The �rst is called the runs test. You �rst choose a base value, which could be the average value of the series, the median value, or even some other value. Then a run is de�ned as a consecutive series of observations that remain on one side of this base level. For example, if the base level is 0 and the series is 1, 5, 3, –3, –2, –4, –1, 3, 2, there are three runs: 1, 5, 3; –3, –2, –4, –1; and 3, 2. The idea behind the runs test is that a random series should have a number of runs that is neither too large nor too small. If the series has too few runs, it could be trend- ing (as in Figure 12.7) or it could be meandering (as in Figure 12.10). If the series has too many runs, it is zigzagging too often (as in Figure 12.11).

Figure 12.10 A Series That Meanders

Time series plot of Series4

80

90

100

110

120

130

140

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 41 43 45 47 49 51 53 55 57 59 61 63 65 67 69 71 73

Se ri

es 4

© C

e n g

a g

e L

e a rn

in g

Time series plot of Series5

90

95

100

105

110

115

120

Se ri

es 5

32987654321 22212019181716151413121110

Figure 12.11 A Series That Oscillates Frequently

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-3 Testing for Randomness 551

We do not provide the mathematical details of the runs test, but we illustrate how it is implemented in StatTools in Example 12.1.

The runs test is a formal test of the null hypothesis of randomness. If there are too many or too few runs in the series, the null hypothesis of randomness can be rejected.

This runs test can be used on any time series, not just a series of residuals.

E X A M P L E 12.1 FORECASTING MONTHLY STEREO SALES

Monthly sales for a chain of stereo retailers are listed in the file Stereo Sales.xlsx. They cover the period from the beginning of 2013 to the end of 2016, during which there was no upward or downward trend in sales and no clear seasonality. This behavior is apparent in the time series graph of sales in Figure 12.12. Therefore, a simple forecast model of sales is to use the average of the series, 182.67, as a forecast of sales for each month. Do the resulting residuals represent random noise?

Objective To use the runs test to check whether the residuals from this simple forecast- ing model represent random noise.

Solution The residuals for this forecasting model are found by subtracting the average, 182.67, from each observation. Therefore, the plot of the residuals (not shown here) has exactly the same shape as the plot of sales. The only difference is that it is shifted down by 182.67 and has mean 0. The runs test can now be used to check whether there are too many or too few runs around the base value of 0 in this residual plot. To do so, select Runs Test for Randomness from the StatTools Time Series and Forecasting dropdown, choose Residual as the variable to analyze, and choose Mean of Series as the cutoff value. The resulting output in shown in Figure 12.13.

Time Series of Sales/Sales Data

300

250

200

150

100

50

0

Ja n

-2 01

3

M ar

-2 01

3

M ay

-2 01

3

Ju l-

20 13

Se p

-2 01

3

N o

v- 20

13

Ja n

-2 01

4

M ar

-2 01

4

M ay

-2 01

4

Ju l-

20 14

Se p

-2 01

4

N o

v- 20

14

Ja n

-2 01

5

M ar

-2 01

5

M ay

-2 01

5

Ju l-

20 15

Se p

-2 01

5

N o

v- 20

15

Ja n

-2 01

6

M ar

-2 01

6

M ay

-2 01

6

Ju l-

20 16

Se p

-2 01

6

N o

v- 20

16

Figure 12.12 Time Series Graph of Stereo Sales

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

552 Chapter 12 Time Series Analysis and Forecasting

The important elements of this output are the following:

■ The number of observed runs is 20, in cell B12.

■ The number of runs expected under an assumption of randomness is expected under an assumption of randomness is expected 24.833, in cell B14. (This follows from a probability argument not shown here.) Therefore, the series of residuals has too few runs. Positive values tend to follow positive values, and negative values tend to follow negative values.

■ The z-value in cell B16, –1.42, indicates how many standard errors the observed number of runs is below the expected number of runs. The corresponding p-value indicates how extreme this z-value is. It can be interpreted just like other p-values for hypothesis tests. If it is small, say, less than 0.05, then the null hypothesis of randomness can be rejected. However, the p-value for this example is only 0.1555. Therefore, there is not convincing evidence of nonrandomness in the residuals. In other words, it is reasonable to conclude that the residuals represent noise. ■

A small p-value in the runs test provides evidence of nonrandomness.

7 8

A BA B Residual

Runs Test for Randomness Data Set

9 10 11 12 13 14 15 16

Observa�ons 48 Below Mean 22 Above Mean 26 Number of Runs 20 Mean 0.00 E(R) 24.8333 StdDev(R) 3.4027

16161616 17

Z-VZ-VZ alue-Value-V –1.4204 P-Value (two-tailed) -Value (two-tailed) -V 0.1555

Figure 12.13 Runs Test for Randomness

© C

e n g

a g

e L

e a rn

in g

Like the runs test, autocorrelations can be calculated for any time series, not just a series of residuals.

12-3b Autocorrelation

In this section we discuss another way to check for randomness of a time series of residuals—we examine the autocorrelations of the residuals. The “auto” means that successive observations are correlated with one another. For example, in the most com- mon form of autocorrelation, positive autocorrelation, large observations tend to follow large observations, and small observations tend to follow small observations. In this case, the runs test is likely to pick it up because there will be fewer runs than expected. Another way to check for the same nonrandomness is to calculate the autocorrelations of the time series.

An autocorrelation is a type of correlation used to measure whether values of a time series are related to their own past values.

To understand autocorrelations, it is �rst necessary to understand what it means to lag a time series. This concept is easy to illustrate in Excel. We again use the monthly stereo sales data in the Stereo Sales.xlsx �le. To lag by one month, you simply “push down” the series by one row. See column D of Figure 12.14. Note that there is a blank cell at the top of the lagged series (in cell D2). This is due to the lack of a December 2012 observa- tion. You can continue to push the series down one row at a time to obtain other lags. For example, the lag 3 version of the series appears in column F. Now there are three missing

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-3 Testing for Randomness 553

observations at the top. Note that in December 2013, say, the �rst, second, and third lags correspond to the observations in November 2013, October 2013, and September 2013, respectively. That is, lags are simply previous observations, removed by a certain number of periods from the present time. These lagged columns can be obtained by copying and pasting the original series or by selecting Lag from the StatTools Data Utilities dropdown menu.

Role of Autocorrelation in Time Series Analysis Due to the introductory nature of this book, we do not discuss autocorrelation in much detail. However, it is the key to many forecasting methods, especially more complex methods. This is not

surprising. Autocorrelations essentially specify how observations in nearby time periods are related, so this information is often useful in forecasting. However, it is not at all obvious how this information should be used—hence the complexity of some forecasting methods.

F u n da m e n ta l I n s i g h t

Then the autocorrelation of lag k, for any integer k, is essentially the correlation between the original series and the lag k version of the series. For example, in Figure 12.14 k version of the series. For example, in Figure 12.14 k the lag 1 autocorrelation is the correlation between the observations in columns C and D. Similarly, the lag 2 autocorrelation is the correlation between the observations in columns C and E.1 Similarly, the lag

1 Similarly, the lag

We have shown the lagged versions of Sales in Figure 12.14, and we have explained autocorrelations in terms of these lagged variables, to help motivate the concept of auto- correlation. However, you can use StatTools’s Autocorrelation procedure directly, without forming the lagged variables, to calculate autocorrelations. This is illustrated in the follow- ing continuation of Example 12.1.

1We ignore the exact details of the calculations here. Just be aware that the formula for autocorrelations that is usually used differs slightly from the correlation formula in Chapter 3. Fortunately, the difference is very slight and of no practical importance.

Figure 12.14 Lags for Stereo Sales

1

2

3

4

5

6

7

8

9

10

Month

Jan-2013

Feb-2013

Mar-2013

Apr-2013

May-2013

Jun-2013

Jul-2013

Aug-2013

Sep-2013

Sales

226

254

204

193

191

166

175

217

167

Residual

43.333

71.333

21.333

10.333

8.333

–16.667

–7.667

34.333

–15.667

Lag1(Residual)

43.333

71.333

21.333

10.333

8.333

–16.667

–7.667

34.333

Lag2(Residual)

43.333

71.333

21.333

10.333

8.333

–16.667

–7.667

Lag3(Residual)

43.333

71.333

21.333

10.333

8.333

–16.667

A BA B C DC D E FE F

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

554 Chapter 12 Time Series Analysis and Forecasting

E X A M P L E 12.1 FORECASTING MONTHLY STEREO SALES (CONTINUED)

The runs test on the stereo sales data suggests that the pattern of sales is not completely random. There is some tendency for large values to follow large values, and for small values to follow small values. Do autocorrelations support this evidence?

Objective To examine the autocorrelations of the residuals from the forecasting model for evidence of nonrandomness.

Solution To answer this question, you can use StatTools’s Autocorrelation procedure, found on the StatTools Time Series and Forecasting dropdown list. It requires you to specify the time series variable (Residual), the number of lags you want (the StatTools default value was accepted here), and whether you want a chart of the autocorrelations. This chart is called a correlogram. The resulting autocorrelations and correlogram appear in Figure 12.15. A typical autocorrelation of lag k indicates the relationship between observations k periods apart. For example, the autocorrelation of lag 3, 0.0814, indicates that there is very little relationship between residuals separated by three months.

How large is a “large” autocorrelation? Under the assumption of randomness, it can be shown that the standard error of any autocorrelation is approximately 1/!T! , in this case

7 8 9

10 11 12

A B C D E F

13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

–1

–0.5

0

0.5

1

1 2 3 4 5 6 7 8 9 10 11 12

Number of Lags

28 29 30 31 32 33 34

Residual Autocorrela�on Table Data Set #1 Durbin-Watson Number of Values of Values of V 48 1.262 Standard Error 0.1443 Lag #1 0.3492 Lag #2 0.0772 Lag #3 0.0814 Lag #4 –0.0095

35 36 37 38 39 40 41

Lag #5 –0.1353 Lag #6 0.0206 Lag #7 –0.1494 Lag #8 –0.1492 Lag #9 –0.2626 Lag #10 –0.1792 Lag #11 0.0121

42 Lag #12 –0.0516

Autocorrela on of Residual

A B C D E FFigure 12.15 Correlogram and Autocorrelations of Residuals

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-3 Testing for Randomness 555

Typically, you can ask for autocorrelations up to as many lags as you like. However, there are several practical considerations to keep in mind. First, it is common practice to ask for no more lags than 25% of the number of observations. For example, if there are 48 observations, you should ask for no more than 12 autocorrelations (lags 1 to 12). (StatTools chooses this number of lags if you accept its Auto setting.)

Second, the �rst few lags are typically the most important. Intuitively, if there is any relationship between successive observations, it is likely to be between nearby observa- tions. The June 2016 observation is more likely to be related to the May 2016 observation than to the October 2015 observation. Sometimes there is a fairly large spike in the corre- logram at some large lag, such as lag 9. However, this can often be dismissed as a random blip unless there is some obvious reason for its occurrence. A similarly large autocorrela- tion at lag 1 or 2 is usually taken more seriously. The one exception to this is a seasonal lag. seasonal lag. seasonal For example, an autocorrelation at lag 12 for monthly data corresponds to a relationship between observations a year apart, such as May 2016 and May 2015. If this autocorrelation is signi�cantly large, it probably should not be ignored.

As discussed brie�y in the previous chapter, one measure of the lag 1 autocorrela- tion, often the most important autocorrelation, is provided by the Durbin-Watson (DW) statistic. (See Section 11-8c.) This statistic can be calculated with the StatTools func- tion StatDurbinWatson. Its value for the residuals in this example is 1.262, as shown in Figure 12.15. The DW statistic is always between 0 and 4. A DW value of 2 indicates no lag 1 autocorrelation, a DW value less than 2 indicates positive autocorrelation, and a DW value greater than 2 indicates negative autocorrelation. The current DW value, 1.262, is considerably less than 2, another indication that the lag 1 autocorrelation of the residuals is positive and possibly signi�cant. There are tables of signi�cance levels for DW statistics (how much less than 2 must DW be to be signi�cant?), but they are not presented here.

We will not examine autocorrelations much further in this book. However, many advanced forecasting techniques are based largely on the examination of the autocorrela- tion structure of time series. This autocorrelation structure indicates how a series is related to its own past values through time, which can be very valuable information for forecasting future values.

1/!4!4! 8! = 0.1443. (Recall that T denotes the number of observations in the series.) If the series is random, then only an occasional autocorrelation will be larger than two standard errors in magnitude. Therefore, any autocorrelation that is larger than two standard errors in magnitude is worth your attention. All significantly nonzero autocorrelations are bold- faced in the StatTools output. For this example, the only “large” autocorrelation for the residuals is the first, or lag 1, autocorrelation of 0.3492. The fact that it is positive indicates once again that there is some tendency for large residuals to follow large residuals and for small to follow small. The autocorrelations for other lags are less than two standard errors in magnitude and can safely be ignored. ■

Autocorrelation analysis is somewhat advanced. However, it is the basis for many useful forecasting methods.

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P12_01.xlsx contains the monthly number of

airline tickets sold by a travel agency. Is this time series

random? Perform a runs test and find a few autocorrela- tions to support your answer.

2. The file P12_02.xlsx contains the weekly sales at a local bookstore for each of the past 25 weeks. Is this time series random? Perform a runs test and find a few autocorrelations to support your answer.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

556 Chapter 12 Time Series Analysis and Forecasting

12-4 REGRESSION-BASED TREND MODELS Many time series follow a long-term trend except for random variation. This trend can be upward or downward. A straightforward way to model this trend is to estimate a regression equation for YtYtY , using time t as the single explanatory variable. In this section we discuss the two most frequently used trend models, linear trend and linear trend and linear exponential trend.exponential trend.exponential

12-4a Linear Trend

A linear trend means that the time series variable changes by a constant amount each time amount each time amount period. The relevant equation is Equation (12.6), where, as in previous regression equa- tions, a is the intercept, b is the slope, and et is an error term.

2 period. The relevant equation is Equation (12.6), where, as in previous regression equa

2 period. The relevant equation is Equation (12.6), where, as in previous regression equa

The interpretation of b is that it represents the expected change in the series from one period to the next. If b is positive, the trend is upward; if b is negative, the trend is down- ward. The intercept term a is less important. It literally represents the expected value of the series at time t = 0. If time t is coded so that the �rst observation corresponds to t is coded so that the �rst observation corresponds to t t = 1, then a is where the series was one period before the observations began. However, it is possible that time is coded in another way. For example, if the data are annual, starting in 1997, the

2It is traditional in the regression literature to use Greek letters for population parameters and Roman letters for estimates of them. However, we decided to use only Roman letters in the regression sections of this chapter. For a book at this level, they are less intimidating.

Linear Trend Model YtYtY = a + bt + et (12.6)

3. The number of employees on the payroll at a food- processing plant is recorded at the start of each month. These data are provided in the file P12_03.xlsx. Perform a runs test and find a few autocorrelations to determine whether this time series is random.

4. The quarterly numbers of applications for home mort- gage loans at a branch office of Northern Central Bank are recorded in the file P12_04.xlsx. Perform a runs test and find a few autocorrelations to determine whether this time series is random.

5. The number of reported accidents at a manufacturing plant was recorded at the start of each month. These data are provided in the file P12_05.xlsx. Is this time series random? Perform a runs test and find a few auto- correlations to support your answer.

6. The file P12_06.xlsx contains the weekly sales at an electronics store for each of the past 36 weeks. Perform a runs test and find a few autocorrelations to determine whether this time series is random.

Level B 7. Determine whether the RAND() function in Excel

actually generates a random stream of numbers. Generate at least 100 random numbers to test their

randomness with a runs test and with autocorrelations. Summarize your findings.

8. Use a runs test and calculate autorrelations to decide whether the random series explained in each part of this problem (a–c) are random. For each part, generate at least 100 random numbers in the series. a. A series of independent normally distributed values,

each with mean 70 and standard deviation 5. b. A series where the first value is normally distributed

with mean 70 and standard deviation 5, and each succeeding value is normally distributed with mean equal to the previous value and standard deviation 5. (For example, if the fourth value is 67.32, then the fifth value will be normally distributed with mean 67.32.)

c. A series where the first value, Y1, is normally distributed with mean 70 and standard deviation 5, and each succeeding value, YtYtY , is normally distributed with mean (1 + at)YtYtY − 1 and standard deviation 5(1 + at), where the at values are t values are t independent and normally distributed with mean 0 and standard deviation 0.2. (For example, if YtYtY − 1 = 67.32 and at = −0.2, then YtYtY will be normally distributed with mean 0.8(67.32) = 53.856 and standard deviation 0.8(5) = 4.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-4 Regression-Based Trend Models 557

�rst value of t might be entered as 1997, which means that the intercept t might be entered as 1997, which means that the intercept t a then corresponds to a period 1997 years earlier. Clearly, its value should not be taken literally in this case.

As always, a graph of the time series is a good place to start. It indicates whether a linear trend is likely to provide a good �t. Generally, the graph should rise or fall at approximately a constant rate through time, without too much random variation. But even if there is a lot of random variation—a lot of zigzags—a linear trend to the data might still be a good starting point. Then the residuals from this trend line, which should have no remaining trend, could possibly be modeled by some other method in this chapter.

E X A M P L E 12.2 MONTHLY U.S. POPULATION

The file US Population.xlsx contains monthly population data for the United States from January 1952 to December 2014 (in thousands). During this period, the popula- tion has increased steadily from about 156 million to about 320 million. The time series graph of these data appears in Figure 12.16. How well does a linear trend fit these data? Are the residuals from this fit random?

Objective To fit a linear trend line to monthly population and examine its residuals for randomness.

Solution The graph in Figure 12.16 indicates a clear upward trend with little or no curvature. Therefore, a linear trend is certainly plausible. In fact, the best-fitting linear trend line is shown in the figure, using the same Excel Trendline tool we have used before. To estimate this linear trend with regression, a variable with consecutive integers is required. This time variable appears in column C of the data set, using the consecutive values 1 through 756. You can then run a simple regression of Population versus Time, with the results shown in Figure 12.17. (For a change, we used Excel’s built-in functions to estimate the regression equation. This is possible because there is a single explanatory variable, the Time variable in column C.) The estimated linear trend line (which also appears in Figure 12.16) is

Forecast Pt Pt opulation = 156469.2 + 213.78Time

Figure 12.16 Time Series Graph of U.S. Population

Popula�on

150000

200000

250000

300000

350000

y = 213.78x + 156469y = 213.78x + 156469y R2 = 0.997

0

50000

1 22 43 64 85 10 6

12 7

14 8

16 9

19 0

21 1

23 2

25 3

27 4

29 5

31 6

33 7

35 8

37 9

40 0

42 1

44 2

46 3

48 4

50 5

52 6

57 4

56 8

58 9

61 0

63 1

65 2

67 3

69 4

71 5

73 6

100000 The series meanders a li�le around the straight line upward trend, but the linear fit is about as good as you’re going to see with real data.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

558 Chapter 12 Time Series Analysis and Forecasting

This equation implies that the population tends to increase by 213.78 thousand per month. (The 156469.2 value in this equation is the predicted population at time 0; that is, December 1951.) To use this equation to forecast future population values, you can substitute later values of Time into the regression equation, so that each future forecast is 213.78 larger than the previous forecast. For example, the forecast for January 2015 is

Forecast Pt Pt opulation Jan-2015 = 156469.2 + 213.78(757) = 318297

The linear fit is not perfect, as the plot of the residuals in Figure 12.18 indicates. These residuals tend to meander, staying negative for a while, then positive, then negative, and then positive. You can check that the runs test for these residuals produces a very small p-value, and that many of its autocorrelations are significantly positive. In short, these residuals are definitely not random noise, and they could possibly be modeled further. not random noise, and they could possibly be modeled further. not However, we will not pursue this analysis here. In fact, it is not at all obvious how the autocorrelations of the residuals could be exploited to get a better forecast model than the could be exploited to get a better forecast model than the could linear trend. ■

Figure 12.17 Regression for Linear Trend

1

2

3

4

5

6

7

8

9

10

Month

Jan-1952

Feb-1952

Mar-1952

Apr-1952

May-1952

Jun-1952

Jul-1952

Aug-1952

Sep-1952

Popula�on

156309

156527

156731

156943

157140

157343

157553

157798

158053

Time

1

2

3

4

5

6

7

8

9

Forecast

156683

156896.7

157110.5

157324.3

157538.1

157751.8

157965.6

158179.4

158393.2

Error

–373.971

–369.746

–379.522

–381.297

–398.073

–408.848

–412.624

–381.399

–340.175

Intercept

Slope

StErr

R-Square

156469.2

213.7755

2582.6

0.997

A BA B C DC D E F HF HF HF HGF HGF H

© C

e n g

a g

e L

e a rn

in g

−7000

−4000

−2000

0

3000

4000

1 21 41 61 81 10 1

12 1

14 1

16 4

18 4

20 1

22 1

24 1

26 1

28 1

30 1

32 1

34 1

36 1

48 1

40 1

42 1

44 1

46 1

48 1

50 1

52 1

54 1

56 1

58 1

60 1

62 1

66 1

68 1

70 1

72 1

74 1

64 1

Error

−6000

−5000

−3000

−1000

2000

1000

Figure 12.18 Time Series Graph of Forecast Errors

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-4 Regression-Based Trend Models 559

12-4b Exponential Trend

In contrast to a linear trend, an exponential trend is appropriate when the time series changes by a constant percentage (as opposed to a constant dollar amount) each period. Then the appropriate regression equation is Equation (12.7), where c and b are constants, and ut represents a multiplicative error term.

An exponential trend for Y is equivalent to a linear trend for the logarithm of Y.

Exponential Trend Model YtYtY = ce

btut (12.7)

Equivalent Linear Trend for Logarithm of Y ln(YtYtY ) = a + bt + et (12.8)

Equation (12.7) is useful for understanding how an exponential trend works, as we will discuss, but it is not useful for estimation. For that, a linear equation is required. linear equation is required. linear Fortunately, linearity can be achieved by taking natural logarithms of both sides of Equation (12.7). (The key is that the logarithm of a product is the sum of the logarithms.) The result appears in Equation (12.8), where a = ln(c) and et = ln(ut). This equation rep- resents a linear trend, but the dependent variable is now the logarithm of the original linear trend, but the dependent variable is now the logarithm of the original linear YtYtY . This implies the following important fact: If a time series exhibits an exponential trend, then a plot of its logarithm versus time should be approximately linear.

Because the software performs the calculations, your main responsibility is to interpret the �nal result. This is fairly easy. It can be shown that the coef�cient b (expressed as a per- centage) is approximately the percentage change per period. For example, if b = 0.05, the series is increasing by approximately 5% per period.3 centage) is approximately the percentage change per period. For example, if

3 centage) is approximately the percentage change per period. For example, if

Conversely, if b = −0.05, the series is decreasing by approximately 5% per period.

An exponential trend can be estimated with regression, but only after the log transfor- mation has been made on YtYtY . We illustrate this in Example 12.3.

E X A M P L E 12.3 QUARTERLY PC DEVICE SALES

The file PC Device Sales.xlsx contains quarterly sales data (in millions of dollars) for a large PC device manufacturer from the first quarter of 2002 through the fourth quarter of 2016. Are the company’s sales growing exponentially through this entire period?

Objective To estimate the company’s exponential growth and to see whether it has been maintained during the entire period from 2002 until the end of 2016.

Solution We first estimate and interpret an exponential trend for the years 2002 through 2011. Then we see how well the projection of this trend into the future fits the data after 2011. The time series graph through 2011 appears in Figure 12.19. You can use Excel’s Trendline tool, with the Exponential option, to superimpose an exponential trend line and the corre- sponding equation on this plot. The fit is evidently quite good. Equivalently, Figure 12.20 illustrates the time series of log sales for this same period, with a linear trend line superimlinear trend line superimlinear - posed. Its fit is equally good.

3More precisely, this percentage change is eb − 1. For example, when b = 0.05, this is eb − 1 = 5.13%.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

560 Chapter 12 Time Series Analysis and Forecasting

You can also use regression to estimate this exponential trend, as shown in Figure 12.21. (Again for variety, we use Excel functions, not StatTools, to perform the regression.) To produce this output, you must first add a time variable in column C (with values 1 through 40) and create a logarithmic transformation of Sales in column D. Then you can regress Log(Sales) on Time (using the data through 2011 only) to obtain the regression output. Note that its two coefficients in cells L2 and L3 are the same as those shown for the lin- ear trend in Figure 12.20. If you take the antilog of the constant 4.130 (with the formula =EXP(L2)), you will obtain the constant multiple shown in Figure 12.19. It corresponds to the constant c in Equation (12.7).

What does it all mean? The estimated Equation (12.7) is

Forecast St St ales = 62.188e0.0654t

Figure 12.19 Time Series Graph of Sales with Exponential Trend Superimposed

1000.00

900.00

800.00

700.00

600.00

500.00

400.00

300.00

200.00

100.00

0.00

y = 62.188e0.0654x

Sales (through 2011)

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 © C

e n g

a g

e L

e a rn

in g

in cells L2 and L3

y = 0.0654y = 0.0654y x + 4.1302x + 4.1302x

0

1

2

3

4

5

6

7

8 Log(Sales) (through 2011)

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39

Figure 12.20 Time Series Graph of Log Sales with Linear Trend Superimposed

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-4 Regression-Based Trend Models 561

The most important constant in this equation is the coefficient of Time, b = 0.0654. Expressed as a percentage, this coefficient implies that the company’s sales increased by approximately 6.54% per quarter throughout this 10-year period. (The constant multi- ple, c = 62.188, is the forecast of sales at time 0; that is, quarter 4 of 2001.) To calculate the forecasts in column E, we first used the regression equation to forecast the log of sales and then used the EXP to find the antilog. Specifically, the formula in cell E2 is = EXP1$L$2 + $L$3*C22, which can then be copied down. (It is important to realize

that without the EXP function, you would be calculating forecasts of log sales, which are of little interest.)

Has this exponential growth continued beyond 2011? It has not, due possibly to slump- ing sales in the computer industry or increased competition from other manufacturers. This is apparent from the time series graph of the two series Sales and Forecast, for all years, shown in Figure 12.22. It is clear that sales in the later years did not exhibit nearly the 6.54% growth observed in the early years. As the company clearly realizes, nothing this good lasts forever.

Before leaving this example, we comment briefly that any of the  three forecast error measures discussed previously are easy to find, as shown in Figure 12.21. (You can check the formulas in the finished version of the file.) For example, forecasts for the 10-year estima- tion period were off, on average, by 8.30%. (Of course, as you can check, forecasts for the quarters after 2011 were off by much more.)after 2011 were off by much more.)after ■

1 2 3 4 5 6 7 8 9

Quarter Ql-2002 Q2-2002 Q3-2002 Q4-2002 Ql-2003 Q2-2003 Q3-2003 Q4-2003

Sales 61.14 64.07 66.18 72.76 84.70 90.05

106.06 118.21

Time 1 2 3 4 5 6 7 8

Log(Sales) 4.113166316 4.159976236 4.192378302 4.287166354 4.439115602 4.500365072 4.664004972 4.772462704

Forecast 66.39 70.88 75.68 80.79 86.26 92.09 98.32

104.97

Error –5.25 –6.81 –9.50 –8.03 –1.56 –2.04

7.74 13.24

SqError 27.599 46.423 90.193 64.557

2.429 4.169

59.913 175.335

AbsError 5.254 6.813 9.497 8.035 1.559 2.042 7.740

13.241

AbsPctError 0.086 0.106 0.144 0.110 0.018 0.023 0.073 0.112

Regression coefficients (through 2011 only) Intercept Slope

Measures of forecast error (through 2011 only) RMSE MAE MAPE

4.130 0.0654

33.69 23.08 8.30%

A BA B C DC D E F HF H I J K L ML M N ON OGF HGF H

Figure 12.21 Regression for Estimating Exponential Trend

© C

e n g

a g

e L

e a rn

in g

Forecast periodEs�mated period

1 3 5 7 9 11 13 15 17 19 21 23 25 27 29 31 33 35 37 39 14 43 45 47 49 51 53 55 57 59

Sales and Forecasts (all years)

Sales Forecast

3500.00

3000.00

2500.00

2000.00

1500.00

1000.00

500.00

0.00

Figure 12.22 Time Series Graph of Forecasts Superimposed on Sales for the Entire Period

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

562 Chapter 12 Time Series Analysis and Forecasting

P R O B L E M S

Level A 9. The file P12_01.xlsx contains the monthly number of

airline tickets sold by a travel agency. a. Does a linear trend appear to fit these data well? If

so, estimate and interpret the linear trend model for this time series. Also, interpret the R2 and se values.

b. Provide an indication of the typical forecast error generated by the estimated model in part a.

c. Is there evidence of some seasonal pattern in these sales data? If so, characterize the seasonal pattern.

10. The file P12_10.xlsx contains the annual revenues for a convenience store. (The store opened at the begin- ning of this period in what turned out to be a popular location.) Does a linear or exponential trend fit these data well? If so, estimate and interpret the best trend model for this time series. Also, interpret the R2 and se values.

11. The file P12_11.xlsx contains annual U.S. federal debt from 1960 through 2011. Fit an exponential growth curve to these data. Write a short report to summarize your findings. If the U.S. federal debt continues to rise at the exponential rate you find, approximately what will its value be at the end of 2020?

12. The file P12_12.xlsx contains five years of monthly data on sales (number of units sold) for a particular company. The company suspects that except for random noise, its sales are growing by a constant percentage each month and will continue to do so for at least the near future. a. Explain briefly whether the plot of the series

visually supports the company’s suspicion. b. Fit the appropriate regression model to the data.

Report the resulting equation and state explicitly what it says about the percentage growth per month.

c. What are the RMSE and MAPE for the forecast model in part b? In words, what do they measure? Considering their magnitudes, does the model seem to be doing a good job?

d. In words, how does the model make forecasts for future months? Specifically, given the forecast value for the last month in the data set, what simple arithmetic could you use to obtain forecasts for the next few months?

13. The file P12_13.xlsx contains quarterly data on GDP. (The data are expressed in billions of chained 2005 dol- lars, and they are seasonally adjusted.) a. Look at a time series plot of GDP. Does it suggest a

linear relationship; an exponential relationship? b. Use regression to estimate an exponential

relationship between GDP and Time (starting with 1 for Q1-1966). Interpret this equation. Would you say that the fit is good?

c. How would the exponential fit differ if you included only the data through the end of year 2007?

Level B 14. The file P03_30.xlsx gives monthly exchange

rates (units of local currency per U.S. dollar) for nine currencies. Technical analysts believe that by charting past changes in exchange rates, it is possible to predict future changes of exchange rates. After analyzing the autocorrelations for these data, do you believe that technical analysis has potential?

15. The unit sales of a new drug for the first 25 months after its introduction to the marketplace are recorded in the file P12_15.xlsx. a. Estimate a linear trend equation using the given data.

How well does the linear trend fit these data? Are the residuals from this linear trend model random?

b. If the residuals from this linear trend model are not random, propose another regression-based trend model that more adequately explains the long-term trend in this time series. Estimate the alternative model(s) using the given data. Check the residuals from the model(s) for randomness. Summarize your findings.

c. Given the best estimated model of the trend in this time series, interpret R2 and se.

12-5 THE RANDOM WALK MODEL Random series are sometimes building blocks for other time series models. The model we now discuss, the random walk model, is an example of this. In a random walk model, the series itself is not random. However, its differences—that is, the changes from one period to the next—are random. This type of behavior is typical of stock price data (as well as various other time series data). For example, the graph in Figure 12.23 shows monthly closing prices for a manufacturer’s stock from January 2010 through April 2016. (See the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-5 The Random Walk Model 563

Random Walk Model YtYtY = YtYtY −1 + m + et (12.9)

�le Stock Prices.xlsx.) This series is not random, as can be seen from its gradual upward trend at the beginning and the general meandering behavior throughout. The runs test and autocorrelations (not shown) for the series itself con�rm that the series is not random. (There are signi�cantly fewer runs than expected, and the autocorrelations are signi�cantly fewer runs than expected, and the autocorrelations are signi�cantly fewer positive for many lags.)

If it were April 2016, and you were asked to forecast the company’s prices for the next few months, it is intuitive that you would not use the average of the historical values as your forecast. This forecast would tend to be too low because of the upward trend. Instead, you might base your forecast on the most recent observation. This is exactly what the random walk model does.

Equation (12.9) for the random walk model is given as follows, where m (for mean dif- (for mean dif- (for mean dif ference) is a constant and et is a random series (noise) with mean 0 and a standard deviation that remains constant through time.constant through time.constant

0.000

Ja n

-2 01

0

M ay

-2 01

0

Se p

-2 01

0

Ja n

-2 01

1

M ay

-2 01

1

Se p

-2 01

1

10.000

20.000

30.000

40.000

50.000

60.000

70.000 Closing Price

Ja n

-2 01

2

M ay

-2 01

2

Se p

-2 01

2

Ja n

-2 01

3

M ay

-2 01

3

Se p

-2 01

3

Ja n

-2 01

4

M ay

-2 01

4

Se p

-2 01

4

Ja n

-2 01

5

M ay

-2 01

5

Se p

-2 01

5

Ja n

-2 01

6

Figure 12.23 Time Series Graph of Stock Prices

© C

e n g

a g

e L

e a rn

in g

If we let DYtYtY = YtYtY − YtYtY − 1, the change in the series from time t to time t − 1 (where D stands for difference), then the random walk model can be rewritten as in Equation (12.10). This implies that the differences form a random series with mean m and a constant standard deviation. An estimate of m is the average of the differences, labeled YDYDY , and an estimate of the standard deviation is the sample standard deviation of the differences, labeled sD.

Difference Form of Random Walk Model DYtYtY = m + et (12.10)

In words, a series that behaves according to this random walk model has random differ- ences, and the series tends to trend upward (if m > 0) or downward (if m < 0) by an amount m each period. If you are standing in period t and want to forecast YtYtY + 1, then a reasonable

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

564 Chapter 12 Time Series Analysis and Forecasting

forecast is given by Equation (12.11). That is, you add the estimated trend to the current observation to forecast the next observation.

One-Step-Ahead Forecast for Random Walk Model FtFtF + 1 = YtYtY + YDYDY (12.11)

For the stock price data, this random walk model is easy to implement. (See the �nished version of the �le.) First, a column of differences is created. The time series of these dif-version of the �le.) First, a column of differences is created. The time series of these dif-version of the �le.) First, a column of differences is created. The time series of these dif ferences is shown in Figure 12.24, and their mean is slightly positive, 0.418. (The runs test and the autocorrelations for this difference series, not shown, indicate that the differences are random.) Then each future forecast adds a multiple of 0.418 to the last observed stock price. For example, the forecast for July 2016 adds 3(0.418) to the April 2016 stock price.

P R O B L E M S

Level A 16. The file P12_16.xlsx contains the daily closing prices of

American Express stock for a one-year period. a. Use the random walk model to forecast the closing

price of this stock on the next trading day. b. You can be about 95% certain that the forecast made

in part a will be off by no more than how many dollars?

17. The closing value of the AMEX Airline Index for each trading day for a one-year period is given in the file P12_17.xlsx.

a. Use the random walk model to forecast the closing price of this stock on the next trading day.

b. You can be about 68% certain that the forecast made in part a will be off by no more than how many dollars?

18. The file P12_18.xlsx contains the daily closing prices of Chevron stock for a one-year period. a. Use the random walk model to forecast the closing

price of this stock on the next trading day. b. You can be about 99.7% certain that the forecast

made in part a will be off by no more than how many dollars?

–15.000

Fe b

-2 01

0

Ju n

-2 01

0

O ct

-2 01

0

Fe b

-2 01

1

Ju n

-2 01

1

O ct

-2 01

1

20.000

15.000

10.000

5.000

0.000

–5.000

–10.000

Difference

Fe b

-2 01

2

Ju n

-2 01

2

O ct

-2 01

2

Fe b

-2 01

5

Ju n

-2 01

5

O ct

-2 01

5

Fe b

-2 01

3

Ju n

-2 01

3

O ct

-2 01

3

Fe b

-2 01

4

Ju n

-2 01

4

O ct

-2 01

4

Fe b

-2 01

6

Figure 12.24 Time Series Graph of Stock Price Differences

Note that if the mean difference is (practically) zero, this random walk model is some- times called the naive forecasting model, and forecasting is particularly simple. For exam- ple, after observing the April value, the forecast for May is the April value. Then after observing the May value, the forecast for June is the May value. And so on.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-6 Moving Averages Forecasts 565

12-6 MOVING AVERAGES FORECASTS Perhaps the simplest and one of the most frequently used extrapolation models is the moving averages model. To implement this model, you �rst choose a span, the number of terms in each moving average. Let’s say the data are monthly and you choose a span of six months. Then the forecast of next month’s value is the average of the values of the last six months. For example, you average January to June to forecast July, you average February to July to forecast August, and so on. This procedure is the reason for the term moving averages.

A moving average is the average of the observations in the past few periods, where the number of terms in the average is the span.

19. The closing value of the Dow Jones Industrial Average for each trading day for a two-year period is provided in the file P12_19.xlsx. a. Use the random walk model to forecast the closing

price of this index on the next trading day. Is a random walk model justified with these data?

b. Would it be wise to use the random walk model to forecast the closing price of this index for a trading day approximately one month after the next trading day? Explain why or why not.

20. Continuing the previous problem, the weekly closing val- ues of the Dow Jones Industrial Average are listed in the file P12_20.xlsx. Answer the same questions as in the previous problem, but now for weeks instead of days.

21. The closing price of a share of JP Morgan Chase stock for each trading day for a one-year period is recorded in the file P12_21.xlsx. a. Use the random walk model to forecast the closing

price of this stock on each of the next 10 trading days. b. You can be about 68% certain that the last forecast

made in part a will be off by no more than how many dollars?

22. The purpose of this problem is to get you used to the concept of autocorrelation in a time series. You could do this with any time series, but here you should use the series of convenience store revenues in the file P12_10.xlsx. a. First, do it the quick way. Use the Autocorrelation

procedure in StatTools to get a list of autocorrelations and a corresponding correlogram of the revenues. You can choose the number of lags.

b. Now do it the more time-consuming way. Create columns of lagged versions of Revenue—3 lags will suffice. Next, look at scatterplots of Revenue versus its first few lags. If the autocorrelations are large, you should see fairly tight scatters—that’s what autocorrelation is all about. Also, generate a correlation matrix to see the correlations between

Revenue and its first few lags. These should be approximately the same as the autocorrelations from part a. (Autocorrelations are calculated slightly differently than regular correlations, which accounts for any slight discrepancies you might notice—but these discrepancies should be minor.)

c. Create the first differences of Revenue in a new column. (You can do this manually with formulas, or you can use StatTools’s Difference procedure on the Data Utilities menu.) Now repeat parts a and b with the differences instead of the original closing prices—that is, examine the autocorrelations of the differences. They should be small, and the scatterplots of the differences versus lags of the differences should be shapeless swarms. This illustrates what happens when the differences of a time series variable have insignificant autocorrelations.

d. Write a short report of your findings.

Level B 23. Consider a random walk model with the following

equation: YtYtY = YtYtY − 1 + 500 + et, where et is a normally distributed random series with mean 0 and standard deviation 10. a. Use Excel to simulate a time series that behaves

according to this random walk model. b. Use the time series you constructed in part a to

forecast the next observation.

24. The file P12_24.xlsx contains the daily closing prices of Procter & Gamble stock from July 2014 to September 2015. Use only the 2014 data to estimate the trend component of the random walk model. Next, use the estimated random walk model to forecast the behav- ior of the time series for the 2015 dates in the series. Comment on the accuracy of the generated forecasts over this period. How could you improve the forecasts as you progress through the 2015 trading days?

The role of the span is important. If the span is large—say, 12 months—then many observations go into each average, and extreme values have relatively little effect on the forecasts. The resulting series of forecasts will be much smoother than the original series.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

566 Chapter 12 Time Series Analysis and Forecasting

(For this reason, the moving average method is called a smoothing method.) In contrast, if the span is small—say, three months—then extreme observations have a larger effect on the fore- casts, and the forecast series will be much less smooth. In the extreme, if the span is 1, there is no smoothing effect at all. The method simply forecasts next month’s value to be the same as the current month’s value. This is the naive forecasting model mentioned in the previous section. It is a special case of the random walk model with the mean difference equal to 0.

What span should you use? This requires some judgment. If you believe the ups and downs in the series are random noise, then you don’t want future forecasts to react too quickly to these ups and downs, and you should use a relatively large span. But if you want to track every little zigzag—under the belief that each up or down is predictable—then you should use a smaller span. You shouldn’t be fooled, however, by a plot of the (smoothed) forecast series superimposed on the original series. This graph will almost always look better when a small span is used, because the forecast series will appear to track the original series better. Does this mean it will always provide better future forecasts? Not necessarily. There is little point in tracking random ups and downs closely if they represent unpredictable noise.

The following example illustrates the use of moving averages.

E X A M P L E 12.4 HOUSES SOLD IN THE UNITED STATES

The file House Sales.xlsx contains monthly data on the number of new one-family houses sold in the United States (in thousands) from January 1991 through June 2015. (These data, available from the U.S. Census Bureau website, are listed as SAAR, season- ally adjusted at an annual rate.)4 A time series graph of the data appears in Figure 12.25. Housing sales were steadily trending upward until about the beginning of 2006, then the bottom fell out of the housing market, and sales eventually started trending upward again. Does a moving averages model fit this series well? What span should be used?

4Government data are often reported in seasonally adjusted form, with the seasonality removed, to make any trends more apparent.

Figure 12.25 Time Series Graph of Monthly House Sales

0

Ja n

-9 1

Fe b

-9 2

M ar

-9 3

A p

r- 94

M ay

-9 5

Ju n

-9 6

Ju l-

97

A u

g- 98

Se p

-9 9

O ct

-0 0

N o

v- 01

Ja n

-0 4

Fe b

-0 5

M ar

-0 6

A p

r- 07

M ay

-0 8

Ju n

-0 9

Ju l-

10

A u

g- 11

Se p

-1 2

O ct

-1 3

N o

v- 14

D ec

-0 2

1,600

1,400

1,200

1,000

800

600

400

200

Houses Sold

© C

e n g

a g

e L

e a rn

in g

Objective To see whether a moving averages model with an appropriate span fits the housing sales data and to see how StatTools implements this method.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-6 Moving Averages Forecasts 567

Solution Although the moving averages method is quite easy to implement in Excel—you just form an average of the appropriate span and copy it down—it can be tedious. It is much easier to implement with StatTools. Actually, the StatTools forecasting procedure is fairly general in that it allows you to forecast with several methods, either with or without taking seasonality into account. Because this is your first exposure to this procedure, we will go through it in some detail in this example.

To use the StatTools Forecasting procedure, select Forecast from the StatTools Time Series and Forecasting dropdown list. This brings up a dialog box with three tabs in its bottom section. The Time Scale tab, shown in Figure 12.26, allows you to select the time period. The Forecast Settings tab, shown in Figure 12.27, allows you to select a forecasting

Figure 12.26 StatTools Forecast Dialog Box, Time Scale Tab

© C

e n g

a g

e L

e a rn

in g

Figure 12.27 StatTools Forecast Dialog Box, Forecast Settings Tab

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

568 Chapter 12 Time Series Analysis and Forecasting

method. Finally, the Graphs to Display tab, not shown here, allows you to select several optional time series graphs. For now, fill out the dialog box sections as shown and select the Forecast Overlay option in the Graphs to Display tab. In particular, note from Figure 12.27 that the moving averages method is being used with a span of 3, and it will generate fore- casts for the next 12 months.

Another option in Figure 12.27 (not used here) is that you can elect to “hold out” a subset of the series for validation purposes. If you hold out several periods at the end of the series for validation, any model that is built is estimated only for the non-holdout observations, and summary measures are reported for the non-holdout and holdout subsets separately.

The output consists of several parts, as shown in Figures 12.28, 12.29, and 12.30. We actually ran the analysis twice, once for a span of 3 and once for a span of 12. These figures show the comparison. (We also obtained output for a span of 6, with results fairly

8 7

9 10 11 12 13 14 15

A BA B C DC D E FE F G

Forecas�ng Constant Moving Averages Forecasts for Houses Sold Moving Averages Forecasts for Houses Sold

Forecas�ng Constant Span 3 Span 12

Moving Averages Moving Averages

Mean Abs Err 37.31 Mean Abs Err 58.26 Root Mean Sq Err 49.15 Root Mean Sq Err 76.95 Mean Abs Per% Err 5.61% Mean Abs Per% Err 8.86%

Figure 12.28 StatTools Moving Averages Summary Output

© C

e n g

a g

e L

e a rn

in g

40 41 42 43 44 45

331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346

ForecasForecasF �ng Data

Jan-1991 Feb-1991 Mar-1991 Apr-1991 May-1991 Mar-2015 Apr-2015 May-2015 Jun-2015 Jul-2015 Aug-2015 Sep-2015 Oct-2015 Nov-2015 Dec-2015 Jan-2016 Feb-2016 Mar-2016 Apr-2016 May-2016 Jun-2016

Houses Sold

401.00 482.00 507.00 508.00 517.00 485.00 523.00 517.00 482.00

Forecast

463.33 499.00 520.33 517.00 517.67 508.33 507.33 502.11 497.15 502.20 500.49 499.94 500.88 500.43 500.42 500.58 500.48 500.49

Error

44.67 18.00

35.33 6.00

0.67 26.33

A BA B C DC D E

ForecasForecasF �ng Data

Jan-1991 Feb-1991 Mar-1991 Apr-1991 May-1991 Mar-2015 Apr-2015 May-2015 Jun-2015 Jul-2015 Aug-2015 Sep-2015 Oct-2015 Nov-2015 Dec-2015 Jan-2016 Feb-2016 Mar-2016 Apr-2016 May-2016 Jun-2016

Houses Sold

401.00 482.00 507.00 508.00 517.00 485.00 523.00 517.00 482.00

Forecast

456.92 463.17 472.58 477.58 483.75 490.48 493.52 496.40 498.43 502.55 503.18 501.69 498.08 499.17 497.19 495.54

Error

28.08 59.83 44.42 4.42

F GF G H IH I

Figure 12.29 StatTools Moving Averages Detailed Output

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-6 Moving Averages Forecasts 569

similar to those for a span of 3.) First, the summary measures MAE, RMSE, and MAPE of the forecast errors are shown in Figure 12.28. As you can see, the forecasts using a span of 3 are considerably more accurate. For example, they are off by about 5.61% on average, whereas the similar measure with a span of 12 is 8.86%.

The essence of the forecasting method is very simple and is captured in column C of Figure 12.29 for a span of 3 (with many hidden rows). Each value in the historical period in this column is an average of the three preceding values in column B. The forecast errors are then just the differences between columns B and C. For the future periods, the forecast formulas in column C use observations when they are available. If they are not available, previous forecasts are used. For example, the forecast for August 2015 is the average of the observed values in May and June 2015 and the observed values in May and June 2015 and the observed forecast value in July 2015.forecast value in July 2015.forecast

The graphs in Figure 12.30 show the behavior of the forecasts. The forecast series with span 3 (the graph on the left) follows the ups and downs of the actual series fairly closely, and when the series starts going down, the moving averages track the turnaround fairly well. In contrast, the 12-month moving average series is much smoother. This is probably a good feature when the series is trending upward—there is no sense in tracking

The moving average method we have presented is the simplest of a group of moving average methods used by professional forecasters. We smoothed exactly once; that is, we smoothed exactly once; that is, we smoothed took moving averages of several observations at a time and used these as forecasts. More complex methods smooth more than once, basically to get rid of random noise. They take moving averages, then moving averages of these moving averages, and so on for several stages. This can become quite complex, but the objective is quite simple—to smooth the data so that underlying patterns are easier to see.

the noise—but when the series suddenly starts downward, the moving averages consist- ently lag behind. That is, the forecasts in this latter period are consistently too high. (This same behavior occurs for a span of 6, but the forecasts are not as biased in the latter part of the series as with a span of 12.)

One interesting feature of the moving average method is that future forecasts tend to be quite flat. This is apparent in Figure 12.30. This is a basic property of moving average forecasts: future forecasts tend to be close to the last few values of the series. ■

Ja n

-1 99

1 Fe

b -1

99 2

M ar

-1 99

3 A

p r-

19 94

M ay

-1 99

5 Ju

n -1

99 6

Ju l-

19 97

A u

g- 19

98 Se

p -1

99 9

O ct

-2 00

0 N

o v-

20 01

Ja n

-2 00

4 Fe

b -2

00 5

M ar

-2 00

6 A

p r-

20 07

M ay

-2 00

8 Ju

n -2

00 9

Ju l-

20 10

A u

g- 20

11 Se

p -2

01 2

O ct

-2 01

3 N

o v-

20 14

D ec

-2 01

5

D ec

-2 00

2

1600.00

Forecast and Original Observa�ons Forecast and Original Observa�ons

1400.00

1200.00

1000.00

800.00

600.00

400.00

200.00

0.00

Ja n

-1 99

1 Fe

b -1

99 2

M ar

-1 99

3 A

p r-

19 94

M ay

-1 99

5 Ju

n -1

99 6

Ju l-

19 97

A u

g- 19

98 Se

p -1

99 9

O ct

-2 00

0 N

o v-

20 01

Ja n

-2 00

4 Fe

b -2

00 5

M ar

-2 00

6 A

p r-

20 07

M ay

-2 00

8 Ju

n -2

00 9

Ju l-

20 10

A u

g- 20

11 Se

p -2

01 2

O ct

-2 01

3 N

o v-

20 14

D ec

-2 01

5

D ec

-2 00

2

1600.00

1400.00

1200.00

1000.00

800.00

600.00

400.00

200.00

0.00

Forest House Sold

Forest House Sold

Figure 12.30 StatTools Moving Averages Forecasts with Span 3 (Left) and Span 12 (Right)

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

570 Chapter 12 Time Series Analysis and Forecasting

P R O B L E M S

Level A 25. The file P12_16.xlsx contains the daily closing prices of

American Express stock for a one-year period. a. Using a span of 3, forecast the price of this stock

for the next trading day with the moving average method. How well does this method with span 3 forecast the known observations in this series?

b. Repeat part a with a span of 10. c. Which of these two spans appears to be more

appropriate? Justify your choice.

26. The closing value of the AMEX Airline Index for each trading day for a one-year period is given in the file P12_17.xlsx. a. How well does the moving average method track

this series when the span is 4; when the span is 12? b. Using the more appropriate span, forecast the

closing value of this index on the next trading day with the moving average method.

27. The closing value of the Dow Jones Industrial Average for each trading day for a two-year period is provided in the file P12_19.xlsx. a. Using a span of 2, forecast the price of this index on

the next trading day with the moving average method. How well does the moving average method with span 2 forecast the known observations in this series?

b. Repeat part a with a span of 5; with a span of 15.

c. Which of these three spans appears to be most appropriate? Justify your choice.

28. The file P12_10.xlsx contains annual revenues for a convenience store. If you want to forecast revenue for the next few years with the moving averages method, what span should you use? Will any span work well?.

29. The file P12_29.xlsx contains monthly revenues for a company over a four-year period. Use the moving aver- age method to forecast this company’s revenues for the 12 months. What span seems to work best?.

30. The file P02_28.xlsx contains total monthly U.S. retail sales data. While holding out the final six months of observations for validation purposes, use the method of moving averages with one or more spans of your choice to forecast U.S. retail sales for the next 12 months. Comment on the performance of your model. What makes this time series more challenging to forecast?

Level B 31. Consider a random walk model with the following

equation: YtYtY = YtYtY − 1 + et, where et is a random series t is a random series t with mean 0 and standard deviation 1. Specify a moving average model that is equivalent to this random walk model. In particular, what is the appropriate span in the equivalent moving average model? What is the smoothing effect of this span?

12-7 EXPONENTIAL SMOOTHING FORECASTS There are two possible criticisms of the moving averages method. First, it puts equal weight on each value in a typical moving average. Many analysts would argue that if next month’s forecast is to be based on the previous 12 months’ observations, more weight should be placed on the more recent observations. The second criticism is that the moving averages method requires a lot of data storage. This is particularly true for companies that routinely make forecasts of hundreds or even thousands of items. If 12-month moving averages are used for 1000 items, then 12,000 values are needed for next month’s forecasts. This may or may not be a concern, given today’s inexpensive computer storage.

Exponential smoothing is a method that addresses both of these criticisms. It bases its forecasts on a weighted average of past observations, with more weight on the more recent observations, and it requires very little data storage. In addition, it is not dif�cult for most busi- ness people to understand, at least conceptually. Therefore, this method is used widely in the business world, particularly when frequent and automatic forecasts of many items are required.

There are many variations of exponential smoothing. The simplest is appropriately called simple exponential smoothing. It is relevant when there is no pronounced trend or seasonality in the series. If there is a trend but no seasonality, Holt’s method is applicable. If, in addition, there is seasonality, Winters’ method can be used. (These last two meth- ods are often collectively called the Holt-Winters model.) This does not exhaust the types of exponential smoothing models—researchers have invented many other variations—but these three models will suf�ce for us.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-7 Exponential Smoothing Forecasts 571

Simple exponential smoothing is appropriate for a series with no pronounced trend or seasonality. Holt’s method is appropriate for a series with trend but no seasonality. Winters’ method is appropriate for a series with seasonality (and possibly trend).

CHANGES IN EXCEL 2016

A promising addition to Excel 2016 is the forecasting tool, run from the Forecast Sheet button on the Data ribbon. This forecasting tool implements a version of exponential smoothing, as explained on their websites. However, it is difficult to tell exactly how their algorithm works (we see only the forecasts, no formulas, and almost no tweaking is possible), so we won’t use the new Excel 2016 forecasting tool in this edition of the book and instead will continue to use StatTools.

The level is an estimate of where the series would be if it were not for random noise.

Even though you usually don’t have to substitute into these equations manually, you should understand what they say. Equation (12.12) shows how to update the estimate of the level. It is a weighted average of the current observation, YtYtY , and the previous level, Lt − 1, with respective weights α and 1 − α. Equation (12.13) shows how forecasts are made. It says that the k-period-ahead forecast, FtFtF + k, made of YtYtY + k in period k in period k t is the most recently estit is the most recently estit - mated level, Lt. This is the same for any value of k ≥ 1. The idea is that in simple exponen- tial smoothing, you believe that the series is not really going anywhere. So as soon as you estimate where the series ought to be in period t (if it weren’t for random noise), you use t (if it weren’t for random noise), you use t this as the forecast for any future period.

The smoothing constant α is analogous to the span in moving averages. There are two ways to see this. The �rst way is to rewrite Equation (12.12), using the fact that the forecast error, Et, made in forecasting YtYtY at time t − 1 is YtYtY − FtFtF = YtYtY − Lt − 1. Using algebra, Equation (12.12) can be rewritten as Equation (12.14).

Simple Exponential Smoothing Formulas Lt = αYtYtY + (1 − α)Lt − 1 (12.12)

FtFtF + k = Lt (12.13)

Equivalent Formula for Simple Exponential Smoothing Lt = Lt − 1 + αEt (12.14)

This equation says that the next estimate of the level is adjusted from the previous estimate by adding a multiple of the most recent forecast error. This makes sense. If the previous forecast was too high, then Et is negative, and the estimate of the level is adjusted downward.

12-7a Simple Exponential Smoothing

We now examine simple exponential smoothing in some detail. We �rst introduce two new terms. Every exponential model has at least one smoothing constant, which is always a number between 0 and 1. Simple exponential smoothing has a single smoothing constant denoted by α. (Its role is discussed shortly.) The second new term is Lt, called the level of level of level the series at time t. This value is not observable but can only be estimated. Essentially, it is an estimate of where the series would be at time t if there were no random noise. Then the simple exponential smoothing method is de�ned by the following two equations, where FtFtF + k is the forecast of k is the forecast of k YtYtY + k made at time t:

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

572 Chapter 12 Time Series Analysis and Forecasting

Another Equivalent Formula for Simple Exponential Smoothing

Lt = αYtYtY + α(1 − α)YtYtY − 1 + α(1 − α) 2YtYtY − 2 + α(1 − α)

3YtYtY − 3 + · · · (12.15)

The opposite is true if the previous forecast was too low. However, Equation (12.14) says that the method does not adjust by the entire magnitude of Et, but only by a fraction of it. If α is small, say, α = 0.1, the adjustment is minor; if α is close to 1, the adjustment is large. So if you want the method to react quickly to movements in the series, you should choose a large α; otherwise, you should choose a small α.

Another way to see the effect of α is to substitute recursively into the equation for Lt. By performing some algebra, you can verify that Lt satis�es Equation (12.15), where the sum extends back to the �rst observation at time t = 1.

Equation (12.15) shows how the exponentially smoothed forecast is a weighted average of previous observations. Furthermore, because 1 − α is less than 1, the weights on the Y’s decrease from time t backward. If t backward. If t α is close to 0, then 1 − α is close to 1 and the weights decrease very slowly. In other words, observations from the distant past continue to have a large in�uence on the next forecast. This means that the graph of the forecasts will be rela- tively smooth, just as with a large span in the moving averages method. But if α is close to 1, the weights decrease rapidly, and only very recent observations have much in�uence on the next forecast. In this case forecasts react quickly to sudden changes in the series. This is equivalent to a small span in moving averages.

What value of α should you use? There is no universally accepted answer to this ques- tion. Some practitioners recommend always using a value around 0.1 or 0.2. Others recom- mend experimenting with different values of α until a measure such as RMSE or MAPE is minimized. Some packages even have an optimization feature to �nd this optimal value of α. (This is the case with StatTools.) But just as we discussed in the moving averages section, the value of α that tracks the historical series most closely does not necessarily guarantee the most accurate future forecasts.

Small smoothing constants provide forecasts that respond slowly to changes in the series. Large smoothing constants do the opposite.

Smoothing Constants in Exponential Smoothing All versions of exponential smoothing—and there are more than are discussed here—use one or more smoothing constants between 0 and 1. To make any such method produce smoother forecasts,

and hence react less quickly to noise, you should use smaller smoothing constants, such as 0.1 or 0.2. When larger smoothing constants are used, the historical forecasts might appear to track the actual series fairly closely, but they might just be tracking random noise.

F u n da m e n ta l I n s i g h t

E X A M P L E 12.4 HOUSES SOLD IN THE UNITED STATES (CONTINUED)

Previously, we used the moving averages method to forecast monthly housing sales in the United States. (See the House Sales.xlsx file.) How well does simple exponential smoothing work with this data set? What smoothing constant should be used?

Objective To see how well a simple exponential smoothing model, with an appropriate smoothing constant, fits the housing sales data, and to see how StatTools implements this method.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-7 Exponential Smoothing Forecasts 573

Figure 12.31 StatTools Forecast Settings for Exponential Smoothing

© C

e n g

a g

e L

e a rn

in g

Solution You can use StatTools to implement the simple exponential smoothing model, specifically equations (12.12) and (12.13). You do this again by selecting Forecast from the StatTools Time Series and Forecasting dropdown list. Specifically, you fill in the forecast dialog box essentially as with moving averages, except that you select the simple exponential smoothing option in the Forecast Settings tab (see Figure 12.31). You should also choose a smoothing constant (0.2 was chosen here, but any other value could be chosen) or you can elect to find an optimal smoothing constant.

The results appear in Figures 12.32 (with many hidden rows) and 12.33. The heart of the method takes place in columns C, D, and E of Figure 12.32. Column C calculates the smoothed levels (Lt) from Equation (12.12), column D calculates the forecasts (FtFtF ) from Equation (12.13), and column E calculates the forecast errors (Et) as the observed values minus the forecasts. Although the Excel formulas do not appear in the figure, you can examine them in the StatTools output.

Every exponential smoothing method requires initial values, in this case the initial initial values, in this case the initial initial smoothed level in cell C41. There is no way to calculate this value, L1, from Equation (12.12) because the previous value, L0, is unknown. Different implementations of exponential smoothing initialize in different ways. StatTools initializes by setting L1 equal to Y1 (in cell B41). The effect of initializing in different ways is usually minimal because any effect of early data is usually washed out as forecasts are made into the future. In the present exam- ple, values from 1991 have little effect on forecasts for 2015 and beyond.

Note that the 12 future forecasts (rows 335 down) are all equal to the last calculated smoothed level, the one for June 2015 in cell C334. The fact that these remain constant is a consequence of the assumption behind simple exponential smoothing, namely, that the series is not really going anywhere. Therefore, the last smoothed level is the best available indication of future values of the series.

Figure 12.33 shows the forecast series superimposed on the original series. You can see the obvious smoothing effect of a relatively small α level. If the various zigzags in the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

574 Chapter 12 Time Series Analysis and Forecasting

7 8 9

10 11 12 13 14 15 16 40 41 42 43

331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346

Simple Exponen�al Smoothing Forecasts for Houses Sold Forecas�ng Conss�ng Conss� tant

Simple Exponen�al

Level (Alpha)

Mean Abs Err Root Mean Sq Err Mean Abs Per%Err

Forecas�ng Datas�ng Datas� Jan-1991 Feb-1991 Mar-1991 Mar-2015 Apr-2015 May-2015 Jun-2015 Jul-2015 Aug-2015 Sep-2015 0ct-2015 Nov-2015 Dec-2015 Jan-2016 Feb-2016 Mar-2016 Apr-2016 May-2016 Jun-2016

0.200

48.70 63.41 7.48%

Houses Sold 401.00 482.00 507.00 485.00 523.00 517.00 482.00

Level 401.00 417.20 435.16 482.83 490.87 496.09 493.28

Forecast

401.00 417.20 482.29 482.83 490.87 496.09 493.28 493.28 493.28 493.28 493.28 493.28 493.28 493.28 493.28 493.28 493.28 493.28

Error

81.00 89.80 2.71

40.17 26.13

�14.09

A BA B C DC D EFigure 12.32 StatTools Simple Exponential Smoothing Output

© C

e n g

a g

e L

e a rn

in g

0.00

Ja n

-1 99

1

Ja n

-2 00

4 D

ec -2

00 3

Fe b

-1 99

2 M

ar -1

99 3

A p

r- 19

94 M

ay -1

99 5

Ju n

-1 99

6 Ju

l- 19

97 A

u g-

19 98

Se p

-1 99

9 O

ct -2

00 1

N o

v- 20

02

Fe b

-2 00

5 M

ar -2

00 6

A p

r- 20

07 M

ay -2

00 8

Ju n

-2 00

7 Ju

l- 20

10 A

u g-

20 11

Se p

-2 01

2 O

ct -2

01 3

N o

v- 20

14 D

ec -2

01 5

1600.00

200.00

400.00

600.00

800.00

1000.00

1200.00

1400.00

Forecast and Original Observa�ons

Houses Sold Forecast

Figure 12.33 StatTools Graph of Forecasts from Simple Exponential Smoothing

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-7 Exponential Smoothing Forecasts 575

original series are really random noise, then perhaps the forecasts shouldn’t try to track these random ups and downs too closely. That is, perhaps a forecast series that emphasizes the basic underlying pattern is preferred. However, notice that once the series starts going downhill, the forecasts never quite catch up. This is the same behavior you saw with a span of 12 for moving averages.

You can see several summary measures of the forecast errors in Figure 12.32. The RMSE and MAE indicate that the forecasts from this model are typically off by a magni- tude of about 49 to 63 thousand, and the MAPE indicates that they are off by about 7.5%. These are fairly sizable errors. One way to reduce the errors is to use a different smooth- ing method. We will try this in the next subsection with Holt’s method. Another way to reduce the errors is to use a different smoothing constant. There are two methods you can use. First, you can simply enter different values in the smoothing constant cell in the Forecast sheet. All formulas, including those for MAE, RMSE, and MAPE, will update automatically.

Second, you can check the Optimize Parameters option in the Forecast dialog box shown in Figure 12.31. This automatically runs an optimization algorithm (not Solver, by the way) to find the smoothing constant that minimizes RMSE. (StatTools is pro- grammed to minimize RMSE. However, you could try minimizing MAPE, say, by using Excel’s Solver add-in.) When this optimization option is used for the housing data, the results (not shown here but available in the finished version of the file) indicate an optimal smoothing constant of 0.680 and slightly lower values of MAE, RMSE, and MAPE than before. This larger smoothing constant produces a less smooth forecast curve and slightly better error measures. However, there is no guarantee that future forecasts made  with this optimal smoothing constant will be any better than with a smoothing constant of 0.2. ■

In the next subsection, Holt’s method is used on this series to see whether it captures the trend better than simple exponential smoothing.

12-7b Holt’s Model for Trend

The simple exponential smoothing model generally works well if there is no obvious trend in the series. But if there is a trend, this method consistently lags behind it. For example, if the series is constantly increasing, simple exponential smoothing forecasts will be con- sistently low. Holt’s method recti�es this by dealing with trend explicitly. In addition to the level of the series, Lt , Holt’s method includes a trend term, TtTtTt , and a corresponding smoothing constant β. The interpretation of Lt is exactly as before. The interpretation of TtTtT is that it represents an estimate of the change in the series from one period to the next. The equations for Holt’s model are as follows.

Formulas for Holt’s Exponential Smoothing Method Lt = αYtYtY + (1 − α) (Lt − 1 + TtTtT − 1) (12.16)

TtTtT = β(Lt − Lt − 1) + (1 − β)TtTtT − 1 (12.17)

FtFtF + k = Lt + kTtTtT (12.18)

The trend term in Holt’s method estimates the change from one period to the next.

These equations are not as bad as they look. (And don’t forget that the software does all of the calculations for you.) Equation (12.16) says that the updated level is a weighted average of the current observation and the previous level plus the estimated change. Equation (12.17) says that the updated trend is a weighted average of the difference between two consecutive levels and the previous trend. Finally, Equation (12.18) says

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

576 Chapter 12 Time Series Analysis and Forecasting

that the k-period-ahead forecast made in period t is the estimated level plus k times the estimated change per period.

Everything we said about α for simple exponential smoothing applies to both α and β in Holt’s model. The new smoothing constant β controls how quickly the method reacts to observed changes in the trend. If β is small, the method reacts slowly. If it is large, the method reacts more quickly. Of course, there are now two smoothing constants to select. Some practitioners suggest using a small value of α (0.1 to 0.2, say) and setting β equal to α. Others suggest using an optimization option (available in StatTools) to select the optimal smoothing constants. We illustrate Holt’s method in the following continuation of the hous- ing sales example.

E X A M P L E 12.4 HOUSES SOLD IN THE UNITED STATES (CONTINUED)

We again examine the monthly data on housing sales in the United States. In the previous subsection, we saw that simple exponential smoothing, even with an optimal smoothing constant, does only a fair job of forecasting housing sales. Given that there are trends in housing sales over this period, Holt’s method might be expected to perform better. Does it?

Objective To see whether Holt’s method, with appropriate smoothing constants, captures the trends in the housing sales data better than simple exponential smoothing (or moving averages).

Solution You implement Holt’s method in StatTools almost exactly as for simple exponential smoothing. The only difference is that you can now choose two smoothing constants, as shown in Figure 12.34. They can have different values, but they have both been chosen to be 0.2 for this example.

Figure 12.34 StatTools Dialog Box for Holt’s Method

© C

e n g

a g

e L

e a rn

in g

The StatTools outputs in Figures 12.35 and 12.36 are also very similar to the simple exponential smoothing outputs. The only difference is that there is now a trend column, col- umn D, in the numerical output. You can check that the formulas in columns C, D, and E

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-7 Exponential Smoothing Forecasts 577

implement equations (12.16), (12.17), and (12.18). As before, an initialization is required in row 42. These require values of L1 and T1 to get the method started. Different implementations of Holt’s method obtain these initial values in slightly different ways, but the effect is fairly minimal in most cases. (You can check cells C42 and D42 to see how StatTools does it.5 of Holt’s method obtain these initial values in slightly different ways, but the effect is fairly

5 of Holt’s method obtain these initial values in slightly different ways, but the effect is fairly

)

5The initial trend in cell D42 (the �rst period) is the �nal observation minus the initial observation, all divided by the number of observations. This is the average change over the entire time period. This might not be the best way to initialize, as suggested by the literature, and StatTools might be rewritten in a future version to initialize with the average change over the �rst two years, for example. This would give it a better chance to learn how a trend changes over time.

Figure 12.35 StatTools Output from Holt’s Method

7

8

9

10

11

12

13

14

15

16

17

41

42

43

44

332

333

334

335

336

337

338

339

340

341

342

343

344

345

346

347

Simple Exponen�al Smoothing ForecasSimple Exponen�al Smoothing ForecasSimple Exponen�al Smoothing F ts for Houses Sold

ForecasForecasF �ng Constant

Holt’s Exponen�alt’s Exponen�alt’

Level (Alpha)

Trend (Beta)

Mean Abs Err

Root MeanSq Err

Mean Abs Per%Err

ForecasForecasF �ng Data

Jan-1991

Feb-1991

Mar-1991

Mar-2015

Apr-2015

May-2015

Jun-2015

Jul-2015

Aug-2015

Sep-2015

0ct-2015

Nov-2015

Dec-2015

Jan-2016

Feb-2016

Mar-2016

Apr-2016

May-2016

Jun-2016

0.200

0.200

38.59

50.56

5.91%

Houses Sold

401.00

482.00

507.00

485.00

523.00

517.00

482.00

Level

401.00

417.42

438.14

498.39

510.30

519.13

519.12

Trend

0.28

3.50

6.95

8.73

9.37

9.26

7.41

Forecast

401.28

420.92

501.74

507.12

519.67

528.39

526.52

533.93

541.33

548.74

556.14

563.55

570.95

578.36

585.76

593.17

600.58

607.98

Error

80.72

86.08

–16.74

15.88

–2.67

–46.39

A BA B C EC ED FD FC ED FC EC ED FC E

© C

e n

g a g

e L

e a rn

in g

The error measures for this implementation of Holt’s method are slightly better than for simple exponential smoothing, but these measures are fairly sensitive to the smoothing constants. Therefore, a second run of Holt’s method was performed, using the Optimize Parameters option. This resulted in somewhat better results (not shown here but avail- able in the finished version of the file). The optimal smoothing constants are α = 0.679

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

578 Chapter 12 Time Series Analysis and Forecasting

and β = 0.000, and the MAE, RMSE, and MAPE values are virtually identical to those from simple exponential smoothing with an optimal smoothing constant. Note that the zero smoothing constant for trend doesn’t mean that there is no trend. It just means that the initial estimate of trend, the average change from the first time period to the last, is initial estimate of trend, the average change from the first time period to the last, is initial kept throughout. We suspect that these “optimal” results are due, at least in part, to the way StatTools determines the initial trend term. In any case, the results using 0.2 for the two smoothing constants appear to be quite good and “believable.” ■

Forecast and Original Observa�ons

0.00

200.00

400.00

600.00

800.00

1000.00

1200.00

1400.00

1600.00 Houses Sold Forecast

Ja n

-1 99

1

Ja n

-2 00

4

D ec

-2 00

3

Fe b

-1 99

2

M ar

-1 99

3

A p

r- 19

94

M ay

-1 99

5

Ju n

-1 99

6

Ju l-

19 97

A u

g- 19

98

Se p

-1 99

9

O ct

-2 00

1

N o

v- 20

02

Fe b

-2 00

5

M ar

-2 00

6

A p

r- 20

07

M ay

-2 00

8

Ju n

-2 00

7

Ju l-

20 10

A u

g- 20

11

Se p

-2 01

2

O ct

-2 01

3

N o

v- 20

14

D ec

-2 01

5

Figure 12.36 StatTools Forecasts from Holt’s Method

© C

e n g

a g

e L

e a rn

in g

P R O B L E M S

Level A 32. Consider the airline ticket data in the file P12_01.xlsx.

a. Create a time series chart of the data. Based on what you see, which of the exponential smoothing models do you think should be used for forecasting? Why?

b. Use simple exponential smoothing to forecast these data, using no holdout period and requesting 12 months of future forecasts. Use the default smoothing constant of 0.1.

c. Repeat part b, optimizing the smoothing constant. Does it make much of an improvement?

d. Write a short report to summarize your results.

33. Consider the applications for home mortgages data in the file P12_04.xlsx. a. Create a time series chart of the data. Based

on what you see, which of the exponential smoothing models do you think should be used for forecasting? Why?

b. Use simple exponential smoothing to forecast these data, using no holdout period and requesting

four quarters of future forecasts. Use the default smoothing constant of 0.1.

c. Repeat part b, optimizing the smoothing constant. Does it make much of an improvement?

d. Write a short report to summarize your results.

34. Consider the American Express closing price data in the file P12_16.xlsx. a. Create a time series chart of the data. Based

on what you see, which of the exponential smoothing models do you think should be used for forecasting? Why?

b. Use Holt’s exponential smoothing to forecast these data, using no holdout period and requesting 20 days of future forecasts. Use the default smoothing constants of 0.1.

c. Repeat part b, optimizing the smoothing constants. Does it make much of an improvement?

d. Repeat parts a and b, this time using a holdout period of 50 days.

e. Write a short report to summarize your results.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-7 Exponential Smoothing Forecasts 579

35. Consider the poverty level data in the file P02_44.xlsx. a. Create a time series chart of the data. Based

on what you see, which of the exponential smoothing models do you think should be used for forecasting? Why?

b. Use simple exponential smoothing to forecast these data, using no holdout period and requesting three years of future forecasts. Use the default smoothing constant of 0.1.

c. Repeat part b, optimizing the smoothing constant. Make sure you request a chart of the series with the forecasts superimposed. Does the Optimize Parameters option make much of an improvement?

d. Write a short report to summarize your results. Considering the chart in part c, would you say the forecasts are adequate?

Problems 36 through 38 ask you to apply the exponential smoothing formulas. These do not require StatTools. In fact, they do not even require Excel. You can do them with a calculator (or with Excel).

36. An automobile dealer is using Holt’s method to forecast weekly car sales. Currently, the level is estimated to be 50 cars per week, and the trend is estimated to be six cars per week. During the current week, 30 cars are sold. After observing the current week’s sales, forecast the number of cars three weeks from now. Use α = β = 0.3.

37. You have been assigned to forecast the number of aircraft engines ordered each month from an engine manufacturing company. At the end of February, the forecast is that 100 engines will be ordered during April. Then during March, 120 engines are actually ordered. a. Using α = 0.3, determine a forecast (at the end

of March) for the number of orders placed during April and during May. Use simple exponential smoothing.

b. Suppose that MAE = 16 at the end of March. At the end of March, the company can be 68% sure that April orders will be between what two values, assuming normally distributed forecast errors? (Hint: It can be shown that the standard deviation of forecast errors is approximately 1.25 times MAE.)

38. Simple exponential smoothing with α = 0.3 is being used to forecast sales of SLR (single lens reflex) cameras at an appliance store. Forecasts are made on a monthly basis. After August camera sales are observed, the forecast for September is 100 cameras. a. During September, 120 cameras are sold. After

observing September sales, what is the forecast for October camera sales? What is the forecast for November camera sales?

b. It turns out that June sales were recorded as 10 cameras. Actually, however, 100 cameras were sold in June. After correcting for this error, what is the forecast for October camera sales?

Level B 39. Holt’s method assumes an additive trend. For example,

a trend of five means that the level will increase by five units per period. Suppose that there is actually a multiplicative trend. For example, if the current estimate of the level is 50 and the current estimate of the trend is 1.2, the forecast of demand increases by 20% per period. So the forecast demand for next period is 50(1.2) and forecast demand for two periods in the future is 50(1.2)2. If you want to use a multiplicative trend in Holt’s method, you should use equations of the form:

Lt = αYtYtY + (1 − α) (I)I)I TtTtT = β(IIIII )I)I + (1 − β)TtTtT − 1 a. What should (I) and (I) and (I II) be?II) be?II b. Suppose you are working with monthly data and

month 12 is December, month 13 is January, and so on. Also suppose that L12 = 100 and T12 = 1.2, and you observe Y13 = 200. At the end of month 13, what is the forecast for Y15? Assume α = β = 0.5 and a multiplicative trend.

40. A version of simple exponential smoothing can be used to predict the outcome of sporting events. To illustrate, consider pro football. Assume for simplicity that all games are played on a neutral field. Before each day of play, assume that each team has a rating. For example, if the rating for the Bears is +10 and the rating for the Bengals is +6, the Bears are predicted to beat the Bengals by 10 − 6 = 4 points. Suppose that the Bears play the Bengals and win by 20 points. For this game, the model underpredicted the Bears’ performance by 20 − 4 = 16 points. Assuming that the best α for pro football is 0.10, the Bears’ rating will increase by 16(0.1) = 1.6 points and the Bengals’ rating will decrease by 1.6 points. In a rematch, the Bears will then be favored by (10 + 1.6) − (6 − 1.6) = 7.2 points. a. How does this approach relate to the equation

Lt = Lt − 1 + αEt? b. Suppose that the home field advantage in pro

football is three points; that is, home teams tend to outscore equally rated visiting teams by an average of three points a game. How could the home field advantage be incorporated into this system?

c. How might you determine the best α for pro football?α for pro football?α d. How could the ratings for each team at the

beginning of the season be chosen? e. Suppose this method is used to predict pro football

(16-game schedule), college football (11-game schedule), college basketball (30-game schedule), and pro basketball (82-game schedule). Which sport do you think will have the smallest optimal α ? Which will have the largest optimal α? Why?

f. Why might this approach yield poor forecasts for major league baseball?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

580 Chapter 12 Time Series Analysis and Forecasting

12-8 SEASONAL MODELS So far we have said practically nothing about seasonality. Seasonality is the consistent month-to-month (or quarter-to-quarter) differences that occur each year. (It could also be the day-to-day differences that occur each week.) For example, there is seasonality in beer sales—high in the summer months, lower in other months. Toy sales are also seasonal, with a huge peak in the months preceding Christmas. In fact, if you start thinking about time series variables that you are familiar with, the majority of them probably have some degree of seasonality.

How can you tell whether there is seasonality in a time series? The easiest way is to check whether a graph of the time series has a regular pattern of ups and/or downs in regular pattern of ups and/or downs in regular particular months or quarters. Although random noise can sometimes mask such a pattern, the seasonal pattern is usually fairly obvious. (We have also included the �le Check for Seasonality.xlsx in the �nished examples folder. It indicates one possible way to check for seasonality.)

There are basically three methods for dealing with seasonality. First, you can use Winters’ exponential smoothing model. It is similar to simple exponential smoothing and Holt’s method, except that it includes another component (and smoothing constant) to cap- ture seasonality. Second, you can deseasonalize the data, then use any forecasting method to model the deseasonalized data, and �nally “reseasonalize” these forecasts. Finally, you can use multiple regression with dummy variables for the seasons. We discuss all of these methods in this section.

Seasonal models are usually classi�ed as additive or multiplicative. Suppose that the series contains monthly data, and that the average of the 12 monthly values for a typical year is 150. An additive model �nds seasonal indexes, one for each month, that are added to the monthly average, 150, to get a particular month’s value. For example, if the index for March is 22, then a typical March value is 150 + 22 = 172. If the seasonal index for September is −12, then a typical September value is 150 − 12 = 138. A multiplicative model also �nds seasonal indexes, but they are multiplied by the monthly average to multiplied by the monthly average to multiplied get a particular month’s value. Now if the index for March is 1.3, a typical March value is 150(1.3) = 195. If the index for September is 0.9, then a typical September value is 150(0.9) = 135.

As you saw with the housing sales data, government agencies often perform part of the second method for us—that is, they deseasonalize the data.

In an additive seasonal model, an appropriate seasonal index is added to a base forecast. These indexes, one for each season, typically average to 0.

In a multiplicative seasonal model, a base forecast is multiplied by an appropriate seasonal index. These indexes, one for each season, typically average to 1.

Either an additive or a multiplicative model can be used to forecast seasonal data. However, because multiplicative models are somewhat easier to interpret (and have worked well in applications), we focus on them. Note that the seasonal index in a multiplicative model can be interpreted as a percentage.6 well in applications), we focus on them. Note that the seasonal index in a multiplicative

6 well in applications), we focus on them. Note that the seasonal index in a multiplicative

Using the �gures in the previous paragraph as an example, March tends to be 30% above the monthly average, whereas September tends to be 10% below it. Also, the seasonal indexes in a multiplicative model typically average to 1. Software packages usually ensure that this happens.

6The new Forecast Sheet tool in Excel 2016 uses an additive model.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-8 Seasonal Models 581

Formulas for Winters’ Exponential Smoothing Model

Lt = α YtYtY

St − M + (1 − α) (Lt − 1 + TtTtT − 1) (12.19)

TtTtT = β(Lt − Lt − 1) + (1 − β)TtTtT − 1 (12.20)

St = γ YtYtYγ L

γ L

γ t

+ (1 − γ)St − M (12.21)

FtFtF + k = (Lt + kTtTtT )St + k − M (12.22)

12-8a Winters’ Exponential Smoothing Model

We now turn to Winters’ exponential smoothing model. It is very similar to Holt’s model— it again has level and trend terms and corresponding smoothing constants α and β—but it also has seasonal indexes and a corresponding smoothing constant γ (gamma). This new smoothing constant controls how quickly the method reacts to observed changes in the sea- sonality pattern. If γ is small, the method reacts slowly. If it is large, the method reacts more quickly. As with Holt’s model, there are equations for updating the level and trend terms, and there is one extra equation for updating the seasonal indexes. For completeness, we list these equations, but they are clearly too complex for hand calculation and are best left to the software. In Equation (12.21), St refers to the multiplicative seasonal index for period t. In equations (12.19), (12.21), and (12.22), M refers to the number of seasons (M refers to the number of seasons (M M = 4 for quarterly data, M = 12 for monthly data).

To see how the forecasting in Equation (12.22) works, suppose you have observed data through June and you want a forecast for the coming September, that is, a three-month- ahead forecast. (In this case t refers to June and t refers to June and t t + k = t + 3 refers to September.) The method �rst adds 3 times the current trend term to the current level. This gives a forecast for September that would be appropriate if there were no seasonality. Next, it multiplies this forecast by the most recent estimate of September’s seasonal index (the one from the previous September) to get the forecast for September. Of course, the software does all of the calculations, but this is basically what it is doing. We illustrate the method in the following example.

E X A M P L E 12.5 QUARTERLY SOFT DRINK SALES

The data in the Soft Drink Sales.xlsx file represent quarterly sales (in millions of dol-lars) for a soft drink company from quarter 1 of 2001 through quarter 4 of 2016. There has been an upward trend in sales during this period, and there is also a fairly regular sea- sonal pattern, as shown in Figure 12.37. Sales in the warmer quarters, 2 and 3, are consist- ently higher than in the colder quarters, 1 and 4. How well can Winters’ method track this upward trend and seasonal pattern?

Objective To see how well Winters’ method, with appropriate smoothing constants, can forecast the company’s seasonal soft drink sales.

Solution To use Winters’ method with StatTools, you proceed exactly as with any of the other expo- nential smoothing methods. However, for a change (and because there are so many years of data), you can use StatTools’s option of holding out some of the data for validation.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

582 Chapter 12 Time Series Analysis and Forecasting

Specifically, fill in the Forecast dialog box as shown in Figure 12.38, selecting Winters’ method, holding out eight quarters of data (Q1-2015 through Q4-2016), and forecasting four quarters into the future (all of 2017). Note that we chose 0.2 for the first two smoothing constants and a larger smoothing constant, 0.4, for seasonality. This is often recommended, but you can experiment with other smoothing constants or check the Optimize option.

The results from Winters’ method are shown in Figures 12.39 and 12.40. The numeric output in Figure 12.39 is very similar to output from Holt’s method, except there is now a column, column E, for the estimated seasonal indexes. These change slightly over time, due to Equation (12.21), but you can see how they consistently pick up the pattern of lower sales in quarters 1 and 4 and higher sales in quarters 2 and 3. You can also see that the error measures in rows 15–17 are similar in the estimation period (through 2014) and the holdout

Sales

Q 1-

20 01

Q 4-

20 01

Q 3-

20 02

Q 2-

20 03

Q 1-

20 04

Q 4-

20 04

Q 3-

20 05

Q 2-

20 06

Q 1-

20 07

Q 4-

20 07

Q 3-

20 08

Q 2-

20 09

Q 1-

20 10

Q 4-

20 10

Q 3-

20 11

Q 2-

20 12

Q 1-

20 13

Q 4-

20 13

Q 4-

20 16

Q 3-

20 14

Q 2-

20 15

Q 1-

20 16

0

1000

2000

3000

4000

5000

6000

7000 Figure 12.37 Time Series Graph of Soft Drink Sales

© C

e n

g a g

e L

e a rn

in g

Figure 12.38 StatTools Forecast Settings for Soft Drink Sales

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-8 Seasonal Models 583

period (2015 and 2016). You typically want to see whether forecasts in the holdout period are significantly worse than in the estimation period, a sign that future forecasts might not be trusted, but this is not the case here.

The graph of the forecasts superimposed on the original series, shown in Figure 12.40, indicates that Winters’ method clearly picks up the seasonal pattern and the upward trend and projects both of these into the future.

The finished version of the file also shows the optimal smoothing constants for Winters’ method. These turn out to be 1, 0, and 0, not exactly what you would expect. As

Figure 12.39 StatTools Output from Winters’ Method for Soft Drink Sales

8

7

9

10

11

12

13

14

15

16

17

18

42

43

44

45

95

96

97

98

99

100

101

102

103

104

105

106

107

108

109

110

Level (Alpha) 0.200

Trend (Beta) 0.200

Season (Gamma) 0.400

ForecasForecasF �ng Constantsntsnt

Winters' Exponen�al Smoothing ForecasWinters' Exponen�al Smoothing ForecasWinters' Exponen�al Smoothing F ts for Sales

Winters' Exponen�al Es�ma�on

Period Holdouts

Period

Mean Abs Err 185.56

235.08

5.77%

Root Mean Sq Err

Mean Abs Per% Err

201.51

230.32

3.71%

ForecasForecasF �ng Data Sales Level Trend Forecast ErrorSeason

Q1-2001

Q2-2001

Q3-2001

Q1-2014

Q2-2014

Q3-2014

Q4-2014

Q1-2015

Q2-2015

Q3-2015

Q4-2015

Q1-2016

Q2-2016

Q3-2016

Q4-2016

Q1-2017

Q2-2017

Q3-2017

Q4-2017

1807.37

2355.32

2591.83

4431.36

5602.21

5349.85

5036.00

4534.61

5836.17

5818.28

5070.42

4497.47

6075.52

5868.67

5432.24

2052.06

2114.29

2229.95

4977.37

5033.30

5102.38

5163.72

56.65

57.76

69.34

13.46

21.95

31.38

37.37

0.88

1.11

1.10

0.89

1.09

1.03

0.96

2324.57

2287.05

4440.56

5373.54

5111.56

4893.21

4635.16

5716.32

5413.45

5111.26

4768.37

5879.44

5566.82

5255.06

4901.58

6042.55

5720.20

5398.86

30.75

304.78

−9.20

228.67

238.29

142.79

−100.55

119.85

404.83

−40.84

−270.90

196.08

301.85

177.18

A BA B C DC D E FE F G

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

584 Chapter 12 Time Series Analysis and Forecasting

The three exponential smoothing methods we have examined are not the only ones available. For example, there are linear and quadratic models available in some software packages. These are somewhat similar to Holt’s model except that they use only a sin- gle smoothing constant. There are also adaptive exponential smoothing models, where the smoothing constants themselves are allowed to change over time. Although these more complex models have been studied thoroughly in the academic literature and are used by some practitioners, they typically offer only marginal gains in forecast accuracy over the models we have examined.

12-8b Deseasonalizing: The Ratio-to-Moving-Averages Method

You have probably seen references to time series data that have been deseasonalized. (Websites often use the abbreviations SA and NSA for seasonally adjusted and nonseason- ally adjusted.) The reason why data are often published in deseasonalized form is that read- ers can then spot trends more easily. For example, if you see a time series of sales that has not been deseasonalized, and it shows a large increase from November to December, you might not be sure whether this represents a real increase in sales or a seasonal phenomenon (Christmas sales). However, if this increase is really just a seasonal effect, the deseasonal- ized version of the series will show no such increase in sales.

Government economists and statisticians have a variety of sophisticated methods for deseasonalizing time series data, but they are typically variations of the ratio-to-moving- averages method described here. This method is applicable when seasonality is multipli- cative, as described in the previous section. The goal is to �nd the seasonal indexes, which can then be used to deseasonalize the data. For example, if the estimated index for June is 1.3, this means that June’s values are typically about 30% larger than the average for all months. Therefore, June’s value is divided by divided by divided 1.3 to obtain the (smaller) deseasonalized

0.00

1000.00

2000.00

3000.00

4000.00

5000.00

6000.00

7000.00

Forecast and Original Observa�ons

Sales Forecast

Q 1-

20 01

Q 4-

20 01

Q 3-

20 02

Q 2-

20 03

Q 1-

20 04

Q 4-

20 04

Q 3-

20 05

Q 2-

20 06

Q 1-

20 07

Q 4-

20 07

Q 3-

20 08

Q 2-

20 09

Q 1-

20 10

Q 4-

20 10

Q 3-

20 11

Q 2-

20 12

Q 1-

20 13

Q 4-

20 13

Q 4-

20 16

Q 3-

20 17

Q 3-

20 14

Q 2-

20 15

Q 1-

20 16

Figure 12.40 StatTools Graph of Forecasts from Winters’ Method

© C

e n g

a g

e L

e a rn

in g

with Holt’s method, we suspect these strange results are due to the way StatTools initial- izes the method. Because of this, we recommend using “good” smoothing constants, like those in Figure 12.38, but not necessarily optimizing. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-8 Seasonal Models 585

To �nd the seasonal index for June 2016 (or any other month) in the �rst place, you essentially divide June’s observation by the average of the 12 observations sur- rounding June. (This is the reason for the term ratio in the name of the method.) There is one minor problem with this approach. June 2016 is not exactly in the middle of any 12-month sequence. If you use the 12 months from January 2016 to December 2016, June 2016 is in the �rst half of the sequence; if you use the �rst half of the sequence; if you use the �rst 12 months from December 2015 to November 2016, June 2016 is in the last half of the sequence. Therefore, you last half of the sequence. Therefore, you last can compromise by averaging the January-to-December and December-to-November averages. This is called a centered average. Then the seasonal index for June is June’s centered average. Then the seasonal index for June is June’s centered observation divided by this centered average. The following equation shows more spe- ci�cally how it works.

Jun2016 index = Jun2016

aDec2015 + … + Nov2016 12

+ Jan2016 + … + Dec2016

12 b╱2╱2╱

The only remaining question is how to combine all of the indexes for any speci�c month such as June. After all, if the series covers several years, the procedure produces several June indexes, one for each year. The usual way to combine them is to average them. This single average index for June is then used to deseasonalize all of the June observations.

Once the seasonal indexes are obtained, each observation is divided by its seasonal index to deseasonalize the data. The deseasonalized data can then be forecast by any of the methods we have described (other than Winters’ method, which wouldn’t make much sense). For example, Holt’s method or the moving averages method could be used to fore- cast the deseasonalized data. Finally, the forecasts are “reseasonalized” by multiplying them by the seasonal indexes.

As this description suggests, the method is not meant for hand calculations. However, it is straightforward to implement in StatTools, as we illustrate in the �nished version of the soft drink sales �le. All you need to do is check a Deseasonalize box and then choose a forecasting method, such as Holt’s, for the deseasonalized series. As you can see in the �le, the results are very similar to the results from Winters’ method.

value. Similarly, if February’s index is 0.85, then February’s values are 15% below the average for all months, so February’s value is divided by 0.85 to obtain the (larger) desea- sonalized value.

To deseasonalize an observation (assuming a multiplicative model of seasonality), divide it by the appropriate seasonal index.

12-8c Estimating Seasonality with Regression

We now examine a regression approach to forecasting seasonal data that uses dummy variables for the seasons. Depending on how you write the regression equation, you can create either an additive or a multiplicative seasonal model.

As an example, suppose that the data are quarterly data with a possible linear trend. Then you can create dummy variables Q1, Q2, and Q3 for the �rst three quarters (using quarter 4 as the reference quarter) and estimate the additive equation

Forecast YtYtY = a + bt + b1Q1 + b2Q2 + b3Q3

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

586 Chapter 12 Time Series Analysis and Forecasting

Then the coef�cients of the dummy variables, b1, b2 and b3, indicate how much each quarter differs from the reference quarter, quarter 4, and the coef�cient b represents the trend.

For example, if the estimated equation is

Forecast YtYtY = 130 + 25t + 15Q1 + 5Q2 − 20Q3 the average increase from one quarter to the next is 25 (the coef�cient of t). This is the trend effect. However, quarter 1 averages 15 units higher than quarter 4, quarter 2 averages 5 units higher than quarter 4, and quarter 3 averages 20 units lower than quarter 4. These coef�cients indicate the seasonality effect.

As discussed in Chapter 10, it is also possible to estimate a multiplicative model using dummy variables for seasonality (and possibly time for trend). Then you would estimate the equation

Forecast YtYtY = ae bteb1Q1eb2Q2eb3Q3

or, after taking logs,

Forecast Lt Lt og YtYtY = Log a + bt + b1Q1 + b2Q2 + b3Q3 Either of these approaches is reasonable, but because of its simplicity, we illustrate only the additive model in the following continuation of the soft drink sales example.

E X A M P L E 12.5 QUARTERLY SOFT DRINK SALES (CONTINUED)

Returning to the soft drink sales data (see the file Soft Drink Sales.xlsx), does a regres-sion approach provide forecasts that are as accurate as those provided by the other seasonal methods in this chapter?

Objective To use an additive regression equation, with dummy variables for seasons and a time variable for trend, to forecast soft drink sales.

Solution Figure 12.41 illustrates the data setup. Besides the Sales and Time variables, you need to create dummy variables for three of the four quarters. You can then use multiple regression, with Sales as the dependent variable, and Time, Q1, Q2, and Q3 as the explanatory variables.

1

2

3

4

5

6

7

8

9

10

11

Quarter

Q1-2001

Q2-2001

Q3-2001

Q4-2001

Q1-2002

Q2-2002

Q3-2002

Q4-2002

Q1-2003

Q2-2003

Sales

1807.37

2355.32

2591.83

2236.39

1549.14

2105.79

2041.32

2021.01

1870.46

2390.56

Time

1

2

3

4

5

6

7

8

9

10

Q1

1

0

0

0

1

0

0

0

1

0

Q2

0

1

0

0

0

1

0

0

0

1

Q3

0

0

1

0

0

0

1

0

0

0

A BA B C DC D E FE F Figure 12.41 Data Setup for Regression Model with Dummies

© C

e n g

a g

e L

e a rn

in g

The regression output appears in Figure 12.42. To make a fair comparison with the expo- nential smoothing methods, the regression is based only on the data through quarter 4 of

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-8 Seasonal Models 587

2014. (That is, the last eight quarters are again held out. This means that the StatTools data set should extend only through row 57.) Of particular interest are the coefficients of the explanatory variables. Specifically, the coefficient of Time means that deseasonalized sales increase by about 68.6 per quarter. Also, the coefficients of Q1, Q2, and Q3 mean that sales in quarters 1, 2, and 3 are, respectively, about 209 below, 512 above, and 314 above sales in the reference quarter, quarter 4. This pattern is quite comparable to the pattern of seasonal indexes you saw in previous models for these data.

To compare the forecast accuracy of this method to earlier models, you must perform several steps manually. (See Figure 12.43 for reference.) First, calculate the forecasts in column G by entering the formula

=Regression!$B$19+MMULT(‘Data Regression’!C2:F2,Regression!$B$20:$B$23)

in cell G2 and copying it down. (This formula assumes the regression output is in a sheet named Regression. It uses Excel’s MMULT function to sum the products of explana- tory values and regression coefficients. Because it is an array formula, you must press Ctrl+Shift+Enter when you enter it. Next, calculate the absolute errors, squared errors, and absolute percentage errors in columns H, I, and J, and summarize them in the usual way, both for the estimation period and the holdout period, in columns M and N.

Note that these summary measures are somewhat larger for this regression model than those from Winters’ method. Still, the corresponding graph in Figure 12.43 shows that the regression method has successfully picked up the trend and the seasonal pattern.

This method of detecting seasonality by using dummy variables in a regression equa- tion is always an option. The other variables included in the regression equation could be time t, lagged versions of YtYtY , and/or current or lagged versions of other explanatory vari- ables. These variables would capture any time series behavior other than seasonality. Just remember that there is always one less dummy variable than the number of seasons. If the data are quarterly, then three dummies are needed; if the data are monthly, then 11 dum- mies are needed. If the coefficients of any of these dummies turn out to be statistically

Figure 12.42 Regression Output for Additive Model

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

Mul�ple Regression for Sales

SummarySummarySummar

ANOVA Tabl Tabl T e

Mul�ple

R

0.9696

Degrees of

Freedom

4

51

Explained

Unexplained

Regression Tablgression Tablgression T e Coefficient

Constant

Time

Q1

Q2

Q3

1415.644423

68.62430495

−209.4813709

512.251467

313.7200192

R-Square

0.9402

Sum of

Squares

73645673.04

4686838.239

Standard

Error

Confidence Interval 95%

110.6560266

2.512315668

114.8268435

114.6893428

114.6067631

Adjusted

R-square

0.9355

Mean of

Squares

18411418.26

91898.78

t-Value-Value-V

12.79319768

27.3151602

−1.824324038

4.466426039

2.737360437

Std. Err. ofd. Err. ofd. Err

Es�mate

303.1481305

200.3445145

p-Value-Value-V

<0.0001

<0.0001

0.0740

<0.0001

0.0085

Rows

Ignored

0

p-Value-Value-V

<0.0001

Lower

1193.49318

63.58062078

−440.0058784

282.0030038

83.63734157

Lower

1637.795666

73.66798911

21.04313662

742.4999302

543.8026969

A BA B C DC D E FE F G

F

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

588 Chapter 12 Time Series Analysis and Forecasting

insignificant, they can be omitted from the equation. Then the omitted terms are effec- tively combined with the reference season. For example, if the Q1 term were  omitted, then quarters 1 and 4 would essentially be combined and treated as the reference season, and the other two seasons would be compared to them through their dummy variable coefficients. ■

P R O B L E M S

Level A 41. University Credit Union is open Monday through

Saturday. Winters’ method is being used (with α = β = γ = 0.5) to predict the number of customers entering the bank each day. After incorporating the arrivals on Monday, October 16, the seasonal indexes are: Monday, 0.90; Tuesday, 0.70; Wednesday, 0.80; Thursday, 1.1; Friday, 1.2; Saturday, 1.3. Also, the current estimates of level and trend are 200 and 1. On Tuesday, October 17, 182 customers enter the bank. At the close of business on October 17, forecast the number of customers who will enter the bank on each of the next six business days.

42. A local bank is using Winters’ method with α = 0.2, β = 0.1, and γ = 0.5 to forecast the number of customers served each day. The bank is open Monday through Friday. At the end of the previous week, the

following seasonal indexes have been estimated: Monday, 0.80; Tuesday, 0.90; Wednesday, 0.95; Thursday, 1.10; Friday, 1.25. Also, the current estimates of level and trend are 20 and 1. After observing that 30 customers are served by the bank on this Monday, forecast the number of customers who will be served on each of the next five business days.

43. Suppose that Winters’ method is used to forecast quarterly U.S. retail sales (in billions of dollars). At the end of the first quarter of 2015, the seasonal indexes are: quarter 1, 0.94; quarter 2, 1.02; quarter 3, 1.0; quarter 4, 1.05. Also, the current estimates of level and trend are 1,168 and 7. During the second quarter of 2015, retail sales are $1,188 billion. Assume α = 0.2, β = 0.4, and γ = 0.5. a. At the end of the second quarter of 2015, develop a

forecast for retail sales during the third and fourth quarters of 2015.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21

Forecast 1274.787 2065.144 1935.237 1690.142 1549.285 2339.642 2209.735 1964.639 1823.782 2614.139 2484.232 2239.136 2098.279 2888.636 2758.729 2513.633 2372.776 3163.133 3033.226 2788.131

SqError 283644.3 84201.82 431113.9 298387.3 0.020902 54686.63 28363.47 3177.705 2178.855 49987.54 81911.47 36981.63 26925.21 232542.1 259762.5 91248.28 18421.61 94066.96 54595.24 20391.99

AbsError 532.5826 290.1755 656.5926 546.2484 0.144577 233.8517 168.4146 56.37114 46.6782

223.5789 286.2018 192.3061 164.089

482.2262 509.669

302.0733 135.7262 306.7034 233.6562 142.8005

PctAbsError 0.294672725 0.123200032 0.253331678 0.244254516 9.33272E-05 0.111051776 0.082502781 0.027892557 0.024955467 0.093525759 0.130208321 0.093953129 0.084836038 0.200392352 0.226614237 0.136588337 0.060671973 0.107372972 0.083461473 0.05398212

Error measures

RMSE MAE MAPE

Es�ma�on 289.30 227.40 7.28%

Holdout 439.85 339.89 6.95%

G HG H I JI J K LK L M NM N O PO P Q RQ R S

7000.00

6000.00

5000.00

4000.00

3000.00

2000.00

1000.00

0.00

Q 1-

20 01

Q 4-

20 01

Q 3-

20 02

Q 2-

20 03

Q 1-

20 04

Q 4-

20 04

Q 3-

20 05

Q 2-

20 06

Q 1-

20 07

Q 4-

20 07

Q 3-

20 08

Q 2-

20 09

Q 1-

20 10

Q 4-

20 10

Q 3-

20 11

Q 2-

20 12

Q 1-

20 13

Q 4-

20 13

Q 3-

20 14

Q 2-

20 15

Q 1-

20 16

Q 4-

20 16

Q 3-

20 17

Sales Forecast

Figure 12.43 Forecasts, Forecast Errors, and Summary Measures

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-8 Seasonal Models 589

b. At the end of the second quarter of 2015, develop a forecast for the first and second quarter of 2016.

44. The file P02_55.xlsx contains monthly retail sales of beer, wine, and liquor at U.S. liquor stores. a. Is seasonality present in these data? b. Use the StatTools Deseasonalize option and then

forecast the deseasonalized data for each month of the next year using the moving average method with an appropriate span.

c. Does Holt’s exponential smoothing method, with optimal smoothing constants, outperform the moving average method used in part b? Demonstrate why or why not.

45. Continuing the previous problem, how do your responses to the questions change if you employ Winters’ method to handle seasonality in this time series? Explain. Which forecasting method do you prefer, Winters’ method or one of the methods used in the previous problem? Defend your choice.

46. The file P12_46.xlsx contains monthly time series data for total U.S. retail sales of building materials, garden equipment, and supplies dealers. a. Is seasonality present in these data? If so,

characterize the seasonality pattern. b. Use the Deseasonalize option in StatTools to

forecast the deseasonalized data for each month of the next year using the moving average method with an appropriate span.

c. Does Holt’s exponential smoothing method, with optimal smoothing constants, outperform the moving average method employed in part b? Demonstrate why or why not.

47. The file P12_47.xlsx consists of the monthly retail sales levels of U.S. gasoline service stations. a. Is there a seasonal pattern in these data? If so, how

do you explain this seasonal pattern? b. Forecast this time series for the first four months

of the next year using the most appropriate method for these data. Defend your choice of forecasting method.

48. The number of employees on the payroll at a food processing plant is recorded at the start of each month. These data are provided in the file P12_03.xlsx. a. Is there a seasonal pattern in these data? If so, how

do you explain this seasonal pattern? b. Forecast this time series for the first four months of

the next year using the most appropriate method. Defend your choice of forecasting method.

49. The file P12_49.xlsx contains total monthly U.S. retail sales data. Compare the effectiveness of Winters’ method with that of the ratio-to-moving-average method in deseasonalizing this time series. Using the deseasonalized time series generated by each of these two methods,

forecast U.S. retail sales with the most appropriate method. Defend your choice of forecasting method.

50. Suppose that a time series consisting of six years (2011−2016) of quarterly data exhibits obvious seasonality. In fact, assume that the seasonal indexes turn out to be 0.75, 1.45, 1.25, and 0.55. a. If the last four observations of the series (the

four quarters of 2016) are 2502, 4872, 4269, and 1924, calculate the deseasonalized values for the four quarters of 2016.

b. Suppose that a plot of the deseasonalized series shows an upward linear trend, except for some random noise. Therefore, you estimate a linear regression equation for this series versus time and obtain the following equation:

Predicted deseasonalized value = 2250 + 51Quarter

Here the time variable Quarter is coded so that Quarter = 1 corresponds to first quarter 2011, Quarter = 24 corresponds to fourth quarter 2016, and the others fall in between. Forecast the actual (not deseasonalized) values for the four quarters of 2017.

51. The file P12_51.xlsx contains monthly data on the non- farm hire rate in the United States since 2005. a. What evidence is there that seasonality is important

in this series? Find seasonal indexes (by any method you like) and state briefly what they mean.

b. Forecast the next 12 months by using a linear trend on the seasonally adjusted data. State briefly the steps you use to obtain this type of forecast.

52. Quarterly sales for a department store over a six-year period are given in the file P12_52.xlsx. a. Use multiple regression to develop an equation that

can be used to predict future quarterly sales. (Hint: Use dummy variables for the quarters and a time variable for the quarter number, 1 to 24.)

b. Letting YtYtY be the sales during quarter t be the sales during quarter t t, discuss how to estimate the following equation for this series.

YtYtY = ab t 1b2

X1b3 X2X2X b4

X3X3X

Here X1 is a dummy for first quarters, X2X2X is a dummy for second quarters, and X3X3X is a dummy for third quarters. c. Interpret the results from part b. d. Which model appears to yield better predictions for

sales, the one in part a or the one in part b?

53. A shipping company is attempting to determine how its shipping costs for a month depend on the number of units shipped during a month. The number of units shipped and total shipping cost for the last 15 months are given in the file P12_53.xlsx. a. Determine a relationship between units shipped and

monthly shipping cost. b. Plot the errors for the predictions in order of time

sequence. Is there any unusual pattern?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

590 Chapter 12 Time Series Analysis and Forecasting

c. It turns out that there was a trucking strike during months 11 through 15, and you believe that this might have influenced shipping costs. How can the answer to part a be modified to account for the effect of the strike? After accounting for this effect, does the unusual pattern in part b disappear?

Level B 54. Consider a monthly series of air conditioner (AC)

sales. In the discussion of Winters’ method, a monthly seasonality of 0.80 for January, for example, means that during January, AC sales are expected to be 80% of the sales during an average month. An alternative approach to modeling seasonality, called an additive model, is to let the seasonality factor for each month represent how far above average AC sales are during the current month. For instance, if SJaSJaS n = −50, then AC sales during January are expected to be 50 fewer than AC sales during an average month. (This is 50 ACs, not 50%.) Similarly, if SJuSJuS ly = 90, then AC sales during July are expected to be 90 more than AC sales during an average month. Let

St = Seasonality fofof r month t aftftf er observing month t demand

Lt = Estimate of level aftftf er observing month t demand

TtTtT = Estimate of trend aftftf er observing month t demand Then the Winters’ method equations given in the text should be modified as follows:

Lt = α(I)I)I + (1 − α) (Lt − 1 + TtTtT − 1) TtTtT = β(Lt − Lt − 1) + (1 − β)TtTtT − 1 St = γ(IIIII )I)I + (1 − γ)St − 12

a. What should (I) and (I) and (I II) be?II) be?II b. Suppose that month 13 is January, L12 = 30,

T12 = −3, S1 = −50, and S2 = −20. Let α = γ = β = 0.5. Suppose 12 ACs are sold during month 13. At the end of month 13, what is the forecast for AC sales during month 14 using this additive model?

55. Winters’ method assumes a multiplicative seasonality but an additive trend. For example, a trend of 5 means that the level will increase by five units per period.

Suppose that there is actually a multiplicative trend. Then (ignoring seasonality) if the current estimate of the level is 50 and the current estimate of the trend is 1.2, the forecast of demand increases by 20% per period. So the forecast demand for the next period is 50(1.2) and forecast demand for two periods in the future is 50(1.2)2. If you want to use a multiplicative trend in Winters’ method, you should use the following equations (assuming a period is a month):

Lt = αa YtYtY

St − 12 b + (1 − α) (I )

TtTtT = β(IIIII ) + (I − β)TtTtT − 1

St = γa YtYtY

Lt b + (1 − γ)St − 12

a. What should (I) and (I) and (I II) be?II) be?II b. Suppose that you are working with monthly

data and month 12 is December, month 13 is January, and so on. Also, suppose that L12 = 100, T12 = 1.2, S1 = 0.90, S2 = 0.70, and S3 = 0.95. If you have just observed Y13 = 200, what is the forecast for Y15 using α = β = γ = 0.5 and a multiplicative trend?

56. Consider the file P12_49.xlsx, which contains total monthly U.S. retail sales data. Does a regression approach for estimating seasonality provide forecasts that are as accurate as those provided by (a) Winters’ method and (b) the ratio-to-moving-average method? Compare the summary measures of forecast errors associated with each method for deseasonalizing this time series. Summarize the results of these comparisons.

57. The file P12_46.xlsx contains monthly time series data for total U.S. retail sales of building materials, garden equipment, and supplies dealers. Does a regression approach for estimating seasonality provide forecasts that are as accurate as those provided by (a) Winters’ method and (b) the ratio-to-moving-average method? Compare the summary measures of forecast errors associated with each method for deseasonalizing the given time series. Summarize the results of these comparisons.

12-9 CONCLUSION We have covered a lot of ground in this chapter. Because forecasting is such an important activity in business, it has received a tremendous amount of attention by both academics and practitioners. All of the methods discussed in this chapter—and more—are actually used, often on a day-to-day basis. There is really no point in arguing which of these methods is best. All of them have their strengths and weaknesses. The most important point is that when they are applied properly, they have all been found to be useful in real business situations.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-9 Conclusion 591

Term Explanation Excel Page Equation

Extrapolation models Forecasting models where only past values of a variable (and possibly time itself) are used to forecast future values

541

Econometric models Forecasting models based on regression, where other time series variables are used as explanatory variables (also called causal or regression-based models)

542

Trend A systematic increase or decrease of a time series variable through time

544

Seasonality A regular pattern of ups and downs based on the season of the year, typically months or quarters

544

Cyclic component An irregular pattern of ups and downs caused by business cycles

544

Noise (or random variation)

The unpredictable ups and downs of a time series variable

545

Forecast error The difference between the actual value and the forecast

546

Mean absolute error (MAE)

The average of the absolute forecast errors 547 12.2

Root mean square error (RMSE)

The square root of the average of the squared forecast errors

547 12.3

Mean absolute percentage error (MAPE)

The average of the absolute percentage forecast errors

547 12.4

Runs test A test of whether the forecast errors are random noise

StatTools/Time Series & Forecasting/ Runs Test for Randomness

551

Autocorrelations Correlations of a time series variable with lagged versions of itself

StatTools/Time Series & Forecasting/ Autocorrelation

552

Correlogram A bar chart of autocorrelations at different lags

StatTools/Time Series & Forecasting/ Autocorrelation

554

Linear trend model A regression model where a time series variable changes by a constant amount each time period

StatTools/Regression & Classification/ Regression

557 12.6

Exponential trend model

A regression model where a time series variable changes by a constant percentage each time period

StatTools/Regression & Classification/ Regression

559 12.7

Random walk model A model indicating that the differences between adjacent observations of a time series variable are constant except for random noise

562 12.9–12.11

Moving averages model

A forecasting model where the average of several past observations is used to forecast the next observation

StatTools/Time Series & Forecasting/Forecast

565

(continued)

Summary of Key Terms

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

592 Chapter 12 Time Series Analysis and Forecasting

P R O B L E M S

Conceptual Questions C.1. “A truly random series will likely have a very small

number of runs.” Is this statement true or false? Explain your choice.

C.2. Distinguish between a correlation and an autocorrelation. How are these measures similar? How are they different?

C.3. Under what conditions would you prefer a simple exponential smoothing model to the moving averages method for forecasting a time series?

C.4. Is it more appropriate to use an additive or a multiplicative model to forecast seasonal data?

Summarize the difference(s) between these two types of seasonal models.

C.5. Suppose that monthly data on some time series variable exhibits a clear upward trend but no seasonality. You decide to use moving averages, with any appropriate span. Will there tend to be a systematic bias in your forecasts? Explain why or why not.

C.6. Suppose that monthly data on some time series variable exhibits obvious seasonality. Can you use moving averages, with any appropriate span, to track the seasonality well? Explain why or why not.

C.7. Suppose that quarterly data on some time series variable exhibits obvious seasonality, although the seasonal pattern varies somewhat from year to year.

Summary of Key Terms (Continued) Term Explanation Excel Page Equation

Span The number of observations in each average of a moving averages model

StatTools/Time Series & Forecasting/Forecast

565

Exponential smoothing models

A class of forecasting models where forecasts are based on weighted averages of previous observations, giving more weight to more recent observations

StatTools/Time Series & Forecasting/Forecast

570

Smoothing constants Constants between 0 and 1 that prescribe the weight attached to previous observations and hence the smoothness of the series of forecasts

StatTools/Time Series & Forecasting/Forecast

571

Simple exponential smoothing

An exponential smoothing model useful for time series with no prominent trend or seasonality

StatTools/Time Series & Forecasting/Forecast

571 12.12–12.15

Holt’s method An exponential smoothing model useful for time series with trend but no seasonality

StatTools/Time Series & Forecasting/Forecast

571 12.16–12.18

Winters’ method An exponential smoothing model useful for time series with seasonality (and possibly trend)

StatTools/Time Series & Forecasting/Forecast

571 12.19–12.22

Additive seasonal model

A model where a seasonal index is added to a base forecast (indexes typically average to 0)

580

Multiplicative seasonal model

A model where a seasonal index is multiplied by a base forecast (indexes typically average to 1)

580

Deseasonalizing A method for removing the seasonal component from a time series

StatTools/Time Series & Forecasting/Forecast

584

Ratio-to-moving- averages method

A method for deseasonalizing a time series, so that some other method can then be used to forecast the deseasonalized series

StatTools/Time Series & Forecasting/Forecast

584

Dummy variables for seasonality

A regression-based method for forecasting seasonality, where dummy variables are used for the seasons

StatTools/Regression & Classification/ Regression

585

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

12-9 Conclusion 593

Which method do you believe will work best: Winters’ method or regression with dummy variables for quarters (and possibly a time variable for trend)? Why?

C.8. Most companies that use (any version of) exponential smoothing use fairly small smoothing constants such as 0.1 or 0.2. Explain why they don’t tend to use larger values.

Level A 58. The file P12_58.xlsx contains monthly data on

consumer revolving credit (in millions of dollars) through credit unions. a. Use these data to forecast consumer revolving credit

through credit unions for the next 12 months. Do it in two ways. First, fit an exponential trend to the series. Second, use Holt’s method with optimized smoothing constants.

b. Which of these two methods appears to provide the best forecasts? Answer by comparing their MAPE values.

59. The file P12_59.xlsx contains revenue (in millions of dollars) for Procter & Gamble. Create a time series graph of these data. Then superimpose a trend line with Excel’s Trendline option. Which of the possible Trendline options seems to provide the best fit? Using this option, what are your forecasts for the next two years?

60. The file P12_60.xlsx lists annual revenues (in mil- lions of dollars) for Nike. Create a time series graph of these data. Then superimpose a trend line with Excel’s Trendline option. Which of the possible Trendline options seems to provide the best fit? Using this option, what are your forecasts for the next two years?

61. The file P12_61.xlsx contains annual data on carbon dioxide (CO2) levels since 1959, measured at the Mauna Loa Observatory in Hawaii. Fit linear, expo- nential, and quadratic (polynomial of order 2) trends to these data. In terms of MAD, which fit is best? Using the best fit, forecast CO2 levels for the next 10 years.

62. The file P12_62.xlsx contains data on a motel chain’s revenue and advertising. a. Use these data and multiple regression to make

predictions of the motel chain’s revenues during the next four quarters. Assume that advertising during each of the next four quarters is $50,000. (Hint: Try using advertising, lagged by one quarter, as an explanatory variable.)

b. Use simple exponential smoothing to make predictions for the motel chain’s revenues during the next four quarters.

c. Use Holt’s method to make forecasts for the motel chain’s revenues during the next four quarters.

d. Use Winters’ method to determine predictions for the motel chain’s revenues during the next four quarters.

e. Which of these forecasting methods would you expect to be the most accurate for these data?

63. The file P12_63.xlsx contains data on monthly U.S. permits for new housing units (in thousands of houses). a. Using Winters’ method, find values of α, β, and γ

that yield an RMSE as small as possible. Does this method track the housing crash in recent years?

b. Although we have not discussed autocorrelation for smoothing methods, good forecasts derived from smoothing methods should exhibit no substantial autocorrelation in their forecast errors. Is this true for the forecasts in part a?

c. At the end of the observed period, what is the forecast of housing sales during the next few months?

64. Let YtYtY be the sales during month t be the sales during month t t (in thousands of dollars) for a photography studio, and let Pt be the price charged for portraits during month t. The data are in the file P11_45.xlsx. Use regression to fit the following model to these data:

YtYtY = a + b1YtYtY − 1 + b2Pt + et This equation indicates that last month’s sales and the current month’s price are explanatory variables. The last term, et, is an error term. a. If the price of a portrait during month 21 is $10,

what would you predict for sales in month 21? b. Does there appear to be a problem with

autocorrelation of the residuals?

Level B 65. The file P12_65.xlsx contains five years of monthly

data for a particular company. The first variable is Time (1 to 60). The second variable, Sales1, contains data on sales of a product. Note that Sales1 increases linearly throughout the period, with only a minor amount of noise. (The third variable, Sales2, is discussed and used in the next problem.) For this problem use the Sales1 variable to see how the following forecasting methods are able to track a linear trend. a. Forecast this series with the moving average method

with various spans such as 3, 6, and 12. What can you conclude?

b. Forecast this series with simple exponential smoothing with various smoothing constants such as 0.1, 0.3, 0.5, and 0.7. What can you conclude?

c. Now repeat part b with Holt’s exponential smoothing method, again for various smoothing constants. Can you do significantly better than in parts a and b?

d. What can you conclude from your findings in parts a, b, and c about forecasting this type of series?

66. The Sales2 variable in the file from the previous prob- lem was created from the Sales1 variable by multiply- ing by monthly seasonal factors. Basically, the summer months are high and the winter months are low. This

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

594 Chapter 12 Time Series Analysis and Forecasting

might represent the sales of a product that has a linear trend and seasonality. a. Repeat parts a, b, and c from the previous problem

to see how well these forecasting methods can deal with trend and seasonality.and seasonality.and

b. Now use Winters’ method, with various values of the three smoothing constants, to forecast the series. Can you do much better? Which smoothing constants work well?

c. Use the ratio-to-moving-average method, where you first deseasonalize the series and then forecast (by any appropriate method) the deseasonalized series. Does this perform as well as, or better than, Winters’ method?

d. What can you conclude from your findings in parts a, b, and c about forecasting this type of series?

67. The file P12_67.xlsx contains monthly time series data on corporate bond yields. These are averages of daily figures, and each is expressed as an annual rate. The variables are:

■ Yield AAA: average yield on AAA bonds ■ Yield BAA: average yield on BAA bonds

If you examine either Yield variable, you will notice that the autocorrelations of the series are not only large for many lags, but that the lag 1 autocorrelation of the differences is significant. This is very common. It means that the series is not a random walk and that it is probably possible to provide a better forecast than the naive forecast from the random walk model. Here is the idea. The large lag 1 autocorrelation of the differences means that the differences are related to the first lag of the differences. This relationship can be estimated by creating the difference variable and a lag of it, then regressing the former on the latter, and finally using this information to forecast the original Yield variable. a. Verify that the autocorrelations are as described, and

form the difference variable and the first lag of it. Call these DYield and L1DYield (where D means difference and L1 means first lag).

b. Run a regression with DYield as the dependent variable and L1DYield as the single explanatory variable. In terms of the original variable Yield, this equation can be written as

Yieldt − Yieldt − 1 = a + b(Yieldt − 1 − Yieldt − 2) Solving for Yieldt is equivalent to the following t is equivalent to the following t equation that can be used for forecasting:

Yieldt = a + (1 + b)Yieldt − 1 − bYieldt − 2 Try it—that is, try forecasting the next month from the known last two months’ values. How might you forecast values two or three months from the last observed month? (Hint: If you do not have an observed value to use in the observed value to use in the observed right side of the equation, use a forecast value.) c. The autocorrelation structure led us to the equation

in part b. That is, the autocorrelations of the original

series took a long time to die down, so we looked at the autocorrelations of the differences, and the large spike at lag 1 led to regressing DYield on L1DYield. In turn, this ultimately led to an equation for Yieldt in terms of its first two lags. Now see what you would have obtained if you had tried regressing Yieldt on its first two lags in the first place—that is, if you had used regression to estimate the equation

Yieldt = a + b1Yieldt − 1 + b2Yieldt − 2 When you use multiple regression to estimate this equation, do you get the same equation as in part b?

68. The file P12_68.xlsx lists monthly and annual values of the average surface air temperature of the earth (in degrees Celsius). (Actually, the data are indexes, relative to the period 1951−1980 where the average temperature was about 14 degrees Celsius. So if you want the actual temperatures, you can add 14 to all values.) A look at the time series shows a gradual upward trend, starting with negative values and ending with (mostly) positive values. This might be used to support the claim of global warming. For this problem, use only the annual averages in column N. a. Is this series a random walk? Explain. b. Regardless of your answer in part a, use a random

walk model to forecast the next value (2010) of the series. What is your forecast, and what is an approximate 95% forecast interval, assuming normally distributed forecast errors?

c. Forecast the series in three ways: (i) simple exponential smoothing (α = 0.35), (ii) Holt’s method (α = 0.5, β = 0.1), and (iii) simple exponential smoothing (α = 0.3) on trend-adjusted data, that is, the residuals from regressing linearly versus time. (These smoothing constants are close to optimal.) For each of these, list the MAPE, the RMSE, and the forecast for next year. Also, comment on any “problems” with forecast errors from any of these three approaches. Finally, compare the qualitative features of the three forecasting methods. For example, how do their short-run or longer-run forecasts differ? Is any one of the methods clearly superior to the others?

d. Does your analysis predict convincingly that global warming has been occurring? Explain.

69. The file P12_69.xlsx contains data on mass layoff events in all industries in the United States. (See the file for an explanation of how mass layoff events are counted.) There are two versions of the data: nonsea- sonally adjusted and seasonally adjusted. Presumably, seasonal factors can be found by dividing the non- seasonally adjusted values by the seasonally adjusted values. For example, the seasonal factor for April 1995 is 1431/1492=0.959. How well can you replicate these seasonal factors with appropriate StatTools analyses?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 12.2 FORECASTING WEEKLY SALES AT AMANTA

Amanta Appliances sells two styles of refrigerators at more than 50 locations in the Midwest. The first style is a relatively expensive model, whereas the second is a standard, less expensive model. Although weekly demand for these two products is fairly stable from week to week, there is enough variation to concern management at Amanta. There have been relatively unsophisticated attempts to forecast weekly demand, but they haven’t been very successful. Sometimes demand (and the corresponding sales) are lower than forecast, so that inventory costs are high. Other times the forecasts are too low. When this happens and on-hand inventory is not sufficient to meet customer demand, Amanta requires expedited shipments to keep customers happy—and this nearly wipes out Amanta’s profit margin on the expedited units.7 this nearly wipes out

7 this nearly wipes out

Profits at Amanta would almost certainly increase if demand could be forecast more accurately.

Data on weekly sales of both products appear in the file C12_02.xlsx. A time series chart of the two sales variables indicates what Amanta management expected—namely, there is no evidence of any upward or downward trends or of any seasonality. In fact, it might appear that each series is an unpredictable sequence of random ups and downs. But is this really true? Is it possible to forecast either series, with some degree of accuracy, with an extrapolation method (where only past values of that series are used to forecast current and future values)? Which method appears to be best? How accurate is it? Also, is it possible, when trying to forecast sales of one product, to somehow incorporate current or past sales of the other product in the forecast other product in the forecast other model? After all, these products might be “substitute” products, where high sales of one go with low sales of the other, or they might be complementary products, where sales of the two products tend to move in the same direction.

C A S E 12.1 ARRIVALS AT THE CREDIT UNION

The Eastland Plaza Branch of the Indiana University Credit Union was having trouble getting the correct staffing levels to match customer arrival patterns. On some days, the number of tellers was too high relative to the customer traffic, so that tellers were often idle. On other days, the opposite occurred. Long customer waiting lines formed because the relatively few tellers could not keep up with the number of customers. The credit union manager, James Chilton, knew that there was a problem, but he had little of the quantitative training he believed would be necessary to find a better staffing solution. James figured that the problem could be broken down into three parts. First, he needed a reliable forecast of each day’s number of customer arrivals. Second, he needed to translate these forecasts into staffing levels that would make

an adequate trade-off between teller idleness and customer waiting. Third, he needed to translate these staffing levels into individual teller work assignments—who should come to work when.

The last two parts of the problem require analysis tools (queueing and scheduling) that we have not covered. However, you can help James with the first part—forecasting. The file C12_01.xlsx lists the number of customers entering this credit union branch each day of the past year. It also lists other information: the day of the week, whether the day was a staff or faculty payday, and whether the day was the day before or after a holiday. Use this data set to develop one or more forecasting models that James could use to help solve his problem. Based on your model(s), make any recommendations about staffing that appear reasonable.

7Because Amanta uses expediting when necessary, its sales each week are equal to its customer demands. Therefore, the terms “demand” and “sales” are used interchangeably.

Case 12.2 Forecasting Weekly Sales at Amanta 595 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Optimization and Simulation Modeling CHAPTER 13 Introduction to Optimization Modeling

CHAPTER 14 Optimization Models

CHAPTER 15 Introduction to Simulation Modeling

CHAPTER 16 Simulation Models

PA RT

5

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

599

OPTIMIZING MANUFACTURING OPERATIONS AT GE PLASTICS

The General Electric Company (GE) is a global organization that must deliver products to its customers anywhere in the world in the right quantity, at the right time, and at a reasonable cost. One arm of GE is GE Plastics (GEP), a $5 billion business that supplies plastics and raw materials to such industries as automotive, appliance, computer, and medical equipment. (GEP has now EP has now EP been reorganized into GE Advanced Materials [GEAM].) As described in Tyagi Tyagi T et al. (2004), GEP practiced a “pole-centric” manufacturing approach, making EP practiced a “pole-centric” manufacturing approach, making EP each product in the geographic area (Aeach product in the geographic area (Aeach product in the geographic area ( mericas, Europe, or Pacific) where it was to be delivered. However, it became apparent in the early 2000s that this approach was leading to higher distribution costs and mismatches in capacity as more of GEP’s demand was originating in the Pacific region. Therefore, the authors of the article were asked to develop a global optimization model to aid GEP’s manufacturing planning. Actually, GEP consists of seven major divisions, EP consists of seven major divisions, EP distinguished primarily by the capability of their products to withstand heat. The fastest growing of these divisions, the high performance polymer (HPP) division, was chosen as the pilot for the new global approach.

All GEP divisions operate as two-echelon manufacturing systems. The first echelon consists of resin plants, which convert raw material stocks into resins and ship them to the second echelon, the finishing plants. These latter plants combine the resins with additives to produce various grades of the end products. Each physical plant consists of several “plant lines” that operate independently, and each of these plant lines is capable of producing multiple products. All end products are then shipped to GE Polymerland warehouses throughout the world. GE Polymerland is a wholly owned subsidiary that acts as the commercial front for GEP. It handles all customer EP. It handles all customer EP

Introduction to Optimization Modeling

C H A P T E R

13

B lo

o m

b e rg

/C o n tr

ib u

to r/

G e tt

y Im

a g

e s

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

600 Chapter 13 Introduction to Optimization Modeling

sales and deliveries from its network of distribution centers and warehouses in more than 20 countries. Because of its experience with customers, GE Polymerland is able to aid the GEP divisions in their planning processes by supplying forecasts of demands and prices for the various products in the various global markets. These forecasts are key inputs to the optimization model.

The optimization model itself attempts to maximize the total contribution margin over a planning horizon, where the contribution margin equals revenues minus the sum of manufacturing, material, and distribution costs. There are demand constraints, manufacturing capacity constraints, and network flow constraints. The decision variables include (1) the amount of resin produced at each resin plant line that will be used at each finishing plant line, and (2) the amount of each end product produced at each finishing plant line that will be shipped to each geographic region. The completed model has approximately 3100 decision variables and 1100 constraints and is completely linear. It was developed and solved in Excel (using LINGO, a commercial optimization solver, not Excel’s Solver add-in), and execution time is very fast—about 10 seconds.

The demand constraints are handled in an interesting way. The authors of the study constrain manufacturing to produce no more than the forecasted demands, but they do not force manufacturing to meet these demands. Ideally, manufacturing would meet demands exactly. However, because of its rapid growth, capacity at HPP in 2002 appeared (at the time of the study) to be insufficient to meet the demand in 2005 and later years. The authors faced this challenge in two ways. First, in cases where demand exceeds capacity, they let their model of maximizing total contribution margin determine which demands to satisfy. The least profitable demands are sim- ply not met. Second, the authors added a new resin plant to their model that would come on line in the year 2005 and provide much needed capacity. They ran the model several times for the year 2005 (and later years), experimenting with the location of the new plant. Although some of the details are withheld in the article for confidentiality reasons, the authors indicate that senior management approved the investment of a Europe-based plant that would cost more than $200 million in plant and equipment. This plant was planned to begin operations in 2005 and ramp up to full production capacity by 2007.

The decision support system developed in the study has been a success at the HPP division since its introduction in 2002. Although the article provides no specific dollar gains from the use of the model, it is noteworthy that the other GEP divisions are adopting similar models for their production planning. ■

13-1 INTRODUCTION In this chapter, we introduce spreadsheet optimization, one of the most powerful and �exible methods of quantitative analysis. The speci�c type of optimization we will discuss here is linear programming (LP). LP is used in all types of organizations, often on a daily basis, to solve a wide variety of problems. These include problems in labor scheduling, inventory management, selection of advertising media, bond trading, management of cash �ows, operation of an electrical utility’s hydroelectric system, routing of delivery vehicles, blending in oil re�neries, hospital staf�ng, and many others. The goal of this chapter is to introduce the basic elements of LP: the types of problems it can solve, how LP problems can be modeled in Excel® introduce the basic elements of LP: the types of problems it can solve, how LP problems

® introduce the basic elements of LP: the types of problems it can solve, how LP problems

, and how Excel’s powerful Solver add-in can be used to �nd optimal solutions. Then in the next chapter we will examine a variety of LP applications, and we will also look at applications of integer and nonlinear programming, two important extensions of LP.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-2 Introduction to Optimization 601

13-2 INTRODUCTION TO OPTIMIZATION Before we discuss the details of LP modeling, it is useful to discuss optimization in general. All optimization problems have several common elements. They all have decision vari- ables, the variables whose values the decision maker is allowed to choose. Either directly or indirectly, the values of these variables determine such outputs as total cost, revenue, and pro�t. Essentially, they are the variables a company or organization must know to func- tion properly; they determine everything else. All optimization problems have an objective function (objective, for short) to be optimized—maximized or minimized. Finally, most optimization problems have constraints that must be satis�ed. These are usually physical, logical, or economic restrictions, depending on the nature of the problem. In searching for the values of the decision variables that optimize the objective, only those values that satisfy all of the constraints are allowed.

Excel uses its own terminology for optimization, and we will use it as well. Excel refers to the decision variables as the decision variable cells.1

Excel uses its own terminology for optimization, and we will use it as well. Excel 1

Excel uses its own terminology for optimization, and we will use it as well. Excel These cells must contain

numbers that are allowed to change freely; they are not allowed to contain formulas. Excel not allowed to contain formulas. Excel not refers to the objective as the objective cell. There can be only one objective cell, which could contain pro�t, total cost, total distance traveled, or others, and it must be related through formulas to the decision variable cells. When the decision variable cells change, the objective cell should change accordingly.

Finally, there must be appropriate cells and cell formulas that operationalize the con- straints. For example, one constraint might indicate that the amount of labor used can be no more than the amount of labor available. In this case, there must be cells for each of these two quantities, and typically at least one of them (probably the amount of labor used) will be related through formulas to the decision variable cells. Constraints can come in a variety of forms. One very common form is nonnegativity. This type of constraint states that decision variable cells must have nonnegative (zero or positive) values. Nonnegativity constraints are usually included for physical reasons. For example, it is impossible to pro- duce a negative number of automobiles.

There are basically two steps in solving an optimization problem. The �rst step is the model development step. Here you decide what the decision variables are, what the objective is, which constraints are required, and how everything �ts together. If you are developing an algebraic model, you must derive the correct algebraic expressions. If you are developing a spreadsheet model, the focus of this book, you must relate all variables with appropriate cell formulas. In particular, you must ensure that your model contains formulas that relate the decision variable cells to the objective cell and

1In Excel 2007 and previous versions, Excel's Solver add-in referred to these as “changing cells.” Starting with Excel 2010, it refers to them as "decision variable cells" (or simply "variable cells"), so we will use the newer terminology.

The decision variable cells contain the values that can be changed to optimize the objective.

The objective cell contains the quantity to be minimized or maximized.

The constraints impose restrictions on the values in the decision variable cells.

Nonnegativity constraints imply that decision variable cells must contain nonnegative values.

Typically, most of your effort goes into the model development step.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

602 Chapter 13 Introduction to Optimization Modeling

formulas that operationalize the constraints. This model development step is where most of your effort goes.

The second step in any optimization model is to optimize. This means that you must systematically choose the values of the decision variables that make the objective as large (for maximization) or small (for minimization) as possible and cause all of the constraints to be satis�ed. Some terminology is useful here. Any set of values of the decision variables that satis�es all of the constraints is called a feasible solution. The set of all feasible solutions is called the feasible region. In contrast, an infeasible solution is a solution that violates at least one constraint. Infeasible solutions are disallowed. The desired feasible solution is the one that provides the best value—minimum for a minimization problem, maximum for a maximization problem—of the objective. This solution is called the optimal solution.

A feasible solution is a solution that satisfies all of the constraints.

The feasible region is the set of all feasible solutions.

An infeasible solution violates at least one of the constraints and is disallowed.

The optimal solution is the feasible solution that optimizes the objective.

An algorithm is a prescription for carrying out the steps required to achieve some goal, such as finding an optimal solution. An algorithm is typically translated into a computer program that performs the work.

Although most of your effort typically goes into the model development step, much of the published research in optimization has been about the optimization step. Algorithms have been devised for searching through the feasible region to �nd the optimal solution. One such algorithm is called the simplex method. It is used for linear models. There are linear models. There are linear other more complex algorithms used for other types of models (those with integer decision variables and/or nonlinearities).

We will not discuss the details of these algorithms. They have been programmed into Excel’s Solver add-in. All you need to do is develop the model and then tell Solver what the objective cell is, what the decision variable cells are, what the constraints are, and what type of model (linear, integer, or nonlinear) you have. Solver then goes to work, �nding the best feasible solution with the appropriate algorithm. You should appreciate that if you used a trial-and-error procedure, even a clever and fast one, it could take hours, weeks, or even years to complete. However, by using the appropriate algorithm, Solver typically �nds the optimal solution in a matter of seconds.

Before concluding this discussion, we mention that there is really a third step in the third step in the third optimization process: sensitivity analysis. You typically choose values of input variables, such as unit costs, forecasted demands, and resource availabilities, and then �nd the opti- mal solution for these particular input values. This provides a single “answer.” However, in any realistic situation, it is wishful thinking to believe that all of the input values you use are exactly correct. Therefore, it is useful—indeed, mandatory in most applied studies—to follow up the optimization step with what-if questions. What if the unit costs increased by 5%? What if forecasted demands were 10% lower? What if resource availabilities could be increased by 20%? What effects would such changes have on the optimal solution? This type of sensitivity analysis can be done in an informal manner or it can be highly struc- tured. Fortunately, as with the optimization step itself, good software allows you to obtain answers to various what-if questions quickly and easily.

13-3 A TWO-VARIABLE PRODUCT MIX MODEL We begin with a very simple two-variable example of a product mix problem. This is a type product mix problem. This is a type product mix of problem frequently encountered in business where a company must decide its product mix—how much of each of its potential products to produce—to maximize its net pro�t. You will see how to model this problem algebraically and then how to model it in Excel. You will also see how to �nd its optimal solution with Solver. Next, because it contains

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-3 A Two-Variable Product Mix Model 603

only two decision variables, you will see how it can be solved graphically. Although this graphical solution is not practical for most realistic problems, it provides useful insights into general LP models. The �nal step is then to ask a number of what-if questions about the completed model.

Pictures such as this one bridge the gap between the problem statement and the ultimate spreadsheet (or algebraic) model.

E X A M P L E 13.1 ASSEMBLING AND TESTING COMPUTERS

PC Tech company assembles and then tests two models of computers, Basic and XP. For the coming month, the company wants to decide how many of each model to assemble and then test. No computers are in inventory from the previous month, and because these models are going to be changed after this month, the company doesn’t want to hold any inventory after this month. It believes the most it can sell this month are 600 Basics and 1200 XPs. Each Basic sells for $300 and each XP sells for $450. The cost of component parts for a Basic is $150; for an XP it is $225. Labor is required for assembly and testing. There are at most 10,000 assembly hours and 3000 testing hours available. Each labor hour for assembling costs $11 and each labor hour for testing costs $15. Each Basic requires five hours for assembling and one hour for testing, and each XP requires six hours for assembling and two hours for testing. PC Tech wants to know how many of each model it should produce (assemble and test) to maximize its net profit, but it cannot use more labor hours than are available, and it does not want to produce more than it can sell.

Objective To use LP to find the best mix of computer models that stays within the com- pany’s labor availability and maximum sales constraints.

Solution The essence of spreadsheet modeling is transforming a “story problem” into an Excel model. Based on our teaching experience, a “bridge” between the two is often needed, especially for complex models. In previous editions of the book, we provided a table of key variables and their roles in the model, but we now have access to a new Excel add-in, BigPicture. This is part of the Palisade DecisionTools Suite, so it is available with the book. BigPicture is essentially a drawing add-in that supplements Excel’s built-in drawing tools. In the next few chapters, most examples in the book will start with a “big picture” to help you understand the model—what the key elements are and how they are related—and get you ready for the eventual spreadsheet model.

We have created these big pictures so that you don’t have to. However, you have the software, and you might want to use it to draw your own big pictures. Actually, the point is not that you need to learn new software. If you find these big pictures helpful, you could create similar drawings with built-in Excel tools only, or you could even draw them with paper and pencil. The real point is that drawings of this type force you to think carefully about the relationships in a model and how they can then translate into a spreadsheet model.

Each big picture is in its own Excel file, such as Product Mix 1 Big Picture.xlsx for this example. (These big picture files are available, just like the example files.) A screen- shot of this big picture appears in Figure 13.1, but when you load the BigPicture add-in (from the Palisade group of programs) and then open the big picture file, you can see more than this static diagram. First, each of the shapes in the diagram can have a “note,” much like an Excel cell comment. When you move the cursor over the shape, the note appears. Second, the software allows you to create slide shows. We have done this for all of the big pictures in the book. This lets you see how the model “evolves,” and each slide is accompa- nied by a “pop-up” text box explanation to help you understand the model even better. (To run the slide show, click the Play button on the BigPicture ribbon and then the Next Slide button for each new slide. When you are finished, click the Stop button.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

604 Chapter 13 Introduction to Optimization Modeling

We have adopted a color-coding/shape convention for these big pictures. You can see the shapes on the printed page, and you can see the colors and shapes when you open the file.

Our Big Picture Conventions • • •

15 and 16). • • •

an inequality or equality sign, as you will often see in the optimization chapters, the arrow indicates a constraint.

The decision variables in this product mix model are fairly obvious. The company must decide two numbers: how many Basics to produce and how many XPs to produce. Once these are known, they can be used, along with the problem inputs, to calculate the number of comput- ers sold, the labor used, and the revenue and cost. However, as you will see with other models in this chapter and the next chapter, determining the decision variables is not always this obvious.

An Algebraic Model In the traditional algebraic solution method, you first identify the decision variables.algebraic solution method, you first identify the decision variables.algebraic 2 In this 2 In this 2

small problem they are the numbers of computers to produce. We label these x1 and x2, although any other labels would do. The next step is to write expressions for the total net profit and the con- straints in terms of the x’s. Finally, because only nonnegative amounts can be produced, explicit constraints are added to ensure that the x’s are nonnegative. The resulting algebraic model isalgebraic model isalgebraic model

Maximize 80x0x0 1 + 129x2 subject to:

5x1 + 6x2 ≤ 10000 x1 + 2x2x2 2 ≤ 3000

x1 ≤ 600 x2 ≤ 1200

x1, x2 ≥ 0

Labor Hours per Unit

Labor Hours Used

Labor Hours Available

Cost per Labor Hour

Selling Price

Maximum Sales

Maximize Profit

Number Produced <=

Cost of Component Parts

<=

Unit Margin

Figure 13.1 Big Picture for Product Mix Model

2This is not a book about algebraic models; the main focus is on spreadsheet modeling. However, we present spreadsheet modeling. However, we present spreadsheet algebraic models of the examples in this chapter for comparison with the corresponding spreadsheet models.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

To understand this model, consider the objective first. Each Basic produced sells for $300, and the total cost of producing it, including component parts and labor, is 150 + 5(11) + 1(15) = $220, so the profit margin is $80. Similarly, the profit margin for an XP is $129. Each profit margin is multiplied by the number of computers produced, and these products are then summed over the two computer models to obtain the total net profit.

The first two constraints are similar. For example, each Basic requires five hours for assembling and each XP requires six hours for assembling, so the first constraint says that the total hours required for assembling is no more than the number available, 10,000. The third and fourth constraints are the maximum sales constraints for Basics and XPs. Finally, negative amounts cannot be produced, so nonnegativity constraints on x1 and x2 are included.

For many years, all LP problems were modeled this way in textbooks. In fact, many commercial LP computer packages are still written to accept LP problems in essentially this format. Since around 1990, however, a more intuitive method of expressing LP prob- lems has become popular. This method takes advantage of the power and flexibility of spreadsheets. Actually, LP problems could always be modeled in spreadsheets, but now modeled in spreadsheets, but now modeled with the addition of Excel’s Solver add-in, spreadsheets have the ability to solve—that is, optimize—LP problems as well. We use Excel’s Solver for all examples in this book.3

A Graphical Solution When there are only two decision variables in an LP model, as there are in this product mix model, you can solve the problem graphically. Although this graphical solution approach is not practical in most realistic optimization models—where there are many more than two decision variables—the graphical procedure illustrated here still yields important insights for general LP models.

In general, if the two decision variables are labeled x1 and x2, then the steps of the method are to express the constraints and the objective in terms of x1 and x2, graph the constraints to find the feasible region [the set of all pairs (x1, x2) satisfying the constraints, where x1 is on the horizontal axis and x2 is on the vertical axis], and then move the objec- tive through the feasible region until it is optimized.

To do this for the product mix problem, note that the constraint on assembling labor hours can be expressed as 5x1 + 6x2 ≤ 10000. To graph this, consider the associated equality (replacing ≤ with = ) and find where the associated line crosses the axes. Specifically, when x1 = 0, then x2 = 10000/6 = 1666.7; and when x2 = 0, then x1 = 10000/5 = 2000.This pro- vides the line labeled “assembling hour constraint” in Figure 13.2. It has slope −5/6 = −0.83. The set of all points that satisfy the assembling hour constraint includes the points on this line plus the points below it, as indicated by the arrow drawn from the line. [The feasible points are below the line because the point (0, 0) is obviously below the line, and (0, 0) clearly satis- fies the assembly hour constraint.] Similarly, the testing hour and maximum sales constraints can be graphed as shown in the figure. The points that satisfy all three of these constraints and are nonnegative comprise the feasible region, which is below the heavier lines in the figure.

To see which feasible point maximizes the objective, it is useful to draw a sequence of lines where, for each, the objective is a constant. A typical line is of the form 80x0x0 1 + 129x2 = c, where c is a constant. Any such line has slope −80/129 = −0.620, regardless of the value of c. This line is steeper than the testing hour constraint line (slope −0.5), but not as steep as the assembling hour constraint line (slope −0.83). The idea now is to move a line with this slope up and to the right, making c larger, until it just barely touches the feasible region. The last feasible point that it touches is the optimal point.

Recall from algebra that any line of the form ax1 + bx2 = c has slope −a/b. This is because it can be put into the slope − intercept form x2 = c/b − (a/b)x1.

Many commercial optimization packages require, as input, an algebraic model of a problem. If you ever use one of these packages, you will be required to think algebraically.

This graphical approach works only for problems with two decision variables.

13-3 A Two-Variable Product Mix Model 605

3The Solver add-in built into Excel was developed by a third-party software company, Frontline Systems. This company develops much more powerful versions of Solver for commercial sales, but its standard version built into Microsoft Excel suf�ces for us. More information about Solver software offered by Frontline can be found at www.solver.com.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

606 Chapter 13 Introduction to Optimization Modeling

Although limited in use, the graphical approach yields the important insight that the optimal solution to any LP model is a corner point of a polygon. This limits the search for the optimal solution and makes the simplex method possible.

Geometry of LP Models and the Simplex Method The feasible region in any LP model is always a multiP model is always a multiP - dimensional version of a polygon, and the objective is always a hyperplane, the multidimensional version of a straight line. The objective should always be moved as far as possible in the maximizing or minimizing direc- tion until it just touches the edge of the feasible region.

Because of this geometry, the optimal solution is always a corner point of the polygon. The simplex method for LP works so well because it can search through the P works so well because it can search through the P finite number of corner points extremely efficiently and recognize when it has found the best corner point. This rather simple insight, plus its clever implementa- tion in software packages, has saved companies many, many millions of dollars in the past 50 years.

F u n da m e n ta l I n s i g h t

Several lines with slope −0.620 are shown in Figure 13.2. The middle dotted line is the one with the largest net profit that still touches the feasible region. The associated optimal point is clearly the point where the assembling hour and XP maximum sales lines intersect. You will eventually find (from Solver) that this point is (560,1200), but even if you didn’t have the Solver add-in, you could find the coordinates of this point by solving two equations (the ones for assembling hours and XP maximum sales) in two unknowns.

Again, the graphical procedure illustrated here can be used only for the simplest of LP models, those with two decision variables. However, the type of behavior pictured in Figure 13.2 generalizes to all LP problems. In general, all feasible regions are (the multidimensional all LP problems. In general, all feasible regions are (the multidimensional all versions of) polygons. That is, they are bounded by straight lines (actually hyperplanes) that intersect at several corner points. There are five corner points in Figure 13.2, three of which are on the axes. [One of them is (0,0).] When the dotted objective line is moved as far as pos- sible toward better values, the last feasible point it touches is one of the corner points. The actual corner point it last touches is determined by the slopes of the objective and constraint lines. Because there are only a finite number of corner points, it suffices to search among this finite set, not the infinite number of points in the entire feasible region.4 lines. Because there are only a finite number of corner points, it suffices to search among

4 lines. Because there are only a finite number of corner points, it suffices to search among

This insight is largely responsible for the efficiency of the simplex method for solving LP problems.

4This is not entirely true. If the objective line is exactly parallel to one of the constraint lines, there can be multi- ple optimal solutions—a whole line segment of optimal solutions. Even in this case, however, at least one of the optimal solutions is a corner point.

30002000

1500

1666.7

600

1200

Feasible region (below dark lines)

constraint

Assembling hour constraint

Basic sales constraint

XP salesXP sales constraint

Isoprofit lines

XP s

pr od

uc ed

Basics produced

To the le­ and below the dark blue line is the feasible region. As the do�ed objec�ve line is pushed as far up to the right as possible, the last feasible point it hits is the one shown. In general, the corner point that is op�mal depends on the rela�ve slopes of the lines.

Figure 13.2 Graphical Solution to Two-Variable Product Mix Problem

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A Spreadsheet Model We now turn our focus to spreadsheet modeling. There are many ways to develop an LP spreadsheet modeling. There are many ways to develop an LP spreadsheet spreadsheet model. Everyone has his or her own preferences for arranging the data in the various cells. We do not provide exact prescriptions, but we do present enough examples to help you develop good habits. The common elements in all LP spreadsheet models are the inputs, decision variable cells, objective cell, and constraints.

■ Inputs. All numerical inputs—that is, all numeric data given in the statement of the problem—should appear somewhere in the spreadsheet. Our convention is to color all of the input cells blue. We also try to put most of the inputs in the upper left sec- tion of the spreadsheet. However, we sometimes violate this convention when certain inputs �t more naturally somewhere else.

■ Decision variable cells. Instead of using variable names, such as x, spreadsheet mod- els use a set of designated cells for the decision variables. The values in these cells can be changed to optimize the objective. The values in these cells must be allowed to vary freely, so there should not be any formulas in the decision variable cells. To not be any formulas in the decision variable cells. To not designate them clearly, our convention is to color them red.

■ Objective cell. One cell, called the objective cell, contains the value of the objective. Solver systematically varies the values in the decision variable cells to optimize the value in the objective cell. This cell must be linked, either directly or indirectly, to the decision variable cells by formulas. Our convention is to color the objective cell gray.5 value in the objective cell. This cell must be linked, either directly or indirectly, to the

5 value in the objective cell. This cell must be linked, either directly or indirectly, to the

Our coloring conventions

Color all input cells blue (appears light blue on the printed page).

Color all of the decision variable cells red (appears deep blue on the printed page).

Color the objective cell gray.

13-3 A Two-Variable Product Mix Model 607

5Our blue/red/gray color scheme shows up very effectively on a color monitor. For users of previous editions who are used to colored borders, we �nd that it is easier to color the cells rather than put borders around them.

■ Constraints. Excel does not show the constraints directly on the spreadsheet. Instead, they are speci�ed in a Solver dialog box, to be discussed shortly. For example, a set of related constraints might be speci�ed by

B16:C16<=B18:C18

This implies two separate constraints. The value in B16 must be less than or equal to the value in B18, and the value in C16 must be less than or equal to the value in C18. We will always assign range names to the ranges that appear in the constraints. Then a typical constraint might be speci�ed as

Number_to_produce<=Maximum_sales

This is much easier to read and understand. (If you �nd that range names take too long to create, you certainly do not have to use them. Solver models work �ne with cell addresses only.)

■ Nonnegativity. Normally, the decision variables—that is, the values in the decision variable cells—must be nonnegative. These constraints do not need to be written explicitly; you simply check an option in the Solver dialog box to indicate that the decision variable cells should be nonnegative. Note, however, that if you want to con- strain any other cells to be nonnegative, you must specify their constraints explicitly.other cells to be nonnegative, you must specify their constraints explicitly.other

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

608 Chapter 13 Introduction to Optimization Modeling

Overview of the Solution Process As mentioned previously, the complete solution of a problem involves three stages. In the model development stage you enter all of the inputs, trial values for the decision variable cells, and formulas relating these in a spreadsheet. This stage is the most crucial because it is here that all of the ingredients of the model are included and related appropriately. In particular, the spreadsheet must include a formula that relates the objective to the decision variable cells, either must include a formula that relates the objective to the decision variable cells, either must directly or indirectly, so that if the values in the decision variable cells vary, the objective value varies accordingly. Similarly, the spreadsheet must include formulas for the various constraints (usually their left sides) that are related directly or indirectly to the decision variable cells.

After the model is developed, you can proceed to the second stage—invoking Solver. At this point, you formally designate the objective cell, the decision variable cells, the con- straints, and selected options, and you tell Solver to find the optimal solution. If the first optimal solution. If the first optimal stage has been done correctly, the second stage is usually very quick and straightforward.

The third stage is sensitivity analysis. Here you see how the optimal solution changes (if at all) as selected inputs are varied. This often provides important insights about the behavior of the model.

We now illustrate this procedure for the product mix problem in Example 13.1.

Where Do the Numbers Come From? There are a variety of inputs in PC Tech’s problem, some easy to find and others more dif-There are a variety of inputs in PC Tech’s problem, some easy to find and others more dif-There are a variety of inputs in PC Tech’s problem, some easy to find and others more dif ficult. Here are some ideas on how they might be obtained.

■ The unit costs in rows 3, 4, and 10 should be easy to obtain. (See Figure 13.3.) These are the going rates for labor and the component parts. Note, however, that the labor

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

GFEDCBA Assembling and tes�ng computers Range names used:

Hours_available =Model!$D$21:$D$22

Cost per labor hour assembling $11

$15

$150

$300

5

1

$225

$450

6

2

Labor hours for assembly

Basic XP

Basic

Hours used

10200

3000

10000

3000

$48,000 $154,800 $202,800

<= <=

<=

<=

XP

Basic XP Total

Hours available

Cost of component parts

Selling price

Unit margin

Assembling, tes�ng plan (# of computers)

Number to produce

Maximum sales

Constraints (hours per month)

Labor hours for tes�ng

Hours_used =Model!$B$21:$B$22

Maximum_sales =Model!$B$18:$C$18

Number_to_produce =Model!$B$16:$C$16

=Model!$D$25Total_profit

Cost per labor hour tes�ng

Labor availability for assembling

Labor availability for tes�ng

Net profit ($ this month)

Inputs for assembling and tes�ng a computer

$129

1200

$80

600

1200600

Figure 13.3 Two-Variable Product Mix Model with an Infeasible Solution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

costs are probably regular-time rates. If the company wants to consider overtime hours, then the overtime rate (and labor hours availability during overtime) would be necessary, and the model would need to be modi�ed.

■ The resource usages in rows 8 and 9, often called technological coef�cients, should be available from the production department. These people know how much labor it takes to assemble and test these computer models.

■ The unit selling prices in row 11 have actually been chosen by PC Tech’s management, probably in response to market pressures and the company’s own costs.

■ The maximum sales values in row 18 are probably forecasts from the marketing and sales department. These people have some sense of how much they can sell, based on current outstanding orders, historical data, and the prices they plan to charge.

■ The labor hour availabilities in rows 21 and 22 are probably based on the current workforce size and possibly on new workers who could be hired in the short run. Again, if these are regular-time hours and overtime is possible, the model would have to be modi�ed to include overtime.

Developing the Spreadsheet Model The spreadsheet model appears in Figure 13.3. (See the file Product Mix 1.xlsx.) To develop this model, use the following steps.

1. Inputs. Enter all of the inputs from the statement of the problem in the shaded cells as shown.

2. Range names. Create the range names shown in columns E and F. Our convention is to enter enough range names, but not to go overboard. Specifically, we enter enough range names so that the setup in the Solver dialog box, to be explained shortly, is entirely in terms of range names. Of course, you can add more range names if you like (or you can omit them altogether). The following tip indicates a quick way to create range names.

Excel Tip: Shortcut for Creating Range Names Select a range such as A16:C16 that includes nice labels in column A and the range you want to name in columns B and C. Then, from the Formulas ribbon, select Create from Selection and accept the default. You automatically get the labels in cells A16 as the range name for the range B16:C16. (Note that if the label contains spaces, they are replaced by underscores in the range name.) This shortcut illustrates the usefulness of adding concise but informative labels next to ranges you want to name.

3. Unit margins. Enter the formula

=B11−B8*$B$3−B9*$B$4−B10

in cell B12 and copy it to cell C12 to calculate the unit profit margins for the two models. (Enter relative/absolute addresses that allow you to copy whenever possible.)

4. Decision variable cells. Enter any two values for the decision variable cells in the Number_to_produce range. Any trial values can be used initially; Solver eventually finds the optimal values. Note that the two values shown in Figure 13.3 cannot be optimal because they use more assembling hours than are available. However, you do not need to worry about satisfying constraints at this point; Solver takes care of this later on.

5. Labor hours used. To operationalize the labor availability constraints, you must calculate the amounts used by the production plan. To do this, enter the formula

=SUMPRODUCT(B8:C8,Number_to_produce)

At this stage, it is point- less to try to outguess the optimal solution. Any values in the decision variable cells will suffice.

Developing the Product Mix 1 Model

13-3 A Two-Variable Product Mix Model 609 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

610 Chapter 13 Introduction to Optimization Modeling

in cell B21 for assembling and copy it to cell B22 for testing. This formula is a short- cut for the following fully written out formula:

=B8*B16+C8*C16

- els, and you will see it often. Here, it multiplies the number of hours per computer by the number of computers for each model and then sums these products over the two models.

formula is not really any simpler than the written-out formula. However, imagine that there are 50 much simpler to enter (and read). For this reason, you should use it whenever possible. Note that each range in this function, B8:C8 and Number_to_produce, is a one-row, two-column range. It is impor-

shape.

6. Net profits. Enter the formula

=B12*B16

in cell B25, copy it to cell C25, and sum these to get the total net profit in cell D25. This latter cell is the objective to maximize. Note that if you didn’t care about the net profits for the two individual models, you could calculate the total net profit with the individual models, you could calculate the total net profit with the individual formula

=SUMPRODUCT(B12:C12,Number_to_produce)

SUM func- tion are the most used functions in LP models.

Experimenting with Possible Solutions The next step is to specify the decision variable cells, the objective cell, and the con- straints in a Solver dialog box and then instruct Solver to find the optimal solution. However, before you do this, it is instructive to try a few guesses in the decision variable cells. There are two reasons for doing so. First, by entering different sets of values in the decision variable cells, you can confirm that the formulas in the other cells are working correctly. Second, this experimentation can help you to develop a better understanding of the model.

For example, the profit margin for XPs is much larger than for Basics, so you might suspect that the company will produce only XPs. The most it can produce is 1200 (maxi- mum sales), and this uses fewer labor hours than are available. This solution appears in Figure 13.4. However, you can probably guess that it is far from optimal. There are still many labor hours available, so the company could use them to produce some Basics and make more profit.

You can continue to try different values in the decision variable cells, attempting to get as large a total net profit as possible while staying within the constraints. Even for this small model with only two decision variable cells, the optimal solution is not totally obvi- ous. You can only imagine how much more difficult it is when there are hundreds or even thousands of decision variable cells and many constraints. This is why software such as Excel’s Solver is required. Solver uses a quick and efficient algorithm to search through all feasible solutions (or more specifically, all corner points) and eventually find the optimal solution. Fortunately, it is quite easy to use, as we now explain.

The “linear” in linear programming is all about sums of products. Therefore, the SUMPRODUCT function is natural and should be used whenever possible.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-3 A Two-Variable Product Mix Model 611

Figure 13.4 Two-Variable Product Mix Model with a Suboptimal Solution

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

GFEDCBA Assembling and tes�ng computers Range names used:

Hours_available =Model!$D$21:$D$22

Cost per labor hour assembling $11

$15

$150

$300

5

1

$225

$450

6

2

Labor hours for assembly

Basic XP

Basic

Hours used

7200

2400

10000

3000

$0 $154,800 $154,800

<= <=

<=

<=

XP

Basic XP Total

Hours available

Cost of component parts

Selling price

Unit margin

Assembling, tes�ng plan (# of computers)

Number to produce

Maximum sales

Constraints (hours per month)

Labor hours for tes�ng

Hours_used =Model!$B$21:$B$22

Maximum_sales =Model!$B$18:$C$18

Number_to_produce =Model!$B$16:$C$16

=Model!$D$25Total_profit

Cost per labor hour tes�ng

Labor availability for assembling

Labor availability for tes�ng

Net profit ($ this month)

Inputs for assembling and tes�ng a computer

$129

1200

$80

0

1200600

© C

e n g

a g

e L

e a rn

in g

Using Solver To invoke Excel’s Solver, select Solver from the Data ribbon. (If there is no such item on your PC, you need to load Solver. To do so in Excel 2010 and later versions, click the load Solver. To do so in Excel 2010 and later versions, click the load

Excel 2007, you click the Office button and then Excel Options.) This shows you the list of available add-ins. If there is a Solver Add-in item in the list, check it to load Solver. If there is no such item, you need to rerun the Microsoft Office installer and elect to install Solver. It should be included in a typical install, but some people elect not to install it the first time around.) The dialog box in Figure 13.5 appears.6 Solver. It should be included in a typical install, but some people elect not to install it the

6 Solver. It should be included in a typical install, but some people elect not to install it the

It has three important sections that you must fill in: the objective cell, the decision variable cells, and the constraints. For the product mix problem, you can fill these in by typing cell references or you can point, click, and drag the appropriate ranges in the usual way. Better yet, if there are any named ranges, these range names appear instead of cell addresses when you drag the ranges. In fact, for reasons of readability, our convention is to use only range names, not cell addresses, in this dialog box.

6This is the Solver dialog box since Excel 2010. It is more convenient than similar dialog boxes in previous ver- sions because the typical settings now all appear in a single dialog box. In previous versions you had to click the Options button to complete the typical settings.

13-3 A Two-Variable Product Mix Model 611 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

612 Chapter 13 Introduction to Optimization Modeling

Excel Tip: Range Names in Solver Dialog Box Our usual procedure is to use the mouse to select the relevant ranges for the Solver dialog box. Fortunately, if these ranges have already been named, the range names will automatically replace the cell addresses.

1. Objective. Select the Total_profit cell as the objective cell, and click the Max option. (Actually, the default option is Max.)

2. Decision variable cells. Select the Number_to_produce range as the decision variable cells.

3. Constraints. Click the Add button to bring up the dialog box in Figure 13.6. Here you specify a typical constraint by entering a cell reference or range name on the left, the type of constraint from the dropdown list in the middle, and a cell reference, range name, or numeric value on the right. Use this dialog box to enter the constraint

Number_to_produce<=Maximum_sales

(Note:(Note:( You can type these range names into the dialog box, or you can drag them in the usual way. If you drag them, the cell addresses shown in the figure eventually change into range names if range names exist.) Then click the Add button and enter the constraint

Figure 13.5 Solver Dialog Box (since Excel 2010)

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Hours_used<=Hours_available

Then click OK to get back to the Solver dialog box. The first constraint says to pro- duce no more than can be sold. The second constraint says to use no more labor hours than are available.

Checking the Non-Negative option ensures only that the decision variable cells will be nonnegative.

Figure 13.6 Add Constraint Dialog Box

© C

e n g

a g

e L

e a rn

in g

Excel Tip: Inequality and Equality Labels in Spreadsheet Models The <= signs in cells B17:C17 and C21:C22 (see Figure 13.3 or Figure 13.4) are not a nec- essary part of the Excel model. They are entered simply as labels in the spreadsheet and do not substitute for entering the constraints in the Add Constraint dialog box. However, they help to document the model, so we include them in all of the examples. In fact, you should try to plan your spreadsheet models so that the two sides of a constraint are in nearby cells, with “gutter” cells in between where you can attach labels like <=, >=, or =. This conven- tion tends to make the resulting spreadsheet models much more readable.

Solver Tip: Entering Constraints in Groups Constraints typically come in groups. Beginners often enter these one at a time, such as B16 <= B18 and C16 <= C18, in the Solver dialog box. This can lead to a long list of constraints, and it is time-consuming. It is better to enter them as a group, as in B16:C16 <= B18:C18. This is not only quicker, but it also takes advantage of range names you have created. For example, this group ends up as Number_to_produce<=Maximum_Sales.

4. Nonnegativity. Because negative production quantities make no sense, you must tell Solver explicitly to make the decision variable cells nonnegative. To do this, check the Make Unconstrained Variables Non-Negative option shown in Figure 13.5. This automatically ensures that all decision variable cells are nonnegative. (In pre-2010 versions of Solver, you have to click the Options button and then check the Assume Non-Negative option in the resulting dialog box.)

5. Linear model. There is one last step before clicking the Solve button. As stated previ- ously, Solver uses one of several numerical algorithms to solve various types of mod- els. The models discussed in this chapter are all linear models. (We will discuss the linear models. (We will discuss the linear properties that distinguish linear models shortly.) Linear models can be solved most efficiently with the simplex method. To instruct Solver to use this method, make sure Simplex LP is selected in the Select a Solving Method dropdown list in Figure 13.5. (In pre-2010 versions of Solver, you have to click the Options button and then check the Assume Linear Model option in the resulting dialog box. In fact, from now on, if you are using a pre-2010 version of Excel and we instruct you to use the Simplex LP method, you should check the Assume Linear Model option. In contrast, if we instruct you to use a nonlinear algorithm, you should uncheck the Assume Linear Model option.)

6. Optimize. Click the Solve button in the dialog box in Figure 13.5. At this point, Solver does its work. It searches through a number of possible solutions until it finds the opti- mal solution. (You can watch the progress on the lower left of the screen, although for

13-3 A Two-Variable Product Mix Model 613 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

614 Chapter 13 Introduction to Optimization Modeling

small models the process is virtually instantaneous.) When it finishes, it displays the message shown in Figure 13.7. You can then instruct it to return the values in the deci- sion variable cells to their original (probably nonoptimal) values or retain the optimal values found by Solver. In most cases you should choose the latter. For now, click OK to keep the Solver solution. You should see the solution shown in Figure 13.8.

Figure 13.7 Solver Results Message

© C

e n g

a g

e L

e a rn

in g

Figure 13.8 Two-Variable Product Mix Model with the Optimal Solution

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

GFEDCBA Assembling and tes�ng computers Range names used:

Hours_available =Model!$D$21:$D$22

Cost per labor hour assembling $11

$15

$150

$300

5

1

$225

$450

6

2

Labor hours for assembly

Basic XP

Basic

Hours used

10000

2960

10000

3000

$44,800 $154,800 $199,600

<= <=

<=

<=

XP

Basic XP Total

Hours available

Cost of component parts

Selling price

Unit margin

Assembling, tes�ng plan (# of computers)

Number to produce

Maximum sales

Constraints (hours per month)

Labor hours for tes�ng

Hours_used =Model!$B$21:$B$22

Maximum_sales =Model!$B$18:$C$18

Number_to_produce =Model!$B$16:$C$16

=Model!$D$25Total_profit

Cost per labor hour tes�ng

Labor availability for assembling

Labor availability for tes�ng

Net profit ($ this month)

Inputs for assembling and tes�ng a computer

$129

1200

$80

560

1200600

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 615

13-4 SENSITIVITY ANALYSIS Having found the optimal solution, it might appear that the analysis is complete. But in real LP applications the solution to a single model is hardly ever the end of the analysis. It is almost always useful to perform a sensitivity analysis to see how (or if) the optimal solu- tion changes as one or more inputs vary. We illustrate systematic ways of doing so in this section. Actually, we discuss two approaches. The �rst uses an optional sensitivity report that Solver offers. The second uses an add-in called SolverTable that one of the authors (Albright) developed.

Solver Tip: Messages from Solver Actually, the message in Figure 13.7 is the one you hope for. However, in some cases Solver is not able to �nd an optimal solution, in which case one of several other messages appears. We discuss two of these later in the chapter.

Discussion of the Solution This solution indicates that PC Tech should produce 560 Basics and 1200 XPs. This plan uses all available labor hours for assembling, has a few leftover labor hours for testing, produces as many XPs as can be sold, and produces a few less Basics than could be sold. No plan can provide a net profit larger than this one—that is, without violating at least one of the constraints.

The solution in Figure 13.8 is typical of solutions to optimization models in the following sense. Of all the inequality constraints, some are satisfied exactly and others are not. In this solution the XP maximum sales and assembling labor constraints are met exactly. Each of these is called a binding constraint. However, the Basic maximum sales and testing labor constraints do not hold as equalities. Each of these is called a not hold as equalities. Each of these is called a not nonbinding constraint. You can think of the binding constraints as bottlenecks. They are the con- straints that prevent the objective from being improved. If it were not for the binding constraints on maximum sales and labor, PC Tech could obtain an even larger net profit.

In a typical optimal solution, you should pay particular attention to two aspects of the solu- tion. First, you should check which of the decision variables are positive (as opposed to 0).

model, they are the products included in the optimal mix. Second, you should check which of the constraints are binding. Again, these represent the bottlenecks that keep the objective from improving. ■

An inequality constraint is binding if the solution makes it an equality. Otherwise, it is nonbinding.

Binding and Nonbinding Constraints Most optimization models contain constraints expressed as inequalities. In an optimal solution, each such constraint is either binding (holds as an equality) or nonbinding. It is extremely important to identify the binding constraints because they are the

constraints that prevent the objective from improving. A typical constraint is on the availability of a resource. If such a constraint is binding, the objective could typ- ically improve by having more of that resource. But if such a resource constraint is nonbinding, more of that resource would not improve the objective at all.

F u n da m e n ta l I n s i g h t

Indeed, many analysts view the “finished” model as a starting point for many what-if questions. We agree.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

616 Chapter 13 Introduction to Optimization Modeling

13-4a Solver’s Sensitivity Report

When you run Solver, the dialog box in Figure 13.7 offers you the option to obtain a sensitivity report.7 This report is based on a well-established theory of sensitivity analysis in optimization models, especially LP models. This theory was developed around algebraic models that are arranged in a “standardized” format. Essentially, all such algebraic models look alike, so  the same type of sensitivity report applies to all of them. Speci�cally, they have an objective function of the form c1x1 + · · · + cnxnxn n, where n is the number of decision variables, the c’s are constants, and the x’s are the decision variables, and each constraint can be expressed as a1x1 + · · · + anxnxn n ≤ b, a1x1 + · · · + anxnxn n ≥ b, or a1x1 + · · · + anxnxn n = b, where the a’s and b’s are constants. Solver’s sensitivity report performs two types of senSolver’s sensitivity report performs two types of senSolver’s sensitivity report - sitivity analysis: (1) on the coef�cients of the objective, the c’s, and (2) on the right sides of the constraints, the b’s.

We illustrate the typical analysis by looking at the sensitivity report for PC Tech’s product mix model in Example 13.1. For convenience, the algebraic model is repeated here.

Maximize 80x0x0 1 + 129x2 subject to:

5x1 + 6x2 ≤ 10000 x1 + 2x2x2 2 ≤ 3000

x1 ≤ 600 x2 ≤ 1200

x1, x2 ≥ 0

On this Solver run, a sensitivity report is requested in Solver’s �nal dialog box. (See Figure 13.7.) The sensitivity report appears on a new worksheet, as shown in Figure 13.9.8 On this Solver run, a sensitivity report is requested in Solver’s �nal dialog box. (See

8 On this Solver run, a sensitivity report is requested in Solver’s �nal dialog box. (See

It contains two sections. The top section is for sensitivity to changes in the two coef�cients, 80 and 129, of the decision variables in the objective. Each row in this section indicates how the optimal solution changes if one of these coef�cients changes. The bottom section is for the sensitivity to changes in the right sides, 10000 and 3000, of the labor constraints.

7It also offers Answer and Limits reports. We don’t �nd these particularly useful, so we will not discuss them here. 8If your table looks different from ours, make sure you chose the simplex method (or checked Assume Linear Model in pre-2010 versions of Solver). Otherwise, Solver uses a nonlinear algorithm and produces a different type of sensitivity report.

A B C D E F G HG HE FC DA B 6 V6 Variable Cells

Constraints

$B$16 $C$16

560 0 80 27.5 80 1200

10000 16 02960

10000 200 2800 3000

33 129

1E+30

1E+30

40

33 Number to produce Basic Number to produce XP

Labor availability for assembling Hours used Labor availability for tes�ng Hours used

$B$21 $B$22

Cell Name Final Value

Reduced Cost

Objec�ve Coefficient

Allowable Increase

Allowable Decrease

Cell Name Final Value

Shadow Price

Constraint R.H. Side

Allowable Increase

Allowable Decrease

7 8 9

10 11 12 13 14 15 16

Figure 13.9 Solver Sensitivity Results

© C

e n g

a g

e L

e a rn

in g

Sensitivity for the Product Mix 1 Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 617

Each row of this section indicates how the optimal solution changes if one of these avail- abilities changes. (The maximum sales constraints represent a special kind of constraint— upper bounds on the decision variable cells. Upper bound constraints are handled in a special way in the Solver sensitivity report, as described shortly.)

Now let’s look at the speci�c numbers and their interpretation. In the �rst row of the top section, the allowable increase and allowable decrease indicate how much the coef- indicate how much the coef- indicate how much the coef �cient of pro�t margin for Basics in the objective, currently 80, could change before the optimal product mix would change. If the coef�cient of Basics stays within this allowable range, from 0 (decrease of 80) to 107.5 (increase of 27.5), the optimal product mix—the set of values in the decision variable cells—does not change at all. However, outside of these limits, the optimal mix between Basics and XPs might change.might change.might

To see what this implies, change the selling price in cell B11 from 300 to 299, so that the pro�t margin for Basics decreases to $79. This change is well within the allowable decrease of 80. If you rerun Solver, you will obtain the same values in the decision vari- able cells, although the objective value will decrease. Next, change the value in cell B11 to 330. This time, the pro�t margin for Basics increases by 30 from its original value of $300. This change is outside the allowable increase, so the solution might change. If you rerun Solver, you will indeed see a change—the company now produces 600 Basics and fewer than 1200 XPs.

The reduced costs in the second column indicate, in general, how much the objec- tive coef�cient of a decision variable that is currently 0 or at its upper bound must change before that variable changes (becomes positive or decreases from its upper bound). The interesting variable in this case is the number of XPs, currently at its upper bound of 1200. The reduced cost for this variable is 33, meaning that the number of XPs will stay at 1200 unless the pro�t margin for XPs decreases by at least $33. Try it. Starting with the original inputs, change the selling price for XPs to $420, a change of less than $33. If you rerun Solver, you will �nd that the optimal plan still calls for 1200 XPs. Then change the selling price to $410, a change of more than $33 from the original value. After rerunning Solver, you will �nd that fewer than fewer than fewer 1200 XPs are in the optimal mix.

The reduced cost for any decision variable with value 0 in the optimal solution indicates how much better that coefficient must be before that variable enters at a positive level. The reduced cost for any decision variable at its upper bound in the optimal solution indicates how much worse its coefficient must be before it will decrease from its upper bound. The reduced cost for any variable between 0 and its upper bound in the optimal solution is irrelevant.

The term shadow price is an economic term. It indicates the change in the optimal value of the objective when the right side of some constraint changes by one unit.

Now turn to the bottom section of the report in Figure 13.9. Each row in this section corresponds to a constraint, although upper bound constraints on decision variable cells are omitted in this section. To have this part of the report make economic sense, the model should be developed as has been done here, where the right side of each constraint is a numeric constant (not a formula). Then the report indicates how much these right-side con- stants can change before the optimal solution changes. To understand this more fully, the concept of a shadow price is required. A shadow price indicates the change in the objective when a right-side constant changes.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

618 Chapter 13 Introduction to Optimization Modeling

A shadow price is reported for each constraint. For example, the shadow price for the assembling labor constraint is 16. This means that if the right side of this constraint increases by one hour, from 10000 to 10001, the optimal value of the objective will increase by $16. It works in the other direction as well. If the right side of this constraint decreases by one hour, from 10000 to 9999, the optimal value of the objective will decrease by $16. However, as the right side continues to increase or decrease, this $16 change in the objective might not continue. This is where the reported allowable increase and allowable decrease are relevant. As long as the right side increases or decreases within its allowable limits, the same shadow price of 16 still applies. Beyond these limits, however, a different shadow price might apply.

You can prove this for yourself. First, increase the right side of the assembling labor constraint by 200 (exactly the allowable increase), from 10000 to 10200, and rerun Solver. (Don’t forget to reset other inputs to their original values if you have made changes.) You will see that the objective indeed increases by 16(200)=$3200, from $199,600 to $202,800. Now increase this right side by one more hour, from 10200 to 10201 and rerun Solver. You will observe that the objective doesn’t increase at all. This means that the shadow price beyond 10200 is less than 16; in fact, it is zero. This is typical. When a right side increases beyond its allowable increase, the new shadow price is typically less than the original shadow price (although it doesn’t always fall to zero, as in this example).

Resource Availability and Shadow Prices If a resource constraint is binding in the optimal solution, the company is willing to pay up to some amount, the shadow price, to obtain more of the resource. This is because the objective improves by having more of the resource. However, there is

typically a decreasing marginal effect: As the company owns more and more of the resource, the shadow price tends to decrease. This is usually because other constraints become binding, which causes extra units of this resource to be less useful (or not use- ful at all).

F u n da m e n ta l I n s i g h t

The idea is that a constraint “costs” the company by keeping the objective from being better than it would be. A shadow price indicates how much the company would be will- ing to pay (in units of the objective) to “relax” a constraint. In this example, the com- pany would be willing to pay $16 for each extra assembling hour. This is because such a change would increase the net pro�t by $16. But beyond a certain point—200 hours in this example—further relaxation of the constraint does no good, and the company is not willing to pay for any further increases.

The constraint on testing hours is slightly different. It has a shadow price of zero. In  fact, the shadow price for a nonbinding constraint is always zero, which makes sense.  If  the right side of this constraint is changed from 3000 to 3001, nothing at all happens to the optimal product mix or the objective value; there is just one more unneeded testing hour. However, the allowable decrease of 40 indicates that something does change when the right side reaches 2960. At this point, the constraint becomes binding—the testing hours used equal the testing hours available—and beyond this, the optimal prod- uct mix starts to change. By the way, the allowable increase for this constraint, shown as 1+E30, means that it is essentially in�nite. The right side of this constraint can be increased above 3000 inde�nitely, and absolutely nothing will change in the optimal solution.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 619

13-4b SolverTable Add-In

The reason Solver’s sensitivity report makes sense for the product mix model is that the spreadsheet model is virtually a direct translation of a standard algebraic model. Unfortunately, given the �exibility of spreadsheets, this is not always the case. We have seen many perfectly good spreadsheet models—and have developed many ourselves— that are structured quite differently from their standard algebraic-model counterparts. In these cases, we have found Solver’s sensitivity report to be more confusing than useful. Therefore, Albright developed an Excel add-in called SolverTable. SolverTable allows you to ask sensitivity questions about any of the input variables, not just coef�cients of the objective and right sides of constraints, and it provides straightforward answers.

The SolverTable add-in is on this textbook’s website (see the Preface for instructions on how to access it).9 To install it, simply copy the SolverTable �les to a folder on your hard drive. These �les include the add-in itself (the .xlam �le) and the online help �le. To load SolverTable, you can proceed in one of two ways:

1. Open the SolverTable.xlam file just as you open any other Excel file.

2. and check the SolverTable item. If it isn’t in the list, Browse for the SolverTable.xlam file.

The advantage of the second option is that if SolverTable is checked in the add-ins list, it will open automatically every time you open Excel (and you can always uncheck it if you don’t want it to open automatically).

that data tables allow you to vary one or two inputs in a spreadsheet model and see instan- taneously how selected outputs change. SolverTable is similar except that it runs Solver for every new input (or pair of inputs), and the current version also provides automatic charts of the results. There are two ways it can be used.

■ One-way table. A one-way table means that there is a single input cell and any num- ber of output cells. That is, there can be a single output cell or multiple output cells.ber of output cells. That is, there can be a single output cell or multiple output cells.ber

■ Two-way table. A two-way table means that there are two input cells and one or more output cells. (You might recall that an Excel two-way data table allows only one output. SolverTable allows more than one. It creates a separate table for each output as a function of the two inputs.)

The Effect of Constraints on the Objective If a constraint is added or an existing constraint becomes more constraining (for example, less of some resource is available), the objective can only get worse; it can never improve. The easiest way to understand this is to think of the feasible region. When a constraint is added or an existing constraint becomes more constraining, the feasible region shrinks, so some solutions that were feasible before,

maybe even the optimal solution, are no longer fea- sible. The opposite is true if a constraint is deleted or an existing constraint becomes less constraining. In this case, the objective can only improve; it can never get worse. Again, the idea is that when a con- straint is deleted or an existing constraint becomes less constraining, the feasible region expands. In this case, all solutions that were feasible before are still feasible, and there are some additional feasible solu- tions available.

F u n da m e n ta l I n s i g h t

Solver’s sensitivity report is almost impossible to unravel for some models. In these cases SolverTable is preferable because of its easily interpreted results.

9It is also available from the Free Downloads link on the authors’ website at www.kelley.iu.edu/albrightbooks. Actually, there are several versions of SolverTable available, each for a particular version of Solver. The one described in the text is for Solver in Excel 2007 or 2010 (or later). This website contains more information about these versions, as well as possible updates to SolverTable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

620 Chapter 13 Introduction to Optimization Modeling

We illustrate some of the possibilities for the product mix example. Speci�cally, we check how sensitive the optimal production plan and net pro�t are to (1) changes in the selling price of XPs, (2) the number of labor hours of both types available, and (3) the maximum sales of the two models.

We assume that the model has been formulated and optimized, as shown in Figure 13.8,

SolverTable button on the SolverTable ribbon. You will be asked whether there is a Solver model on the active sheet. (Note that the active sheet at this point should be the sheet con- taining the model. If it isn’t, click Cancel and then activate this sheet.) You are then given the choice between a one-way or a two-way table. For the �rst sensitivity question, choose the one-way option. You will see the dialog box in Figure 13.10. For the sensitivity analysis on the XP selling price, �ll it in as shown. Note that ranges can be entered as cell addresses or range names. Also, multiple ranges in the Outputs box must be separated by commas.

Figure 13.10 SolverTable One-Way Dialog Box

© C

e n g

a g

e L

e a rn

in g

We chose the input range from 350 to 550 in increments of 25, but you can choose any desired range of input values.

Excel Tip: Selecting Multiple Ranges

If you need to select multiple output ranges, the trick is to keep your finger on the Ctrl key as you drag the ranges. This automatically enters the separating comma(s) for you. Actually, the same trick works for selecting multiple decision variable cell ranges in Solver’s dialog box. It even works for entering multiple range arguments in any Excel function.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 621

When you click OK, Solver solves a separate optimization problem for each of the nine rows of the table and then reports the requested outputs (number produced and net pro�t) in the table, as shown in Figure 13.11. It can take a while, depending on the speed of your computer and the complexity of the model, but everything is automatic. However, if you want to update this table—by using different XP selling prices in column A, for example—you must repeat the procedure. Note that if the requested outputs are included in named ranges, the range names are used in the SolverTable headings. For example, the label Number_to_produce_1 indicates that this output is the �rst cell in the Number_to_ produce range. The label Total_pro�t indicates that this output is the only cell in the Total_ pro�t range. (If a requested output is not part of a named range, its cell address is used as the label in the SolverTable results.)

Figure 13.11 SolverTable Results for Varying XP Price

6

4

3

1

2

5

A

7 8 9

10 11 12 13

B C D E F GD E F GB C

N u

m b

er _t

o _p

ro d

u ce

_1

N u

m b

er _t

o _p

ro d

u ce

_2

To ta

l_ p

ro fi

t

Selling Price XP (cell $C$11) values along side, output cell(s) along top

1166.667 1166.667 1166.667

1200 1200 1200 1200 1200 1200

$81,833 $111,000 $140,167

600 600 600 560 560 560 560 560 560

$169,600 $199,600 $229,600 $259,600 $289,600

$350 $375 $400 $425 $450 $475 $500 $525 $550 $319,600

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

The outputs in this table show that when the selling price of XPs is relatively low, the company should make as many Basics as it can sell and a few less XPs, but when the selling price is relatively high, the company should do the opposite. Also, the net pro�t increases steadily through this range. You can calculate these changes (which are not part of the SolverTable output) in column E. The increase in net pro�t per every extra $25 in XP selling price is close to, but not always exactly equal to, $30,000.

SolverTable also produces the chart in Figure 13.12. There is a dropdown list in cell K4 where you can choose any of the SolverTable outputs. (We selected the total pro�t, cell D25.) The chart then shows the data for that column from the table in Figure 13.11. Here there is a steady increase (slope about $30,000) in net pro�t as the XP selling price increases.

The second sensitivity question asks you to vary two inputs, the two labor availa- bilities, simultaneously. This requires a two-way SolverTable, so you should �ll in the SolverTable dialog box as shown in Figure 13.13. Here two inputs and two input ranges

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

622 Chapter 13 Introduction to Optimization Modeling

are speci�ed, and multiple output cells are again allowed. An output table is generated for each of the output cells, as shown in Figure 13.14. For example, the top table shows how the optimal number of Basics varies as the two labor availabilities vary. Comparing the columns of this top table, it is apparent that the optimal number of Basics becomes increas- ingly sensitive to the available assembling hours as the number of available testing hours increases. The SolverTable output also includes two charts (not shown here) that let you graph any row or any column of any of these tables.

The third sensitivity question, involving maximum sales of the two models, reveals the �exibility of SolverTable. Instead of letting these two inputs vary independently in a

0

50000

100000

150000

200000

250000

300000

350000

$350 $375 $400 $425 $450 $475 $500 $525 $550

Selling Price XP ($C$11)

Sensi�vity of Total_profit to Selling Price XP

81833.33

Data for chart

K LK L M NM N O PO P Q RQ R

111000

140166.7

169600

199600

229600

259600

289600

319600

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

To ta

l_ p

ro fi

t

When you select an output from the dropdown list in cell $K$4, the chart will adapt to that output.

Figure 13.12 Associated SolverTable Chart for Total Profit

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 623

Figure 13.13 SolverTable Two-Way Dialog Box

© C

e n g

a g

e L

e a rn

in g

A B C D E F G H I J 3

I JG HE FC DA B Assembling hours (cell $D$21) values along side, Tes�ng hours (cell $D$22) values along top, output cell in corner

4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35

Number_to_produce_1 8000

2000 600 600 600 600 600 600 600 600 600

700 700 700 700 700 700 700 700 700

8500 9000 9500

10000 10500 11000 11500 12000

Number_to_produce_2 8000 8500 9000 9500

10000 10500 11000 11500 12000

Total_profit 8000 8500 9000 9500

10000 10500 11000 11500 12000

2500 3000 3500 4000 4500 5000

2000 2500 1125 1200

1200 1200 1200 1200 1200 1200 1200 1200

1200

1200 1200 1200 1200 1200 1200 1200 1200

1200

1200 1200 1200 1200 1200 1200 1200 1200

1200

1200 1200 1200 1200 1200 1200 1200 1200

1200

1200 1200 1200 1200 1200 1200 1200 12001000

950 950 950 950 950 950 950

3000 3500 4000 4500 5000

2000 2500 3000 3500 4000 4500 5000

250 160 160 160 160 160 500 260 260 260 260 260 600 360 360 360 360 360 600 460 460 460 460 460 600 560 560 560 560 560 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600 600

$138,300 $165,125 $167,600 $167,600 $138,300 $169,000 $175,600 $175,600 $138,300 $170,550 $183,600 $183,600 $138,300 $170,550 $191,600 $191,600 $138,300 $170,550 $199,600 $199,600 $138,300 $170,550 $202,800 $202,800 $138,300 $170,550 $202,800 $202,800 $138,300 $170,550 $202,800 $202,800 $138,300 $170,550 $202,800 $202,800

$167,600 $175,600 $183,600 $191,600 $199,600 $202,800 $202,800 $202,800 $202,800

$167,600 $175,600 $183,600 $191,600 $199,600 $202,800 $202,800 $202,800 $202,800

$167,600 $175,600 $183,600 $191,600 $199,600 $202,800 $202,800 $202,800 $202,800

Figure 13.14 Two-Way SolverTable Results

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

624 Chapter 13 Introduction to Optimization Modeling

two-way SolverTable, it is possible to let both of them vary according to a single percent- age change. For example, if this percentage change is 10%, both maximum sales increase by 10%. The trick is to modify the model so that one percentage-change cell drives changes in both maximum sales. The modi�ed model appears in Figure 13.15. Starting with the original model, enter the original values, 600 and 1200, in new cells, E18 and F18. (Do not copy the range B18:C18 to E18:F18. This would make the right side of the constraint not copy the range B18:C18 to E18:F18. This would make the right side of the constraint not

Finally, enter the formula

=E18*(1+$G$18)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

HGFEDCBA Assembling and tes�ng computers

Cost per labor hour assembling $11

$15

$150

$300

5

1

$225

$450

6

2

Labor hours for assembly

Basic Xc XP

Basic

Hours used

10000

2960

10000

3000

$44,800 $154,800 $199,600

<= <= Original values % change in both

<=

<=

XP

Basic Xc XP TP Total

Hours available

Cost of component parts

Selling price

Unit margin

Assembling, tes�ng plan (# of computers)

Number to produce

Maximum sales

Constraints (hours per month)

Labor hours for tes�ng

Cost per labor hour tes�ng

Labor availability for assembling

Labor availability for tes�ng

Net profit ($ this month)

Inputs for assembling and tes�ng a computer

$129

1200

$80

560

1200600 1200 0%600

The trick here is to let the single value in cell G18 drive both values in cells B18 and C18 from their original values.

Figure 13.15 Modified Model for Simultaneous Changes

© C

e n g

a g

e L

e a rn

in g

in cell B18 and copy it to cell C18. Now a one-way SolverTable can be used with the per-

SolverTable dialog box should be set up as in Figure 13.16, with the corresponding results in Figure 13.17.

You should always scan these sensitivity results to see if they make sense. For exam- ple, if the company can sell 20% or 30% more of both models, it makes no more pro�t than if it can sell only 10% more. The reason is labor availability. By this point, there isn’t enough labor to produce the increased demand.

It is always possible to run a sensitivity analysis by changing inputs manually in the spreadsheet model and rerunning Solver. The advantages of SolverTable, however, are that it enables you to perform a systematic sensitivity analysis for any selected inputs and out- puts, and it keeps track of the results in a table and associated chart(s). You will see other applications of this useful add-in later in this chapter and in the next chapter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-4 Sensitivity Analysis 625

Figure 13.16 SolverTable One-Way Dialog Box

© C

e n g

a g

e L

e a rn

in g

3

2

1

4 5 6 7 8 9

10 11

A BA B C DC D E FE F G

% change in max sales (cell $G$18) values along side, output cell(s) along top

N u

m b

er _t

o _p

ro d

u ce

_1

N u

m b

er _t

o _p

ro d

u ce

_2

To ta

l_ p

ro fi

t

$B $1

2

–30% –20% –10%

420 840 $141,960 $80 480 960 $162,240 $80 540 1080 $182,520 $80

0% 560 1200 $199,600 $80 10% 500 1250 $201,250 $80 20% 500 1250 $201,250 $80 30% 500 1250 $201,250 $80

Oneway analysis for Solver model in Modified Model worksheet Figure 13.17 Sensitivity to Percentage Change in Maximum Sales ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

626 Chapter 13 Introduction to Optimization Modeling

13-4c Comparison of Solver’s Sensitivity Report and SolverTable

Sensitivity analysis in optimization models is extremely important, so it is important that you understand the pros and cons of the two tools in this section. Here are some points to keep in mind.

■ Solver’s sensitivity report focuses only on the coef�cients of the objective and the right sides of the constraints. SolverTable allows you to vary any of the inputs.

■ Solver’s sensitivity report provides very useful information through its reduced costs, shadow prices, and allowable increases and decreases. This same information can be obtained with SolverTable, but it requires a bit more work and some experimentation with the appropriate input ranges.

■ Solver’s sensitivity report is based on changing only one objective coef�cient or one right side at a time. This one-at-a-time restriction prevents you from answering certain questions directly. SolverTable is much more �exible in this respect.

■ Solver’s sensitivity report is based on a well-established mathematical theory of sensitivity analysis in linear programming. If you lack this mathematical background—as many users do—the outputs can be dif�cult to understand, especially for somewhat “nonstandard” spreadsheet formulations. In contrast, SolverTable’s outputs are straightforward. You can vary one or two inputs and see directly how the optimal solution changes.

■ Solver’s sensitivity report is not even available for integer-constrained models, and its interpretation for nonlinear models is more dif�cult than for linear models. SolverTable’s outputs have the same interpretation for any type of optimization model.

■ Solver’s sensitivity report comes with Excel. SolverTable is a separate add-in that is not included with Excel—but it is included with this book and is freely available from the Free Downloads link at the authors’ website, www.kelley.iu.edu/albrightbooks.

In summary, each of these tools can be used to answer certain questions. We tend to favor SolverTable because of its �exibility, but in the optimization examples in this chapter and the next chapter, we will illustrate both tools to show how each can provide useful information.

13-5 PROPERTIES OF LINEAR MODELS Linear programming is an important subset of a larger class of models called mathemati- cal programming models.10 Linear programming is an important subset of a larger class of models called

10 Linear programming is an important subset of a larger class of models called

All such models select the levels of various activities that can be performed, subject to a set of constraints, to maximize or minimize an objective such as total pro�t or total cost. In PC Tech’s product mix example, the activities are the numbers of PCs to produce, and the purpose of the model is to �nd the levels of these activities that maximize the total net pro�t subject to speci�ed constraints.

In terms of this general setup—selecting the optimal levels of activities—there are three important properties that LP models possess that distinguish them from general math- ematical programming models: proportionality, additivity, and divisibility.

10The word programming in linear programming or mathematical programming has nothing to do with computer programming. It originated with the British term programme, which is essentially a plan or a schedule of operations.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-5 Properties of Linear Models 627

Proportionality means that if the level of any activity is multiplied by a constant fac- tor, the contribution of this activity to the objective, or to any of the constraints in which the activity is involved, is multiplied by the same factor. For example, suppose that the production of Basics is cut from its optimal value of 560 to 280—that is, it is multiplied by 0.5. Then the amounts of labor hours from assembling and from testing Basics are both cut in half, and the net pro�t contributed by Basics is also cut in half.

Proportionality is a perfectly valid assumption in the product mix model, but it is often violated in certain types of models. For example, in various blending models used by petroleum companies, chemical outputs vary in a nonlinear manner as chemical inputs are varied. If a chemical input is doubled, say, the resulting chemical output is not necessarily doubled. This type of behavior violates the proportionality property, and it requires nonlin- ear optimization, which we discuss in the next chapter.ear optimization, which we discuss in the next chapter.ear

The additivity property implies that the sum of the contributions from the various activities to a particular constraint equals the total contribution to that constraint. For exam- ple, if the two PC models use, respectively, 560 and 2400 testing hours (as in Figure 13.8), then the total number used in the plan is the sum of these amounts, 2960 hours. Similarly, the additivity property applies to the objective. That is, the value of the objective is the sum of the contributions from the various activities. In the product mix model, the net pro�ts from the two PC models add up to the total net pro�t. The additivity property implies that the contribution of any decision variable to the objective or to any constraint is independent of the levels of the other decision variables.

The divisibility property simply means that both integer and noninteger levels of the activities are allowed. In the product mix model, we got integer values in the optimal solution, 560 and 1200, just by luck. For slightly different inputs, they could easily have been fractional values. In general, if you want the levels of some activities to be integer values, there are two possible approaches: (1) You can solve the LP model without inte- ger constraints, and if the solution turns out to have fractional values, you can attempt to round them to integer values; or (2) you can explicitly constrain certain decision variable cells to contain integer values. The latter approach, however, requires integer program- ming, which we discuss in the next chapter. At this point, we simply state that in general, integer-constrained problems are much more dif�cult to solve than problems without inte- ger constraints.

So far, the discussion of these three properties, especially proportionality and additivity, is fairly abstract. How can you recognize whether a model satis�es proportionality and additivity? This is easy if the model is described algebraically. In this case the objective must be of the form

a1x1 + a2x2x2 2 + · · · + anxnxn n where n is the number of decision variables, the a’s are constants, and the x’s are decision variables. This expression is called a linear combination of the x’s. Also, each constraint must be equivalent to a form where the left side is a linear combination of the x’s and the right side is a constant. For example, the following is a typical linear constraint:

3x1 + 7x2 − 2x2x2 3 ≤ 50

It is not quite so easy to recognize proportionality and additivity—or the lack of them—in a spreadsheet model, because the logic of the model is typically embedded in a series of cell formulas. However, the ideas are the same. First, the objective cell must ultimately (possibly through a series of formulas in intervening cells) be a sum of products of constants and decision variable cells, where a “constant” means that it does not depend on decision variable cells. Second, each side of each constraint must ultimately be either a constant or a sum of products of constants and decision variable cells. This explains why

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

628 Chapter 13 Introduction to Optimization Modeling

It is usually easier to recognize when a model is not linear. Two particular situations not linear. Two particular situations not that lead to nonlinear models are when (1) there are products or quotients of expressions involving decision variable cells or (2) there are nonlinear functions, such as squares, square roots, or logarithms, that involve decision variable cells. These are typically easy to spot, and they guarantee that the model is nonlinear.

Whenever you model a real problem, you usually make some simplifying assump- tions. This is certainly the case with LP models. The world is frequently not linear, which not linear, which not means that an entirely realistic model typically violates some or all of the three properties in this section. However, numerous successful applications of LP have demonstrated the usefulness of linear models, even if they are only approximations of reality. If you suspect that the violations are serious enough to invalidate a linear model, you should use an integer or nonlinear model, as we illustrate in the next chapter.

In terms of Excel’s Solver, if the model is linear—that is, if it satis�es the proportional- ity, additivity, and divisibility properties—you should check the Simplex LP option (or the Assume Linear Model option in pre-2010 versions of Excel). Then Solver uses the simplex method, a very ef�cient method for a linear model, to solve the problem. Actually, you can check the Simplex LP option even if the divisibility property is violated—that is, for linear models with integer-constrained variables—but Solver then embeds the simplex method in a more complex algorithm in its solution procedure.

Linear Models and Scaling11

In some cases you might be sure that a model is linear, but when you check the Simplex LP option (or the Assume Linear Model option) and then solve, you get a Solver message to the effect that the conditions for linearity are not satis�ed. This can indicate a logical error in your formulation, so that the proportionality and additivity conditions are indeed not satis�ed. However, it can also indicate that Solver erroneously thinks the linearity condi- tions are not satis�ed, which is typically due to roundoff error in its calculations—not any error on your part. If the latter occurs and you are convinced that the model is correct, you can try not using the simplex method to see whether that works. If it does not, you should not using the simplex method to see whether that works. If it does not, you should not consult your instructor. It is possible that the non-simplex algorithm employed by Solver simply cannot �nd the solution to your problem.

In any case, it always helps to have a well-scaled model. In a well-scaled model, all well-scaled model. In a well-scaled model, all well-scaled of the numbers are roughly the same magnitude. If the model contains some very large numbers—100,000 or more, say—and some very small numbers—0.001 or less, say—it is poorly scaled for the methods used by Solver, and roundoff error is more likely to be an poorly scaled for the methods used by Solver, and roundoff error is more likely to be an poorly scaled issue, not only in Solver’s test for linearity conditions but in all of its algorithms.

If you believe your model is poorly scaled, there are three possible remedies. The �rst is to check the Use Automatic Scaling option in Solver. (It is found by clicking on the Options button in the main Solver dialog box.) This might help and it might not; we have had mixed success. (Frontline Systems, the company that develops Solver, has told us that the only drawback to checking this box is that the solution procedure can be slower.) The second option is to rede�ne the units in which the various quantities are de�ned. Finally, you can change the Precision setting in Solver’s Options dialog box to a larger number, such 0.00001 or 0.0001. (The default has �ve zeros.)

Excel Tip: Rescaling a Model Suppose you have a whole range of input values expressed, say, in dollars, and you would like to reexpress them in thousands of dollars, that is, you would like to divide each value by 1000. There is a simple copy/paste way to do this. Enter the value 1000 in some unused cell and copy it. Then select the range you want to rescale, and from the Paste dropdown menu, select Paste

You can decrease the chance of getting an incorrect “Conditions for Assume Linear Model are not satisfied” message by changing Solver’s Precision setting.

11This section might seem overly technical. However, when you develop a model that you are sure is linear and Solver then tells you it doesn’t satisfy the linear conditions, you will appreciate this section.

Real-life problems are almost never exactly linear. However, linear approximations often yield very useful results.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-6 Infeasibility and Unboundedness 629

Special and then the Divide option. No formulas are required; your original values are auto- matically rescaled (and you can then delete the 1000 cell). You can use this same method to add, subtract, or multiply by a constant.

13-6 INFEASIBILITY AND UNBOUNDEDNESS In this section we discuss two of the things that can go wrong when you invoke Solver. Both of these might indicate that there is a mistake in the model. Therefore, because mistakes are common in LP models, you should be aware of the error messages you might encounter.

The �rst problem is infeasibility feasible if it satis�es all of the constraints. Among all of the feasible solutions, you are looking for the one that optimizes the objective. However, it is possible that there are no feasible solutions to the model. There are generally two reasons for this: (1) there is a mistake in the model (an input was entered incorrectly, such as a ≤ symbol instead of ≥) or (2) the problem has been so constrained that there are no solutions left. In the former case, a careful check of the model should �nd the error. In the latter case, you might need to change, or even eliminate, some of the constraints.

To show how an infeasible problem could occur, suppose in PC Tech’s product mix problem you change the maximum sales constraints to minimum sales constraints (and leave everything else unchanged). That is, you change these constraints from ≤ to ≥. If Solver is then used, the message in Figure 13.18 appears, indicating that Solver cannot �nd a feasible solution. The reason is clear: There is no way, given the constraints on labor hours, that the company can produce these minimum sales values. The company’s only choice is to set at least one of the minimum sales values lower. In general, there is no fool- proof way to remedy the problem when a “no feasible solution” message appears. Careful checking and rethinking are required.

A second type of problem is unboundedness. In this case, the model has been formu- lated in such a way that the objective is unbounded—that is, it can be made as large (or as small, for minimization problems) as you like. If this occurs, you have probably entered a

Figure 13.18 No Feasible Solution Message

© C

e n g

a g

e L

e a rn

in g

A perfectly reasonable model can have no feasible solutions because of too many constraints.

Infeasibility and Unboundedness

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

630 Chapter 13 Introduction to Optimization Modeling

wrong input or forgotten some constraints. To see how this could occur in the product mix problem, suppose that you change all constraints to be all constraints to be all ≤ instead of ≥. Now there is no upper bound on available labor hours or the number of PCs the company can sell. If you make these changes in the model and then use Solver, the message in Figure 13.19 appears, stating that the objective cell does not converge. In other words, the total net pro�t can grow without bound.

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Other sensitivity analyses besides those discussed

could be performed on the product mix model. Use SolverTable to perform each of the following. In each case keep track of the values in the decision variable cells and the objective cell, and discuss your findings. a. Let the selling price for Basics vary from $220 to

$350 in increments of $10.

b. Let the labor cost per hour for assembling vary from $5 to $20 in increments of $1.

c. Let the labor hours for testing a Basic vary from 0.5 to 3.0 in increments of 0.5.

d. Let the labor hours for assembling and testing an XP vary independently, the first from 4.5 to 8.0 and the second from 1.5 to 3.0, both in increments of 0.5.

2. In PC Tech’s product mix problem, assume there is another PC model, the VXP, that the company can produce in addition to Basics and XPs. Each VXP requires eight hours for assembling, three hours for

Figure 13.19 Unbounded Solution Message

© C

e n g

a g

e L

e a rn

in g

Except in very rare situations, if Solver informs you that your model is unbounded, you have made an error.

Infeasibility and unboundedness are quite different in a practical sense. It is quite pos- sible for a reasonable model to have no feasible solutions. For example, the marketing department might impose several constraints, the production department might add some more, the engineering department might add even more, and so on. Together, they might constrain the problem so much that there are no feasible solutions left. The only way out is to change or eliminate some of the constraints. An unboundedness problem is quite dif-is to change or eliminate some of the constraints. An unboundedness problem is quite dif-is to change or eliminate some of the constraints. An unboundedness problem is quite dif ferent. There is no way a realistic model can have an unbounded solution. If you get the message shown in Figure 13.19, then you must have made a mistake: You entered an input incorrectly, you omitted one or more constraints, or there is a logical error in your model.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-7 A Larger Product Mix Model 631

13-7 A LARGER PRODUCT MIX MODEL The problem we examine in this section is a direct extension of the product mix model in the previous section. There are two modi�cations. First, the company makes eight com- puter models, not just two. Second, testing can be done on either of two lines, and these two lines have different characteristics.

testing, $275 for component parts, and sells for $560. At most 50 VXPs can be sold. a. Modify the spreadsheet model to include this

new product, and use Solver to find the optimal product mix.

b. You should find that the optimal solution is not integer-valued. If you round the values in the decision variable cells to the nearest integers, is the resulting solution still feasible? If not, how might you obtain a feasible solution that is at least close to optimal?

3. Continuing the previous problem, perform a sensitivity analysis on the selling price of VXPs. Let this price vary from $500 to $650 in increments of $10, and keep track of the values in the decision variable cells and the objective cell. Discuss your findings.

4. Again continuing problem 2, suppose that you want to force the optimal solution to be integers. Do this in Solver by adding a new constraint. Select the decision variable cells for the left side of the constraint, and in the middle dropdown list, select the “int” option (for “integer”). How does the optimal integer solution compare to the optimal noninteger solution in prob- lem 2? Are the decision variable cell values rounded versions of those in problem 2? Is the objective value more or less than in problem 2?

5. If all of the inputs in PC Tech’s product mix problem are nonnegative (as they should be for any realistic version of the problem), are there any input values such that the resulting model has no feasible

6. There are five corner points in the feasible region for the product mix problem. We identified the coordinates of one of them: (560, 1200). Identify the coordinates of the others.

a. Only one of these other corner points has positive values for both decision variable cells. Discuss the changes in the selling prices of either or both models that would be necessary to make this corner point optimal.

b. Two of the other corner points have one decision variable cell value positive and the other zero. Discuss the changes in the selling prices of either or both models that would be necessary to make either of these corner points optimal.

Level B 7. Using the graphical solution of the product mix model

as a guide, suppose there are only 2800 testing hours available. How do the answers to the previous problem change? (Is the previous solution still optimal? Is it still feasible?)

8. Again continuing problem 2, perform a sensitivity analysis where the selling prices of Basics and XPs simultaneously change by the same percentage, but the selling price of VXPs remains at its original value. Let the percentage change vary from −25% to 50% in increments of 5%, and keep track of the values in the decision variable cells and the total profit. Discuss your findings.

9. Consider the graphical solution to the product mix problem. Now imagine that another constraint— any constraint—is added. Which of the following three things are possible: (1) the feasible region shrinks; (2) the feasible region stays the same; (3) the feasible region expands? Which of the following three things are possible: (1) the optimal value in objective cell decreases; (2) the optimal value in objective cell stays the same; (3) the optimal value in objective cell increases? Explain your answers. Do they hold just for this particular model, or do they hold in general?

E X A M P L E 13.2 PRODUCING COMPUTERS AT PC TECH

As in the previous example, PC Tech must decide how many of each of its computer models to assemble and test, but there are now eight available models, not just two. Each computer must be assembled and then tested, but there are now two lines for testing. The first line tends to test faster, but its labor costs are slightly higher, and each line has a certain number of hours available for testing. Any computer can be tested on either line. The inputs for the model are same as before: (1) the hourly labor costs for assembling and

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

632 Chapter 13 Introduction to Optimization Modeling

testing, (2) the required labor hours for assembling and testing any computer model, (3) the cost of component parts for each model, (4) the selling prices for each model, (5) the max- imum sales for each model, and (6) labor availabilities. These input values are listed in the file Product Mix 2.xlsx. As before, the company wants to determine the product mix that maximizes its total net profit.

Objective To use LP to find the mix of computer models that maximizes total net profit and stays within the labor hour availability and maximum sales constraints.

Where Do the Numbers Come From? The same comments as in Example 13.1 apply here.

Solution The diagram shown in Figure 13.20 (see the file Product Mix 2 Big Picture.xlsx) is simi- lar to the one for the smaller product mix model, but it is not the same. You must choose the number of computers of each model to produce on each line, the sum of which cannot be larger than the maximum that can be sold. This choice determines the labor hours of each type used and all revenues and costs. No more labor hours can be used than are available.

Figure 13.20 Big Picture for Larger Product Mix Model

Labor Hours per Unit

Labor Hours Used

Labor Hours Available

Cost per Labor Hour

Selling Price

Maximum Sales

Maximize Profit

Total Computers Produced

Number Computers Tested on Each Line

<=

Cost of Component Parts

<=

Unit Margin

© C

e n g

a g

e L

e a rn

in g

It might not be immediately obvious what the decision variable cells should be for this model (at least not before you look at Figure 13.20). You might think that the company simply needs to decide how many computers of each model to produce. However, because of the two testing lines, this is not enough information. The company must also decide how many of each model to test on each line. For example, suppose they decide to test 100 model 4’s on line 1 and 300 model 4’s on line 2. This means they will need to assemble (and ultimately sell) 400 model 4’s. In other words, given the detailed plan of how many to test on each line, everything else is determined. But without the detailed plan, there is not enough information to complete the model. This is the type of reasoning you must go through to determine the appropriate decision variables for any LP model.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-7 A Larger Product Mix Model 633

Developing the Product Mix 2 Model

An Algebraic Model We will not spell out the algebraic model for this expanded version of the product mix model because it is so similar to the two-variable product mix model. However, we will say that it is larger, and hence probably more intimidating. Now we need decision variables of the form xijiji , the number of model j computers to test on line i, and the total net profit and

these variables. Instead of focusing on these algebraic expressions, we turn directly to the spreadsheet model.

Developing the Spreadsheet Model The spreadsheet in Figure 13.21 illustrates the solution procedure for PC Tech’s product mix problem. (See the file Product Mix 2.xlsx.) The first stage is to develop the spread- sheet model step by step.

1. Inputs. Enter the various inputs in the blue ranges. Again, remember that our con- vention is to color all input cells blue. Enter only numbers, not formulas, in input cells. They should always be numbers directly from the problem statement. (In this case, we supplied them in the spreadsheet template.)

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

JIHGFEDCBA Assembling and testing computers

Cost per labor hour assembling $11 Cost per labor hour testing, line 1 Cost per labor hour testing, line 2

$19 $17

Inputs for assembling and testing a computer Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Labor hours for assembly Labor hours for tes�ng, line 1 Labor hours for tes�ng, line 2

5 5.5 5.5 5.5 6 1.5

4 5 5 2 2 2 2.5 2.5 2.5 3

2 2.5 2.5 2.5 3 3 3.5 3.5 Cost of component parts $150 $225 $225 $225 $250 $250 $250 $300 Selling price $600$530$525$500$470$460$450$350 Unit margin, tested on line 1 Unit margin, tested on line 2

$128 $132 $142 $152 $142 $167 $172 $177 $122 $128 $138 $148 $139 $164 $160 $175

50000 1250

0 0

0 0

0 0

Number tested on line 1 Number tested on line 2

1000 800 0 0 0 0

Total computers produced 0 0 00 0 0 1250 0 500 1000 800 <= <= <= <= <= <= <= <=

Maximum sales 1250 1000 1000 1000 800125012501500

Constraints (hours per month) Hours used Hours available Labor availability for assembling 19300 <= 20000 Labor availability for tes�ng, line 1 Labor availability for tes�ng, line 2

6150 <= 5000 3125 <= 6000

Net profit ($ per month) Totals $0$0$0$0$0Tested on line 1

Tested on line 2 $172,000$83,500

$184,375 $141,600 $397,100

$184,375 $581,475

$0$0$0$0$0$0$0

Assembling, testing plan (# of computers)

Figure 13.21 Larger Product Mix Model with Infeasible Solution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

634 Chapter 13 Introduction to Optimization Modeling

2. Range names. Name the ranges indicated. According to our convention, there are enough named ranges so that the Solver dialog box contains only range names, no cell addresses. Of course, you can name additional ranges if you like. (Note that you can again use the range-naming shortcut explained in the Excel tip for the previous example. That is, you can take advantage of labels in adjacent cells, except for the Profit cell.)

3. Unit margins. Note that two rows of these are required, one for each testing line, because the costs of testing on the two lines are not equal. To calculate them, enter the formula

=B$13-$B$3*B$9-$B4*B10-B$12

in cell B14 and copy it to the range B14:I15.

4. Decision variable cells. As discussed above, the decision variable cells are the red cells in rows 19 and 20. You do not have to enter the values shown in Figure 13.21. not have to enter the values shown in Figure 13.21. not You can use any trial values initially; Solver will eventually find the optimal valoptimal valoptimal - ues. Note that the four values shown in Figure 13.21 cannot be optimal because they do not satisfy all of the constraints. Specifically, this plan uses more labor hours for assembling than are available. However, you do not need to worry about satisfying constraints at this point; Solver will take care of this later.

5. Labor used. Enter the formula

=SUMPRODUCT(B9:E9,Total_computers_produced)

in cell B26 to calculate the number of assembling hours used. Similarly, enter the formulas

=SUMPRODUCT(B10:I10,Number_tested_on_line_1)

and

=SUMPRODUCT(B11:I11,Number_tested_on_line_22 in cells B27 and B28 for the labor hours used on each testing line.

Excel Tip: Copying Formulas with Range Names When you enter a range name in an Excel formula and then copy the formula, the range name reference acts like an absolute reference. Therefore, it wouldn’t work to copy the for- mula in cell B27 to cell B28. However, this would work if range names hadn’t been used. This is one potential disadvantage of range names that you should be aware of.

6. Revenues, costs, and profits. The area from row 30 down shows the summary of monetary values. Actually, only the total profit in cell J33 is needed, but it is also useful to calculate the net profit from each computer model on each testing line. To obtain these, enter the formula

=B14*B19

in cell B31 and copy it to the range B31:I32. Then sum these to obtain the totals in column J. The total in cell J33 is the objective to maximize.

Experimenting with Other Solutions Before going any further, you might want to experiment with other values in the decision variable cells. However, it is a real challenge to guess the optimal solution. It is tempting to fill up the decision variable cells corresponding to the largest unit margins. However, this

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-7 A Larger Product Mix Model 635

You typically gain insights into a solution by checking which constraints are binding.

totally ignores their use of the scarce labor hours. If you can guess the optimal solution to this model, you are better than we are!

Using Solver The Solver dialog box should be filled out as shown in Figure 13.22. (Again, note that there are enough named ranges so that only range names appear in this dialog box.) Except that this model has two rows of decision variable cells, the Solver setup is identical to the one in Example 13.1.

Discussion of the Solution When you click Solve, you obtain the optimal solution shown in Figure 13.23. The opti- mal plan is to produce computer models 1, 4, 6, and 7 only, some on testing line 1 and others on testing line 2. This plan uses all of the available labor hours for assembling and testing on line 1, but about 1800 of the testing line 2 hours are not used. Also, maximum sales are achieved only for computer models 1, 6, and 7. This is typical of an LP solu- tion. Some of the constraints are met exactly—they are binding—whereas others contain a certain amount of “slack.” The binding constraints prevent PC Tech from earning an even higher profit.

Figure 13.22 Solver Dialog Box

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

636 Chapter 13 Introduction to Optimization Modeling

Excel Tip: Roundoff Error Because of the way numbers are stored and calculated on a computer, the optimal values in the decision variable cells and elsewhere can contain small roundoff errors. For example, the value that really appears in cell E20 on one of our Excel 2007 PCs is 475757 .000002015897, not exactly 7, not exactly 7 475757 . For all practical purposes, this number can be treated as 475757 , and we have formatted it as such in the spreadsheet. (It appears that roundoff in Solver results are less of a problem in Excel 2010 and later.)

Sensitivity Analysis If you want to experiment with different inputs to this problem, you can simply change the inputs and then rerun Solver. The second time you use Solver, you do not have to specify the objective and decision variable cells or the constraints. Excel remembers all of these settings and saves them when you save the file.

You can also use SolverTable to perform a more systematic sensitivity analysis on one or more input variables. One possibility appears in Figure 13.24, where the number of available assembling labor hours is allowed to vary from 18,000 to 25,000 in increments of 1000, and the numbers of computers produced and profit are designated as outputs. There

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33

Assembling, tes�ng plan (# of computers) Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Number tested on line 1 Number tested on line 2

1500 0 0 125 0 0 0 000475000

Total computers produced 1500 0 00 0 600 0 00 0 <= <= <= <= <= <= <= <=

80010001000

10000 010000 0

1000

10000 010000 0 1000

10001250125012501500Maximum sales

Constraints (hours per month) Hours used Hours available Labor availability for assembling 20000 <= 20000 Labor availability for tes�ng, line 1 Labor availability for tes�ng, line 2

5000 <= 5000 4187.5 <5 <= 6000

Net profit ($ per month) Totals $191,250

$0 $0 $0

$0 $0

$0 $0 $0

$0 $0$0 $163,500

$172,000Tested on line 1 Tested on line 2

$19,000 $382,250 $70,063 $233,563

$615,813

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16

JIHGFEDCBA Assembling and testing computers

Cost per labor hour assembling $11 Cost per labor hour testing, line 1 Cost per labor hour testing, line 2

$19 $17

Inputs for assembling and testing a computer Model 1 Model 2 Model 3 Model 4 Model 5 Model 6 Model 7 Model 8

Labor hours for assembly Labor hours for tes�ng, line 1 Labor hours for tes�ng, line 2

5 5.5 5.5 5.5 6 1.5

4 5 5 2 2 2 2.5 2.5 2.5 3

2 2.5 2.5 2.5 3 3 3.5 3.5 Cost of component parts $150 $225 $225 $225 $250 $250 $250 $300 Selling price $600$530$525$500$470$460$450$350 Unit margin, tested on line 1 Unit margin, tested on line 2

$128 $132 $142 $152 $142 $167 $172 $177 $122 $128 $138 $148 $139 $164 $160 $175

Figure 13.23 Optimal Solution to Larger Product Mix Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-7 A Larger Product Mix Model 637

3

1 2

4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I JI J

Assembling labor (cell $D$26) values along side, output cell(s) along top

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 1

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 2

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 3

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 4

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 5

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 6

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 7

To ta

l_ co

m pu

te rs

_p ro

du ce

d_ 8

To ta

l_ pr

of it

18000 1500 0 00 0 200 0 1000 0 $556,813 19000 1500 0 00 0 400 0 1000 0 $586,313 20000 1500 0 00 0 600 0 1000 0 $615,813 21000 1500 0 00 0 800 0 1000 0 $645,313 22000 1500 0 00 0 1000 0 1000 0 $674,813 23000 1500 0 00 0 1200 0 1000 0 $704,313 24000 1500 0 700 1250 0 1000 0 $724,750 25000 1500 0 1250 1250 0 1000

1000 1000 1000 1000 1000 1000

500 60 0 $727,170

Oneway analysis for Solver model in Model worksheet

800000

700000

600000

500000

400000

300000

200000

100000

0 18000 19000 20000 21000 22000 23000 24000 25000

Assembling labor ($D$26)

Sensitivity of Total_profit to Assembling labor

Figure 13.24 Sensitivity to Assembling Labor Hours

© C

e n g

a g

e L

e a rn

in g

are several ways to interpret the output from this sensitivity analysis. First, you can look at columns B through I to see how the product mix changes as more assembling labor hours become available. For assembling labor hours from 18,000 to 23,000, the only thing that changes is that more model 4’s are produced. Beyond 23,000, however, the company starts to produce model 3’s and produces fewer model 7’s. Second, you can see how extra labor hours add to the total profit. Note exactly what this increased profit means. For example, when labor hours increase from 20,000 to 21,000, the model requires that the company must pay $11 apiece for these extra hours (if it uses them). But the net effect is that profit net effect is that profit net increases by $29,500, or $29.50 per extra hour. In other words, the labor cost increases by

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

638 Chapter 13 Introduction to Optimization Modeling

$11,000 [=$11(1000)], but this is more than offset by the increase in revenue that comes from having the extra labor hours.

As column J illustrates, it is worthwhile for the company to obtain extra assembling labor hours, even though it has to pay for them, because its profit increases. However, the increase in profit per extra labor hour—the shadow price of assembling labor hours—is not constant. In the top part of the table, it is $29.50 (per extra hour), but it then decreases to $20.44 and then $2.42. The accompanying SolverTable chart of column J illustrates this decreasing shadow price through its decreasing slope.

SolverTable Technical Tip: Charts and Roundoff As SolverTable performs all of its Solver runs, it reports and then charts the values found by Solver. These can include small roundoff errors and slightly misleading charts. For example, the chart in Figure 13.25 shows one possibility, where we varied the cost of testing on line 2 and charted the assembling hours used. Throughout the range, this output value was 20,000, but because of slight roundoff in two of the cells (19999.9999999292 and 20000.0000003259 on our PC), the chart doesn’t appear to be �at. If you see this behavior, you can change the chart manually by modifying its vertical scale.

Finally, you can gain additional insight from Solver’s sensitivity report, shown in Figure 13.26. However, you have to be very careful in interpreting this report. Unlike Example 13.1, there are no upper bound (maximum sales) constraints on the decision variable cells. The maximum sales constraints are on the total computers produced (row 21 of the model), not the decision variable cells. Therefore, the only nonzero reduced costs in the top part of the table are for decision variable cells currently at zero (not those at their upper bounds as in the previous example). Each nonzero reduced cost indicates how much the profit margin for this activity would have to change before this activity would be profitable. Also, there is a row in the bottom part of the table for each con- straint, including the maximum sales constraints. The interesting values are again the shadow prices. The first two indicate the amount the company would pay for an extra

Figure 13.25 A Misleading SolverTable Chart

20000

20000

20000

20000

20000

20000

20000

20000 $10 $11 $12 $13 $14 $15 $16 $17 $18 $19 $20 $21 $22 $23 $24 $25

Testing cost 2 ($B$5)

Sensitivity of Hours_used_1 to Testing cost 2

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-7 A Larger Product Mix Model 639

6

7 8

9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

25 26

27 28

29 30 31 32 33 34 35 36 37 38 39

HGFEDCBA Variable Cells

Final Value

Reduced Cost

Allowable Increase

Allowable DecreaseNameCell

1500 0 127.5 1E+30 2.125 0 –20 0 –10

132 20 1E+30 142 10 1E+30

125 0 152 2.833333333 1.7 0 –25.875 142 25.875 1E+30 0 –2.125

0 –6.75 0 –2.125 0 –20 0 –10

0 –23.75

0 –6.375

$B$19 Number tested on line 1 Model 1 $C$19 $D$19

0 –2.5

167 2.125 1E+30 1000 0 172 1E+30 4.125

177 6.75 1E+30 122 2.125 1E+30

127.5 20 1E+30 137.5 10 1E+30

475 0 147.5 1.136363636 2.083333333 138.5 23.75 1E+30

1000 0 163.5 1E+30 1.25 160 6.375 1E+30

174.5 2.5 1E+30

Constraints

Final Value

Shadow Price

Constraint R.H. Side

Allowable Increase

Allowable DecreaseNameCell

20000 29.5 20000 3250 2375

4187.5 0 6000 1E+30 1812.5 5000 2.25 5000 950 250

1500 6.125 1500 166.6666667 812.5 1E+30 1E+30 1E+30 1E+30

1E+30

1250 1250 1250

00 1250 1250

00 600 0 650

10001000 1000 1000

00 1000 1.25 431.8181818 590.9090909 1000 4.125 100 590.909

$B$26 Labor availability for assembling Hours used $B$27 Labor availability for tes�ng, line 1 Hours used

Labor availability for tes�ng, line 2 Hours used$B$28 $B$21 Total computers produced Model 1

Total computers produced Model 2 Total computers produced Model 3 Total computers produced Model 4 Total computers produced Model 5 Total computers produced Model 6 Total computers produced Model 7 Total computers produced Model 8

$C$21 $D$21 $E$21 $F$21 $G$21 $H$21 $I$21 80080000

Objec�ve Coefficient

$E$19 $F$19 $G$19 $H$19 $I$19 $B$20 $C$20 $D$20 $E$20 $F$20 $G$20 $H$20 $I$20

Number tested on line 1 Model 2 Number tested on line 1 Model 3 Number tested on line 1 Model 4 Number tested on line 1 Model 5 Number tested on line 1 Model 6 Number tested on line 1 Model 7 Number tested on line 1 Model 8 Number tested on line 2 Model 1 Number tested on line 2 Model 2 Number tested on line 2 Model 3 Number tested on line 2 Model 4 Number tested on line 2 Model 5 Number tested on line 2 Model 6 Number tested on line 2 Model 7 Number tested on line 2 Model 8

Figure 13.26 Solver’s Sensitivity Report

© C

e n g

a g

e L

e a rn

in g

assembling or line 1 testing labor hour. (Does the 29.5 value look familiar? Compare it to the SolverTable results above.) The shadow prices for all binding maximum sales constraints indicate how much more profit the company could make if it could increase its demand by one computer of that model.

The information in this sensitivity report is all relevant and definitely provides some insights if studied carefully. However, this really requires you to know the exact rules Solver uses to create this report. That is, it requires a fairly in-depth knowledge of the theory behind LP sensitivity analysis, more than we have provided here. Fortunately, we believe the same basic information—and more—can be obtained in a more intuitive way by creating several carefully chosen SolverTable reports. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

640 Chapter 13 Introduction to Optimization Modeling

Level A Note: All references to the product mix model in the following problems are to the larger product mix model in this section.larger product mix model in this section.larger

10. Modify PC Tech’s product mix model so that there is no maximum sales constraint. (This is easy to do in the Solver dialog box. Just highlight the constraint and click on the Delete button.) Does this make the problem unbounded? Does it change the optimal solution at all? Explain its effect.

11. In the product mix model it makes sense to change the maximum sales constraint to a “minimum sales” constraint, simply by changing the direction of the inequality. Then the input values in row 23 can be considered customer demands that must be met. Make this change and rerun Solver. What do you find? What do you find if you run Solver again, this time making the values in row 23 one-quarter of their current values?

12. Use SolverTable to run a sensitivity analysis on the cost per assembling labor hour, letting it vary from $5 to $20 in increments of $1. Keep track of the computers produced in row 21, the hours used in the range B26:B28, and the total profit. Discuss your findings. Are they intuitively what you expected?

13. Create a two-way SolverTable for the product mix model, where total profit is the only output and the two inputs are the testing line 1 hours and testing line 2 hours available. Let the former vary from 4000 to 6000 in increments of 500, and let the latter vary from 3000 to 5000 in increments of 500. Discuss the changes in profit you see as you look across the various rows of the table. Discuss the changes in profit you see as you look down the various columns of the table.

14. Model 8 has fairly high profit margins, but it isn’t included at all in the optimal mix. Use SolverTable, along with some experimentation on the correct range,

to find the (approximate) selling price required for model 8 before it enters the optimal product mix.

Level B 15. Suppose that you want to increase all three of the

resource availabilities in the product mix model simultaneously by the same percentage. You want this percentage to vary from −25% to 50% in increments of 5%. Modify the spreadsheet model slightly so that this sensitivity analysis can be performed with a one-way SolverTable, using the percentage change as the single input. Keep track of the computers produced in row 21, the hours used in the range B26:B28, and the total profit. Discuss the results.

16. Some analysts complain that spreadsheet models are difficult to resize. You can be the judge of this. Suppose the current product mix problem is changed so that there is an extra resource, packaging labor hours, and two additional PC models, 9 and 10. What additional input data are required? What modifications are necessary in the spreadsheet model (including range name changes)? Make up values for any extra required input data and incorporate these into a modified spreadsheet model. Then optimize with Solver. Do you conclude that it is easy to resize a spreadsheet model? (By the way, it turns out that algebraic models are typically much easier to resize.)

17. In Solver’s sensitivity report for the product mix model, the allowable decrease for available assembling hours is 2375. This means that some- thing happens when assembling hours fall to 20,000 − 2375 = 17,625. See what this means by first running Solver with 17,626 available hours and then again with 17,624 available hours. Explain how the two solutions compare to the original solution and to each other.

P R O B L E M S

13-8 A MULTIPERIOD PRODUCTION MODEL The product mix examples illustrate a very important type of LP model. However, LP models come in many forms. For variety, we now present a quite different type of model that can also be solved with LP. (In the next chapter we provide other examples, linear and otherwise.) The distinguishing feature of the following model is that it relates decisions made during several time periods. This type of problem occurs when a company must make a decision now that will have rami�cations in the future. The company does not want to focus completely on the short run and forget about the long run.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-8 A Multiperiod Production Model 641

Pigskin Company produces footballs. Pigskin must decide how many footballs to pro-duce each month. The company has decided to use a six-month planning horizon. The forecasted monthly demands for the next six months are 10,000, 15,000, 30,000, 35,000, 25,000, and 10,000. Pigskin wants to meet these demands on time, knowing that it cur- rently has 5000 footballs in inventory and that it can use a given month’s production to help meet the demand for that month. (For simplicity, we assume that production occurs during the month, and demand occurs at the end of the month.) During each month there is enough production capacity to produce up to 30,000 footballs, and there is enough storage capac- ity to store up to 10,000 footballs at the end of the month, after demand has occurred. The forecasted production costs per football for the next six months are $12.50, $12.55, $12.70, $12.80, $12.85, and $12.95, respectively. The holding cost per football held in inventory at the end of any month is figured at 5% of the production cost for that month. (This cost includes the cost of storage and also the cost of money tied up in inventory.) The selling price for footballs is not considered relevant to the production decision because Pigskin will satisfy all customer demand exactly when it occurs—at whatever the selling price is. In other words, total revenue for the planning horizon is fixed, regardless of production deci- sions. Therefore, Pigskin wants to determine the production schedule that minimizes the total production and holding costs.

Objective To use LP to find the production schedule that meets demand on time and minimizes total production and inventory holding costs.

Where Do the Numbers Come From? The input values for this problem are not all easy to find. Here are some thoughts on where they might be obtained.

■ The initial inventory should be available from the company’s database system or from a physical count.

■ The unit production costs would probably be estimated in two steps. First, the company might ask its cost accountants to estimate the current unit production cost. Then it could examine historical trends in costs to estimate in�ation factors for future months.

■ The holding cost percentage is typically dif�cult to determine. Depending on the type of inventory being held, this cost can include storage and handling, rent, property taxes, insurance, spoilage, and obsolescence. It can also include capital costs—the cost of money that could be used for other purposes.

■ The demands are probably forecasts made by the marketing and sales department. They might be “seat-of-the-pants” forecasts, or they might be the result of a formal quantitative forecasting procedure as discussed in Chapter 12. Of course, if there are already some orders on the books for future months, these are included in the demand �gures.

■ The production and storage capacities are probably supplied by the production department. They are based on the size of the workforce, the available machinery, availability of raw materials, and physical space.

Solution The variables for this model appear in Figure 13.27. There are two keys to relating these variables. First, the months cannot be treated independently. This is because the ending inventory in one month is the beginning inventory for the next month. Second, to ensure

E X A M P L E 13.3 PRODUCING FOOTBALLS AT PIGSKIN

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

642 Chapter 13 Introduction to Optimization Modeling

that demand is satisfied on time, the amount on hand after production in each month must be at least as large as the demand for that month. This constraint must be included explic- itly in the model.

12This example illustrates a subtle difference between algebraic and spreadsheet models. It is often convenient in algebraic models to de�ne “decision variables,” in this case the I’s, that are really determined by other decision variables, in this case the P’s. In spreadsheet models, however, we typically de�ne the decision variable cells as the smallest set of variables that must be chosen—in this case the production quantities. Then values that are determined by these decision variable cells, such as the ending inventory levels, can be calculated with spread- sheet formulas.

By modifying the timing assumptions in this type of model, alternative— and equally realistic— models with very different solutions can be obtained.

Figure 13.27 Big Picture for Production Planning Model

Produc�on Capacity

Produc�on Cost

Ending Inventory

Holding Cost

Holding Cost Percentage

Unit Produc�on Cost

Minimize Tot Tot T al Cost

Units Produced

Storage Capacity

<=<=

Available Inventory

Forecasted Demand

Ini�al Inventory

>=

© C

e n g

a g

e L

e a rn

in g

When you model this type of problem, you must be very specific about the timing of events. In fact, depending on the assumptions you make, there can be a variety of potential models. For example, when does the demand for footballs in a given month occur: at the beginning of the month, at the end of the month, or continually throughout the month? The same question can be asked about production in a given month. The answers to these two questions indicate how much of the production in a given month can be used to help satisfy the demand in that month. Also, are the maximum storage constraint and the holding cost based on the ending inventory in a month, the average amount of inventory in a month, or the maximum inventory in a month? Each of these possibilities is reasonable and could be implemented.

To simplify the model, we assume that (1) all production occurs at the beginning of the month, (2) all demand occurs after production, so that all units produced in a month after production, so that all units produced in a month after can be used to satisfy that month’s demand, and (3) the storage constraint and the hold- ing cost are based on ending inventory in a given month. (You are asked to modify these assumptions in the problems.)

An Algebraic Model In the traditional algebraic model, the decision variables are the production quantities for the six months, labeled P1 through P6. It is also convenient to let I1 through I6I6I be the corresponding end-of-month inventories (after demand has occurred).12

through 12 through

For example, I3I3I

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-8 A Multiperiod Production Model 643

P1 − I1 = 1000 − 5000 I1 + P2 − I2I2I = 15000 I2I2I + P3 − I3I3I = 30000 I3I3I + P4 − I4I4I = 35000 I4I4I + P5 − I5I5I = 25000 I5I5I + P6 − I6I6I = 10000 (13.1)

Developing the Production Planning Model

is the number of footballs left over at the end of month 3. Therefore, the obvious con- straints are on production and inventory storage capacities: PjPjP ≤ 30000 and IjIjI ≤ 10000 for 1 ≤ j ≤ 6.

In addition to these constraints, balance constraints that relate the P’s and I’s are nec- essary. In any month the inventory from the previous month plus the current production equals the current demand plus leftover inventory. If DjDjD is the forecasted demand for month j, the balance equation for month j isj isj

IjIjI − 1 + PjPjP = DjDjD + IjIjI

The balance equation for month 1 uses the known beginning inventory, 5000, for the previ- ous inventory (the IjIjI − 1 term). By putting all variables (P’s and I’s) on the left and all known values on the right (a standard LP convention), these balance constraints can be written as

As usual, there are nonnegativity constraints: all P’s and I’s must be nonnegative. What about meeting demand on time? This requires that in each month the inventory

from the preceding month plus the current production must be at least as large as the cur- rent demand. But take a look, for example, at the balance equation for month 3. By rear- ranging it slightly, it becomes

I3I3I = I2I2I + P3 − 30000

Now, the nonnegativity constraint on I3I3I implies that the right side of this equation, I2I2I + P3 − 30000, must also be nonnegative. But this implies that demand in month 3 is covered—the beginning inventory in month 3 plus month 3 production is at least 30000. Therefore, the nonnegativity constraints on the Is automatically guarantee that all demands will be met on time, and no other constraints are needed. Alternatively, the constraint can be written directly as I2I2I + P3 ≥ 30000. In words, the amount on hand after production in month 3 must be at least as large as the demand in month 3. The spreadsheet model takes advantage of this interpretation.

Finally, the objective to minimize is the sum of production and holding costs. It is the sum of unit production costs multiplied by P’s, plus unit holding costs multiplied by I’s.

Developing the Spreadsheet Model The spreadsheet model of Pigskin’s production problem is shown in Figure 13.28. (See the file Production Scheduling.xlsx.) The main feature that distinguishes this model from the product mix model is that some of the constraints, namely, Equations (13.1), are built into the spreadsheet itself by means of formulas. This means that the only decision variable cells are the production quantities. The ending inventories shown in row 20 are determined by the production quantities and Equations (13.1). As you see, the decision variables in an algebraic model (the P’s and I’s) are not necessarily the same as the decision variable cells in an equivalent spreadsheet model. (The only decision variable cells in the spreadsheet model correspond to the P’s.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

644 Chapter 13 Introduction to Optimization Modeling

To develop the spreadsheet model in Figure 13.28, proceed as follows.

1. Inputs. Enter the inputs in the blue cells. Again, these are all entered as numbers directly from the problem statement. (Unlike some spreadsheet modelers who prefer to put all inputs in the upper left corner of the spreadsheet, we enter the inputs wher- ever they fit most naturally. Of course, this takes some planning before diving in.)

2. Name ranges. Name the ranges indicated. Note that all but one of these (Total_cost) can be named easily with the range-naming shortcut, using the labels in column A.

3. Production quantities. Enter any values in the range Units_produced as production quantities. As always, you can enter values that you believe are good, maybe even optimal. This is not crucial, however, because Solver eventually finds the optimal production quantities.

4. On-hand inventory. Enter the formula

=B4+B12

in cell B16. This calculates the first month’s on-hand inventory after production (but before demand). Then enter the typical formula

=B20+C12

for on-hand inventory after production in month 2 in cell C16 and copy it across row 16.

5. Ending inventories. Enter the formula

=B16-B18

for ending inventory in cell B20 and copy it across row 20. This formula calculates ending inventory in the current month as on-hand inventory before demand minus the demand in that month.

6. Production and holding costs. Enter the formula

=B8*B12

In multiperiod problems, there is often one formula for the first period and a slightly different (copyable) formula for all other periods.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I J K Mul�period produc�on model

Input data Ini�al inventory 5000 Holding cost as % of prod cost 5%

Month Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Produc�on cost/unit $12.50 $12.55 $12.70 $12.80 $12.85 $12.95

Produc�on plan Month Units produced 100002500030000300001500015000

Produc�on capacity 30000 30000 30000 30000 30000 30000

On hand a�er produc�on 20000 25000 40000400004000 40000400004000 30000300003000 15000

100002500035000300001500010000Demand

Ending inventory 500050005000100001000010000

<= <= <= <= <= <=

>= >= >= >= >= >=

<= <= <= <= <= <= Storage capacity 100001000010000100001000010000

Summary of costs Month Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Totals Produc�on costs $187,500 $188,250 $381,000 $384,000 $129,500 $1,591,500 Holding costs $6,350 $3,200 $3,213 $3,238 $28,525

$1,620,025$324,463 $132,738$387,200

$321,250

$387,350 $6,250 $6,275

$194,525$193,750Totals

1 2 3 4 5 61 2 3 4 5 6

Range names used Demand

On_hand_a�er_produc�on Produc�on_capacity

Ending_inventory

Storage_capacity Total_Cost Units_produced

=Model!$B$20:$G$20 =Model!$B$18:$G$18

=Model!$B$16:$G$16 =Model!$B$14:$G$14 =Model!$B$22:$G$22

=Model!$B$12:$G$12 =Model!$H$28

I J

Figure 13.28 Production Planning Model with a Suboptimal Solution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-8 A Multiperiod Production Model 645

Then enter the formula

=$B$5*B8*B20

that these are based on monthly ending inventories. Finally, calculate the cost totals in column H with the SUM function.

Using Solver To use Solver, fill out the main dialog box as shown in Figure 13.29. The logic behind the constraints is straightforward. The constraints are that (1) the production quantities cannot exceed the production capacities, (2) the on-hand inventories after production must be at least as large as demands, and (3) ending inventories cannot exceed storage capacities. Check the Non-Negative option and select the Simplex LP method, and then click Solve.

Discussion of the Solution The optimal solution from Solver appears in Figure 13.30. The solution can be interpreted best by comparing production quantities to demands. In month 1, Pigskin should produce just enough to meet month 1 demand (taking into account the initial inventory of 5000). In month 2, it should produce 5000 more footballs than month 2 demand, and then in month 3 it should produce just enough to meet month 3 demand, while still carrying the extra 5000 footballs in inventory from month 2 production. In month 4, Pigskin should finally use these 5000 footballs, along with the maximum production amount, 30,000, to meet month 4 demand. Then in months 5 and 6 it should produce exactly enough to meet these months’ demands. The total cost is $1,535,563, most of which is production cost.

Figure 13.29 Solver Dialog Box for Production Planning Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

646 Chapter 13 Introduction to Optimization Modeling

Could you have guessed this optimal solution? Upon reflection, it makes perfect sense. Because the monthly holding costs are large relative to the differences in monthly production costs, there is little incentive to produce footballs before they are needed to take advantage of a “cheap” production month. Therefore, Pigskin Company produces foot balls in the month when they are needed—when possible. The only exception to this rule is the 20,000 footballs produced during month 2 when only 15,000 are needed. The extra 5000 footballs produced in month 2 are needed, however, to meet the month 4 demand of 35,000, because month 3 production capacity is used entirely to meet the month 3 demand. Thus month 3 capacity is not available to meet the month 4 demand, and 5000 units of month 2 capacity are used to meet the month 4 demand.

Multiperiod Optimization Problems and Myopic Solutions Many optimization problems are of a multiperiod nature, where a sequence of decisions must be made over time. When making the first of these decisions, first of these decisions, first the one for this week or this month, say, it is usu- ally best to include future decisions in the model,

as has been done here. If you ignore future periods and make the initial decision based only on the first period, the resulting decision is called myopic (short-myopic (short-myopic sighted). Myopic decisions are occasionally optimal, but not very often. The idea is that if you act now in a way that looks best in the short run, it might lead you down a strategically unattractive path for the long run.

F u n da m e n ta l I n s i g h t

If you want Solver Table to keep track of a quantity that is not in your model, you need to create it with an appropriate formula in a new cell.

Sensitivity Analysis SolverTable can now be used to perform a number of interesting sensitivity analyses. We illustrate two possibilities. First, note that the most inventory ever carried at the end of a month is 5000, although the storage capacity each month is 10,000. Perhaps this is because the holding cost percentage, 5%, is fairly large. Would more ending inventory be carried if this holding cost percentage were lower? Or would even less be carried if it were higher? You can check this with the SolverTable output shown in Figure 13.31. Now the single

You can often improve your intuition by trying to reason why Solver’s solution is indeed optimal.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I J K Mul�period produc�on model

Input data Ini�al inventory 5000 Holding cost as % of prod cost 5%

Month Month 1 Month 2 Month 3 Month 4 Month 5 Month 6 Produc�on cost/unit $12.50 $12.55 $12.70 $12.80 $12.85 $12.95

Produc�on plan Month Units produced 10000250003000030000200005000

Produc�on capacity 30000 30000 30000 30000 30000 30000

On hand a�er produc�on 10000 20000 35000350003500 35000350003500 25000250002500 10000

100002500035000300001500010000Demand

Ending inventory 0005000500010000

<= <= <= <= <= <=

>= >= >= >= >= >=

<= <= <= <= <= <= Storage capacity 100001000010000100001000010000

Summary of costs Month Month 1 Month 2 Month 3 Month 4Month 4 Month 5 Month 6 Totals Produc�on costs $62,500 $251,000 $381,000 $384,000 $129,500 $1,529,250 Holding costs $3,175 $0 $0 $0 $6,313

$1,535,563$321,250 $129,500$384,000

$321,250

$384,175 $0 $3,138

$254,138$62,500Totals

1 2 3 4 5 61 2 3 4 5 6

Range names used Demand

On_hand_a�er_produc�on Produc�on_capacity

Ending_inventory

Storage_capacity Total_Cost Units_produced

=Model!$B$20:$G$20 =Model!$B$18:$G$18

=Model!$B$16:$G$16 =Model!$B$14:$G$14 =Model!$B$22:$G$22

=Model!$B$12:$G$12 =Model!$H$28

I J

Figure 13.30 Optimal Solution for Production Planning Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-8 A Multiperiod Production Model 647

6

4

3

5

A

7 8 9

10 11 12 13 14

B C D E F GD E F GB C

2 1

$B $3

1

Holding cost pct (cell $B$5) values along side, output cell(s) along top

Oneway analysis for Solver model in Model worksheet

10000 5000 5000 5000 5000 5000 5000 5000 5000

1% 2% 3% 4% 5% 6% 7% 8% 9%

10% 5000

Some�mes you’d like to use SolverTable on an output that isn’t explicitly part of the model. In that case, just calculate it in a new cell (as in cell B31 in the Model sheet) and then use SolverTable.

Figure 13.31 Sensitivity of Maximum Inventory to Holding Cost

© C

e n g

a g

e L

e a rn

in g

input cell is cell B5, and the single output is the maximum ending inventory ever held, which you can calculate in cell B31 with the formula

=MAX(Ending_inventory)

As the SolverTable results indicate, the storage capacity limit is reached only when the holding cost percentage falls to 1%. (This output doesn’t indicate which month or how many months the ending inventory is at the upper limit.) On the other hand, even when the holding cost percentage reaches 10%, the company still continues to hold a maximum ending inventory of 5000.

A second possible sensitivity analysis is suggested by the way the optimal production schedule would probably be implemented. The optimal solution to Pigskin’s model speci- fies the production level for each of the next six months. In reality, however, the company would probably implement the model’s recommendation only for the first month. Then at first month. Then at first the beginning of the second month, it would gather new forecasts for the next six months, next six months, next months 2 through 7, solve a new six-month model, and again implement the model’s rec- ommendation for the first of these months, month 2. If the company continues in this man- ner, we say that it is following a six-month rolling planning horizon.

The question, then, is whether the assumed demands (really, forecasts) toward the end of the planning horizon have much effect on the optimal production quantity in month 1. We would hope not, because these forecasts could be quite inaccurate. The two-way Solver table in Figure 13.32 shows how the optimal month 1 production quantity varies with the forecasted demands in months 5 and 6. As you can see, if the errors in the forecasted demands for months 5 and 6 remain fairly small, the optimal month 1 production quan- tity remains at 5000. This is good news. It means that the optimal production quantity in month 1 is fairly insensitive to the possibly inaccurate forecasts for months 5 and 6.

Solver’s sensitivity report for this model appears in Figure 13.33. The bottom part of this report is fairly straightforward to interpret. The first six rows are for sensitivity to changes in the demand, whereas the last six are for sensitivity to changes in the stor- age capacity. (There are no rows for the production capacity constraints because these are

report handles this type of constraint differently from “normal” constraints.) In contrast, the top part of the report is virtually impossible to unravel. This is because the objec- tive coefficients of the decision variables are each based on multiple inputs. (Each is a

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

648 Chapter 13 Introduction to Optimization Modeling

Figure 13.32 Sensitivity of Month 1 Production to Demand in Months 5 and 6

6

4

3

5

A

7

B C D E F GD E F G H I JH IB C

2 1

Month 5 demand (cell $F$18) values along side, Month 6 demand (cell $G$18) values along top, output cell in corner

Twoway analysis for Solver model in Model worksheet

Units_produced_1 10000 20000 30000

10000 5000 5000 5000

20000 5000 5000 5000

30000 5000 5000 5000

© C

e n g

a g

e L

e a rn

in g

Figure 13.33 Solver Sensitivity Report for Production Planning Model

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

Variable Cells

$B$12

$C$12

$D$12

$E$12

$F$12

$G$12

Cells

Units produced Month 1

Units produced Month 2

Units produced Month 3

Units produced Month 4

Units produced Month 5

Units produced Month 6

Name

5000

20000

30000

30000

25000

10000

Final

Value

0

0

–0.477500009

–1.012500019

0

0

Reduced

Cost

16.31750006

15.74250005

15.26500004

14.73000003

14.14000002

13.59750001

Objec�ve

Coefficient

1E+30

0.575000009

0.477500009

1.012500019

1.602500028

0.54250001

Allowable

Increase

0.575000009

0.477500009

1E+30

1E+30

0.54250001

13.59750001

Allowable

Decrease

Constraints

$B$16

$C$16

$D$16

$E$16

$F$16

$G$16

$B$20

$C$20

$D$20

$E$20

$F$20

$G$20

Cells

On hand a�er produc�on <=

On hand a�er produc�on <=

On hand a�er produc�on <=

On hand a�er produc�on <=

On hand a�er produc�on <=

On hand a�er produc�on <=

Ending inventory >=

Ending inventory >=

Ending inventory >=

Ending inventory >=

Ending inventory >=

Ending inventory >=

Name

10000

20000

35000

35000

25000

10000

0

5000

5000

0

0

0

Final

Value

0.575000009

0

0

1.602500028

0.54250001

13.59750001

0

0

0

0

0

0

Shadow

Price

10000

15000

30000

35000

25000

10000

10000

10000

10000

10000

10000

10000

Constraint

R.H. Side

10000

5000

5000

5000

5000

10000

1E+30

1E+30

1E+30

1E+30

1E+30

1E+30

Allowable

Increase

5000

1E+30

1E+30

5000

20000

10000

10000

5000

5000

10000

10000

10000

Allowable

Decrease

A B C DC D E FE F G HG HA B

combination of unit production costs and the holding cost percentage.) Therefore, if you want to know how the solution will change if you change a single unit production cost or the holding cost percentage, this report does not answer your question. This is one case where a sensitivity analysis with SolverTable is much more straightforward and intuitive. It allows you to change any of the model’s inputs and directly see the effects on the solution.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

13-9 A Comparison of Algebraic and Spreadsheet Models 649

13-9 A COMPARISON OF ALGEBRAIC AND SPREADSHEET MODELS To this point you have seen algebraic optimization models and corresponding spreadsheet models. How do they differ? If you review the two product mix examples in this chapter, we believe you will agree that (1) the algebraic models are quite straightforward and (2) the spreadsheet models are almost direct translations into Excel of the algebraic models. In par- ticular, each algebraic model has a set of x’s that corresponds to the decision variable cell

Modeling Issues We assume that Pigskin uses a six-month planning horizon. Why six months? In multiperiod models such as this, the company has to make forecasts about the future, such as the level of customer demand. Therefore, the length of the planning horizon is usually the length of time for which the company can make reasonably accurate forecasts. Here, Pigskin evidently believes that it can forecast up to six months from now, so it uses a six-month planning horizon. ■

P R O B L E M S

Level A 18. Can you guess the results of a sensitivity analysis on

the initial inventory in the Pigskin model? See if your guess is correct by using SolverTable and allowing the initial inventory to vary from 0 to 10,000 in increments of 1000. Keep track of the values in the decision vari- able cells and the objective cell.

19. Modify the Pigskin model so that there are eight months in the planning horizon. You can make up reasonable values for any extra required data. Don’t forget to modify range names. Then modify the model again so that there are only four months in the planning horizon. Do either of these modifications change the optimal production quantity in month 1?

20. As indicated by the algebraic formulation of the Pigskin model, there is no real need to calculate inventory on hand after production and constrain it to be greater than or equal to demand. An alternative is to calculate ending inventory directly and constrain it to be nonnegative. Modify the current spreadsheet model to do this. (Delete rows 16 and 17, and calculate ending inventory appropriately. Then add an explicit nonnegativity constraint on ending inventory.)

21. In one modification of the Pigskin problem, the maximum storage constraint and the holding cost are based on the average inventory (not ending inventory) for a given month, where the average inventory is defined as the sum of beginning inventory and ending inventory, divided by 2, and beginning inventory is before produc- tion or demand. Modify the Pigskin model with this new

assumption, and use Solver to find the optimal solution. How does this change the optimal production schedule? How does it change the optimal total cost?

Level B 22. Modify the Pigskin spreadsheet model so that except

for month 6, demand does not have to be met on time. The only requirement is that all demand must be met eventually by the end of month 6. How does this change the optimal production schedule? How does it change the optimal total cost?

23. Modify the Pigskin spreadsheet model so that demand in any of the first five months must be met no later than a month late, whereas demand in month 6 must be met on time. For example, the demand in month 3 can be met partly in month 3 and partly in month 4. How does this change the optimal production schedule? How does it change the optimal total cost?

24. Modify the Pigskin spreadsheet model in the following way. Assume that the timing of demand and produc- tion are such that only 70% of the production in a given month can be used to satisfy the demand in that month. The other 30% occurs too late in that month and must be carried as inventory to help satisfy demand in later months. How does this change the optimal production schedule? How does it change the optimal total cost? Then use SolverTable to see how the optimal production schedule and optimal cost vary as the percentage of production usable for this month’s demand (now 70%) is allowed to vary from 20% to 100% in increments of 10%.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

650 Chapter 13 Introduction to Optimization Modeling

range in the spreadsheet model. In addition, each objective and each left side of each con- straint in the spreadsheet model corresponds to a linear expression involving xs in the alge- braic model.

However, the Pigskin production planning model is quite different. The spreadsheet model includes one set of decision variable cells, the production quantities, and everything else is related to these through spreadsheet formulas. In contrast, the algebraic model has two sets of variables, the P’s for the production quantities and the I’s for the ending inven- tories, and together these constitute the decision variables. These two sets of variables must then be related algebraically, and this is done through a series of balance equations.

This is a typical situation in algebraic models, where one set of variables (the pro- duction quantities) corresponds to the real decision variables, and other sets of variables, real decision variables, and other sets of variables, real along with extra equations or inequalities, are introduced to capture the logic. We believe— and this belief is reinforced by many years of teaching experience—that this extra level of abstraction makes algebraic models much more dif�cult for typical users to develop and comprehend. It is the primary reason we have decided to focus almost exclusively on spreadsheet models in this book.

13-10 A DECISION SUPPORT SYSTEM If your job is to develop an LP spreadsheet model to solve a problem such as Pigskin’s production problem, then you will be considered the “expert” in LP. Many people who need to use such models, however, are not experts. They might understand the basic not experts. They might understand the basic not ideas behind LP and the types of problems it is intended to solve, but they will not know the details. In this case it is useful to provide these users with a decision support sys- tem (DSS) that can help them solve problems without having to worry about technical details.

We will not teach you in this book how to build a full-scale DSS, but we will show you what a typical DSS looks like and what it can do.13

We will not teach you in this book how to build a full-scale DSS, but we will show you 13

We will not teach you in this book how to build a full-scale DSS, but we will show you (We consider only DSSs built around

spreadsheets. There are many other platforms for developing DSSs that we will not con- sider.) Basically, a spreadsheet-based DSS contains a spreadsheet model of a problem, such as the one in Figure 13.26. However, as a user, you will probably never even see this model. Instead, you will see a front end and a back end. The front end allows you to select input values for your particular problem. The user interface for this front end can include several features, such as buttons, dialog boxes, toolbars, and menus—the things you are used to seeing in Windows applications. The back end will then produce a report that explains the solution in nontechnical terms.

We illustrate a DSS for a slight variation of the Pigskin problem in the �le Decision Support.xlsm. This �le has three worksheets. When you open the �le, you see the Explanation sheet shown in Figure 13.34. It contains two buttons, one for setting up the problem (getting the user’s inputs) and one for solving the problem (running Solver). When you click the Set Up Problem button, you are asked for the inputs: the initial inventory, the forecasted demands for each month, and others. An example appears in Figure 13.35. These input boxes should be self-explanatory, so that all you need to do is enter the values

13For readers interested in learning more about this DSS, this textbook’s essential resource website includes notes about its development in the �le Developing the Decision Support Application.docx, under Chapter 13 Example Files, and the accompanying videos provide details for developing a slightly less complex DSS for a product mix model. If you are interested in learning more about spreadsheet DSSs in general, Albright has written the book VBA for Modelers, now in its �fth edition. It contains a primer on the VBA language and presents many applications and instructions for creating DSSs with VBA.

Developing a Decision Support System

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Figure 13.35 Dialog Box for Obtaining User Inputs

© C

e n g

a g

e L

e a rn

in g

Figure 13.36 Indication of No Feasible Solutions

© C

e n g

a g

e L

e a rn

in g

13-10 A Decision Support System 651

Pigskin Produc�on Scheduling

Set Up Problem Find Op�mal Solu�on

This applica�on solves a 6-month produc�on planning model similar to the example in the chapter. The onlyr. The onlyr difference is that the produc�on capacity and storage capacity are allowed to vary by month. To run theary by month. To run theary by month. T applica�on, click the le� bu�on to enter inputs. Then click the right bu�on to run Solver and obtain a solu�on report.

Figure 13.34 Explanation Sheet for DSS

© C

e n g

a g

e L

e a rn

in g

you want to try. (To speed up the process, the inputs from the previous run are shown by default.) After you have entered all of these inputs, you can take a look at the Model sheet. This sheet contains a spreadsheet model similar to the one in Figure 13.30 but with the inputs you just entered.

Now go back to the Explanation sheet and click the Find Optimal Solution button. This automatically sets up the Solver dialog box and runs Solver. There are two possibili- ties. First, it is possible that there is no feasible solution to the problem with the inputs you entered. In this case you see a message to this effect, as in Figure 13.36. In most cases,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

652 Chapter 13 Introduction to Optimization Modeling

Monthly schedule

Month 1

Month 2

Units Dollars

Produc�on cost

Holding cost

Dollars

Start with 5000 5000

10000 0

Produce Demand is End with

Units Start with 0

15000 15000

0

Produce Demand is End with

Month 3 Units Start with 0

30000 30000

0

Produce Demand is End with

$62,500

$0

Produc�on cost

Holding cost

$189,750

$0

Dollars

Produc�on cost

Holding cost

$382,500

$0

Figure 13.37 Optimal Solution Report

© C

e n g

a g

e L

e a rn

in g

summarizes the optimal solution in nontechnical terms. Part of one sample output appears in Figure 13.37.

After studying this report, you can then click the Solve Another Problem button, which takes you back to the Explanation sheet so that you can solve a new problem. All of this is done automatically with Excel macros. These macros use Microsoft’s Visual Basic for Applications (VBA) programming language to automate various tasks. In most professional applications, nontechnical people need only to enter inputs and look at reports. Therefore, the Model sheet and VBA code will most likely be hidden and protected from end users.

13-11 CONCLUSION This chapter has provided a good start to LP modeling—and to optimization modeling in general. You have learned how to develop three basic LP spreadsheet models, how to use Solver to �nd their optimal solutions, and how to perform sensitivity analyses with Solver’s sensitivity reports or with the SolverTable add-in. You have also learned how to recognize whether a mathematical programming model satis�es the linear assumptions. In the next chapter you will see a variety of other optimization models, but the three basic steps of model development, Solver optimization, and sensitivity analysis remain the same.

Summary of Key Terms

Term Explanation Excel Page

Linear programming objective and linear constraints, often abbreviated as LP

600

Objective The value, such as profit, to be optimized in an optimization model

601

Constraints Conditions that must be satisfied in an optimization model

601

(continued)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Summary of Key Terms (Continued )

13-11 Conclusion 653

(continued)

Term Explanation Excel Page

Decision variable cells Cells that contain the values of the decision variables

Specify in Solver dialog box

601

Objective cell Cell that contains the value of the objective Specify in Solver dialog box

601

Nonnegativity constraints Constraints that require the decision variables to be nonnegative, usually for physical reasons

601

Feasible solution A solution that satisfies all of the constraints 602

Feasible region The set of all feasible solutions 602

Infeasible solution A solution that doesn’t satisfy all of the constraints

602

Optimal solution The feasible solution that has the best value of the objective

602

Solver Add-in that ships with Excel for performing optimization, developed by Frontline Systems 

Solver on Data ribbon

602

Simplex method An efficient algorithm for finding the optimal solution in a linear programming model

602

Sensitivity analysis Seeing how the optimal solution changes as various input values change

602

Algebraic model A model that expresses the constraints and the objective algebraically

604

Shows the constraints and objective graphically so that the optimal solution can be identified; useful only when there are two decision variables

605

Spreadsheet model A model that uses spreadsheet formulas to express the logic of the model

607

Binding constraint A constraint that holds as an equality 615

Nonbinding constraint An inequality constraint where there is a difference between the two sides of the inequality

615

Solver’s sensitivity report sensitivity to objective coefficients and right sides of constraints

Available in Solver dialog box after Solver runs

616

Amount the objective coefficient of a variable currently equal to zero must change before it is optimal for that variable to be positive (or the amount the objective of a variable currently at its upper bound must change before that variable decreases from its upper bound)

617

Shadow price The change in the objective for a change in the right side of a constraint; indicates amount a company would pay for more of a scarce resource

617

SolverTable Add-in developed by Albright that performs sensitivity analysis to any inputs and reports results in tabular and graphical form

SolverTable tab 619

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

654 Chapter 13 Introduction to Optimization Modeling

Term Explanation Excel Page

Selecting multiple ranges Useful when decision variable cells, e.g., are in noncontiguous ranges

Pressing Ctrl key, drag ranges, one after the other

620

Mathematical programming model

Any optimization model, whether linear, integer, or nonlinear

626

Proportionality, additivity, divisibility

Properties of optimization model that result in a linear programming model

627

Infeasibility Condition where a model has no feasible solutions

629

Unboundedness Condition where there is no limit to the objective; almost always a sign of an error in the model

629

Multiperiod model where only the decision in the first period is implemented, and then a new multiperiod model is solved in succeeding periods

647

Decision support system User-friendly system where an end user can enter inputs to a model and see outputs, but need not be concerned with technical details

650

Summary of Key Terms (Continued )

Conceptual Questions C.1. Suppose you use Solver to find the optimal solution

to a maximization model. Then you remember that you omitted an important constraint. After adding the constraint and running Solver again, is the optimal value of the objective guaranteed to decrease? Why or why not?

C.2. Consider an optimization model with a number of resource constraints. Each indicates that the amount of the resource used cannot exceed the amount available. Why is the shadow price of such a resource constraint always zero when the amount used in the optimal solution is less than the amount available?

C.3. If you add a constraint to an optimization model, and the previously optimal solution satisfies the new constraint, will this solution still be optimal with the new constraint added? Why or why not?

C.4. Why is it generally necessary to add nonnegativity constraints to an optimization model? Wouldn’t Solver automatically choose nonnegative values for the decision variable cells?

C.5. Suppose you have a linear optimization model where linear optimization model where linear you are trying to decide which products to produce to maximize profit. What does the additive assumption

imply about the profit objective? What does the proportionality assumption imply about the profit objective? Be as specific as possible. Can you think of any reasonable profit functions that would not be not be not linear in the amounts of the products produced?

C.6. In a typical product mix model, where a company must decide how much of each product to produce to maximize profit, discuss possible situations where there might not be any feasible solutions. Could these be realistic? If you had such a situation in your company, how might you proceed?

C.7. In a typical product mix model, where a company must decide how much of each product to produce to maximize profit, there are sometimes customer demands for the products. We used upper-bound constraints for these: Don’t produce more than you can sell. Would it be realistic to have lower-bound constraints instead: Produce at least as much as is demanded? Would it be realistic to have both (where the upper bounds are greater than the lower bounds)? Would it be realistic to have equality constraints: Produce exactly what is demanded?

C.8. In a typical production scheduling model like Pigskin’s, if there are no production capacity constraints—the company can produce as much as

P R O B L E M S

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

it needs in any time period—but there are storage capacity constraints and demand must be met on time, is it possible that there will be no feasible solutions? Why or why not?

C.9. In a production scheduling problem like Pigskin’s, suppose the company must produce several products several products several to meet customer demands. Would it suffice to solve a separate model for each product, as we did for Pigskin, or would one big model for all products be necessary? If the latter, discuss what this big model might look like.

C.10. In any optimization model such as those in this chapter, we say that the model is unbounded (and Solver will indicate as such) if there is no limit to the value of the objective. For example, if the objective is profit, then for any dollar value, no mat- ter how large, there is a feasible solution with profit at least this large. In the real world, why are there never any unbounded models? If you run Solver on a model and get an “unbounded” message, what should you do?

Level A 25. A chemical company manufactures three chemicals:

A, B, and C. These chemicals are produced via two

for an hour costs $400 and yields 300 units of A, 100 units of B, and 100 an hour costs $100 and yields 100 units of A and 100 units of B. To meet customer demands, at least 1000 units of A, 500 units of B, and 300 units of C must be produced daily. a. Use Solver to determine a daily production plan

that minimizes the cost of meeting the company’s daily demands.

b. Confirm graphically that the daily production plan from part a minimizes the cost of meeting the company’s daily demands.

c. Use SolverTable to see what happens to the decision variables and the total cost when the hourly processing cost for process 2 increases in increments of $0.50. How large must this cost increase be before the decision variables change? What happens when it continues to increase beyond this point?

26. A furniture company manufactures desks and chairs. Each desk uses four units of wood, and each chair uses three units of wood. A desk contributes $400 to profit, and a chair contributes $250. Marketing restrictions require that the number of chairs produced be at least twice the number of desks produced. There are 2000 units of wood available. a. Use Solver to maximize the company’s profit.

b. Confirm graphically that the solution in part a maximizes the company’s profit.

c. Use SolverTable to see what happens to the decision variables and the total profit when the availability of wood varies from 1000 to 3000 in 100-unit increments. Based on your findings, how much would the company be willing to pay for each extra unit of wood over its current 2000 units? How much profit would the company lose if it lost any of its current 2000 units?

27. A farmer in Iowa owns 450 acres of land. He is going to plant each acre with wheat or corn. Each acre planted with wheat yields $2000 profit, requires three workers, and requires two tons of fertilizer. Each acre planted with corn yields $3000 profit, requires two workers, and requires four tons of fertilizer. There are currently 1000 workers and 1200 tons of fertilizer available. a. Use Solver to help the farmer maximize the profit

from his land. b. Confirm graphically that the solution from part a

maximizes the farmer’s profit from his land. c. Use SolverTable to see what happens to the

decision variables and the total profit when the availability of fertilizer varies from 200 tons to 2200 tons in 100-ton increments. When does the farmer discontinue producing wheat? When does he discontinue producing corn? How does the profit change for each 10-ton increment?

28. During the next four months, a customer requires, respectively, 500, 650, 1000, and 700 units of a commodity, and no backlogging is allowed (that is, the customer’s requirements must be met on time). Production costs are $50, $80, $40, and $70 per unit during these months. The storage cost from one month to the next is $20 per unit (assessed on ending inventory). It is estimated that each unit on hand at the end of month 4 can be sold for $60. Assume there is no beginning inventory. a. Determine how to minimize the net cost incurred in

meeting the demands for the next four months. b. Use SolverTable to see what happens to the

decision variables and the total cost when the initial inventory varies from 0 to 1000 in 100-unit increments. How much lower would the total cost be if the company started with 100 units in inventory, rather than none? Would this same cost decrease occur for every 100-unit increase in initial inventory?

29. A company faces the following demands during the next three weeks: week 1, 2000 units; week 2, 1000 units; week 3, 1500 units. The unit production costs during each week are as follows: week 1, $130; week 2, $140; week 3, $150. A holding cost of $20 per unit is assessed against each week’s ending inventory. At

13-11 Conclusion 655 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

656 Chapter 13 Introduction to Optimization Modeling

the beginning of week 1, the company has 500 units on hand. In reality, not all goods produced during a month can be used to meet the current month’s demand. To model this fact, assume that only half of the goods produced during a week can be used to meet the current week’s demands. a. Determine how to minimize the cost of meeting the

demand for the next three weeks. b.

Dt + kCt, where Dt is the original demand (from t is the original demand (from t above) in month t, k is a given factor, and k is a given factor, and k Ct is an t is an t amount of change in month t demand. Develop the t demand. Develop the t model in such a way that you can use SolverTable to analyze changes in the amounts produced and the total cost when k varies from k varies from k 0 to 10 in 1-unit increments, for any fixed values of the C s. For example, try this when C1 = 200, C2 = 500, and C3 = 300. Describe the behavior you observe in the table. Can you find any reasonable C’s that induce positive production levels in week 3?

30. Maggie Stewart loves desserts, but due to weight and cholesterol concerns, she has decided that she must plan her desserts carefully. There are two possible desserts she is considering: snack bars and ice cream. After reading the nutrition labels on the snack bar and ice cream packages, she learns that each serving of a snack bar weighs 37 grams and contains 120 calories and 5 grams of fat. Each serving of ice cream weighs 65 grams and contains 160 calories and 10 grams of fat. Maggie will allow herself no more than 450 calories and 25 grams of fat in her daily desserts, but because she loves desserts so much, she requires at least 120 grams of dessert per day. Also, she assigns a “taste index” to each gram of each dessert, where 0 is the lowest and 100 is the highest. She assigns a taste index of 95 to ice cream and 85 to snack bars (because she prefers ice cream to snack bars). a. Use Solver to find the daily dessert plan that stays

within her constraints and maximizes the total taste index of her dessert.

b. Confirm graphically that the solution from part a maximizes Maggie’s total taste index.

c. Use a two-way Solver table to see how the optimal dessert plan varies when the calories per snack bar and per ice cream vary. Let the former vary from 80 to 200 in increments of 10, and let the latter vary from 120 to 300 in increments of 10.

31. For a telephone survey, a marketing research group needs to contact at least 600 wives, 480 husbands, 400 single adult males, and 440 single adult females. It costs $3 to make a daytime call and (because of higher labor costs) $5 to make an evening call. The file P13_31.xlsx lists the results that can be expected. For example, 30% of all daytime calls are answered by a wife, 15% of all evening calls are answered by a single

male, and 40% of all daytime calls are not answered at all. Due to limited staff, at most 40% of all phone calls can be evening calls. a. Determine how to minimize the cost of completing

the survey. b. Use SolverTable to investigate changes in the unit

cost of either type of call. Specifically, investigate changes in the cost of a daytime call, with the cost of an evening call fixed, to see when (if ever) only daytime calls or only evening calls will be made. Then repeat the analysis by changing the cost of an evening call and keeping the cost of a daytime call fixed.

32. A furniture company manufactures tables and chairs. Each table and chair must be made entirely out of oak or entirely out of pine. A total of 15,000 board feet of oak and 21,000 board feet of pine are available. A table requires either 17 board feet of oak or 30 board feet of pine, and a chair requires either 5 board feet of oak or 13 board feet of pine. Each table can be sold for $800, and each chair for $300. a. Determine how the company can maximize its

revenue. b. Use SolverTable to investigate the effects of

simultaneous changes in the selling prices of the products. Specifically, see what happens to the total revenue when the selling prices of oak products and the selling prices of pine products are allowed to vary (independently) by as much as plus or minus 30%, in increments of 10%, from

previous problem so that you can use SolverTable to investigate these changes. Can you conclude that total revenue changes linearly within this range?

33. A manufacturing company makes two products. Each product can be made on either of two machines. The time (in hours) required to make each product on each machine is listed in the file P13_33.xlsx. Each month, 500 hours of time are available on each machine. Each month, customers are willing to buy up to the quantities of each product at the prices also given in the same file. The company’s goal is to maximize the revenue obtained from selling units during the next two months. a. Determine how the company can meet this goal.

Assume that it will not produce any units in a month that it cannot sell in that month.

b. Use SolverTable to see what happens if customer demands for each product in each month simultaneously change by as much as plus or minus 30%, in increments of 10%, from their

can use SolverTable to investigate the effect of these changes on total revenue. Does revenue change in a linear manner over this range? Can

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

you explain intuitively why it changes in the way it does?

34. emits two types of pollutants, labeled P1 and P2, into the river. If the waste from each factory is processed, the pollution in the river can be reduced. It costs $1500 to process a ton of factory 1 waste, and each ton processed reduces the amount of P1 by 0.10 ton and the amount of P2 by 0.45 ton. It costs $1000 to process a ton of factory 2 waste, and each ton processed reduces the amount of P1 by 0.20 ton and the amount of P2 by 0.25 ton. It costs $2000 to process a ton of factory 3 waste, and each ton processed reduces the amount of P1 by 0.40 ton and the amount of P2 by 0.30 ton. The state wants to reduce the amount of P1 in the river by at least 30 tons and the amount of P2 by at least 40 tons. a. Use Solver to determine how to minimize the cost

of reducing pollution by the desired amounts. Are the LP proportionality and additivity assumptions reasonable in this problem?

b. Use SolverTable to investigate the effects of increases in the minimal reductions required by the state. Specifically, see what happens to the amounts of waste processed at the three factories and the total cost if both requirements (currently 30 and 40 tons, respectively) are increased by the same

SolverTable to investigate these changes when the percentage increase varies from 10% to 100% in increments of 10%. Do the amounts processed at the three factories and the total cost change in a linear manner?

Level B 35. A company manufactures two types of trucks. Each

truck must go through the painting shop and the assembly shop. If the painting shop were completely devoted to painting type 1 trucks, 800 per day could be painted, whereas if the painting shop were completely devoted to painting type 2 trucks, 700 per day could be painted. If the assembly shop were completely devoted to assembling truck 1 engines, 1500 per day could be assembled, whereas if the assembly shop were completely devoted to assembling truck 2 engines, 1200 per day could be assembled. It is possible, however, to paint both types of trucks in the painting shop. Similarly, it is possible to assemble both types in the assembly shop. Each type 1 truck contributes $1000 to profit; each type 2 truck contributes $1500. Use Solver to maximize the company’s profit. (Hint: One approach, but not the only approach, is to try a graphical procedure first and then deduce the constraints from the graph.)

36. A company manufactures mechanical heart valves from the heart valves of pigs. Different heart operations require valves of different sizes. The company purchases pig valves from three different suppliers. The cost and size mix of the valves purchased from each supplier are given in the file P13_36.xlsx. Each month, the company places an order with each supplier. At least 500 large, 300 medium, and 300 small valves must be purchased each month. Because of the limited availability of pig valves, at most 500 valves per month can be purchased from each supplier. a. Use Solver to determine how the company can

minimize the cost of acquiring the needed valves. b. Use SolverTable to investigate the effect on

total cost of increasing its minimal purchase requirements each month. Specifically, see how the total cost changes as the minimal purchase requirements of large, medium, and small valves all increase from their original values by the same

can be used to investigate these changes when the percentage increase varies from 2% to 20% in increments of 2%. Explain intuitively what happens when this percentage is at least 16%.

37. A company that builds sailboats wants to determine how many sailboats to build during each of the next four quarters. The demand during each of the next four quarters is as follows: first quarter, 160 sailboats; sec- ond quarter, 240 sailboats; third quarter, 300 sailboats; fourth quarter, 100 sailboats. The company must meet demands on time. At the beginning of the first quarter, the company has an inventory of 40 sailboats. At the beginning of each quarter, the company must decide how many sailboats to build during that quarter. For simplicity, assume that sailboats built during a quarter can be used to meet demand for that quarter. During each quarter, the company can build up to 160 sailboats with regular-time labor at a total cost of $1600 per sailboat. By having employees work overtime during a quarter, the company can build additional sailboats with overtime labor at a total cost of $1800 per sailboat. At the end of each quarter (after production has occurred and the current quarter’s demand has been satisfied), a holding cost of $80 per sailboat is incurred. a. Determine a production schedule to minimize the

sum of production and inventory holding costs during the next four quarters.

b. Use SolverTable to see whether any changes in the $80 holding cost per sailboat could induce the

your model so that SolverTable can be used to investigate the effects on ending inventory during the four-quarter period of systematic changes in

13-11 Conclusion 657 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

658 Chapter 13 Introduction to Optimization Modeling

the unit holding cost. (Assume that even though the unit holding cost changes, it is still constant over the four-quarter period.) Are there any (nonnegative) unit holding costs that would induce the company to hold more inventory than it holds when the holding cost is $80? Are there any unit holding costs that would induce the company to hold less inventory than it holds when the holding cost is $80?

38. During the next two months an automobile manufacturer must meet (on time) the following demands for trucks and cars: month 1, 400 trucks and 800 cars; month 2, 300 trucks and 300 cars. During each month at most 1000 vehicles can be produced. Each truck uses two tons of steel, and each car uses one ton of steel. During month 1, steel costs $700 per ton; during month 2, steel is projected to cost $800 per ton. At most 2500 tons of steel can be purchased each month. (Steel can be used only during the month in which it is purchased.) At the beginning of month 1, 100 trucks and 200 cars are in the inventory. At the end of each month, a holding cost of $200 per vehicle is assessed. Each car gets 20 miles per gallon (mpg), and each truck gets 10 mpg. During each month, the vehicles produced by the company must average at least 16 mpg. a. Determine how to meet the demand and mileage

requirements at minimum total cost. b. Use SolverTable to see how sensitive the total

cost is to the 16 mpg requirement. Specifically, let this requirement vary from 14 mpg to 18 mpg in increments of 0.25 mpg. Explain intuitively what happens when the requirement is greater than 17 mpg.

39. A textile company produces shirts and pants. Each shirt requires two square yards of cloth, and each pair of pants requires three square yards of cloth. During the next two months the following demands for shirts and pants must be met (on time): month 1, 1000 shirts and 1500 pairs of pants; month 2, 1200 shirts and 1400 pairs of pants. During each month the following resources are available: month 1, 9000 square yards of cloth; month 2, 6000 square yards of cloth. In addition, cloth that is available during month 1 and is not used can be used during month 2. During each month it costs $8 to produce an article of clothing with regular-time labor and $16 with overtime labor. During each month a total of at most 2500 articles of clothing can be produced with regular-time labor, and an unlimited number of articles of clothing can be produced with overtime labor. At the end of each month, a holding cost of $3 per article of clothing is incurred. a. Determine how to meet demands for the next two

months (on time) at minimum cost. Assume that

100 shirts and 200 pairs of pants are already in inventory at the beginning of month 1.

b. Use a two-way SolverTable to investigate the effect on total cost of two simultaneous changes. The first change is to allow the ratio of overtime to regular- time production cost (currently $16/$8 = 2) to decrease from 20% to 80% in increments of 20%, while keeping the regular time cost at $8. The second change is to allow the production capacity each month (currently 2500) to decrease by 10% to 50% in increments of 10%. The idea here is that less regular-time capacity is available, but overtime becomes relatively cheaper. Is the net effect on total cost positive or negative?

40. Each year, a shoe manufacturing company faces demands (which must be met on time) for pairs of shoes as shown in the file P13_40.xlsx. Employees work three consecutive quarters and then receive one quarter off. For example, a worker might work during quarters 3 and 4 of one year and quarter 1 of the next year. During a quarter in which an employee works, he or she can produce up to 500 pairs of shoes. Each worker is paid $5000 per quarter. At the end of each quarter, a holding cost of $10 per pair of shoes is incurred. a. Determine how to minimize the cost per year (labor

plus holding) of meeting the demands for shoes. To simplify the model, assume that at the end of each year, the ending inventory is 0. (You can assume that a given worker gets the same quarter off during each year.)

b. Suppose the company can pay a flat fee for a training program that increases the productivity of all of its workers. Use SolverTable to see how much the company would be willing to pay for a training program that increases worker productivity from 500 pairs of shoes per quarter to P pairs of shoes per quarter, where P varies from 525 to 700 in increments of 25.

41. A small appliance manufacturer must meet (on time) the following demands: quarter 1, 3000 units; quarter 2, 2000 units; quarter 3, 4000 units. Each quarter, up to 2700 units can be produced with regular-time labor, at a cost of $40 per unit. During each quarter, an unlimited number of units can be produced with overtime labor, at a cost of $60 per unit. Of all units produced, 20% are unsuitable and cannot be used to meet demand. Also, at the end of each quarter, 10% of all units on hand spoil and cannot be used to meet any future demands. After each quarter’s demand is satisfied and spoilage is accounted for, a cost of $15 per unit in ending inventory is incurred. a. Determine how to minimize the total cost of

meeting the demands of the next three quarters.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Assume that 1000 usable units are available at the beginning of quarter 1.

b. The company wants to know how much money it would be worth to decrease the percentage of unsuitable items and/or the percentage of items that spoil. Write a short report that provides relevant information. Base your report on three uses of SolverTable: (1) where the percentage of unsuitable items decreases and the percentage of items that spoil stays at 10%, (2) where the percentage of unsuitable items stays at 20% and the percentage of items that spoil decreases, and (3) where both percentages decrease. Does the sum of the separate effects on total cost from the first two tables equal the combined effect from the third table? Include an answer to this question in your report.

42. A pharmaceutical company manufactures two drugs at Los Angeles and Indianapolis. The cost of manufacturing a pound of each drug depends on the manufacturing a pound of each drug depends on the manuf location, as indicated in the file P13_42.xlsx. The machine time (in hours) required to produce a pound of each drug at each city is also shown in this table. The company must produce at least 1000 pounds per week of drug 1 and at least 2000 pounds per week of drug 2. It has 500 hours per week of machine time at Indianapolis and 400 hours per week at Los Angeles. a. Determine how the company can minimize the cost

of producing the required drugs.

b. Use SolverTable to determine how much the company would be willing to pay to purchase a combination of A extra hours of machine time at Indianapolis and B extra hours of machine time at Los Angeles, where A and B can be any positive multiples of 10 up to 50.

43. A company manufactures two products on two machines. The number of hours of machine time and labor depends on the machine and product as shown in the file P13_43.xlsx. The cost of producing a unit of each product depends on which machine produces it. These unit costs also appear in the same file. There are 200 hours available on each of the two machines, and there are 400 labor hours available total. This month at least 200 units of product 1 and at least 240 units of product 2 must be produced. Also, at least half of the product 1 requirement must be produced on machine 1, and at least half of the product 2 requirement must be produced on machine 2. a. Determine how the company can minimize the cost

of meeting this month’s requirements. b. Use SolverTable to see how much the “at least

half” requirements are costing the company. Do this by changing both of these requirements from “at least half” to “at least x percent,” where x can be any multiple of 5% from 0% to 50%.

Shelby Shelving is a small company that manufactures two types of shelves for grocery stores. Model S is the standard model; model LX is a heavy-duty version. Shelves are manufactured in three major steps: stamping, forming, and assembly. In the stamping stage, a large machine is used to stamp (i.e., cut) standard sheets of metal into appropriate sizes. In the forming stage, another machine bends the metal into shape. Assembly involves joining the parts with a combination of soldering and riveting. Shelby’s stamping and forming machines work on both models of shelves. Separate assembly departments are used for the final stage of production.

The file C13_01.xlsx contains relevant data for Shelby. (See Figure 13.38.) The hours required on each machine for each unit of product are shown in the range B5:C6 of the Accounting Data sheet. For example, the production of one model S shelf requires 0.25 hour on the forming machine. Both the stamping and forming machines can operate for 800 hours each month. The model S assembly department has a monthly capacity of 1900 units. The model LX assembly department has a monthly capacity of only 1400 units. Currently Shelby is producing and selling 400 units of model S and 1400 units of model LX per month.

Case 13.1 Shelby Shelving 659

C A S E 13.1 SHELBY SHELVING

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

660 Chapter 13 Introduction to Optimization Modeling

Model S shelves are sold for $1800, and model LX shelves are sold for $2100. Shelby’s operation is fairly small in the industry, and management at Shelby believes it cannot raise prices beyond these levels because of the competition. However, the marketing department believes that Shelby can sell as much as it can produce at these prices. The costs of production are summarized in the Accounting Data sheet. As usual, values in blue cells are given, whereas other values are calculated from these.

Management at Shelby just met to discuss next month’s operating plan. Although the shelves are selling well, the overall profitability of the company is a concern. The plant’s engineer suggested that the current production of model S shelves be cut back. According to him, “Model S shelves are sold for $1800 per unit, but our costs are $1839. Even though we’re selling only 400 units a month, we’re losing money on each one. We should decrease production of model S.” The controller disagreed. He said that the problem was the model S assembly department trying to absorb a large overhead with a small production volume. “The model S units are making a contribution to overhead. Even though production doesn’t cover all of the fixed costs, we’d be worse off with lower production.”

Your job is to develop an LP model of Shelby’s problem, then run Solver, and finally make a

recommendation to Shelby management, with a short verbal argument supporting the engineer or the controller.

Notes on Accounting Data Calculations The fixed overhead is distributed using activity-based costing principles. For example, at current production levels, the forming machine spends 100 hours on model S shelves and 700 hours on model LX shelves. The forming machine is used 800 hours of the month, of which 12.5% of the time is spent on model S shelves and 87.5% is spent on model LX shelves. The $95,000 of fixed overhead in the forming department is distributed as $11,875 (= 95,000 × 0.125) to model S shelves and $83,125 (= 95,000 × 0.875) to model LX shelves. The fixed overhead per unit of output is allocated as $29.69 (= 11,875/400) for model S and $59.38 (= 83,125/1400) for model LX. In the calculation of the standard overhead cost, the fixed and variable costs are added together, so that the overhead cost for the forming department allocated to a model S shelf is $149.69 (= 29.69 + 120, shown in cell G20 rounded up to $150). Similarly, the overhead cost for the forming department allocated to a model LX shelf is $229.38 (= 59.38 + 170, shown in cell H20 rounded down to $229).

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

A BA B C DC D E FE F G HG H I Shelby Shelving Data for CurrShelby Shelving Data for CurrShelby Shelving Data f ent Produc on Schedule

Machine requirements (hours per unit) Given monthly overhead cost data Model S Model LX Fixed Variable S Variable LX

$90$80$125,0000.30.3Stamping $170$120$95,000

$80,000 $85,000

0.5

Available 800 8000.25Forming

Model S Assembly $165 $0 Model S Model LX Model LX Assembly $0 $185

Current monthly produc�on 400 1400

Hours spent in departments Model S Model LX Model S Model LX Totals Direct materials $1,000 $1,200

Direct labor:540420120Stamping 800700100Forming

Stamping Forming

Stamping Forming

Stamping Forming

Stamping Forming

$35 $35 $60 $90

Percentages of �me spent in departments Assembly $80 $85 Model S Model LX Total direct labor $175 $210

Overhead alloca�on 77.8%22.2% 87.5%12.5% $149 $159

$150 $229 Unit selling price $1,800 $2,100 Assembly $365 $246

Total overhead $664 $635 Assembly capacity 1900 1400 Total cost $1,839 $2,045

) G S M

) G) G d V

S M X M

S M

s As A

X M

s D

s A

) G

X M

s D

s A

Standard costs of the shelves -- based on the current produc�on levelsbased on the current produc�on levelsbased on the current produc�on level

Figure 13.38 Data for Shelby Case

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

661

PRODUCTION, INVENTORY, AND DISTRIBUTION AT KELLOGG

The Kellogg Company is the largest cereal producer in the world and is a leading producer of convenience foods. Its worldwide sales in 1999 were nearly $7 billion. Kellogg’s first product in 1906 was Corn Flakes, and 7 billion. Kellogg’s first product in 1906 was Corn Flakes, and 7 it developed a variety of ready-to-eat cereals over the years, including Raisin Bran, Rice Krispies, Corn Pops, and others. Although the company continues to develop and market new cereals, it has also gone into convenience foods, such as Pop-Tarts and Nutri-Grain cereal bars, and has also entered the health- food market. Kellogg produces hundreds of products and sells thousands of stock-keeping units (SKUs). Managing production, inventory, and distribution of these—that is, the daily operations—in a cost-effective manner is a challenge.

By the late 1980s, Kellogg realized that the increasing scale and complexity of its operations required optimization methods to coordinate its daily operations in a centralized manner. As described in Brown et al. (2001), a team of management scientists developed an optimization software system called KPS (Kellogg Planning System). This system was originally intended for operational (daily and weekly) decisions, but it expanded into a system for making tactical (longer-range) decisions about issues such as plant budgets, capacity expansion, and consolidation. By the turn of the century, KPS had been in use for about a decade. Operational decisions made by KPS reduced production, inventory, and distribution costs by approximately $4.5 million per year. Better yet, the tactical side of KPS recently suggested a consolidation of production capacity that saved the company approximately $35–40 million annually.

Kellogg operates five plants in the United States and Canada, has seven distribution centers (DCs) in such areas as Los Angeles and Chicago, and has

Optimization Models

C H A P T E R

14

Ju a n m

o n in

o /iS

to c kp

h o to

.c o

m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

662 Chapter 14 Optimization Models

about 15 co-packers, companies that contract to produce or pack some of Kellogg’s products. Customer demands are seen at the DCs and the plants. In the cereal business alone, Kellogg has to coordinate the packaging, inventorying, and distributing of 600 SKUs at about 27 locations with a total of about 90 production lines and 180 packaging lines. This requires a tremendous amount of day-to-day coordination to meet customer demand at a low cost. The KPS operational system that guides operational decisions is essentially a large linear programming (LP) model that takes as its inputs the forecasted customer demands for the various products and specifies what should be produced, held, and shipped on a daily basis. The resulting model is similar to the Pigskin model of football production discussed in the previous chapter, except that it is much larger.

Specifically, for each week of its 30-week planning horizon, the model specifies (1) how much of each product to make on each production line at each facility; (2) how much of each SKU to pack on each packaging line at each facility; (3) how much inventory of each SKU to hold at each facility; and (4) how much of each SKU to ship from each location to other locations. In addition, the model has to take constraints into account. For example, the production within a given plant in a week cannot exceed the processing line capacity in that plant. LP models such as Kellogg’s tend to be very large— thousands of decision variables and hundreds or thousands of constraints—but the algorithms Kellogg uses are capable of optimizing such models very quickly. Kellogg runs its KPS model each Sunday morning and uses its recommendations in the ensuing week.

The KPS system illustrates a common occurrence when companies turn to manage- ment science for help. As stated earlier, the system was originally developed for making daily operational decisions. Soon, however, the company developed a tactical version of KPS for long-range planning on the order of 12 to 24 months. The tactical model is similar to the operational model except that time periods are now months, not days or weeks, and other considerations must be handled, such as limited product shelf lives. The point is, however, that when companies such as Kellogg become comfortable with management science methods in one part of their operations, they often look for other areas to apply similar methods. As with Kellogg, such methods can save the company millions of dollars. ■

14-1 INTRODUCTION In a survey of Fortune 500 �rms, 85% of those responding said that they use optimization. In this chapter we discuss some of the optimization models that are most often applied to real-world applications. Some typical examples include:

■ scheduling bank clerks for check encoding

■ optimizing the operation of an oil re�nery

■ planning dairy production at a creamery

■ scheduling production of products at a �berglass manufacturer

■ optimizing a Wall Street �rm’s bond portfolio.

There are two basic goals in this chapter. The �rst is to illustrate some of the many real applications that can take advantage of optimization. You will see that these applications cover a wide range, from oil production to worker scheduling to cash management. The second goal is to increase your facility in modeling optimization problems on a spread- sheet. We present a few principles that will help you model a wide variety of problems. The best way to learn, however, is to see many examples and work through numerous problems. In short, mastering the art of spreadsheet optimization modeling takes hard work and practice. You will have plenty of opportunity to do both with the material in this chapter.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-2 Employee Scheduling Models 663

Although a wide variety of problems can be formulated as linear programming linear programming linear models, there are some that cannot. Either they require integer variables or they are integer variables or they are integer nonlinear in the nonlinear in the nonlinear decision variables. We include examples of integer programming and nonlinear programming models in this chapter, just to give you a taste of what is involved.1 decision variables. We include examples of integer programming and nonlinear programming

1 decision variables. We include examples of integer programming and nonlinear programming

You will see that the mod- eling process for these types of problems is not much different than for linear optimization problems. Once the models are formulated, Excel’s Solver can be used to solve them. Then SolverTable can be used to perform sensitivity analysis. However, we point out that these integer and nonlinear models are inherently more dif�cult to solve. Solver must use more complex algorithms and is not always guaranteed to �nd the optimal solution. As long as you are aware of this, you will see that Solver provides the power to solve a great variety of realistic business problems.

Although there is a tremendous amount of theory behind the algorithms that solve these problems, the modeling process itself is fairly straightforward, and you can learn it best by seeing a variety of examples. Therefore, we proceed in this chapter by modeling (and then solving) a diverse class of problems that arise in business. The exercises throughout the chapter provide even more examples of how optimization models can be applied.

All of these models can bene�t from sensitivity analysis, either done formally with the SolverTable add-in or informally by changing one or more inputs and rerunning Solver. To keep the chapter from being too long, we present only a few of the many possible sensitivity analyses. However, we stress that in real applications, model development is just the begin- ning of the overall analysis. It is then usually followed by extensive sensitivity analysis.

14-2 EMPLOYEE SCHEDULING MODELS Many organizations must determine how to schedule employees to provide adequate ser- vice. The following example illustrates how to use linear programming (with integer con- straints) to schedule employees on a daily basis.

1Besides the nonlinear models discussed in this chapter, which can be solved with Solver’s GRG nonlinear algo- rithm, there is an even more dif�cult class of nonlinear models called nonsmooth models. Although we will not discuss nonsmooth models, we can recommend Solver’s Evolutionary algorithm for these dif�cult models. (This is available only in the version of Solver introduced in Excel® discuss nonsmooth models, we can recommend Solver’s Evolutionary algorithm for these dif�cult models. (This

® discuss nonsmooth models, we can recommend Solver’s Evolutionary algorithm for these dif�cult models. (This

2010.) These nonsmooth problems can also be solved with the Evolver add-in, part of Palisade’s DecisionTools®

2010.) These nonsmooth problems can also be ® 2010.) These nonsmooth problems can also be Suite, but we won’t discuss Evolver in this book.

E X A M P L E 14.1 EMPLOYEE SCHEDULING

Asmall business requires different numbers of full-time employees on different days of the week. The number of full-time employees required each day is given in Table 14.1. Union rules state that each full-time employee must work five consecutive days and then receive two days off. For example, an employee who works Monday to Friday must be off on Saturday and Sunday. The company wants to meet its daily requirements using only full-time employees. Its objective is to minimize the number of full-time employees on its payroll.

Table 14.1 Employee Requirements Day of Week Minimum Number of Employees Required

Monday 17 Tuesday 13 Wednesday 15 Thursday 19 Friday 14 Saturday 16 Sunday 11

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

664 Chapter 14 Optimization Models

In real employee- scheduling problems, much of the work involves forecasting and queueing analysis to obtain employee requirements. This must be done before an optimal schedule can be found.

The key to this model is choosing the correct decision variables.

Choosing the Decision Variable Cells The decision variable cells should always be cho- sen so that their values determine all required outputs in the model. In other words, their val- ues should tell the company exactly how to run its business. Sometimes the choice of decision vari- able cells is obvious, but in many cases (as in this

employee scheduling model), the proper choice of decision variable cells takes some deeper thinking about the problem. An improper choice of deci- sion variable cells typically leads to a dead end, where their values do not supply enough informa- tion to calculate required outputs or implement certain constraints.

F u n da m e n ta l I n s i g h t

Objective To develop an optimization model that relates five-day shift schedules to daily numbers of employees available, and to use Solver on this model to find a schedule that uses the fewest number of employees and meets all daily workforce requirements.

Where Do the Numbers Come From? The only inputs needed for this problem are the minimum employee requirements in Table 14.1, but these are not easy to obtain. They would probably be obtained through a combination of two quantitative techniques: forecasting (Chapter 12) and queueing analy- sis (not covered in this book). The post office would first use historical data to forecast customer and mail arrival patterns throughout a typical week. It would then use queueing analysis to translate these arrival patterns into employee requirements on a daily basis. Actually, we have kept the problem relatively simple by considering only daily require- ments. In a realistic setting, the organization might forecast employee requirements on an hourly or even a 15-minute basis.

Solution A diagram of this model appears in Figure 14.1. (See the file Employee Scheduling Big Picture.xlsx.) The trickiest part is identifying the appropriate decision variables. You might think that the decision variables are the numbers of employees working on the various days of the week. Clearly, these values must eventually be determined. However, it is not enough to specify, say, that 18 employees are working on Monday. The problem is that this doesn’t indicate when these 18 employees start their five-day shifts. Without this knowledge, it is impossible to implement the five-consecutive-day, two-day-off requirement. (If you don’t believe this, try developing your own model with the wrong decision variables. You will eventually reach a dead end.)

The trick is to define the decision variables as the numbers of employees working each of the seven possible five-day shifts. By knowing these values, the other output variables can be calculated. For example, the number working on Thursday is the sum of those who begin their five-day shifts on Sunday, Monday, Tuesday, Wednesday, and Thursday.

Note that this is a “wraparound” problem. We assume that the daily requirements in Table 14.1 and the employee schedules continue week after week. So, for example, the

Figure 14.1 Big Picture for Employee Scheduling Model

Employees from Each Shi� Available

Total Employees Available

Employees Required

Employees Star�ng 5-Day Shi�

>=

Minimize Tot Tot T al Employees

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-2 Employee Scheduling Models 665

employees assigned to the Thursday through Monday shift always wrap around from one week to the next on their five-day shift.

Developing the Spreadsheet Model The spreadsheet model for this problem is shown in Figure 14.2. (See the file Employee Scheduling.xlsx.) To develop this model, proceed as follows.

1. Inputs and range names. Enter the number of employees needed on each day of the week (from Table 14.1) in the blue cells, and create the range names shown.

2. Employees beginning each day. Enter any trial values for the number of employees beginning work on each day of the week in the Employees_starting range. These beginning days determine the possible five-day shifts. For example, the employees in cell B4 work Monday through Friday.

3. Employees on hand each day. The key to this solution is to realize that the numbers in the Employees_starting range—the decision variable cells—do not represent the number of employees who will show up each day. As an example, the number in cell B4 represent those who start on Monday work Monday through Friday. Therefore, enter the formula

=$B$4

in cell B14 and copy it across to cell F14. Proceed similarly for rows 15–20, being careful to take “wraparounds” into account. For example, the workers starting on Thursday work Thursday through Sunday, plus Monday. Then calculate the total number who are available on each day by entering the formula

=SUM(B14:B20)

in cell B23 and copying it across row 23.

Developing the Employee Scheduling Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I JI J K Employee scheduling model Range names used

Employees_available

Employees_Star�ng Decision variables: number of employees star�ng their five-day shi� on various days Employees_required

1.33Mon 3.33Tue 2.00Wed 7.33Thu 0.00Fri 3.33

3.33 3.33 3.33 3.33 3.33

Sat 5.00

3.33 3.33 3.33 3.33 5.00 5.00 5.00 5.00

Sun

Mon Tue Wed Thu Fri Sat Sun

Result of decisions: number of employees working on various days (along top) who started their shi� on various days (along side) Mon Tue Wed Thu Fri Sat Sun 1.33 1.33 1.33 1.33 1.33

2.002.002.002.00 7.33 7.33 7.33 7.33 0.00 0.00 0.00 0.00

3.33

2.00 7.33 0.00

5.00

Constraint on employee availabili�es Employees available

Employees required

17.00 13.00 15.00 19.00 14.00 16.00 17.67 >= >= >= >= >= >= >= 17 13 15 19 14 16 11

Objec�ve to maximize Total employees

Total_employees

22.33

n T i S

=Model!$B$4:$B$10 =Model!$B$28

=Model!$B$25:$H$25 =Model!$B$23:$H$23

Figure 14.2 Employee Scheduling Model with Optimal (Non-Integer) Solution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

666 Chapter 14 Optimization Models

Excel Tip: Ctrl+Enter Shortcut You often enter a typical formula in a cell and then copy it. One way to do this ef�ciently is to select the entire range, here B23:H23. Then enter the typical formula, here =SUMUMU (B1(B1( 4:B20), and press Ctrl+Enter. This has the same effect as copying, but it is slightly quicker.

4. Total employees. Calculate the total number of employees in cell B28 with the formula

=SUM(Employees_starting) Note that there is no double-counting in this sum. For example, the employees in cells B4 and B5 are not the same people.not the same people.not

At this point, you might want to experiment with the numbers in the decision variable cell range to see whether you can guess an optimal solution (without looking at Figure 14.2). It is not that easy. Each employee who starts on a given day works the next four days as well, so when you find a solution that meets the minimal requirements for the various days, you usually have a few more employees available on some days than are needed.

Using Solver Invoke Solver and fill out its main dialog box as shown in Figure 14.3. (You don’t need to include the integer constraint yet. This will be discussed shortly.) Make sure you check the Non-Negative option and select the Simplex LP method.

Figure 14.3 Solver Dialog Box for Employee Scheduling Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-2 Employee Scheduling Models 667

Discussion of the Solution The optimal solution shown in Figure 14.2 has one drawback: It requires the number of employees starting work on some days to be a fraction. Because part-time employees are not allowed (an assumption of the model), this solution is unrealistic. However, it is simple to add an integer constraint on the decision variable cells. This integer constraint appears in Figure 14.3. (To create this integer constraint in Solver’s Add Constraint dialog box, select the Employees_starting for the left side, and select “int” in the middle dropdown list. The word “integer” will automatically appear in the right side of the constraint.) With this integer con- straint, the optimal solution appears in Figure 14.4.

Technical Tip: Solver Integer Optimality Setting When working with integer constraints, you should be aware of Solver’s Integer Optimality set- ting. The idea is as follows. As Solver searches for the best integer solution, it is often able to find a “good” integer solution fairly quickly, but it often has to spend a lot of time finding slightly better solutions. A nonzero setting allows it to quit early. The default setting is 1 (percent). (It used to be 5, which you still might see, depending on your version of Excel.) This means that if Solver finds a feasible integer solution that is guaranteed to have an objective value no more than 1% from the optimal value, it will quit and report this good solution (which might even be the optimal solution). Therefore, if you keep this default setting, your integer solutions will sometimes not be optimal, but they will be close. If you want to ensure that you get an optimal solution, you can change the Solver setting to zero. (In Excel

® 2010 and later versions, click the Options button, and then under the All

Methods tab, uncheck Ignore Integer Constraints and enter a value in the Integer Optimality [%] box. In previous versions, click the Options button and enter a value in the Tolerance box.)

Set Solver’s Integer Optimality to zero to ensure that you get the optimal integer solution. Be aware, however, that this can incur significant extra computing time for larger models.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I JI J K Employee scheduling model Range names used

Employees_available

Employees_Star�ng Decision variables: number of employees star�ng their five-day shi� on various days Employees_required

2Mon 3Tue 3Wed 7Thu 0Fri 4

3 3 3 3 3

Sat 4

4 4 4 4 4 4 4 4

Sun

Mon Tue Wed Thu Fri Sat Sun

Result of decisions: number of employees working on various days (along top) who started their shi� on various days (along side) Mon Tue Wed Thu Fri Sat Sun

2 2 2 2 2

3333 7 7 7 7 0 0 0 0

4

3 7 0

4

Constraint on employee availabili�es Employees available

Employees required

17 13 16 19 15 17 18 >= >= >= >= >= >= >= 17 13 15 19 14 16 11

Objec�ve to maximize Total employees

Total_employees

23

n T i S 2 2

7 7 0 0 4 4 4 4 4 4

3 3 3 3

7 7

4 4 4 4

2 2 3 3 3 3

7 7

4 4 4 4 4 4

3 3 3 3

4 4

7 7 0 0

4 4

=Model!$B$4:$B$10 =Model!$B$28

=Model!$B$25:$H$25 =Model!$B$23:$H$23

Figure 14.4 Optimal Integer Solution to Employee Scheduling Model

© C

e n g

a g

e L

e a rn

in g

The decision variable cells in the optimal solution indicate the numbers of workers who start their five-day shifts on the various days. You can then look at the columns of the B14:H20 range to see which employees are working on any given day. This optimal solution is typical in scheduling problems. Due to a labor constraint—each employee must

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

668 Chapter 14 Optimization Models

work five consecutive days and then have two days off—it is typically impossible to meet the minimum employee requirements exactly. To ensure that there are enough employees available on busy days, it is necessary to have more than enough on hand on light days.

Another interesting aspect of this problem is that when you solve it, you might get a dif-dif-dif ferent schedule that is still optimal—that is, a solution that still uses a total of ferent schedule that is still optimal—that is, a solution that still uses a total of ferent 23 employees and meets all constraints. This is a case of multiple optimal solutions, not at all uncom- mon in linear optimization problems. In fact, it is typically good news for a manager, who can then choose among the optimal solutions using other, possibly nonquantitative criteria.

Sensitivity Analysis The most obvious type of sensitivity analysis in this example is to analyze the effect of employee requirements on the optimal solution. Specifically, let’s suppose the number of employees needed on each day of the week increases by two, four, or six. How does this change the total number of employees needed? You can answer this with SolverTable, but you must first modify the model slightly, as shown in Figure 14.5. The problem is that we want to increase each of the daily minimal required values by the same amount. The trick is to enter the original requirements in row 12, enter a trial value for the extra number required per day in cell K12, enter the formula =B12+$K$12 in cell B27, and then copy this formula across to cell H27. Now you can use the one-way SolverTable option, using the Extra cell as the single input, letting it vary from 0 to 6 in increments of 2, and specify- ing the Total_employees cell as the single output cell.

Multiple optimal solutions have different values in the decision variable cells, but they all have the same objective value.

To run some sensitivity analyses with SolverTable, you need to modify the original model slightly to incorporate the effect of the input being varied.

The results appear in Figure 14.6. When the requirement increases by two each day, only two extra employees are necessary (scheduled appropriately). However, when the requirement increases by four each day, more than four extra employees are necessary. The same is true when the requirement increases by six each day. This might surprise you at first, but there is an intuitive reason: Each extra worker works only five days of the week.

Note that we did not use Solver’s sensitivity report here for two reasons. First, Solver does not offer a sensitivity report for models with integer constraints. Second, even if the

1 2 3 4 5 6 7 8 9

10 11

14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

A BA B C DC D E FE F G HG H I JI J K Employee scheduling model Range names used

Employees_available

Employees_Star�ng Decision variables: number of employees star�ng their five-day shi� on various days Employees_required

2Mon 3Tue 3Wed 7Thu 0Fri 4

3 3 3 3 3

Sat 4

4 4 4 4 4 4 4 4

Sun

Employees required (original values) Extra required each day 0

Mon Tue Wed Thu Fri Sat Sun

Result of decisions: number of employees working on various days (along top) who started their shi� on various days (along side) Mon Tue Wed Thu Fri Sat Sun

2 2 2 2 2

3333 7 7 7 7 0 0 0 0

4

3

17 13 15 19 14 1116

7 0

4

Constraint on employee availabili�es Employees available

Employees required

17 13 16 19 15 17 18 >= >= >= >= >= >= >= 17 13 15 19 14 16 11

Objec�ve to maximize Total employees

Total_employees

23

n T 2 2

7 7 0 0 4 4 4 4 4 4

3 3 3 3

7 7

4 4 4 4

2 2 3 3 3 3

7 7

4 4 4 4 4 4

3 3 3 3

4 4

7 7 0 0

4 4

12 13

=Model!$B$4:$B$10 =Model!$B$28

=Model!$B$25:$H$25 =Model!$B$23:$H$23

Note how the original model has been modified so that the extra value in cell K12 drives all of the requirements in row27.

Figure 14.5 Modified Employee Scheduling Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-2 Employee Scheduling Models 669

Heuristic solutions are often close to optimal, but they are never guaranteed to be optimal.

integer constraints are deleted, Solver’s sensitivity report does not answer questions about multiple input changes, as we have asked here. It is used for questions about one-at-a-time changes to inputs, such as a change to a specific day’s worker requirement. In this sense, SolverTable is a more flexible tool.

Modeling Issues ■ The employee scheduling example is called a static scheduling model because we

assume that the company faces the same situation each week. In reality, demands change over time, employees take vacations in the summer, and so on, so the com- pany does not face the same situation each week. A dynamic scheduling model (not covered here) is necessary for such problems.

■ In a weekly scheduling model for a supermarket or a fast-food restaurant, the number of decision variables can grow quickly and optimization software such as Solver will have dif�culty �nding an optimal solution. In such cases, heuristic methods (essentially clever trial-and-error algorithms) have been used to �nd good solutions to the problem. For example, Love and Hoey (1990) indicate how this was done for a particular staff scheduling problem.

■ Our model can easily be expanded to handle part-time employees, the use of overtime, and alternative objectives such as maximizing the number of weekend days off received by employees. You are asked to explore such extensions in the problems. ■

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Modify the employee scheduling model so that

employees are paid $10 per hour on weekdays and $15 per hour on weekends. Change the objective so that you now minimize the weekly payroll. (You can

assume that each employee works eight hours per day.) Is the previous optimal solution still optimal?

2. How much influence can the employee requirements for one, two, or three days have on the weekly sched- ule in the employee scheduling example? You are asked to explore this in the following questions. a. Let Monday’s requirements change from 17 to 25

in increments of 1. Use SolverTable to see how the total number of employees changes.

Figure 14.6 Sensitivity to Number of Extra Employees Required per Day

3

2

1

4

5

6

7

8

9

10

11

A BA B C DC D E FE F G HG H I

Extra required (cell $K$12) values along side, output cell(s) along top

To ta

l_ em

p lo

ye es

0 20 23

2 22 25

4 24 28

6 36 31 0

10

20

30

40

0 2 4 6 Extra required ($K$12)

Sensi�vity of Total_employees to Extra required

Oneway analysis for Solver model in Model Sensi�vity worksheet

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

670 Chapter 14 Optimization Models

14-3 BLENDING MODELS In many situations, various inputs must be blended to produce desired outputs. In many of these situations, blending models can be used to �nd the optimal combination of outputs as well as the mix of inputs that are used to produce the desired outputs. The following are some typical examples of blending problems.

E X A M P L E 14.2 BLENDING OIL PRODUCTS

Inputs Outputs Meat, filler, water Different types of sausage Various types of oil Heating oil, gasolines, aviation fuels Carbon, iron, molybdenum Different types of steels Different types of pulp Different kinds of recycled paper

Chandler Oil has 5000 barrels of crude oil 1 and 10,000 barrels of crude oil 2 available. Chandler sells gasoline and heating oil. These products are produced by blending the two crude oils together. Each barrel of crude oil 1 has a “quality level” of 10 and each barrel of crude oil 2 has a quality level of 5.2 two crude oils together. Each barrel of crude oil

2 two crude oils together. Each barrel of crude oil

Gasoline must have an average quality level

2To avoid being overly technical, we use the generic term quality level. In real oil blending, qualities of interest might be octane rating, viscosity, and others.

b. Suppose the Monday and Tuesday requirements can each, independently of one another, increase from 1 to 8 in increments of 1. Use a two-way SolverTable to see how the total number of employees changes.

c. Suppose the Monday, Tuesday, and Wednesday requirements each increase by the same amount, where this increase can be from 1 to 8 in increments of 1. Use a one-way SolverTable to investigate how the total number of employees changes.

3. In the employee scheduling example, suppose that each full-time employee works eight hours per day. Thus, Monday’s requirement of 17 workers can be viewed as a requirement of 8(17) = 136 hours. The post office can meet its daily labor requirements by using both full-time and part-time employees. During each week a full-time employee works eight hours a day for five consecutive days, and a part-time employee works four hours a day for five consecutive days. A full-time employee costs the post office $15 per hour, whereas a part-time employee (with reduced fringe benefits) costs the post office only $10 per hour. Union requirements limit part- time labor to 25% of weekly labor requirements. a. Modify the model as necessary, and then use Solver

to minimize the post office’s weekly labor costs. b. Use SolverTable to determine how a change in

the part-time labor limitation (currently 25%) influences the optimal solution.

Level B 4. In the employee scheduling example, suppose the

employees want more flexibility in their schedules. They want to be allowed to work five consecutive days followed by two days off or to work three consecutive or to work three consecutive or days followed by a day off followed by two consecutive days followed by another day off. Modify the original model (with integer constraints) to allow this flexibility. Might this be a good deal for management as well as labor? Explain.

5. In the employee scheduling example, suppose that the company can force employees to work one day of overtime each week on the day immediately fol- lowing this five-day shift. For example, an employee whose regular shift is Monday to Friday can also be required to work on Saturday. Each employee is paid $100 a day for each of the first five days worked dur- ing a week and $135 for the overtime day (if any). Determine how the post office can minimize the cost of meeting its weekly work requirements.

6. In the employee scheduling example, suppose the company has 28 full-time employees and is not allowed to fire any of them or hire more. Determine a schedule that maximizes the number of weekend days off received by these employees.

Example 14.2 illustrates how to model a typical blending problem in Excel. Although this example is small relative to blending problems in real applications, it is still probably too complex for you to guess the optimal solution.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-3 Blending Models 671

In typical blending problems, the correct decision variables are the amounts of each input blended into each output.

of at least 8, whereas heating oil must have an average quality level of at least 6. Gasoline sells for $75 per barrel, and heating oil sells for $60 per barrel. In addition, if any barrels of the crude oils are left over, they can be sold for $65 and $50 per barrel, respectively. (This option wasn’t available in previous editions of the book.) We assume that demand for heating oil and gasoline is unlimited, so that all of Chandler’s production can be sold. Chandler wants to maximize its revenue from selling gasoline, heating oil, and any leftover crude oils.

Objective To develop an optimization model for finding the revenue-maximizing plan that meets quality constraints and stays within limits on crude oil availabilities.

Where Do the Numbers Come From? Most of the inputs for this problem should be easy to obtain.

■ The selling prices for outputs are dictated by market pressures.

■ The availabilities of inputs are based on crude supplies from the suppliers.

■ The quality levels of crude oils are known from chemical analysis, whereas the required quality levels for outputs are speci�ed by Chandler, probably in response to competitive or regulatory pressures.

Solution The variables and constraints required for this blending model are shown in Figure 14.7. (See the file Blending Oil Big Picture.xlsx.). The key is the selection of the appropri- ate decision variables. You might think it is sufficient to specify the amounts of the two crude oils used and the amounts of the two products produced. However, this is not enough. The problem is that this information doesn’t tell Chandler how to make the out- puts from the inputs. The company instead needs to have a blending plan: how much of each input to use in the production of a barrel of each output. Once you understand that this blending plan is the basic decision, all other output variables follow in a straightfor- ward manner.

Figure 14.7 Big Picture for Oil Blending Model

Inputs Used

Outputs Sold

Quality Obtained in Outputs

Required Quality Levels of Outputs

Inputs Le� Over and SoldQuality Levels of

Inputs

Selling Prices of Outputs

Values of Inputs

Input Available

Blending Plan

<=

>= Minimize Total Revenue

A secondary, but very important, issue in typical blending models is how to implement the quality constraints. (The constraints here are in terms of a generic “quality.” In other blending problems they are often expressed in terms of percentages of some ingredient(s). For example, a typical quality constraint is that some output can contain no more than 2% sulfur.) When we explain how to develop the spreadsheet model, we will discuss the pre- ferred way of implementing the quality constraints.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

672 Chapter 14 Optimization Models

Developing the Spreadsheet Model The spreadsheet model for this problem appears in Figure 14.8. (See the file Blending Oil.xlsx.) To set it up, proceed as follows.

1. Inputs and range names. Enter the unit selling prices, quality levels for inputs, required quality levels for outputs, and availabilities of inputs in the blue cells. Then name the ranges as indicated.

2. Inputs blended into each output. As discussed, the quantities Chandler must specify are the barrels of each input used to produce each output. Enter any trial values for these quantities in the Blending_plan range. For example, the value in cell B13 is the amount of crude oil 1 used to make gasoline and the value in cell C13 is the amount of crude oil 1 used to make heating oil. The Blending_plan range contains the decision variable cells.

3. Inputs used and outputs sold. Calculate the row sums (in column D) and column sums (in row 15) of the Blending_plan range. There is a quick way to do this. Select both the row and column where the sums will go (select one, then hold down the Ctrl key and select the other), and click the AutoSum (Σ) button on the Home ribbon. This creates SUM formulas in the selected cells. Then calculate the leftover barrels of each crude oil in column G by subtracting the amount used from the amount available.

4. Quality achieved. Keep track of the quality level of gasoline and heating oil in the Quality_obtained range as follows. Begin by calculating for each output the average quality (AQ) in the inputs used to produce this output:

AQ in gasoline = 10 * Oil 1 in gasoline + 5 * Oil 2 in gasoline AQ in heating oil = 10 * Oil 1 in heating oil + 5 * Oil 2 in heating oil

From here on, the solutions shown are optimal. However, remember that you can start with any solution. It doesn’t even have to be feasible.

Developing the Blending Model

Figure 14.8 Oil Blending Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

G HG HFEDCBA Oil blending model Rl Rl Rl Rl Range names used

Available Barrels_sold Blending_plan Le�over Quality_obtained Quality_required Total_revenue Used

=Model!$F$13:$F$14 =Model!$B$15:$C$15 =Model!$B$13:$C$14 =Model!$G$13:$G$14 =Model!$B$19:$C$19 =Model!$B$21:$C$21 =Model!$B$24 =Model!$D$13:$D$14

Proper es of crude oil inputs

Proper es of outputs Selling price per barrel Required quality level

Blending plan (barrels of crude in each output)

Crude oil 1 Crude oil 2 Barrels sold

Quality constraints with cleared denominators Quality constraints in "intui ve" form

Quality obtained

Quality required

Objec ve to maximize Total revenue

Crude oil 1 Crude oil 2

Gasoline 3000 2000 5000

Hea�ng oil 2000 8000

10000

Used 5000

10000

Le�over 0 0

<= <=

Gasoline 40000

>= 40000

$975,000

Hea�ng oil 60000

>= 60000

Gasoline 8

>= 8

Hea�ng oil 6

>= 6

Gasoline $75

8

Hea�ng oil $60

6

Value per barrel $65 $50

Quality level 10

5

l Rl R

Available 5000

10000

l R

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-3 Blending Models 673

AQ in gasoline ≥ 8 * Gasoline sold (14.1)

AQ in heating oil ≥ 6 * Heating oil sold (14.2)

Similarly, the heating oil quality constraint is

To implement Inequalities (14.1) and (14.2), calculate the AQ for gasoline in cell B19 with the formula

=SUMPRODUCT(B13:B14,$C$4:$C$5)

and copy this formula to cell C19 to generate the AQ for heating oil.

5. Quality required. Calculate the required average quality for gasoline and heating oil in cells B21 and C21. Specifically, determine the required average quality for gasoline in cell B21 with the formula

=B9*B15

and copy this formula to cell C21 for heating oil.

6. Revenue. Calculate the total revenue in cell B24 with the formula

=SUMPRODUCT(B15:C15,B8:C8)+SUMPRODUCT(G13:G14,B4:B5)

Using Solver To solve Chandler’s problem with Solver, fill out the main Solver dialog box as shown in Figure 14.9. As usual, check the Non-Negative option and select the Simplex LP method before optimizing. You should obtain the optimal solution shown in Figure 14.8.

Figure 14.9 Solver Dialog Box for Blending Model

© C

e n g

a g

e L

e a rn

in g

The gasoline quality constraint is then

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

674 Chapter 14 Optimization Models

Discussion of the Solution The optimal solution implies that Chandler should make 5000 barrels of gasoline with 3000 barrels of crude oil 1 and 2000 barrels of crude oil 2. The company should also make 10,000 barrels of heating oil with 2000 barrels of crude oil 1 and 8000 barrels of crude oil 2. With this blend, Chandler will obtain a revenue of $975,000, all from selling gasoline and heating oil. As stated previously, this problem is sufficiently complex to defy intui- tion. Clearly, gasoline is more profitable per barrel than heating oil, but given the crude availability and the quality constraints, it turns out that Chandler should sell twice as much heating oil as gasoline. This would have been very difficult to guess ahead of time.

This solution uses all of the inputs to produce outputs; no crude oils are left over to sell. However, if you change the value of crude oil 2 to $55 and rerun Solver, you will see a much different solution, where no heating oil is produced and a lot of crude oil 2 is left over for sale. (Try it to convince yourself.) Why would the cheaper crude oil 2 be sold rather than the more expensive crude oil 1? The reason is quality. Gasoline requires a higher quality, and crude oil 1 is able to deliver it.

Sensitivity Analysis We perform two typical sensitivity analyses on this blending model. In each, we see how revenue and the amounts of the inputs and outputs sold vary. In the first analysis, we use the unit selling price of gasoline as the input and let it vary from $50 to $90 in increments of $5. The SolverTable results appear in Figure 14.10. Two things are of interest. First, as the price of gasoline increases from $55 to $65, Chandler starts producing gasoline and less heating oil, exactly as you would expect. Second, when the price of gasoline gets to $80 or more, no heating oil is produced, and leftover crude oil 2 is sold instead. Third, the revenue can only increase or stay the same, as the changes in column G (calculated manu- ally) indicate.

Figure 14.10 Sensitivity to the Selling Price of Gasoline

1 2 3

4 Ba rr

el s_

so ld

_1

Ba rr

el s_

so ld

_2

Le �

ov er

_1

5 $50 $55 $60 $65 $70 $75 $80 $85 $90

0 0 0

5000 5000 5000

8333.333 8333.333 8333.333

12500 12500 12500 10000 10000 10000

0 0 0

Le �

ov er

_2

2500 2500 2500

0 0 0 0 0 0

To ta

l_ re

ve nu

e

0 0 0 0 0 0

6666.667 6666.667 6666.667

$912,500 $912,500 $912,500 $925,000 $950,000 $975,000

$1,000,000 $1,041,667 $1,083,333

In cr

ea se

$0 $0

$12,500 $25,000 $25,000 $25,000 $41,667 $41,667

6 7 8 9

10 11 12 13

A BA B C DC D E FE F G Oneway analysis for Solver model in Model worksheet

Selling price gasoline (cell $B$8) values along side, output cell(s) along top

© C

e n g

a g

e L

e a rn

in g

In the second sensitivity analysis, we vary the availability of crude 1 from 2000 barrels to 20,000 barrels in increments of 1000 barrels. The resulting SolverTable output appears in Figure 14.11. These results make sense if you analyze them carefully. First, the revenue increases, but at a decreasing rate, as more crude 1 is available. This is a common occur- rence in LP models. As more of a resource is made available, revenue can only increase or remain the same, but each extra unit of the resource produces less (or at least no more) rev- enue than the previous unit. Second, the amount of gasoline produced increases, whereas

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-3 Blending Models 675

Figure 14.11 Sensitivity to the Availability of Crude 1 3

A BA B C DC D E FE F G

2 1

4 5 6 7 8 9

10 11 12 13 14 15 300015151515 16 17 18 19 20 21 22 23

2000 3000 4000 5000 6000 7000 8000 9000

10000 11000 12000 13000 14000 15000 16000 17000 18000 19000 20000

0 1000 3000 5000 7000 9000

11000 13000 15000 17000 19000 21000 23000 25000 26000 27000 28000 29000 30000

0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

2000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

10000 $700,000 $795,000 $885,000 $975,000

$1,065,000 $1,155,000 $1,245,000 $1,335,000 $1,425,000 $1,515,000 $1,605,000 $1,695,000 $1,785,000 $1,875,000 $1,950,000 $2,025,000 $2,100,000 $2,175,000 $2,250,000

12000 $95,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $90,000 $75,000 $75,000 $75,000 $75,000 $75,000

11000 10000

9000 8000 7000 6000 5000 4000

2000 1000

0 0 0 0 0 0

Crude oil 1 available (cell $F$13) values along side, output cell(s) along top Crude oil 1 available (cell $F$13) values along side, output cell(s) along top

Ba rr

el s_

so ld

_2

Ba rr

el s_

so ld

_1

Le �

ov er

_2

Le �

ov er

_1

To ta

l_ re

ve nu

e

In cr

ea se

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

the amount of heating oil produced decreases. Here’s why: Crude 1 has a higher quality than crude 2, and gasoline requires higher quality. Gasoline also sells for a higher price. Therefore, as more crude 1 is available, Chandler can produce more gasoline, receive more revenue, and still meet quality standards. Note, however, that there is one exception to this, when only 2000 barrels of crude oil 1 are available. In this case, no gasoline is sold and leftover crude oil 2 is sold instead.

A Caution about Blending Constraints Before concluding this example, we discuss why the model is linear. The key is the imple- mentation of the quality constraints, shown in Inequalities (14.1) and (14.2). To keep a model linear, each side of an inequality constraint must be a constant, the product of a con- stant and a variable, or a sum of such products. If the quality constraints are implemented as in Inequalities (14.1) and (14.2), the constraints are indeed linear. However, it is argu- ably more natural to rewrite this type of constraint by dividing through by the amount sold. For example, the modified gasoline constraint becomes

AQ in gasoline

Gasoline sold ≥ 8 (14.3)

Although this form of the constraint is perfectly valid—and is possibly more natural to many people—it has two drawbacks. First, it makes the model nonlinear. This is because the left side is no longer a sum of products; it involves a quotient. We prefer linear models whenever possible. Second, suppose it turns out that Chandler’s optimal solution calls for no gasoline at all. Then Inequality (14.3) involves division by zero, and this causes an error

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

676 Chapter 14 Optimization Models

14-4 LOGISTICS MODELS In many situations a company produces products at locations called origins and ships these products to customer locations called destinations. Typically, each origin has a limited capacity that it can ship, and each destination must receive a required quantity of the product. Logistics models can be used to determine the minimum-cost shipping method for satisfying customer demands.

P R O B L E M S

Level A 7. Use SolverTable in the blending model to see whether,

by increasing the selling price of gasoline, you can get an optimal solution that produces only gasoline, no heating oil. Then use SolverTable again to see whether, by increasing the selling price of heating oil, you can get an optimal solu- tion that produces only heating oil, no gasoline.

8. Use SolverTable in the blending model to find the shadow price of crude oil 1—that is, the amount Chandler would be willing to spend to acquire more crude oil 1. Does this shadow price change as Chandler keeps getting more of crude oil 1? Answer the same questions for crude oil 2.

9. How sensitive is the optimal blending solution (barrels of each output sold and profit) to the required quality levels? Answer this by running a two-way SolverTable with these three outputs. You can choose the values of the two inputs to vary.

10. In the blending model suppose there is a chemical ingredi- ent called C1 that both gasoline and heating oil need. At least 3% of every barrel of gasoline must be C1, and at least 5% of every barrel of heating oil must be C1. Suppose that 4% of all crude oil 1 is C1 and 6% of all crude oil 2

is C1. Modify the model to incorporate the constraints on C1, and then optimize. Don’t forget to clear denominators.

11. In the current version of the blending model, a barrel of any input results in a barrel of output. However, in a real blending problem there can be losses. Suppose a barrel of input results in only a fraction of a barrel of output. Specifically, each barrel of either crude oil used for gaso- line results in only 0.95 barrel of gasoline, and each barrel of either crude used for heating oil results in only 0.97 barrel of heating oil. Modify the model to incorporate these losses and then find the optimal solution.

Level B 12. We warned you about clearing denominators in the

quality constraints. This problem indicates what happens if you don’t do so. a. Implement the quality constraints as indicated in

Inequality (14.3). Then run Solver with the simplex method. What happens? What if you run Solver with the GRG nonlinear method?

b. Repeat part a, but increase the selling price of heating oil to $120 per barrel. What happens now?

Clearing Denominators Some constraints, particularly those that arise in blend- ing models, are most naturally expressed in terms of ratios. For example, the percentage of sulfur in a product is a ratio: (amount of sulfur in product)/(total amount of product).This ratio could then be constrained to be

less than or equal to 6%, say. This is a perfectly valid way to express the constraint, but it has the undesir-way to express the constraint, but it has the undesir-way to express the constraint, but it has the undesir able effect of making the model nonlinear. The fix is sim- ple.To make the model linear, multiply through by the denominator of the ratio. This has the added benefit of ensuring that division by zero will not occur.

F u n da m e n ta l I n s i g h t

in Excel. Because of these two drawbacks, it is best to “clear denominators” in all such blending constraints.

Modeling Issues In reality, a company using a blending model would run the model periodically (each day, say) and set production on the basis of the current inventory of inputs and the current fore- casts of demands and prices. Then the forecasts and the input levels would be updated, and the model would be run again to determine the next day’s production. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 677

E X A M P L E 14.3 SHIPPING CARS FROM PLANTS TO REGIONS

The Grand Prix Automobile Company manufactures automobiles in three plants and then ships them to four regions of the country. The plants can supply the amounts listed in the right column of Table 14.2. The customer demands by region are listed in the bottom row of this table, and the unit costs of shipping an automobile from each plant to each region are listed in the middle of the table. Grand Prix wants to find the lowest-cost shipping plan for meeting the demands of the four regions without exceeding the capacities of the plants.

14-4a Transportation Models

We begin by assuming that the only possible shipments are those directly from an origin to a destination. That is, no shipments between origins or between destinations are allowed. Such a problem has traditionally been called a transportation problem.

Table 14.2 Input Data for Grand Prix Example Region 1 Region 2 Region 3 Region 4 Capacity

Plant 1 131 218 266 120 450 Plant 2 250 116 263 278 600 Plant 3 178 132 122 180 500 Demand 450 200 300 300

Objective To develop an optimization model for finding the least-cost way of ship- ping the automobiles from plants to regions, staying within plant capacities and meeting regional demands.

Where Do the Numbers Come From? A typical transportation problem requires three sets of numbers: capacities (or supplies), demands (or requirements), and unit shipping (and possibly production) costs.

■ The capacities indicate the most each plant can supply in a given amount of time—a month, say—under current operating conditions. In some cases it might be possible to increase the “base” capacities, by using overtime, for example. In such cases the model could be modi�ed to determine the amounts of additional capacity to use (and pay for).

■ The customer demands are typically estimated from some type of forecasting model (as discussed in Chapter 12). The forecasts are often based on historical customer demand data.

■ The unit shipping costs come from a transportation cost analysis—what does it really cost to send a single automobile from any plant to any region? This is not an easy question to answer, and it requires an analysis of the best mode of transportation (such as railroad, ship, or truck). However, companies typically have the required data. Actually, the unit “shipping” cost can also include the unit production cost at each plant. However, if this cost is the same across all plants, as we are tacitly assuming here, it can be omitted from the model.

Solution The variables and constraints required for this model are shown in Figure 14.12. (See the file Transportation Big Picture.xlsx.) The company must decide exactly the number of autos to send from each plant to each region—a shipping plan. Then it can calculate the total number of autos sent out of each plant and the total number received by each region.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

678 Chapter 14 Optimization Models

Figure 14.13 Network Representation of Transportation Model

Representing Transportation in a Network Model A network diagram of this model appears in Figure 14.13. This diagram is typical of network models. It consists of nodes and arcs. A node, indicated by a circle, generally represents a geographical location. In this case the nodes on the left correspond to plants, and the nodes on the right correspond to regions. An arc, indicated by an arrow, generally represents a route for getting a product from one node to another. Here, the arcs all go from a plant node to a region node—from left to right.

The problem data fit nicely on such a diagram. The capacities are placed next to the plant nodes, the demands are placed next to the region nodes, and the unit shipping costs are placed on the arcs. The decision variables are usually called flows. They represent the amounts shipped on the various arcs. Sometimes (although not in this problem), there are upper limits on the flows on some or all of the arcs. These upper limits, called arc capaci- ties, can also be shown on the diagram.3 upper limits on the flows on some or all of the arcs. These upper limits, called

3 upper limits on the flows on some or all of the arcs. These upper limits, called

Developing the Spreadsheet Model The spreadsheet model appears in Figure 14.14. (See the file Transportation.xlsx.) To develop this model, perform the following steps.

1. Inputs.4 Enter the unit shipping costs, plant capacities, and region demands in the blue cells.

3There can even be lower limits, other than zero, on certain �ows, but we don’t consider any such constraints here. 4 From here on, we might not remind you about creating range names, but we will continue to list our suggested range names on the spreadsheets.

In a transportation problem all flows go from left to right—from origins to destinations. You will see more complex network structures in the next subsection.

Developing the Transportation Model

© C

e n g

a g

e L

e a rn

in g

Figure 14.12 Big Picture for Transportation Model

Amount Shipped

Total Shipped Out Plant Capacity<=

Total Shipped In Regional Demand

Unit Shipping Cost

>=

Minimize Total Cost

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 679

2. Shipping plan. Enter any trial values for the shipments from plants to regions in the Shipping_plan range. These are the decision variable cells. Note that this rectangular range is exactly the same shape as the range where the unit shipping costs are entered. This is a natural model design, and it simplifies the formulas in the following steps.

3. Numbers shipped from plants. To calculate the amount shipped out of each plant in the range G13:G15, select this range and click the AutoSum (Σ) button.

4. Amounts received by regions. Similarly, calculate the amount shipped to each region in the range C16:F16 by selecting the range and clicking the AutoSum button.

5. Total shipping cost. Calculate the total cost of shipping power from the plants to the regions in the Total_cost cell with the formula

=SUMPRODUCT(C6:F8,Shipping_plan)

This formula sums all products of unit shipping costs and amounts shipped. You now see the benefit of placing unit shipping costs and amounts shipped in similar-size rec- tangular ranges—you can then use the SUMPRODUCT function.

Using Solver Invoke Solver with the settings shown in Figure 14.15. As usual, check the Non-Negative option and select the Simplex LP method before optimizing.

Discussion of the Solution The Solver solution appears in Figure 14.14 and is illustrated graphically in Figure 14.16. The company incurs a total shipping cost of $176,050 by using the shipments listed in Figure 14.16. Except for the six routes shown, no other routes are used. Most of the ship- ments occur on the low-cost routes, but this is not always the case. For example, the route from plant 2 to region 1 is relatively expensive, and it is used. On the other hand, the route from plant 3 to region 2 is relatively cheap, but it is not used. A good shipping plan tries to use cheap routes, but it is constrained by capacities and demands.

Note that the available capacity is not all used. The reason is that total capacity is 1550, whereas total demand is only 1250. Even though the demand constraints are of the

It is typical in transportation models, especially large models, that only a relatively few of the possible routes are used.

Figure 14.14 Transportation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21

A BA B C DC D E FE F G HG H I JI J K Grand Prix transporta�on model Range names used:

Capacity =Model!$I$13:$I$15 Unit shipping costs Demand =Model!$C$18:$F$18

=Model!$C$13:$F$15==Model!$C$13:$F$15==Model!$C$13:$F$15Shipping_PlanTo Region 1 Region 2 Region 3 Region 4 =Model!$B$21Total_cos4 =Total_cos4 =t4 =t4 =

From Plant 1 =Model!$C$16:$F$16 =Model!$G$13:$G$15

Total_received$120$266$218$131 Plant 2 Total_shipped$278$263$116$250 Plant 3 $178 $132 $122 $180

Shipping plan, and constraints on supply and demand To

Region 1 Region 2 Region 3 Region 4 Total shipped Capacity From Plant 1 150 0 0 300 450 <= 450

Plant 2 100 200 0 0 300 <= 600 Plant 3 200 0 300 0 500 <= 500 Total received 450 200 300 300

>= >= >= >= Demand 450 200 300 300

to minimize Total cost $176,050

1 R 2 R 3 R 4 =

1 R 2 R 3 R

4 =

d C

4 =4 =

d C

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

680 Chapter 14 Optimization Models

Figure 14.16 Graphical Representation of Optimal Solution

“≥” type, there is clearly no reason to send the regions more than they request because it only  increases shipping costs. Therefore, the optimal plan sends them the minimal amounts they request and no more. In fact, the demand constraints could have been mod- eled as “=” constraints, and Solver would have found exactly the same solution.

Figure 14.15 Solver Dialog Box for Transportation Model

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 681

Sensitivity Analysis There are many sensitivity analyses you could perform on the basic transportation model. For example, you could vary any one of the unit shipping costs, capacities, or demands. The effect of any such change in a single input is captured nicely in Solver’s sensitivity report, shown in Figure 14.17. The top part indicates the effects of changes in the unit shipping costs. The results here are typical. For all routes with positive flows, the corresponding reduced cost is zero, whereas for all routes not currently being used, the reduced cost indicates how much less the unit shipping cost would have to be before the company would start shipping along that route. For example, if the unit shipping cost from plant 2 to region 3 decreased by more than $69, this route would become attractive.

Figure 14.17 Solver’s Sensitivity Report for Transportation Model

Final Value

Reduced Cost

Allowable Increase

Allowable DecreaseCell Name

Objec�ve Coefficient

6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31

A BA B C DC D E FE F G HG H Variable Cells

$C$13 Plant 1 Region 1 150 0 131 119 13 $D$13 Plant 1 Region 2 0 221 218 1E+30 221 $E$13 Plant 1 Region 3 0 191 266 1E+30 191 $F$13 Plant 1 Region 4 300 0 120 13 239 $C$14 Plant 2 Region 1 100 0 250 39 72 $D$14 Plant 2 Region 2 200 0 116 88 116 $E$14 Plant 2 Region 3 0 69 263 1E+30 69 $F$14 Plant 2 Region 4 0 39 278 1E+30 39 $C$15 Plant 3 Region 1 200 0 178 13 69 $D$15 Plant 3 Region 2 0 88 132 1E+30 88 $E$15 Plant 3 Region 3 300 0 122 69 194 $F$15 Plant 3 Region 4 0 13 180 1E+30 13

Constraints Final Value

Shadow Price

Constraint R.H. Side

Allowable Increase

Allowable DecreaseCell Name

$G$13 Plant 1 Total shipped 450 –119 450 100 150 $G$14 Plant 2 Total shipped 300 0 600 1E+30 300 $G$15 Plant 3 Total shipped 500 –72 500 100 200 $C$16 Total received Region 1 450 250 450 300 100 $D$16 Total received Region 2 200 116 200 300 200 $E$16 Total received Region 3 300 194 300 200 100 $F$16 Total received Region 4 300 239 300 150 100 ©

C e n g

a g

e L

e a rn

in g

The bottom part of this report is useful because of its shadow prices. For example, plants 1 and 3 are currently shipping all of their capacity, so the company would benefit from having more capacity at these plants. In particular, the report indicates that each extra unit of capacity at plant 1 is worth $119, and each extra unit of capacity at plant 3 is worth $72. However, because the allowable increase for each of these is 100, you know that after an increase in capacity of 100 at either plant, further increases will probably be worth less than the current shadow prices.

One interesting analysis that cannot be performed with Solver’s sensitivity report is to keep shipping costs and capacities constant and allow all of the demands to change by a certain percentage (positive or negative). To perform this analysis, use SolverTable, with the varying percentage as the single input. Then keep track of the total cost and any particular amounts shipped of interest. The key to doing this correctly is to modify the model slightly, as illus- trated in the previous chapter and Example 14.1, before running SolverTable. The appropriate modifications appear in the third sheet of the finished version of the Transportation.xlsx file.

The key to this sensitivity analysis is to modify the model slightly before running SolverTable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

682 Chapter 14 Optimization Models

Although this model is possibly less natural than the original model, it generalizes better to other logistics models.

Then run SolverTable, allowing the percentage change in all demands to vary from −20% to 30% in increments of 5%, and keep track of total cost. As the table in Figure 14.18 shows, the total shipping cost increases at an increasing rate as the demands increase. However, at some point the problem has no feasible solutions. As soon as the total demand is greater than the total capacity, it is impossible to meet all demand.

Figure 14.18 Sensitivity Analysis to Percentage Changes in All Demands

3 2 1

4

5 6 7 8 9

10 11 12 13 14 15

A BA BA BA B C DC DC DC DC D E FE FE FE F G H

Change in demands (cell $I$10) values along side, output cell(s) along top

Oneway analysis for Solver model in Modified Model for Sensi�vity worksheet

To ta

l_ co

st

–20% $130,850

–15% $140,350 –10% $149,850

–5% $162,770 0% $176,050 5% $189,330

10% $202,610 15% $215,890 20% $229,170 25% Not feasible 30% Not feasible

© C

e n g

a g

e L

e a rn

in g

An Alternative Model The transportation model in Figure 14.14 is a very natural one. In the graphical rep- resentation in Figure 14.13, note that all arcs go from left to right, that is, from plants to regions. Therefore, the rectangular range of shipments allows you to calculate shipments out of plants as row sums and shipments into regions as column sums. In anticipation of later models in this chapter, however, where the graphical network can be more complex, we present an alternative model of the transportation problem. (See the file Transportation Alternative.xlsx.)

First, it is useful to introduce some additional network terminology. Recall that flows are the amounts shipped on the various arcs. The direction of the arcs indicates which way the flows are allowed to travel. An arc pointed into a node is called an inflow, whereas an arrow pointed out of a node is called an outflow. In the basic transportation model, all outflows originate from suppliers, and all inflows go toward demanders. However, general networks can have both inflows and outflows for any given node.

With this general structure in mind, the typical network model has one decision vari- able cell per arc. It indicates how much (if any) to send along that arc in the direction of the arrow. Therefore, it is often useful to model network problems by listing all of the arcs and their corresponding flows in one long list. Then constraints can be indicated in a sepa- rate section of the spreadsheet. Specifically, for each node in the network, there is a flow balance constraint. These flow balance constraints for the basic transportation model are simply the supply and demand constraints already discussed, but they can be more general for other network models, as will be discussed in the next subsection.

The alternative model of the Grand Prix problem appears in Figure 14.19. The plant and region indexes and the associated unit shipping costs are entered manually in the range A5:C16. Each row in this range corresponds to an arc in the network. For example, row 12 corresponds to the arc from plant 2 to region 4, with unit shipping cost $278. Then the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 683

Figure 14.19 Alternative Form of Transportation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

A BA B C DC D E FE F G HG H I JI J K LK L M

Grand Prix transporta�on model: a more general network formula�on Range names used: Capacity =Model!$I$6:$I$8

Network structure and flows Flow balance constraints Demand =Model!$I$12:$I$15 Origin Des�na�on Unit cost Flow Capacity constraints =Model!$B$5:$B$16Des�na�on

1 1 131 150 Plant Ou�low Capacity Flow =Model!$D$5:$D$16 1 2 218 0 10 1 450 <= 450 Inflow =Model!$G$12:$G$15 1 3 266 0 20 2 300 <= 600 Origin =Model!$A$5:$A$16 1 4 120 300 3 500 <= 500 Ou�low =Model!$G$6:$G$8

=Model!$B$19Total_Cost10025012 2 2 116 200 Demand constraints 2 3 263 0 Region Inflow Demand 2 4 278 0 10 1 450 >= 450 3 1 178 200 2 200 >= 200 3 2 132 0 30 3 300 >= 300 3 3 122 300 4 300 >= 300 3 4 180 0

Objec�ve to minimize Total Cost $176,050

1 1 1 2 1 3 1 4

2 2 2 3 2 4 3 1 3 2 3 3 3 4

0 1 0 2

0 1

0 3

© C

e n g

a g

e L

e a rn

in g

decision variable cells for the flows are in column D. (If there were arc capacities, they could be placed to the right of the flows.)

The flow balance constraints are conceptually straightforward. Each cell in the Outflow and Inflow ranges in column G contains the appropriate sum of flows. For example, cell G6, the outflow from plant 1, represents the sum of cells D5 through D8, whereas cell G12, the inflow to plant 1, represents the sum of cells D5, D9, and D13. Fortunately, there is an easy way to enter these summation formulas.5 inflow to plant 1, represents the sum of cells D5, D9, and D13. Fortunately, there is an easy way

5 inflow to plant 1, represents the sum of cells D5, D9, and D13. Fortunately, there is an easy way

The trick is to use Excel’s built-in SUMIF function (see explanation below). For example, the formula in cell G6 is

=SUMIF(Origin,F6,Flow)

This formula compares the plant number in cell F6 to the Origin range in column A and sums all flows where they are equal—that is, it sums all flows out of plant 1. This formula can be copied down to cell G8 to obtain the flows out of the other plants. For flows into regions, the similar formula in cell G12 for the flow into region 1 is

=SUMIF(Destination,F12,Flow)

and this can be copied down to cell G15 for flows into the other regions. In general, the SUMIF function finds all cells in the first argument that satisfy the criterion in the second argument and then sums the corresponding cells in the third argument. It is a very handy function—and not just for network modeling.

Excel Function: SUMIF The SUMIF function is useful for summing values in a certain range if cells in a related range satisfy a given condition. It has the syntax =SUMIUMIU FMIFMI (c(c( ompmpm areRange,criterion,sumRange), where compareRange and sumRange are similar-size ranges. This formula checks each cell in compareRange to see whether it satis�es the criterion. If it does, it adds the correspond- ing value in sumRange to the overall sum. For example, =SUMIUMIU FMIFMI (A1(A1( 2:A1:A1: 3,3,3 1,D12:D23) sums all values in the range D12:D23 where the corresponding cell in the range A12:A23 has the value 1.

5Try entering these formulas as simple sums even for a 3 × 4 transportation model, and you will see why the SUMIF function is so handy.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

684 Chapter 14 Optimization Models

This use of the SUMIF function, along with the list of origins, destinations, unit costs, and flows in columns A through D, is the key to the model. The rest is straightforward. The total cost is a SUMPRODUCT of unit costs and flows, and the Solver dialog box is set up as shown in Figure 14.20.

Figure 14.20 Solver Dialog Box for Alternative Transportation Model

© C

e n g

a g

e L

e a rn

in g

The alternative network model not only accommodates more general networks, but it is more efficient because it has fewer decision variable cells.

This alternative model generalizes nicely to other network problems. Essentially, it shows that all network models look alike. There is an additional benefit from this alter- native model. Suppose that flows from certain plants to certain regions are not allowed. (Maybe no roads exist.) It is not easy to disallow such routes in the original model. One option is to allow the “disallowed” routes but to impose extremely large unit shipping costs on them. This works, but it is wasteful because it adds decision variable cells that do not really belong in the model. However, the alternative network model simply omits arcs that are not allowed. For example, if the route from plant 2 to region 4 is not allowed, you simply omit the data in the range A12:D12. This creates a model with exactly as many decision variable cells as allowable arcs. This additional benefit can be very valuable when the number of potential arcs in the network is huge—even though the vast majority of them are disallowed—which is exactly the situation in many large network models.

We do not necessarily recommend this more general network model for simple transpor- tation problems. In fact, it is probably less natural than the original model in Figure 14.14. However, it paves the way for the more complex network problems discussed next.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 685

Depending on how you treat the demand constraints, you can get several varieties of the basic transportation model.

14-4b Other Logistics Models

The objective of many real-world network models is to ship goods from one set of locations to another at minimum cost, subject to various constraints. There are many variations of these models. The simplest models include a single product that must be shipped via one mode of transportation (truck, for example) in a particular period of time. More complex models—and much larger ones—can include multiple products, multiple modes of trans- portation, and/or multiple time periods. We discuss one such problem in this section.

Basically, the general logistics problem is like the transportation problem except for two possible differences. First, arc capacities are often imposed on some or all of the arcs. These become simple upper-bound constraints in the model. Second and more signi�cant, there can be in�ows and out�ows associated with any node. Nodes are generally categorized as origins, and out�ows associated with any node. Nodes are generally categorized as origins, and destinations, and transshipment points. An origin is a location that starts with a certain supply

(or possibly a capacity for supplying). A destination is the opposite; it requires a certain amount to end up there. A transshipment point is a location where transshipment point is a location where transshipment point goods simply pass through.

The best way to think of these categories is in terms of net in�ow and net out�ow. The net in�ow for any node is de�ned as total in�ow minus total out�ow for that node. The net out�ow is the nega- tive of this, total out�ow minus total in�ow. Then an origin is a node with positive net out�ow, a des- tination is a node with positive net in�ow, and a transshipment point is a node with net out�ow (and net in�ow) equal to 0. It is important to realize that in�ows are sometimes allowed to origins, but their

Modeling Issues

■ The customer demands in typical transportation problems can be handled in one of two ways. First, you can think of these forecasted demands as minimal requirements that must be sent to the customers. This is how regional demands were treated here. Alternatively, you could consider the demands as maximal sales quantities, the most each region can sell. Then you would constrain the amounts sent to the regions to be less than or equal to the forecasted demands. Whether the demand constraints are expressed as “≥” or “≤” (or even “=”) constraints depends on the context of the problem—do the dealers need at least this many, do they need exactly this many, or can they sell only this many?

■ If all the supplies and demands for a transportation problem are integers, the optimal Solver solution automatically has integer-valued shipments. Explicit integer constraints are not required. This is a very important bene�t. It means that the “fast” simplex method can be used rather than much slower integer algorithms.

■ Shipping costs are often nonlinear (and “nonsmooth”) due to quantity discounts. For example, if it costs $3 per item to ship up to 100 items between locations and $2 per item for each additional item, the proportionality assumption of LP is violated and the resulting transportation model is nonlinear. Shipping problems that involve quantity discounts are generally quite dif�cult to solve.

■ Excel’s Solver uses the simplex method to solve transportation problems. There is a streamlined version of the simplex method, called the transportation simplex method, that is much more ef�cient than the ordinary simplex method for transportation prob- lems. Large transportation problems are usually solved with the transportation simplex method. See Winston (2003) for a discussion of the transportation simplex method. ■

Flow Balance Constraints All network optimization models have some form of flow balance constraints at the various nodes of the network. This flow balance relates the amount that enters the node to the amount that leaves the node. In many network models, the simple structure of these flow balance constraints guarantees that the optimal solutions have integer values. It also enables special- ized network versions of the simplex method to solve the huge network models typically encountered in real logistics applications.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

686 Chapter 14 Optimization Models

Figure 14.21 Graphical Representation of Logistics Model

E X A M P L E 14.4 PRODUCING AND SHIPPING TOMATO PRODUCTS AT REDBRAND

RedBrand Company produces a tomato product at three plants. This product can be shipped RedBrand Company produces a tomato product at three plants. This product can be shipped Rdirectly to the company’s two customers or it can first be shipped to the company’s two Rdirectly to the company’s two customers or it can first be shipped to the company’s two R warehouses and then to the customers. Figure 14.21 is a network representation of RedBrand’s problem. Nodes 1, 2, and 3 represent the plants (these are the origins, denoted by S for supplier), nodes 4 and 5 represent the warehouses (these are the transshipment points, denoted by T), and nodes 6 and 7 represent the customers (these are the destinations, denoted by D). Note that some shipments are allowed among plants, among warehouses, and among customers. Also, some arcs have arrows on both ends. This means that flow is allowed in either direction.

The cost of producing the product is the same at each plant, so RedBrand is concerned with minimizing the total shipping cost incurred in meeting customer demands. The pro- duction capacity of each plant (in tons per year) and the demand of each customer are shown in Figure 14.21. For example, plant 1 (node 1) has a capacity of 200, and customer 1 (node 6) has a demand of 400. In addition, the cost (in thousands of dollars) of shipping a ton of the product between each pair of locations is listed in Table 14.3, where a blank indicates that RedBrand cannot ship along that arc. We also assume that at most 200 tons of the product can be shipped between any two nodes. This is the common arc capacity. RedBrand wants to determine a minimum-cost shipping schedule.

© C

e n g

a g

e L

e a rn

in g

net out�ows are positive. Similarly, out�ows from destinations are sometimes allowed, but net out�ows are positive. Similarly, out�ows from destinations are sometimes allowed, but net their net in�ows are positive. For example, if Cincinnati and Memphis are manufacturers net in�ows are positive. For example, if Cincinnati and Memphis are manufacturers net (origins) and Dallas and Phoenix are retail locations (destinations), then it is possible that �ow could go from Cincinnati to Memphis to Dallas to Phoenix.

There are typically two types of constraints in logistics models (besides nonnegativ- ity of �ows). The �rst type represents the arc capacity constraints, which are simple upper bounds on the arc �ows. The second type represents the �ow balance constraints, one for each node. For an origin, this constraint is typically of the form Net Outflow = Capacity or possibly Net Outflow ≤ Capacity. For a destination, it is typically of the form Net Inflow >= Demand or possibly Net Inflow = Demand. For a transshipment point, it is of the form Net Inflow = 0 (which is equivalent to Net Outflow = 0).

It is easy to visualize these constraints in a graphical representation of the network by simply examining the �ows on the arrows leading into and out of the various nodes. We illustrate a typical logistics model in Example 14.4.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 687

Table 14.3 Shipping Costs for RedBrand Example (in $1000s) To node

From node 1 2 3 4 5 6 7

1 5.0 3.0 5.0 5.0 20.0 20.0 2 9.0 9.0 1.0 1.0 8.0 15.0 3 0.4 8.0 1.0 0.5 10.0 12.0 4 1.2 2.0 12.0 5 0.8 2.0 12.0 6 1.0 7 7.0

© C

e n g

a g

e L

e a rn

in g

Other than arc capacity constraints, the only constraints are flow balance constraints.

Objective To develop an optimization model for finding the minimum-cost way to ship the tomato product from suppliers to customers, possibly through warehouses, so that cus- tomer demands are met and supplier capacities are not exceeded.

Where Do the Numbers Come From? The network configuration itself would come from geographical considerations—which routes are physically possible (or sensible) and which are not. The numbers would be derived as in the Grand Prix automobile example. (See Example 14.3 for further discussion.)

Solution The variables and constraints for this logistics model are shown in Figure 14.22. (See the file RedBrand Logistics Big Picture.xlsx.) The key to the model is handling the flow balance constraints. You will see exactly how to implement these when we give step-by- step instructions for developing the spreadsheet model. However, it is not enough, say, to specify that the flow out of plant 2 is less than or equal to the capacity of plant 2. The rea- son is that there might also be flow into plant 2 (from another plant). Therefore, the correct flow balance constraint for plant 2 is that the flow out of it must be less than or equal to its capacity plus any flow into it. Equivalently, the net outflow from plant 2 must be less than net outflow from plant 2 must be less than net or equal to its capacity.

Figure 14.22 Big Picture for Logistics Model

Amount Sent on Routes

Route Capacity

Plant Net Ou low

Plant Capacity

Customer Net Inflow

Customer Demand

Warehouse Net Ou low (or inflow)

0

<=

<=

>=

=

Minimize Total Cost

Unit Shipping Cost

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

688 Chapter 14 Optimization Models

We generally prefer positive numbers on the right sides of constraints. This is why we calculate net outflows for origins and net inflows for destinations.

Developing the Spreadsheet Model To set up the spreadsheet model, proceed as follows. (See Figure 14.23 and the file RedBrand Logistics.xlsx. Also, refer to the network in Figure 14.21.)

1. Origins and destinations. Enter the node numbers (1 to 7) for the origins and desti- nations of the various arcs in the range A8:B33. Note that the disallowed arcs are not entered in this list.

2. Input data. Enter the unit shipping costs (in thousands of dollars), the common arc capacity, the plant capacities, and the customer demands in the blue cells. Again, only the nonblank entries in Table 14.3 are used to fill the column of unit shipping costs.

3. Flows on arcs. Enter any initial values for the flows in the range D8:D33. These are the decision variable cells.

4. Arc capacities. To indicate a common arc capacity for all arcs, enter the formula

=$B$4

in cell F8 and copy it down column F.

5. Flow balance constraints. Nodes 1, 2, and 3 are supply nodes, nodes 4 and 5 are transshipment points, and nodes 6 and 7 are demand nodes. Therefore, set up the left sides of the flow balance constraints appropriately for these three cases. Specifically, enter the net outflow for node 1 in cell I9 with the formula

=SUMIF(Origin,H9,Flow)-SUMIF(Destination,H9,Flow)

and copy it down to cell I11. This formula subtracts �ows into node 1 from �ows out of node 1 to obtain net out�ow for node 1. Next, copy this same formula to cells I15 and

Developing the Logistics Model

Figure 14.23 Logistics Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

KJIHGFEDCBA RedBrand shipping model

Inputs Common arc capacity 200

Network structure, flows, and arc capacity constraints Node balance constraints Origin Unit Cost Flow Arc Capacity Plant constraints

Plant net ou�lowNode200<=0521 Plant capacity 200<=1801200<=180331 300<=3002200<=0541 100<=1003200<=0551

1 6 20 0 <0 <= 200 1 7 20 0 <0 <= 200 Warehouse constraints

Warehouse net ou�lowNode200<=0912 Required 0=04200<=0932 0=05200<=120142

2 5 1 01 0 <= 200 2 6 8 180 <= 200 Customer constraints

Customer net inflowNode200<=01572 Customer demand 400>=4006200<=00.413 180>=1087200<=0823

3 4 1 81 80 <0 <= 200 3 5 0.5 200 <= 200 Range names used 3 6 10 0 <0 <= 200 Arc_Capacity =Model!$F$8:$F$33 3 7 12 0 <0 <= 200 Customer_demand =Model!$K$20:$K$21 4 5 1.2 0 <0 <= 200 Customer_net_inflow =Model!$I$20:$I$21 4 6 2 200 <= 200 =Model!$B$8:$B$33

=Model!$D$8:$D$33Flow Des�na�on

200<=01274 5 4 0.8 0 <0 <= 200 Origin =Model!$A$8:$A$33 5 6 2 200 <= 200 =Model!$K$9:$K$11 5 7 12 0 <0 <= 200 =Model!$I$9:$I$11 6 7 1 180 <= 200 Total_cost =Model!$B$36 7 6 7 07 0 <= 200 Unit_Cost =Model!$C$8:$C$33

Warehouse_net_ou�low

Plant_net_ou�low Plant_capacity

=Model!$I$15:$I$16

Total cost $3,260

t F w A

1 6 1 7

2 5 2 6

3 4 3 5 3 6 3 7 4 5 4 6

5 4 5 6 5 7 6 7 7 6

w A

Objec�ve to minimize

Des�na�on

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 689

I16 for the warehouses. (Remember that, for transshipment nodes, the left side of the constraint can be net out�ow or net in�ow, whichever you prefer. The reason is that if or net in�ow, whichever you prefer. The reason is that if or net out�ow is zero, net in�ow must also be zero.) Finally, enter the net in�ow for node 6 in cell I20 with the formula

=SUMIF(Destination,H20,Flow)-SUMIF(Origin,H20,Flow)

and copy it to cell I21. This formula subtracts �ows out of node 6 from �ows into node 6 to obtain the net in�ow for node 6.

6. Total shipping cost. Calculate the total shipping cost (in thousands of dollars) in cell B36 with the formula

=SUMPRODUCT(Unit_cost,Flow)

Using Solver The Solver dialog box should be set up as in Figure 14.24. The objective is to minimize total shipping costs, subject to the three types of flow balance constraints and the arc capacity constraints.

Figure 14.24 Solver Dialog Box for Logistics Model

© C

e n g

a g

e L

e a rn

in g

Discussion of the Solution The optimal solution in Figure 14.23 indicates that RedBrand’s customer demand can be satisfied with a shipping cost of $3,260,000. This solution appears graphically in

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

690 Chapter 14 Optimization Models

Figure 14.25. Note in particular that plant 1 produces 180 tons (under capacity) and ships it all to plant 3, not directly to warehouses or customers. Also, note that all shipments from the warehouses go directly to customer 1. Then customer 1 ships 180 tons to customer 2. We purposely chose unit shipping costs (probably unrealistic ones) to produce this type of behavior, just to show that it can occur. As you can see, the costs of shipping from plant 1 directly to warehouses or customers are relatively large compared to the cost of shipping directly to plant 3. Similarly, the costs of shipping from plants or warehouses directly to customer 2 are prohibitive. Therefore, RedBrand ships to customer 1 and lets customer 1 forward some of its shipment to customer 2.

7The COUNTIF and SUMIF functions are limited in that they allow only one condition, such as “>=10”. For this reason, Microsoft added two new functions in Excel 2007, COUNTIFS and SUMIFS, that allow multiple condi- tions. You can learn about them in online help.

Sensitivity Analysis How much effect does the arc capacity have on the optimal solution? Currently, three of the arcs with positive flow are at the arc capacity of 200. You can use SolverTable to see how sensitive this number and the total cost are to the arc capacity.6 In this case the single input cell for SolverTable is cell B4, which is varied from 150 to 300 in increments of 25. Two quantities are designated as outputs: total cost and the number of arcs at arc capacity. As before, if you want to keep track of an output that does not already exist, you can create it with an appropriate formula in a new cell before running SolverTable. Specifically, you can enter the formula =COUNTIF(Flow,B4) in an unused cell. This formula counts the arcs with flow equal to arc capacity. (See the finished version of the file for a note about this formula.)

Excel Function: COUNTIF The COUNTIF function counts the number of values in a given range that satisfy some criterion. The syntax is =COUNUNU TITIT FIFI (r(r( arar nge,e,e criterion). For example, the formula =COUNUNU TITIT FIFI (D(D( 8:D33,3,3 150) counts the number of cells in the range D8:D33 that contain the value 150. This formula could also be entered as =COUNUNU TITIT FIFI (D(D( 8:D33,3,3 “=150”). Similarly, the formula =COUNUNU TITIT FIFI (D(D( 8:D33,3,3 “>=100”) counts the number of cells in this range with values greater than or equal to 100.

7

6Note that Solver’s sensitivity report would not answer our question. This report is useful only for one-at-a- time changes in inputs, and here we are simultaneously changing the upper limit for each �ow. However, this report (its bottom section) can be used to assess the effects of changes in plant capacities or customer demands.

Figure 14.25 Optimal Flows for Logistics Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-4 Logistics Models 691

Figure 14.26 Sensitivity to Arc Capacity

3 2 1

4

5

6

7

8

9

10

11

A BA B C DC D E FE F G

Common arc capacity (cell $B$4) values along side, output cell(s) along top

To ta

l_ co

st

A rc

s_ at

_c ap

ac ity

150 $4,120 5

175 $3,643 6

200 $3,260 3

225 $2,998 3

250 $2,735 3

275 $2,473 3

300 $2,320 2

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

The SolverTable output in Figure 14.26 is what you would expect. As the arc capacity decreases, more flows bump up against it, and the total cost increases. But even when the arc capacity is increased to 300, two flows are constrained by it. In this sense, even this large an arc capacity costs RedBrand money.

Modeling Issues ■ There are many variations of this basic logistics model. Two variations are illustrated

in the �les RedBrand Logistics Multiple Products Finished.xlsx and RedBrand Logistics Shrinkage Finished.xlsx. In the �rst variation, two products compete for the same arc capacity. In the second, there is shrinkage at the warehouses due to spoiling.

■ Excel’s Solver uses the simplex method to solve logistics models. However, the simplex method can be simpli�ed dramatically for these types of models. The simpli�ed version of the simplex method, called the network simplex method, is much more ef�cient than the ordinary simplex method. Specialized computer codes have been written to implement the network simplex method, and all large logistics problems are solved by using the network simplex method. This is fortunate because real logistics models tend to be extremely large. See Winston (2003) for a discussion of this method.

■ If the given supplies and demands for the nodes are integers and all arc capacities are integers, the logistics model always has an optimal solution with all integer �ows. Again, this is very fortunate for large problems—you get integer solutions “for free” without having to use an integer programming algorithm. Note, however, that this “integers for free” bene�t is guaranteed only for the basic logistics model, as in the original RedBrand model. When the model is modi�ed in certain ways, such as by adding a shrinkage factor, the optimal solution is no longer guaranteed to be integer-valued. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

692 Chapter 14 Optimization Models

P R O B L E M S

Level A 13. In the original Grand Prix example, the total capac-

ity of the three plants is 1550, well above the total customer demand. Would it help to have 100 more units of capacity at plant 1? What is the most Grand Prix would be willing to pay for this extra capacity? Answer the same questions for plant 2 and for plant 3. Explain why extra capacity can be valuable even though the company already has more total capacity than it requires.

14. The optimal solution to the original Grand Prix prob- lem indicates that with a unit shipping cost of $132, the route from plant 3 to region 2 is evidently too expensive—no autos are shipped along this route. Use SolverTable to see how much this unit shipping cost would have to be reduced before some autos would be shipped along this route.

15. In the RedBrand example, suppose the plants cannot ship to each other and the customers cannot ship to each other. Modify the model appropriately, and rerun Solver. How much does the total cost increase because of these disallowed routes?

16. Modify the RedBrand example so that all flows must be from plants to warehouses and from warehouses to customers. Disallow all other arcs. How much does this restriction cost RedBrand, relative to the original optimal shipping cost?

17. In the RedBrand example, the costs for shipping from plants or warehouses to customer 2 were purposely made high so that it would be optimal to ship to customer 1 and then let customer 1 ship to customer 2. Use SolverTable appropriately to do the following. Decrease the unit shipping costs from plants and warehouses to customer 1, all by the same amount, until it is no longer optimal for customer 1 to ship to customer 2. Describe what happens to the optimal shipping plan at this point.

18. In the RedBrand example the arc capacity is the same for all allowable arcs. Modify the model so that each arc has its own arc capacity. You can make up the arc capacities.

19. Continuing the previous problem, make the problem even more general by allowing upper bounds (arc capacities) and lower bounds for the and lower bounds for the and flows on the allowable arcs. Some of the upper bounds can be very large numbers, effectively indicating that there is no arc capacity for these arcs, and the lower bounds can be zero or positive. If they are positive, they indicate that some

positive flow must occur on these arcs. Modify the model appropriately to handle these upper and lower bounds. You can make up the upper and lower bounds.

20. Suppose in the original Grand Prix example that the routes from plant 2 to region 1 and from plant 3 to region 3 are not allowed. (Perhaps there are no rail- road lines for these routes.) How would you modify the original model (Figure 14.14) to rule out these routes? How would you modify the alternative model (Figure 14.19) to do so? Discuss the pros and cons of these two approaches.

21. The RedBrand model in the file RedBrand Logistics Multiple Product Finished.xlsx assumes that the unit shipping costs are the same for both prod- ucts. Modify the model so that each product has its own unit shipping costs. You can assume that the original unit shipping costs apply to product 1, and you can make up new unit shipping costs for product 2.

Level B 22. Here is a problem to challenge your intuition. In the

original Grand Prix example, reduce the capacity of plant 2 to 300. Then the total capacity is equal to the total demand. Rerun Solver on the modified model. You should find that the optimal solution uses all capacity and exactly meets all demands with a total cost of $176,050. Now increase the capacity of plant 1 and the demand at region 2 by one automobile each, and optimize again. What happens to the optimal total cost? How can you explain this “more for less” paradox?

23. Continuing the previous problem (with capacity 300 at plant 2), suppose you want to see how much extra capacity and extra demand you can add to plant 1 and region 2 (the same amount to each) before the total shipping cost stops decreasing and starts increasing. Use SolverTable appropriately to find out. (You will probably need to use some trial and error on the range of input values.) Can you explain intuitively what causes the total cost to stop decreasing and start increasing?

24. Modify the original Grand Prix example by increas- ing the demand at each region by 200, so that total demand is well above total plant capacity. However, now interpret these “demands” as “maximum sales,” the most each region can accommodate, and change the “demand” constraints to become “≤” constraints, not “≥” constraints. How does the optimal solution change? Does it make realistic sense? If not, how

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-5 Aggregate Planning Models 693

might you change the model to obtain a realistic solution?

25. Modify the original Grand Prix example by increasing the demand at each region by 200, so that total demand is well above total plant capacity. This means that some demands cannot be supplied. Suppose there is a unit “penalty” cost at each region for not supplying an automobile. Let these unit penalty costs be $600, $750, $625, and $550 for the four regions. Develop a model to minimize the sum of shipping costs and penalty costs for unsatisfied demands. (Hint: Introduce a fourth plant with plenty of capacity, and set its unit shipping costs to the regions equal to the unit penalty costs. Then interpret an auto shipped from this fictitious plant to a region as a unit of demand not satisfied.)

26. How difficult is it to expand the RedBrand model? Answer this by adding a new plant, two new warehouses, and three new customers, and modify the spreadsheet model appropriately. You can make up the required input data. Would you conclude that these types of spreadsheet models scale easily?

27. In the RedBrand model in the file RedBrand Logistics Shrinkage Finished.xlsx, change the assumptions. Now instead of assuming that there is some shrinkage at the warehouses, assume that there is shrinkage in delivery along each route. Specifically, assume that a certain percentage of the units sent along

each arc perish in transit—from faulty refrigeration, for example—and this percentage can differ from one arc to another. Modify the model appropriately to take this type of behavior into account. You can make up the shrinkage factors, and you can assume that arc capacities apply to the amounts originally shipped, not to the amounts after shrinkage. (Make sure your input data permit a feasible solution. After all, if there is too much shrinkage, it will be impossible to meet demands with available plant capacity. Increase the plant capacities if necessary.)

28. Consider a modification of the RedBrand model where there are N plants, N plants, N M warehouses, and L customers. Assume that the only allowable arcs are from plants to warehouses and from warehouses to customers. If all such arcs are allowable— all plants can ship to all warehouses and all warehouses can ship to all customers—how many decision variable cells are in the spreadsheet model? Keeping in mind that Excel’s Solver can handle at most 200 decision variable cells, provide some combinations of N, M, and L that barely stay within Solver’s limit.

29. Continuing the previous problem, develop a sample model with your own choices of N, N, N M, and L that barely stay within Solver’s limit. L that barely stay within Solver’s limit. L You can make up any input data. The important point here is the layout and formulas of the spreadsheet model.

14-5 AGGREGATE PLANNING MODELS In this section, we extend the production planning model discussed in Example 13.3 of the previous chapter to include a situation where the number of workers available in�u- ences the possible production levels. We allow the workforce level to be modi�ed each period through the hiring and �ring of workers. Such models, where we determine work- force levels and production schedules for a multiperiod time horizon, are called aggregate planning models. There are many variations of aggregate planning models, depending on the detailed assumptions made. We consider a fairly simple version and then ask you to modify it in the problems.

E X A M P L E 14.5 AGGREGATE PLANNING AT SURESTEP

During the next four months SureStep Company must meet (on time) the following demands for pairs of shoes: 3000 in month 1; 5000 in month 2; 2000 in month 3; and 1000 in month 4. At the beginning of month 1, 500 pairs of shoes are on hand, and SureStep has 100 workers. A worker is paid $1500 per month. Each worker can work up to 160 hours a month before he or she receives overtime. A worker can work up to

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

694 Chapter 14 Optimization Models

The key to this model is choosing the correct decision variable cells— the decision variables that determine all outputs.

20 hours of overtime per month and is paid $13 per hour for overtime labor. It takes four hours of labor and $15 of raw material to produce a pair of shoes. At the beginning of each month, workers can be hired or fired. Each hired worker costs $1600, and each fired worker costs $2000. At the end of each month, a holding cost of $3 per pair of shoes left in inventory is incurred. Production in a given month can be used to meet that month’s demand. SureStep wants to determine its optimal production schedule and labor policy.

Objective To develop an optimization model that relates workforce and production decisions to monthly costs, and to find the minimum-cost solution that meets forecasted demands on time and stays within limits on overtime hours and production capacity.

Where Do the Numbers Come From? There are a number of required inputs for this type of problem. Some, including initial inventory, holding costs, and demands, are similar to requirements for Example 13.3 in the previous chapter, so we won’t discuss them again here. Others might be obtained as follows.

■ The data on the current number of workers, the regular hours per worker per month, the regular hourly wage rates, and the overtime hourly rate, should be well known. The maximum number of overtime hours per worker per month is probably either the result of a policy decision by management or a clause in the workers’ contracts.

■ The costs for hiring and �ring a worker are not trivial. The hiring cost includes training costs and the cost of decreased productivity due to the fact that a new worker must learn the job. The �ring cost includes severance costs and costs due to loss of morale. Neither the hiring nor the �ring cost would be simple to estimate accurately, but the human resources department should be able to estimate their values.

■ The unit production cost is a combination of two inputs: the raw material cost per pair of shoes and the labor hours per pair of shoes. The raw material cost is the going rate from the supplier(s). The labor per pair of shoes represents the “production function”—the average labor required to produce a unit of the product. The operations managers should be able to supply this number.

Solution A diagram for this model appears in Figure 14.27. (See the file Aggregate Planning Big Picture.xlsx.) It is divided into three parts: a section for workers, a section for shoes, and a section relating workers to shoe production. As you see, there are a lot of variables to keep track of. In fact, the most difficult aspect of modeling this problem is knowing which variables the company gets to choose—the decision variables—and which variables are determined by these decisions. It should be clear that the company gets to choose the determined by these decisions. It should be clear that the company gets to choose the determined number of workers to hire and fire and the number of shoes to produce. Also, because management sets only an upper limit on overtime hours, it gets to decide how many over- time hours to use within this limit. But once it decides the values of these variables, everything else is determined. We will show how these are determined through detailed cell formulas, but you should mentally go through the yellow calculated values (those in rounded rectangles) and deduce how they are determined by the decision variables. Also, you should convince yourself that the three constraints listed are the ones, and the only ones, that are required.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-5 Aggregate Planning Models 695

This is common in multiperiod problems. You usually have to relate a beginning value in one period to an ending value from the previous period.

Developing the Basic Aggregate Planning Model

Developing the Spreadsheet Model The spreadsheet model appears in Figure 14.28. (See the file Aggregate Planning 1.xlsx.) It can be developed as follows.

1. Inputs and range names. Enter the input data and create the range names listed.

2. Production, hiring, and firing plan. Enter any trial values for the number of pairs of shoes produced each month, the overtime hours used each month, the workers hired each month, and the workers fired each month. These four ranges, in rows 18, 19, 23, and 30, comprise the decision variable cells.

3. Workers available each month. In cell B17 enter the initial number of workers available with the formula

=B5 Because the number of workers available at the beginning of any other month (before hiring and firing) is equal to the number of workers from the previous month, enter the formula

=B20 in cell C17 and copy it to the range D17:E17. Then calculate the number of workers available in month 1 (after hiring and firing) in cell B20 with the formula

=B17+B18-B19 and copy this formula to the range C20:E20 for the other months.

Figure 14.27 Big Picture for Aggregate Planning Model

Minimize Total Cost (sum of costs in gray)

Workers

Workers to Shoe Produc�on

Shoe Produc�on

Hiring Cost Per Worker

Total Hiring Cost

Workers from Previous Month

Workers Available A�er Hiring and Firing

Ini�al Number of Workers

Workers Hired

Firing Cost Per Worker

Total Firing Cost

Regular Hours Per Worker Per Month

Regular-�me Hours Available

Total Hours for Produc�on

Labor Hours Per Pair of Shoes

Total Over�me Wages

Total Regular- Time Wages

Maximum Over�me Labor Hours Available

Over�me Wage Rate Per Hour

Regular Wages Per Worker Per Month

Maximum Over�me Hours Per Worker Per Month

Workers Fired

Shoes Produced

<=

<=

Over�me Labor Hours Used

Raw Material Cost Per Pair of Shoes

Total Raw Material Cost

Produc�on Capacity

Holding Cost Per Pair of Shoes Per Month

Total Holding Cost

Ending Inventory

Ini�al Inventory of Shoes

Inventory A�er Produc�on

>= Forecasted Demand

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

696 Chapter 14 Optimization Models

4. Overtime capacity. Because each available worker can work up to 20 hours of overtime in a month, enter the formula

=$B$7*B20 in cell B25 and copy it to the range C25:E25.

5. Production capacity. Because each worker can work 160 regular-time hours per month, calculate the regular-time hours available in month 1 in cell B22 with the formula

=$B$6*B20 and copy it to the range C22:E22 for the other months. Then calculate the total hours available for production in cell B27 with the formula

=SUM(B22:B23) and copy it to the range C27:E27 for the other months. Finally, because it takes four hours of labor to make a pair of shoes, calculate the production capacity in month 1 with the formula

=B27/$B$12

in cell B32 and copy it to the range C32:E32.

In Example 13.3 from the previous chapter, production capacities were given inputs. Now they are based on the size of the workforce, which itself is a decision variable.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

IHGFEDCBA SureStep aggregate planning model

Input data Range names used: Ini�al inventory of shoes Forecasted_demand500 Ini�al number of workers Inventory_a�er_produc�on100 Regular hours/worker/month Maximum_over�me_labor_hours_available160 Maximum over�me hours/worker/month Over�me_labor_hours_used20 Hiring cost/worker Produc�on_capacity$1,600 Firing cost/worker Shoes_produced$2,000 Regular wages/worker/month Total_cost$1,500 Over�me wage rate/hour Workers_fired$13 Labor hours/pair of shoes =Model!$B$18:$E$18Workers_hired4 Raw material cost/pair of shoes $15 Holding cost/pair of shoes in inventory/month $3

Worker plan Month 1 Month 2 Month 3 Month 4 Workers from previous month 509394100 Workers hired 0 0 0 0 Workers fired 04316 Workers available a�er hiring and firing 94 93 50 50

Regular-�me hours available 800080001488015040 Over�me labor hours used 00800

<= <= <= <= Maximum over�me labor hours available 1880 1860 1000 1000

Total hours for produc�on 800080001496015040

Produc�on plan Month 1 Month 2 Month 3 Month 4 Shoes Produced 1000200037403760

Produc�on capacity 2000200037403760

Inventory a�er produc�on 1000200050004260

<= <= <= <=

>= >= >= >= Forecasted demand 1000200050003000 Ending inventory 0001260

Monetary outputs Month 1 Month 2 Month 3 Month 4 Totals Hiring cost $0$0$0$0$0 Firing cost $100,000$0$86,000$2,000$12,000 Regular-�me wages $430,500$75,000$75,000$139,500$141,000 Over�me wages $1,040$0$0$1,040$0 Raw material cost $157,500$15,000$30,000$56,100$56,400 Holding cost $3,780$0$0$0$3,780

$692,820$90,000$191,000$198,640$213,180Totals Objec�ve to minimize

=Model!$B$19:$E$19 =Model!$F$46 =Model!$B$30:$E$30 =Model!$B$32:$E$32 =Model!$B$23:$E$23 =Model!$B$25:$E$25 =Model!$B$34:$E$34 =Model!$B$36:$E$36

© C

e n g

a g

e L

e a rn

in g

Figure 14.28 Aggregate Planning Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-5 Aggregate Planning Models 697

6. Inventory each month. Calculate the inventory after production in month 1 (which is available to meet month 1 demand) with the formula

=B4+B30

in cell B34. For any other month, the inventory after production is the previous month’s ending inventory plus that month’s production, so enter the formula

=B37+C30

in cell C34 and copy it to the range D34:E34. Then calculate the month 1 ending inventory in cell B37 with the formula

=B34-B36

and copy it to the range C37:E37.

7. Monthly costs. Calculate the various costs shown in rows 40 through 45 for month 1 by entering the formulas

=$B$8*B18

=$B$9*B19

=$B$10*B20

=$B$11*B23

=$B$13*B30

=$B$14*B37

in cells B40 through B45. Then copy the range B40:B45 to the range C40:E45 to calculate these costs for the other months.

8. Totals. In row 46 and column F, use the SUM function to calculate cost totals, with the value in F46 being the overall total cost to minimize.

Excel Tip: Calculating Row and Column Sums with AutoSum A common operation in spreadsheet models is to calculate row and column sums for a rectangular range, as we did for costs in step 8. There is a very quick way to do this. Select the row and column where the sums will go (remember to press the Ctrl key to select nonadjacent ranges) and click the AutoSum (Σ) button. This enters all of the sums automatically. It even calculates the “grand sum” in the corner (cell F46 in the example) if this cell is part of the selection.

Using Solver The Solver dialog box should be filled in as shown in Figure 14.29. Note that the deci- sion variable cells include four separate named ranges. To enter these in the dialog box, drag the four ranges, keeping your finger on the Ctrl key. (Alternatively, you can drag a range, type a comma, drag a second range, type another comma, and so on.) As usual, you should also check the Non-Negative option and select the Simplex LP method before optimizing.

Note that there are integer constraints on the numbers hired and fired. You could also constrain the numbers of shoes produced to be integers. However, integer constraints typi- cally require longer solution times. Therefore, it is often best to omit such constraints, especially when the optimal values are fairly large, such as the production quantities in this model. If the solution then has noninteger values, you can usually round them to integers for a solution that is at least close to the optimal integer solution.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

698 Chapter 14 Optimization Models

Discussion of the Solution The optimal solution is given in Figure 14.28. Observe that SureStep should never hire any workers, and it should fire six workers in month 1, one worker in month 2, and 43 workers in month 3. Eighty hours of overtime are used, but only in month 2. The company produces over 3700 pairs of shoes during each of the first 2 months, 2000 pairs in month 3, and 1000 pairs in month 4. A total cost of $692,820 is incurred. The Solver solution will recommend overtime hours only when regular-time production capacity is exhausted. This is because overtime labor is more expensive.

Again, you would probably not force the number of pairs of shoes produced each month to be an integer. It makes little difference whether the company produces 3760 or 3761 pairs of shoes during a month, and forcing each month’s shoe production to be an integer can greatly increase the time Solver needs to find an optimal solution. On the other hand, it is somewhat more important to ensure that the number of workers hired and fired each month is an integer, given the relatively small numbers of workers involved.

Finally, if you want to ensure that Solver finds the optimal solution in a problem where some or all of the decision variable cells must be integers, you should go into Options (in the Solver dialog box) and make sure the Integer Optimality is set to zero. Otherwise, Solver might stop when it finds a solution that is only close to optimal.

Sensitivity Analysis There are many possible sensitivity analyses for this SureStep model. We illustrate one of them with SolverTable, where we see how the overtime hours used and the total cost vary

Figure 14.29 Solver Dialog Box for Aggregate Planning Model

© C

e n g

a g

e L

e a rn

in g

Because integer constraints make a model more difficult to solve, use them sparingly—only when they are really needed.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-5 Aggregate Planning Models 699

Figure 14.30 Sensitivity to Overtime Wage Rate

3 2 1

4 5 6 7 8 9

10 11 12

A BA B C DC D E FE F G

Over me rate (cell $B$11) values along side, output cell(s) along top

To ta

l_ co

st

O ve

r m

e_ la

bo r_

ho ur

s_ us

ed _4

O ve

r m

e_ la

bo r_

ho ur

s_ us

ed _3

O ve

r m

e_ la

bo r_

ho ur

s_ us

ed _2

O ve

r m

e_ la

bo r_

ho ur

s_ us

ed _1

$7 1620 1660 0 0 $684,755 $9 80 1760 0 0 $691,180

$11 0 80 0 0 $692,660 $13 0 80 0 0 $692,820 $15 0 80 0 0 $692,980 $17 0 80 0 0 $693,140 $19 0 0 0 0 $693,220 $21 0 0 0 0 $693,220

0 8 0 8 0 8 0 8 0 0 0 0

0 0

Oneway analysis for Solver model in Model worksheet

8Solver’s sensitivity report isn’t even available here because of the integer constraints.

© C

e n g

a g

e L

e a rn

in g

with the overtime wage rate.8 The results appear in Figure 14.30. As you can see, when the wage rate is really low, the company uses considerably more overtime hours, whereas when it is sufficiently large, the company uses no overtime hours. It is not surprising that the company uses much more overtime when the overtime rate is $7 or $9 per hour. The regular-time wage rate is $9.375 per hour (=1500/160). Of course, the company would never pay less per hour for overtime than for regular time.

The term “backlogging” means that the customer’s demand is met at a later date. The term “back-ordering” means the same thing.

The Rolling Planning Horizon Approach In reality, an aggregate planning model is usually implemented via a rolling planning horizon. To illustrate, we assume that SureStep works with a four-month planning hori- zon. To implement the SureStep model in the rolling planning horizon context, we view the demands as forecasts and solve a four-month model with these forecasts. However, the company would implement only the month 1 production and work scheduling rec- ommendation. Thus (assuming that the numbers of workers hired and fired in a month must be integers) the company would hire no workers, fire six workers, and produce 3760 pairs of shoes with regular-time labor in month 1. Next, the company would observe month 1’s actual demand. Suppose it is 2950. Then SureStep would begin month 2 with 1310 (= 4260 − 2950) pairs of shoes and 94 workers. It would now enter 1310 in cell B4 and 94 in cell B5 (referring to Figure 14.28). Then it would replace the demands in the Demand range with the updated forecasts for the next four months. Finally, SureStep next four months. Finally, SureStep next would rerun Solver and use the production levels and hiring and firing recommendations in column B as the production level and workforce policy for month 2.

Model with Backlogging Allowed In many situations, backlogging of demand is allowed—that is, customer demand can be met at a later date. We now show how to modify the SureStep model to include the option

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

700 Chapter 14 Optimization Models

Although these formulas accurately compute holding and shortage costs, the IF func- tions make the objective cell a nonlinear function of the decision variable cells, and Solver’s nonlinear function of the decision variable cells, and Solver’s nonlinear GRG nonlinear algorithm must be used, as indicated in Figure 14.32.9 (How do you know the model is nonlinear? Although there is a mathematical reason, it is easier to try running Solver with the simplex algorithm. Solver will then inform you that the model is nonlinear.)

We ran Solver with this setup from a variety of initial solutions in the decision variable cells, and it always found the optimal solution. But we were lucky. When certain functions, including IF, MIN, MAX, and ABS, are used to relate the objective cell to the decision variable cells, the resulting model becomes not only nonlinear but nonsmooth. Essentially, nonsmooth functions can have sharp edges or discontinuities. Solver’s GRG nonlinear algo- rithm can handle “smooth” nonlinearities, as you will see in Section 14-8, but it has trouble

of backlogging demand. We assume that at the end of each month a cost of $20 is incurred for each unit of demand that remains unsatisfied at the end of the month. This is easily modeled by allowing a month’s ending inventory to be negative. For example, if month 1’s ending inventory is −10, a shortage cost of $200 (and no inventory holding cost) is incurred. To ensure that SureStep produces any shoes at all, we constrain the ending inven- tory in month 4 to be nonnegative. This implies that all demand is eventually satisfied by the end of the four-month planning horizon. We now need to modify the monthly cost calculations to incorporate costs due to backlogging.

There are actually several modeling approaches to this backlogging problem. We show the most natural approach in Figure 14.31. (See the file Aggregate Planning 2.xlsx.) To begin, enter the per-unit monthly shortage cost in cell B15. (A new row was inserted for this cost input.) Note in row 38 how the ending inventory in months 1 through 3 can be positive (leftovers) or negative (shortages). You can account correctly for the resulting costs with IF functions in rows 46 and 47. For holding costs, enter the formula

=IF(B38>0,$B$14*B38,0)

in cell B46 and copy it across. For shortage costs, enter the formula

=IF(B38<0,−$B$15*B38,0)

in cell B47 and copy it across. (The minus sign makes this a positive cost.)

Developing the Aggregate Planning Backlogging Model

Figure 14.31 Nonlinear Aggregate Planning Model Using IF Functions

$690,180

40 39

41 42 43 44 45 46 47 48

Monetary outputs Hiring cost Firing cost Regular-�me wages Over�me wages Raw material cost Holding cost Shortage cost Totals

Month 1 $0

$12,000 $141,000

$0 $56,400

$3,780 =IF(B38<0,�$B$15*B38,0)

Totals $0

$124,000 $394,500

$0 $157,500

$3,780 $10,400

Month 4 $0 $0

$57,000 $0

$22,500 $0 $0

9,500

Month 3 $0

$110,000 $57,000

$0 $22,800

$0

Month 2 $0

$2,000

37 38

Forecasted demand Ending inventory

3000 1260

1000 0

2000 �500

5000 �20

$139,500 $0

$55,800 $0

FEDCBA

IF(logical_test,[value_if_true], [value_if_false])

© C

e n g

a g

e L

e a rn

in g

9GRG stands for generalized reduced gradient. This is a technical term for the mathematical algorithm used. The other algorithm available in Solver (starting with Excel 2010) is the Evolutionary algorithm. It can handle IF func- tions, but we will not discuss this algorithm here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-5 Aggregate Planning Models 701

Figure 14.32 Solver Dialog Box for the GRG Nonlinear Algorithm

© C

e n g

a g

e L

e a rn

in g

with nonsmooth functions. Sometimes it gets lucky, as it did here, and other times it finds a nonoptimal solution that is not even close to the optimal solution. For example, we changed the unit shortage cost from $20 to $40 and reran Solver. Starting from a solution where all decision variable cells contain zero, Solver stopped at a solution with total cost $726,360, even though the optimal solution has total cost $692,820. So we weren’t so lucky this time.

The moral is that you should avoid these nonsmooth functions in optimization models if at all possible. If you do use them, as we have done here, you should run Solver sev- eral times, starting from different initial solutions. There is still no guarantee that you will get the optimal solution, but you will see more evidence of how Solver is progress- ing. (Alternatively, you can use Frontline Systems’s Evolutionary Solver, which became available in Excel’s Solver in Excel 2010. You can also use the Evolver add-in, part of Palisade’s DecisionTools® available in Excel’s Solver in Excel 2010. You can also use the Evolver add-in, part of

® available in Excel’s Solver in Excel 2010. You can also use the Evolver add-in, part of

Suite.)

Solver Tip: Nonsmooth Functions There is nothing inherently wrong with using IF, MIN, MAX, ABS, and other nonsmooth functions in spreadsheet optimization models. The problem is that Solver’s GRG nonlinear algorithm cannot handle these functions in a predictable manner.

There are sometimes alternatives to using IF, MIN, MAX, and ABS functions that make a model linear. Unfortunately, these alternatives are often far from intuitive, and we will not cover them here. (If you are interested, we have included the “linearized” version of the backlogging model in the file Aggregate Planning 3 Finished.xlsx.) ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

702 Chapter 14 Optimization Models

Nonsmooth Functions and Solver Excel’s Solver, as well as most other commercial optimization software packages, has trouble with nonsmooth nonlinear functions. These nonsmooth functions typically have sharp edges or discontinui- ties that make them difficult to handle in optimization models, and (in Excel) they are typically implemented

with functions such as IF, MAX, MIN, ABS, and a few others. There is nothing wrong with using such funcwrong with using such funcwrong - tions to implement complex logic in Excel optimi- zation models. The problem is that Solver cannot handle models with these functions predictably. This is not really the fault of Solver. Such problems are inherently difficult.

F u n da m e n ta l I n s i g h t

P R O B L E M S

Level A 30. Extend SureStep’s original (no backlogging) aggregate

planning model from four to six months. Try several different values for demands in months 5 and 6, and run Solver for each. Is your optimal solution for the first four months the same as the one in the example?first four months the same as the one in the example?first

31. The current solution to SureStep’s no-backlogging aggregate planning model does quite a lot of firing. Run a one-way SolverTable with the firing cost as the input variable and the numbers fired as the outputs. Let the firing cost increase from its current value to double that value in increments of $400. Do high firing costs eventually induce the company to fire fewer workers?

32. SureStep is currently getting 160 regular-time hours from each worker per month. This is actually calcu- lated from 8 hours per day times 20 days per month. For this, they are paid $9.375 per hour (=1500/160). Suppose workers can change their contract so that they have to work only 7.5 hours per day regular time— everything above this becomes overtime—and their regular-time wage rate increases to $10 per hour. They will still work 20 days per month. Does this change the optimal no-backlogging solution?

33. Suppose SureStep could begin a machinery upgrade and training program to increase its worker productivity. This program would result in the following values of labor hours per pair of shoes over the next four months: 4, 3.9, 3.8, and 3.8. How much would this new program be worth to SureStep, at least for this four-month planning horizon with no backlogging? How might you evaluate the program’s worth beyond the next four months?beyond the next four months?beyond

Level B 34. In the current no-backlogging problem, SureStep

doesn’t hire any workers, and it uses almost no

overtime. This is evidently because of low demand. Change the demands to 6000, 8000, 5000, and 3000, and rerun Solver. Is there now any hiring and/or overtime? With this new demand pattern, explore the trade-off between hiring and overtime by running a two-way SolverTable. As inputs, use the hiring cost per worker and the maximum overtime hours allowed per worker per month, varied over reasonable ranges. As outputs, use the total number of workers hired over the four months and the total number of overtime hours used over the four months. Discuss the results.

35. In the SureStep no-backlogging problem, change the demands so that they become 6000, 8000, 5000, and 3000. Also, change the problem slightly so that newly hired workers take six hours to produce a pair of shoes during their first month of employment. After that, they take only four hours per pair of shoes. Modify the model appropriately, and use Solver to find the opti- mal solution.

36. You saw that the “natural” way to model SureStep’s backlogging problem, with IF functions, leads to a nonsmooth model that Solver has difficulty han- dling. There is another version of the problem that is also difficult for Solver. Suppose SureStep wants to meet all demands on time (no backlogging), but it wants to keep its employment level as constant over time as possible. To induce this, it charges a cost of $1000 each month on the absolute difference between the beginning number of workers and the number after hiring and firing—that is, the absolute difference between the values in rows 17 and 20 of the original spreadsheet model. Implement this extra cost in the model in the “natural” way, using the ABS function. Using demands of 6000, 8000, 5000, and 3000, see how well Solver does in solving this nonsmooth model. Try several initial solutions, and see whether Solver gets the same optimal solution from each of them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 703

14-6 FINANCIAL MODELS The majority of optimization examples described in management science textbooks are in the area of operations: scheduling, blending, logistics, aggregate planning, and others. This is probably warranted, because many of the most successful management science applications in the real world have been in these areas. However, optimization and other management science methods have also been applied successfully in a number of �nancial areas, and they deserve recognition. In this section we begin the discussion with two typical applications of optimization in �nance. The �rst involves investment strategy. The second involves pension fund management.

E X A M P L E 14.6 FINDING AN OPTIMAL INVESTMENT STRATEGY AT BARNEY-JONES

At the present time, the beginning of year 1, Barney-Jones Investment Corporation has $100,000 to invest for the next four years. There are five possible investments, labeled A through E. The timing of cash outflows and cash inflows for these investments is somewhat irregular. For example, to take part in investment A, cash must be invested at the beginning of year 1, and for every dollar invested, there are returns of $0.50 and $1.00 at the beginnings of years 2 and 3. Information for the other investments follows, where all returns are per dollar invested:10 at the beginnings of years 2 and 3. Information for the other investments follows, where all

10 at the beginnings of years 2 and 3. Information for the other investments follows, where all

■ Investment B: Invest at the beginning of year 2, receive returns of $0.50 and $1.00 at the beginnings of years 3 and 4

■ Investment C: Invest at the beginning of year 1, receive return of $1.20 at the beginning of year 2

■ Investment D: Invest at the beginning of year 4, receive return of $1.90 at the beginning of year 5

■ Investment E: Invest at the beginning of year 3, receive return of $1.50 at the beginning of year 4

We assume that any amounts can be invested in these strategies and that the returns are the same for each dollar invested. However, to create a diversified portfolio, Barney-Jones wants to limit the amount put into any investment to $75,000. The company wants an investment strategy that maximizes the amount of cash on hand at the beginning of year 5. At the beginning of any year, it can invest only cash on hand, which includes returns from previous investments. Any cash not invested in any year can be put in a short-term money market account that earns 3% annually.

Objective To develop an optimization model that relates investment decisions to total ending cash, and to use Solver to find the strategy that maximizes ending cash and invests no more than a given amount in any one investment.

Where Do the Numbers Come From? There is no mystery here. We assume that the terms of each investment are spelled out, so that Barney-Jones knows exactly when money must be invested and what the amounts and timing of returns will be. Of course, this would not be the case for many real-world

10You might criticize this model for assuming known returns in future years. If the returns are actually uncertain with given probability distributions, the RISKOptimizer tool in @RISK (part of Palisade’s DecisionTools Suite) can be used to �nd the investment strategy that maximizes the expected return. However, we won’t discuss this expected return. However, we won’t discuss this expected possibility here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

704 Chapter 14 Optimization Models

investments, such as money put into the stock market, where considerable uncertainty is involved. We consider one such example of investing with uncertainty when we study port- folio optimization in Section 14-8.

Solution The variables and constraints for this investment model are shown in Figure 14.33. (See the file Investing Big Picture.xlsx.) On the surface, this problem appears to be very straight- forward. You must decide how much to invest in the available investments at the beginning of each year, using only the cash available. If you try modeling this problem without our help, however, we suspect that you will have some difficulty. It took us a few tries to get a model that is easy to read and generalizes to other similar investment problems. Note that the second constraint in the table can be expressed in two ways. It can be expressed as shown, where the cash on hand after investing is nonnegative, or it can be expressed as after investing is nonnegative, or it can be expressed as after “cash invested in any year must be less than or equal to cash on hand at the beginning of that year.” These are equivalent. The one you choose is a matter of taste.

There are often multiple equivalent ways to state a constraint. You can choose the one that is most natural for you.

Developing the Spreadsheet Model The spreadsheet model for this investment problem appears in Figure 14.34. (See the file Investing.xlsx.) To set up this spreadsheet, proceed as follows.

1. Inputs and range names. As usual, enter the given inputs in the blue cells and name the ranges indicated. Pay particular attention to the two shaded tables. This is probably the first model you have encountered where model development is affected significantly by the way you enter the inputs, specifically, the information about the investments. We sug- gest separating cash outflows from cash inflows, as shown in the two ranges B11:F14 and B19:F23. The top table indicates when investments can be made, where a blank (equiva- lent to a 0) indicates no possible investment, and $1.00 indicates a dollar of investment. The bottom table then indicates the amounts and timing of returns per dollar invested.

2. Investment amounts. Enter any trial values in the Dollars_invested range. This range contains the decision variable cells. Also put a link to the maximum invest- ment amount per investment by entering the formula

=$B$5 in cell B28 and copying it across.

Note how the two input tables allow you to create copyable SUMPRODUCT formulas for cash outflows and inflows. Careful spreadsheet planning can often greatly simplify the necessary formulas.

Developing the Investment Model

© C

e n g

a g

e L

e a rn

in g

Dollars Invested

Cash Invested

Cash A�er Inves�ng

Minimize Final Cash

Return from InvestmentsBeginning Cash

Ini�al Amount to Invest

Interest Rate on Cash

Maximum per Investment

Cash Return Per Dollar Invested

Cash Outlay Per Dollar Invested

<=

>= 0

Figure 14.33 Big Picture for Investment Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 705

3. Cash balances and flows. The key to the model is the section in rows 32 through 36. For each year, you need to calculate the beginning cash held from the previous year, the returns from investments that are due in that year, the investments made in that year, and cash balance after investments. Begin by entering the initial cash in cell B32 with the formula

=B4 Moving across, calculate the return due in year 1 in cell C32 with the formula

=SUMPRODUCT(B19:F19,Dollars_invested)

Admittedly, no returns come due in year 1, but this formula can be copied down column C for other years. Next, calculate the total amount invested in year 1 in cell D32 with the formula

=SUMPRODUCT(B11:F11,Dollars_invested)

Now find the cash balance after investing in year 1 in cell E32 with the formula

=B32+C32-D32

The only other required formula is the formula for the cash available at the begin- ning of year 2. Because any cash not invested earns 3% interest, enter the formula

=E32*(1+$B$6)

in cell B33. This formula, along with those in cells C32, D32, and E32, can now be copied down. (The zeros in column G are entered manually as a reminder of the nonnegativity constraint on cash after investing.)

Figure 14.34 Investment Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30

31 32 33 34 35 36 37 38

Investments with irregular �ming of returns Range names used

Inputs Ini�al amount to invest Maximum per investment

$100,000 $75,000

Interest rate on cash 3%

Cash outlays on investments (all incurred at beginning of year) Investment

EDCBAYear $1.00$1.001

$1.002 $1.003

$1.004

Cash returns from investments (all incurred at beginning of year) Investment

EDCBAYear

$0.50 1

$1.20 $1.00

2 $0.503

$1.50$1.004 $1.905

Investment decisions Dollars invested $75,000$75,000$35,714$75,000$64,286

<= <= <= <= <= Maximum per investment

Constraints on cash balance

Year Beginning cash Returns from investments Cs Cash invested

Cash a�er inves�ng

0>=$0$100,000$0$100,0001 0>=–$0$75,000$75,000$02 0>=$26,786$75,000$101,786–$03 0>=$140,089$75,000$187,500$27,5894

$142,500$144,2925

Final cash $286,792 Objec�ve to maximize : final cash at beginning of year 5

A BA B C DC D E FE F G HG H I JI J

=Model!$E$32:$E$35 Dollars_invested Cash_a�er_inves�ng

=Model!$B$26:$F$26 Final_cash =Model!$B$38 Maximum_per_investment =Model!$B$28:$F$28

$75,000 $0 $75,000 $75,000 $75,000 $75,000

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

706 Chapter 14 Optimization Models

4. Ending cash. The ending cash at the beginning of year 5 is the sum of the amount in the money market and any returns that come due in year 5. Calculate this sum with the formula

=SUM(B36:C36) in cell B38. (Note: Here is the type of error to watch out for. We originally failed to calculate the return in cell C36 and mistakenly used the beginning cash in cell B36 as the objective cell. We realized our error when the optimal solution called for no money in investment D, which is clearly an attractive investment. The moral is that you can often catch errors by looking at the plausibility of the outputs.)

Review of the Model Take a careful look at this model and how it has been set up. There are undoubtedly alter- native ways to model this problem, but the attractive feature of this model is the way the tables of inflows and outflows in rows 11 through 14 and 19 through 23 create copyable formulas for returns and investment amounts in columns C and D of rows 32 through 35. In fact, this same model setup, with only minor modifications, will work for any set of investments, regardless of the timing of investments and their returns. This is a quality you should strive for in your spreadsheet models: generalizability.

Using Solver To find the optimal investment strategy, fill in the main Solver dialog box as shown in Figure 14.35. Note that the explicit nonnegativity constraint is necessary, even though the

Figure 14.35 Solver Dialog Box for Investment Model

© C

e n g

a g

e L

e a rn

in g

Always look at the Solver solution for signs of implausibility. This can often help you spot an error in your model.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 707

Non-Negative option is checked. Again, this is because the Non-Negative option covers only the decision variable cells. If you want other output cells to be nonnegative, you must add such constraints explicitly.

Discussion of the Results The optimal solution appears in Figure 14.34. Let’s follow the cash. The company spends all of its cash in year 1 on the two available investments, A and C ($64,286 in A, $35,714 in C). A total of $75,000 in returns from these investments is available in year 2, and all of this is invested in investment B. At the beginning of year 3, a total of $101,786 is available from investment A and B returns, and $75,000 of this is invested in investment E. This leaves $26,786 for the money market, which grows to $27,589 at the beginning of year 4. In addi- tion, returns totaling $187,500 from investments B and E come due in year 4. Of this total cash of $215,089, $75,000 is invested in investment D, and the rest, $140,089, is put in the money market. The return from investment D, $142,500, plus the money available from the money market, $144,292, equals the final cash in the objective cell, $286,792.

Sensitivity Analysis A close look at the optimal solution in Figure 14.34 indicates that Barney-Jones is penal- izing itself by imposing a maximum of $75,000 per investment. This upper limit is forc- ing the company to put cash into the money market fund, despite this fund’s low rate of return. Therefore, a natural sensitivity analysis is to see how the optimal solution changes as this maximum value changes. You can perform this sensitivity analysis with a one- way SolverTable, shown in Figure 14.36.11 The maximum in cell B5 is the input cell, varied from $75,000 to $225,000 in increments of $25,000, and the optimal decision variable cells and objective cell are outputs. As you can see, the final cash (column G) grows steadily as the maximum allowable investment amount increases. This is because the company can take greater advantage of the attractive investments and put less in the money market account.

11Because Solver’s sensitivity reports do not help answer our speci�c sensitivity questions in this example or the next example, we discuss only SolverTable results.

Figure 14.36 Sensitivity of Optimal Solution to Maximum Investment Amount

3

4

5

6

7

8

9

10

11

A BA B C DC D E FE F G

Max per investment (cell $B$5) values along side, output cell(s) along top 2 1 Oneway analysis for Solver model in Model worksheet

D o

lla rs

_i nv

es te

d _1

D o

lla rs

_i nv

es te

d _2

D o

lla rs

_i nv

es te

d _3

D o

lla rs

_i nv

es te

d _4

D o

lla rs

_i nv

es te

d _5

Fi n

al _c

as h

$75,000 $64,286 $75,000 $35,714 $75,000 $75,000 $286,792

$100,000 $61,538 $76,923 $38,462 $100,000 $100,000 $320,731

$125,000 $100,000 $50,000 $0 $125,000 $125,000 $353,375

$150,000 $100,000 $50,000 $0 $150,000 $125,000 $375,125

$175,000 $100,000 $50,000 $0 $175,000 $125,000 $396,875

$200,000 $100,000 $50,000 $0 $200,000 $125,000 $418,625

$225,000 $100,000 $50,000 $0 $225,000 $125,000 $440,375

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

708 Chapter 14 Optimization Models

Example 14.7 illustrates a common situation where �xed payments are due in the future and current funds must be allocated and invested so that their returns are suf�cient to make the payments. We place this in a pension fund context.

E X A M P L E 14.7 MANAGING A PENSION FUND AT ARMCO

James Judson is the financial manager in charge of the company pension fund at Armco Incorporated. James knows that the fund must be sufficient to make the payments listed in Table 14.4. Each payment must be made on the first day of each year. James is going to finance these payments by purchasing bonds. It is currently the beginning of year 1, and three bonds are available for immediate purchase. The prices and coupons for the bonds are as follows. (All coupon payments arrive in time to meet the pension payments for the year in which they arrive.)

■ Bond 1 costs $980 and yields a $60 coupon in years 2 through 5 and a $1060 payment on maturity in year 6.

■ Bond 2 costs $970 and yields a $65 coupon in years 2 through 11 and a $1065 payment on maturity in year 12.

■ Bond 3 costs $1050 and yields a $75 coupon in years 2 through 14 and a $1075 payment on maturity in year 15.

Figure 14.37 Sensitivity of Maximum in Money Market to Two Inputs

3

A BA B C DC D E FE F G HG H I

Interest on cash (cell $B$6) values along side, Max per investment (cell $B$5) values along top, output cell in corner

4 5 6 7

Maximum_in_money_market $75,000 $100,000 $125,000 $150,000 $175,000 $200,000 $225,000 0.5% $139,420 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 1.0% $139,554 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 1.5% $139,688 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500

$ $ $ $ $ $ $

C D E F G HC D E F G H

8 9

10 11 12 13

2.0% $139,821$ $$139,821$ $$126,923$ $$126,923$ $ $112,500$ $$112,500$ $$87,500$ $$87,500$ $ $62,500$ $$62,500$ $$37,500$ $$37,500$ $ $12,500$$12,500$ 2.5% $139,955 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 3.0% $140,089 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 3.5% $140,223 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 4.0% $140,357 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500 4.5% $140,491 $126,923 $112,500 $87,500 $62,500 $37,500 $12,500

$ $ $ $ $ $

2 1 Twoway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

To perform sensitivity on an output variable not calculated explicitly in your spreadsheet model, calculate it in some unused portion of the spreadsheet before running SolverTable.

You can go one step further with the two-way SolverTable in Figure 14.37. Now both the maximum investment amount and the money market rate are inputs, and the maxi- mum amount ever put in the money market fund is the single output. Because this latter amount is not calculated in the spreadsheet model, you need to calculate it with the formula =MAX(Cash_after_investing) in an unused cell before using it as the output cell for SolverTable. In every case, even with a large maximum investment amount and a low money market rate, the company puts some money into the money market account. The reason is simple. Even when the maximum investment amount is $225,000, the company evidently has more cash than this to invest at some point (probably at the beginning of year 4). Therefore, it will have to put some of it in the money market. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 709

Table 14.4 Payments for Pension Example Year Payment Year Payment Year Payment

1 $11,000 6 $18,000 11 $25,000

2 $12,000 7 $20,000 12 $30,000

3 $14,000 8 $21,000 13 $31,000

4 $15,000 9 $22,000 14 $31,000

5 $16,000 10 $24,000 15 $31,000

© C

e n g

a g

e L

e a rn

in g

James must decide how much cash to allocate (from company coffers) to meet the initial $11,000 payment and buy enough bonds to make future payments. He knows that any excess cash on hand can earn an annual rate of 4% in a fixed-rate account. How should he proceed?

Objective To develop an optimization model that relates initial allocation of money and bond purchases to future cash availabilities, and to minimize the initialize allocation of money required to meet all future pension fund payments.

Where Do the Numbers Come From? As in the previous financial example, the inputs are fairly easy to obtain. A pension fund has known liabilities that must be met in future years, and information on bonds and fixed- rate accounts is widely available.

Solution The variables and constraints required for this pension fund model are shown in Figure 14.38. (See the file Pension Fund Management Big Picture.xlsx.) When modeling this problem, there is a new twist that involves the money James must allo- cate now for his funding problem. It is clear that he must decide how many bonds of each type to purchase now (note that no bonds are purchased in the future), but he must also decide how much money to allocate from company coffers. This allocated money has to cover the initial pension payment this year and the bond purchases. In and the bond purchases. In and addition, James wants to find the minimum allocation that will suffice. Therefore, this initial allocation serves two roles in the model. It is a decision variable and it is the and it is the and objective to minimize. In terms of spreadsheet modeling, it is perfectly acceptable to make the objective cell one of the decision variable cells, and this is done here. You will not see this in many models—because the objective typically involves a linear combination of several decision variables—but it is occasionally the most natural way to proceed.

Cash Allocated to Purchase Bonds and Make Pension Payments - Also

the Objec�ve to Minimize

Cash Available from Bonds and Interest

Pension Cash Requirements

Interest RateCost of Bonds Income from Bonds

>=

Number of Bonds to Purchase

Figure 14.38 Big Picture for Pension Fund Management Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

710 Chapter 14 Optimization Models

1. Inputs and range names. Enter the given data and name the ranges as indicated. Note that the bond costs in the range B5:B7 have been entered as positive quantities. Some financial analysts might prefer that they be entered as negative numbers, indi- cating outflows. It doesn’t really matter, however, as long as you are careful with the Excel formulas later on.

2. Cash allocated and bonds purchased. As discussed previously, the cash allocated in year 1 and the numbers of bonds purchased are both decision variables, so enter any values for these in the Cash_allocated and Bonds_purchased ranges. Note that the color-coding convention for the Cash_allocated cell has to be modified. Because it is both a decision variable cell and the objective cell, we colored it red but added a note to emphasize that it is the objective to minimize.

3. Cash available to make payments. In the current year, the only cash available is the money initially allocated minus cash used to purchase bonds. Calculate this quantity in cell B20 with the formula

=Cash_allocated-SUMPRODUCT(Bonds_purchased,B5:B7)

Always document your spreadsheet conventions as clearly as possible.

Figure 14.39 Pension Fund Management Model

© C

e n g

a g

e L

e a rn

in g

Developing the Spreadsheet Model The completed spreadsheet model is shown in Figure 14.39. (See the file Pension Fund Management.xlsx.) You can create it with the following steps.

The Objective as a Decision Variable Cell In all optimization models, the objective cell has to be a function of the decision variable cells, that is, the objective value should change as values in the deci- sion variable cells change. It is perfectly consistent

with this requirement to have the objective cell be one of the decision variable cells. This doesn’t occur in very many optimization models, but it is sometimes useful, even necessary.

F u n da m e n ta l I n s i g h t

Developing the Pension Fund Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

A BA B C DC D E FE F G HG H I JI J K LK L M NM N O PO P Pension fund management

Costs (year 1) and income (in other years) from bonds Year 15Year 14Year 13Year 12Year 11Year 10Year 9Year 8Year 7Year 6Year 5Year 4Year 3Year 2Year 1

Bond 1 $1,060$60$60$60$980 Bond 2 $1,065$65$65$65$65$65$65$65$65$65$970 Bond 3 $1,050 $75 $75 $75

$60 $65 $75 $75 $75 $75 $75 $75 $75 $75 $75 $75 $1,075

Interest rate 4.00%

Number of bonds (allowing frac�onal values) to purchase now Bond 1 73.69 Bond 2 77.21 Bond 3 28.84

Cash allocated $197,768 Objec�ve to minimize, also a decision variable cell

Constraints to meet payments Year 15Year 14Year 13Year 12Year 11Year 10Year 9Year 8Year 7Year 6Year 5Year 4Year 3Year 2Year 1

$20,376 $21,354 $21,332 $19,228 $16,000 $85,298 $77,171 $66,639 $54,646 $41,133 $25,000 $84,390 $58,728 $31,000 $31,000 >= >= >= >= >= >= >= >= >= >= >= >= >= >= >=

Cash required

Cash available

$11,000 $12,000 $14,000 $15,000 $16,000 $18,000 $20,000 $21,000 $22,000 $24,000 $25,000 $30,000 $31,000 $31,000 $31,000

Range names used: Bonds_purchased Cash_allocated Cash_available Cash_required

=Model!$B$12:$B$14 =Model!$B$16 =Model!$B$20:$P$20 =Model!$B$22:$P$22

also a decision variable cell

The value in cell B16 is the money allocated to make the current payment and buy bonds now. It is both a decision variable cell and the objec�ve cell to minimize.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 711

For all other years, the cash available comes from two sources: excess cash invested at the fixed interest rate the year before and payments from bonds. Calculate this quantity for year 1 in cell C20 with the formula

=(B20-B22)*(1+$B$9)+SUMPRODUCT(Bonds_purchased,C5:C7)

and copy it across row 20 for the other years.

As you can see, this model is fairly straightforward to develop once you under- stand the role of the amount allocated in cell B16. However, we have often given this problem as an assignment to our students, and many fail to deal correctly with the amount allocated. (They usually forget to make it a decision variable cell.) So make sure you understand what we have done, and why we have done it this way.

Using Solver The main Solver dialog box should be filled out as shown in Figure 14.40. Once again, notice that the Cash_allocated cell is both the objective cell and one of the decision variable cells.

Figure 14.40 Solver Dialog Box for Pension Fund Model

© C

e n g

a g

e L

e a rn

in g

Discussion of the Solution The optimal solution appears in Figure 14.39. You might argue that the numbers of bonds purchased should be constrained to integer values. We tried this and the optimal solution changed very little: The optimal numbers of bonds to purchase changed to 74, 79, and 27, and the optimal money to allocate increased to $197,887. With this integer

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

712 Chapter 14 Optimization Models

solution, shown in Figure 14.41, James sets aside $197,887 initially. Any less than this would not work—he couldn’t make enough from bonds to meet future pension payments. All but $20,387 of this (see cell B20) is spent on bonds, and of the $20,387, $11,000 is used to make the current pension payment. After this, the amounts in row 20, which are always sufficient to make the payments in row 22, are composed of returns from bonds and cash, with interest, from the previous year. Even more so than in previous examples, there is no way to guess this optimal solution. The timing of bond returns and the irregu- lar pension payments make a spreadsheet optimization model absolute necessary.

Constraints always have the potential to penalize the objective to some extent. SolverTable is a perfect tool for finding the mag- nitude of this penalty.

Figure 14.41 Optimal Integer Solution for Pension Fund Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22

A BA B C DC D E FE F G HG H I JI J K LK L M NM N O PO P Pension fund management

Costs (year 1) and income (in other years) from bonds Year 15Year 14Year 13Year 12Year 11Year 10Year 9Year 8Year 7Year 6Year 5Year 4Year 3Year 2Year 1Year

Bond 1 $1,060$60$60$60$980 Bond 2 $1,065$65$65$65$65$65$65$65$65$65$970 Bond 3 $1,050 $75 $75 $75

$60 $65 $75 $75 $75 $75 $75 $75 $75 $75 $75 $75 $1,075

Interest rate 4.00%

Number of bonds (allowing frac�onal values) to purchase now Bond 1 74.00 Bond 2 79.00 Bond 3 27.00

Cash allocated $197,887 Objec�ve to minimize, also a decision variable cell

Constraints to meet payments Year 15Year 14Year 13Year 12Year 11Year 10Year 9Year 8Year 7Year 6Year 5Year 4Year 3Year 2Year 1Year

$20,387 $21,363 $21,337 $19,231 $16,000 $85,600 $77,464 $66,923 $54,919 $41,396 $25,252 $86,422 $60,704 $32,917 $31,019 >= >= >= >= >= >= >= >= >= >= >= >= >= >= >=

Cash required

Cash available

$11,000 $12,000 $14,000 $15,000 $16,000 $18,000 $20,000 $21,000 $22,000 $24,000 $25,000 $30,000 $31,000 $31,000 $31,000 © C

e n g

a g

e L

e a rn

in g

Figure 14.42 Sensitivity to Fixed Interest Rate 3

4 5 6 7 8 9

10 11 12 13 14 15

A BA B C DC D E FE F G

Interest rate (cell $B$9) values along side, output cell(s) along top 2 1 Oneway analysis for Solver model in Model with Integers worksheet

Bo nd

s_ pu

rc ha

se d_

1

Bo nd

s_ pu

rc ha

se d_

2

Bo nd

s_ pu

rc ha

se d_

3

Ca sh

_a llo

ca te

d

2.00% 2.40% 2.80% 3.20% 3.60% 4.00% 4.40% 4.80% 5.20% 5.60% 6.00%

77.00 77.00 76.00 75.00 75.00 74.00 73.00 73.00 72.00 71.00 71.00

80.00 80.00 80.00 80.00 79.00 79.00 79.00 77.00 77.00 78.00 76.00

28.00 27.00 27.00 27.00 27.00 27.00 27.00 28.00 28.00 27.00 28.00

$202,219 $201,372 $200,469 $199,605 $198,769 $197,887 $197,060 $196,208 $195,369 $194,574 $193,787 ©

C e n g

a g

e L

e a rn

in g

Sensitivity Analysis Because the bond information and pension payments are evidently fixed, there is only one obvious direction for sensitivity analysis: on the fixed interest rate in cell B9. We tried this, allowing this rate to vary from 2% to 6% in increments of 0.5% and keeping track of the opti- mal decision variable cells, including the objective cell. The results appear in Figure 14.42

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-6 Financial Models 713

P R O B L E M S

Level A 37. Modify the Barney-Jones investment problem so that

there is a minimum amount that must be put into any investment, although this minimum can vary by invest- ment. For example, the minimum amount for invest- ment A might be $0, whereas the minimum amount for investment D might be $50,000. These minimum amounts should be inputs; you can make up any values you like. Run Solver on your modified model.

38. In the Barney-Jones investment problem, increase the maximum amount allowed in any investment to $150,000. Then run a one-way sensitivity analysis to the money market rate on cash. Capture one output variable: the maximum amount of cash ever put in the money market account. You can choose any reasonable range for varying the money market rate.

39. We claimed that our model for Barney-Jones is gener- alizable. Try generalizing it to the case where there are two more potential investments, F and G. Investment F requires a cash outlay in year 2 and returns $0.50 in each of the next four years. Investment G requires a cash outlay in year 3 and returns $0.75 in each of years 5, 6, and 7. Modify the model as necessary, mak- ing the objective the final cash after year 7.

40. In our Barney-Jones spreadsheet model, we ran invest- ments across columns and years down rows. Many financial analysts prefer the opposite. Modify the spreadsheet model so that years go across columns and investments go down rows. Run Solver to ensure that your modified model is correct. (We suggest three possible ways to do this, and you can experiment to see which you prefer. First, you could start over on a blank worksheet. Second, you could use Copy and then Paste Special with the Transpose option. Third, you could use Excel’s TRANSPOSE function.)

41. In the pension fund problem, suppose there is a fourth bond, bond 4. Its unit cost in year 1 is $1020, it returns coupons of $70 in years 2 through 7 and a payment of $1070 in year 8. Modify the model to incorporate this extra bond, and reoptimize. Does the solution change— that is, should James purchase any of bond 4?

42. In the pension fund problem, suppose there is an upper limit of 60 on the number of bonds of any particular type that can be purchased. Modify the model to incorporate this extra constraint and then optimize. How much more money does James need to allocate initially?

43. In the pension fund problem, suppose James has been asked to see how the optimal solution will

change if the required payments in years 8 through 15 all increase by the same percentage, where this percentage could be anywhere from 5% to 25%. Use an appropriate one-way SolverTable to help him out, and write a memo describing the results.

44. Our pension fund model is streamlined, perhaps too much. It does all of the calculations concerning cash flows in row 20. James decides he would like to break these out into several rows of calculations: Beginning cash (for year 1, this is the amount allocated; for other years, it is the unused cash, plus interest, from the previous year), Amount spent on bonds (positive in year previous year), Amount spent on bonds (positive in year pre 1 only), Amount received from bonds (positive for years 2 through 15 only), Cash available for making pension fund payments, and, below the Pension payment row, Cash left over (amount invested in the fixed interest rate). Modify the model by inserting these rows, enter the appropriate formulas, and run Solver. You should obtain the same result, but you get more detailed information.

Level B 45. Suppose the investments in the Barney-Jones problem

sometimes require cash outlays in more than one year. For example, a $1 investment in investment B might require $0.25 to be spent in year 1 and $0.75 to be spent in year 2. Does the current model easily accommodate such investments? Try it with some cash outlay data you can make up, run Solver, and interpret your results.

46. In the pension fund problem, you know that if the amount of money allocated initially is less than the amount found by Solver, James will not be able to meet all of the pension fund payments. Use the current model to demonstrate that this is true. To do so, enter a value less than the optimal value in cell B16. Then run Solver, but remove the Cash_allocated cell as a deci- sion variable cell and as the objective cell. (If there is no objective cell, Solver simply tries to find a solution that satisfies all of the constraints.) What do you find?

47. Continuing the previous problem in a slightly different direction, continue to use the Cash_allocated cell as a decision variable cell, but add a constraint that it must be less than or equal to any value, such as $195,000, that is less than its current optimal value. With this constraint, James will again not be able to meet all of the pension fund payments. Create a new objective cell to minimize the total amount of payments not met. The easiest way to do this is with IF functions. Unfortunately, this makes the model nonsmooth, and Solver might have trouble finding the optimal solution. Try it and see.

(without the integer constraints). They indicate that as the interest rate increases, James can get by with fewer bonds of types 1 and 2, and he can allocate less money for the problem. The reason is that he is making more interest on excess cash. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

714 Chapter 14 Optimization Models

14-7 INTEGER OPTIMIZATION MODELS In this section you will learn how to model some problems by using 0–1 variables (and possibly other integer variables) as decision variable cells. A 0–1 variable, or binary vari- able, is a variable that must equal 0 or 1. Usually a 0–1 variable corresponds to an activity that is or is not undertaken. If the 0–1 variable corresponding to the activity equals 0, the activity is not undertaken; if it equals 1, the activity is undertaken.

Optimization models in which some or all of the variables must be integers are known as integer programming (IP) models. You have already seen examples of integer con- straints in the discussion of scheduling employees, aggregate planning, and pension fund management. This section illustrates some of methods that are needed to formulate IP models of complex situations. You should be aware that Solver typically has a much harder time solving an IP problem than an LP problem. In fact, Solver is unable to solve some IP problems, even when they have an optimal solution. The reason is that these problems are inherently dif�cult, no matter which software package is used. However, as you will see in this section, your ability to model complex problems increases tremendously when you are able to use IP, particularly with 0–1 variables.

Difficulty of Integer Programming Models You might suspect that IP models would be easier to solve easier to solve easier than LP models. After all, there are only a finite number of feasible integer solutions in an IP model, whereas there are infinitely many feasible (integer and noninteger) solu- tions in an LP model. However, exactly the opposite is true. IP models are much more difficult than LP models. All IP algorithms try to perform an efficient search through

the typically huge number of feasible integer solutions. General-purpose algorithms such as branch and bound can be very effective for modest-size problems, but they can fail (or require extremely long computing times) on the large problems often faced in real applications. In such cases, analysts must develop special-purpose optimization algorithms, or perhaps even heuristics, to find “good,” but not necessarily optimal, solutions.

F u n da m e n ta l I n s i g h t

E X A M P L E 14.8 SELECTING INVESTMENTS AT TATHAM

The Tatham Company is considering seven investments. The cash required for each investment and the net present value (NPV) each investment adds to the firm are listed in Table 14.5. Each NPV is based on a stream of future revenues, and it includes the cash requirement, which is incurred right away. The table also lists the return of investment (ROI) for each investment, defined as the ratio of NPV to cash required, minus 1. The budget for investment is $15 million. Tatham wants to find the investment policy that maximizes its total NPV. The crucial assumption here is that if Tatham wants to take part in any of these investments, it must go all the way. It cannot, for example, go halfway in investment 1 by investing $2.5 million and realizing an NPV of $2.8 million. In fact, if partial investments were allowed, you wouldn’t need IP; you could use LP.

14-7a Capital Budgeting Models

Perhaps the simplest types of IP models are capital budgeting models. Example 14.8 perfectly illustrates the go/no-go decisions inherent in many IP models.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 715

Table 14.5 Data for the Capital Budgeting Example ($ millions) Investment Cash Required NPV ROI

1 $5.0 $5.6 12.0% 2 $2.4 $2.7 12.5% 3 $3.5 $3.9 11.4% 4 $5.9 $6.8 15.3% 5 $6.9 $7.7 11.6% 6 $4.5 $5.1 13.3% 7 $3.0 $3.3 10.0%

© C

e n g

a g

e L

e a rn

in g

Objective To use binary IP to find the set of investments that stays within budget and maximizes total NPV.

Where Do the Numbers Come From? The initial required cash and the available budget are easy to obtain. Obtaining the NPV for each investment is undoubtedly harder. A time sequence of anticipated revenues from the investments and a discount factor are required. In any case, financial analysts must provide the estimations of the required NPVs.

Solution The variables and constraints required for this model appear in Figure 14.43. (See the file Capital Budgeting Big Picture.xlsx.) The most important part is that the decision vari- ables must be binary, where a 1 means that an investment is chosen and a 0 means that it isn’t. These variables cannot have fractional values such as 0.5, because partial invest- ments are not allowed—the company has to go all the way or not at all. When you set up the Solver dialog box, you must add explicit binary constraints in the Constraints section.

Developing the Capital Budgeting Model

Maximize Total NPV

Total Cost of Investments

Whether to Invest

Investment NPV

Investment Cost

Budget<=

Figure 14.43 Big Picture for Capital Budgeting Model

Developing the Spreadsheet Model To form the spreadsheet model, which is shown in Figure 14.44, proceed as follows. (See the file Capital Budgeting.xlsx.)

1. Inputs.  Enter the initial cash requirements, the NPVs, and the budget in the light blue ranges. The ROIs aren’t absolutely required, but you can calculate them in row 7.

2. 0–1 values for investments. Enter any trial 0–1 values for the investments in row 10. Actually, you can even enter fractional values such as 0.5 in these cells. Solver’s binary constraints will eventually force them to be 0 or 1.

3. Cash invested. Calculate the total cash invested in cell B14 with the formula

=SUMPRODUCT(B5:H5,Decisions)

A SUMPRODUCT for- mula, where one of the ranges is a 0–1 range, just sums the values in the other range that correspond to the Is.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

716 Chapter 14 Optimization Models

Solver makes it easy to specify binary constraints, by choosing the bin option..

Figure 14.44 Capital Budgeting Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17

A BA B C DC D E FE F G HG H I KJ LJ LJ LI KJ LI KI KJ LI K Capital budge�ng model Range names used

Budget Decisions Total_cost Total_NPV

=Model!$D$14 =Model!$B$10:$H$10 =Model!$B$14 =Model!$B$17

Input data on poten�al investments ($ millions) Investment Cost NPV ROI

1 if yes, 0 if no

<=

$16.7

Total cost $14.9

Budget $15

Decisions: whether to invest

Budget constraint

Objec�ve to maximize Total NPV

I K

1 $5.0 $5.6

12.0%

2 $2.4 $2.7

12.5%

3 $3.5 $3.9

11.4%

1

5 $6.9 $7.7

11.6%

1

6 $4.5 $5.1

13.3%

0

7 $3.0 $3.3

10.0%

4 $5.9 $6.8

15.3%

0 0 01

© C

e n g

a g

e L

e a rn

in g

Note that this formula sums the costs only for those investments with 0–1 variables equal to 1. To see this, think how the SUMPRODUCT function works when one of its ranges is a 0–1 range. It effectively sums the cells in the other range corresponding to the 1’s.

4. 4NPV contribution.  Calculate the NPV contributed by the investments in cell B17 with the formula

=SUMPRODUCT(B6:H6,Decisions)

Again, this sums only the NPVs of the investments with 0–1 variables equal to 1.

Using Solver The Solver dialog box appears in Figure 14.45. The objective is to maximize the total NPV, subject to staying within the budget. However, the decision variable cells must be con- strained to be 0–1. Fortunately, Solver makes this simple, as shown in Figure 14.46. You strained to be 0–1. Fortunately, Solver makes this simple, as shown in Figure 14.46. You strained add a constraint with the decision variable cells in the left box and choose the bin option in the middle box. The word “binary” in the right box is then added automatically. Note that if all decision variable cells are binary, the Non-Negative option is optional (because 0 all decision variable cells are binary, the Non-Negative option is optional (because 0 all and 1 are certainly nonnegative), but you should still choose the Simplex LP method if the model is linear, as it is here.12 and 1 are certainly nonnegative), but you should still choose the Simplex LP method if the

12 and 1 are certainly nonnegative), but you should still choose the Simplex LP method if the

Finally, in the Solver Options dialog box, you should make sure the Ignore Integer Constraints option is not checked.not checked.not

Discussion of the Solution The optimal solution in Figure 14.44 indicates that Tatham can obtain a maximum NPV of $16.7 million by selecting investments 3, 5, and 6. These three investments consume only $14.9 million of the available budget, with $100,000 left over. However, this $100,000 is not nearly enough—because of the “investing all the way” requirement—to invest in any of the remaining investments.

If Tatham’s investments are ranked on the basis of ROI (see row 7 of Figure 14.44), the ranking from best to worst is 4, 6, 2, 5, 1, 3, 7. Using your economic intuition, you might expect the investments to be chosen in this order—until the budget runs out. However, the

12 All the models in this section satisfy two of the three properties of linear models in Chapter 13: proportional- ity and additivity. Even though they clearly violate the third assumption, divisibility, which precludes integer constraints, they are still considered linear by Solver. Therefore, you should still choose the Simplex LP method.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 717

Figure 14.45 Solver Dialog Box for Capital Budgeting Model

© C

e n g

a g

e L

e a rn

in g

Figure 14.46 Specifying a Binary Constraint

© C

e n g

a g

e L

e a rn

in g

optimal solution does not do this. It selects the second-, fourth-, and sixth-best investments, and it ignores the best. To understand why it does this, imagine investing in the order from best to worst, according to row 7, until the budget allows no more. By the time you have chosen investments 4, 6, and 2, you will have consumed $12.8 million of the budget, and the remainder, $2.2 million, is not suf�cient to invest in any of the rest. This strategy pro- vides an NPV of only $14.6 million. A smarter strategy, the optimal solution from Solver, gains you an extra $2.1 million in NPV.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

718 Chapter 14 Optimization Models

Figure 14.47 Sensitivity to Budget

3 2 1

4 5 6 7 8 9

10 11 12 13 14 15

A BA B C DC D E FE F G HG H I JI J

Budget (cell $D$14) values along side, output cell(s) along top

D ec

is io

n s_

1

D ec

is io

n s_

2

D ec

is io

n s_

3

D ec

is io

n s_

4

D ec

is io

n s_

5

D ec

is io

n s_

6

D ec

is io

n s_

7

To ta

l_ co

st

To ta

l_ N

P V

In cr

ea se

in N

P V

$15 0 0 1 0 1 1 0 $14.9 $16 1 0 1 0 0 1 1 $1.2

$1.2 $1.1 $1.2 $0.9 $1.2 $1.2 $0.9 $1.2 $1.1

$17 0 0 1 1 0 1 1 $18 1 1 0 1 0 1 0 $19 1 0 1 1 0 1 0 $20 1 1 1 1 0 0 1 $21 1 1 0 1 0 1 1 $22 1 0 1 1 0 1 1 $23 1 0 1 0 1 1 1 $24 0 0 1 1 1 1 1 $25 1 1 0 1 1 1 0

0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

0 0 1 0 1 1 0 1 0 1 0 0 1 1 0 0 1 1 0 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 0 0 1 1 0 1 0 1 1 0 1 1 0 1 1 0 1 0 1 1 0 0 1 1 1 1 1 1 0 1 1 1

0 0 1 0 1 1 0 1 0 1 0 0 1 1

K

$16.7 $16.0 $17.9 $16.9 $19.1 $17.8 $20.2 $18.9 $21.4 $19.8 $22.3 $20.8 $23.5 $21.9 $24.7 $22.9 $25.6 $23.8 $26.8 $24.7 $27.9

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

Sensitivity Analysis SolverTable can be used on models with binary variables exactly as you have used it in previous models.13 SolverTable can be used on models with binary variables exactly as you have used it in

13 SolverTable can be used on models with binary variables exactly as you have used it in

Here you can use it to see how the total NPV varies as the budget increases. Select the Budget cell as the single input cell, allow it to vary from $15 million to $25 million in increments of $1 million, and keep track of the total investment cost, the total NPV, and the binary variables. The results are shown in Figure 14.47. Clearly, Tatham can achieve a larger NPV with a larger budget, but as the increases in column K indicate, each extra $1 million of budget does not have the same effect on total NPV. Note also how not have the same effect on total NPV. Note also how not the selected investments vary as the budget increases. This somewhat strange behavior is due to the “lumpiness” of the inputs and the all-or-nothing nature of the problem.

13 As mentioned earlier, Solver’s sensitivity report is not even available for models with integer constraints because the mathematical theory behind the report changes signi�cantly when variables are constrained to be integers.

Effect of Solver Integer Optimality Setting To illustrate the effect of the Solver Integer Optimality setting, compare the SolverTable results in Figure 14.48 with those in Figure 14.47. Each is for the Tatham capital budgeting model, but Figure 14.48 uses Solver’s (old) default setting of 5%, whereas Figure 14.47 uses a setting of 0%. The four shaded cells in Figure 14.48 indicate lower total NPVs lower total NPVs lower than the corresponding cells in Figure 14.47. In these three cases, Solver stopped short of finding the true optimal solutions because it found solutions within the 5% of the optimal objective value and then quit.

When the Integer Optimality setting is 5% instead of 0%, Solver’s solution might not be optimal, but it will be close.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 719

Figure 14.49 A Two-Period Capital Budgeting Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19

Capital budgeting model with costs in multiple periods

Input data on potential investments ($ millions) 7654321tnemtsevnI

Year 1 $0.0$1.5$3.9$3.0$1.0$2.0$4.0 $3.0$3.0$3.0$2.9$2.5$0.4$1.0 $3.3$5.1$7.7$6.8$3.9$2.7$5.6

10.0%13.3%11.6%15.3%11.4%12.5%12.0%

tsoc Year 2 tsoc2 tsoc2 t

VPN ROI

Decisions: whether to invest 1 if yes, 0 if no

Year 1 Year 2

0001011

Budget constraint Total cost Budget

$9.0 $9 $4.3

Objective to maximize Total NPV $15.1

<= <= $6

A BA B C DC D E FE F G HG H

© C

e n g

a g

e L

e a rn

in g

Modeling Issues

■ Capital budgeting models with cash requirements in multiple time periods can also be handled. Figure 14.49 shows one possibility. (See the Capital Budgeting Multiple Period.xlsx �le.) The costs in rows 5 and 6 are both incurred if any given investment is selected. Now there are two budget constraints, one in each year, but otherwise the model is exactly as before. Note that some investments can have a cost of 0 in year 1 and a positive cost in year 2. This effectively means that these investments are under- taken in year 2 rather than year 1. Also, it is easy to modify the model to incorporate costs in years 3, 4, and so on.

Figure 14.48 Results with Integer Optimality at 5%

© C

e n g

a g

e L

e a rn

in g

3 2 1

4 5 6 7 8 9

10 11 12 13 14 15

A BA B C DC D E FE F G HG H I JI J

Budget (cell $D$14) values along side, output cell(s) along top

D ec

is io

n s_

2

D ec

is io

n s_

3

D ec

is io

n s_

4

D ec

is io

n s_

5

D ec

is io

n s_

6

D ec

is io

n s_

7

To ta

l_ co

st

To ta

l_ N

P V

$15 0 0 1 0 1 1 00 0 1 0 1 1 00 0 1 0 1 1 00 0 1 0 1 1 00 0 1 0 1 1 00 0 1 0 1 1 00 0 1 0 1 1 0 $14.9 $16 0 1 0 1 0 1 10 1 0 1 0 1 10 1 0 1 0 1 10 1 0 1 0 1 10 1 0 1 0 1 10 1 0 1 0 1 10 1 0 1 0 1 1 $17 0 1 1 1 0 1 00 1 1 1 0 1 00 1 1 1 0 1 00 1 1 1 0 1 00 1 1 1 0 1 00 1 1 1 0 1 00 1 1 1 0 1 0 $18 1 1 0 1 0 1 01 1 0 1 0 1 01 1 0 1 0 1 01 1 0 1 0 1 01 1 0 1 0 1 01 1 0 1 0 1 01 1 0 1 0 1 0 $19 1 0 1 1 0 1 01 0 1 1 0 1 01 0 1 1 0 1 01 0 1 1 0 1 01 0 1 1 0 1 01 0 1 1 0 1 01 0 1 1 0 1 0 $20 0 1 1 1 0 1 10 1 1 1 0 1 10 1 1 1 0 1 10 1 1 1 0 1 10 1 1 1 0 1 10 1 1 1 0 1 10 1 1 1 0 1 1 $21 1 1 0 1 0 1 11 1 0 1 0 1 11 1 0 1 0 1 11 1 0 1 0 1 11 1 0 1 0 1 11 1 0 1 0 1 11 1 0 1 0 1 1 $22 1 1 1 1 0 1 01 1 1 1 0 1 01 1 1 1 0 1 01 1 1 1 0 1 01 1 1 1 0 1 01 1 1 1 0 1 01 1 1 1 0 1 0 $23 0 1 0 1 1 1 10 1 0 1 1 1 10 1 0 1 1 1 10 1 0 1 1 1 10 1 0 1 1 1 10 1 0 1 1 1 10 1 0 1 1 1 1 $24 0 1 1 1 1 1 00 1 1 1 1 1 00 1 1 1 1 1 00 1 1 1 1 1 00 1 1 1 1 1 00 1 1 1 1 1 00 1 1 1 1 1 0 $25 1 1 0 1 1 1 01 1 0 1 1 1 01 1 0 1 1 1 01 1 0 1 1 1 01 1 0 1 1 1 01 1 0 1 1 1 01 1 0 1 1 1 0

D ec

is io

n s_

1

$16.7 $15.8 $17.9$15.8 $17.9 $16.3 $18.5$16.3 $18.5$16.3 $18.5 $17.8 $20.2$17.8 $20.2 $18.9 $21.4$18.9 $21.4 $19.3 $21.8$19.3 $21.8 $20.8 $23.5$20.8 $23.5 $21.3 $24.1$21.3 $24.1 $22.7 $25.6$22.7 $25.6 $23.2 $26.2$23.2 $26.2 $24.7 $27.9$24.7 $27.9

Oneway analysis for Solver model in Model worksheet

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

720 Chapter 14 Optimization Models

Binary Variables for Modeling Binary variables are often used to transform a non- linear model into a linear (integer) model. For example, a fixed cost is not a linear function of the level of some activity; it is either incurred or it isn’t incurred. This type of all-or-nothing behavior is difficult for nonlinear algorithms to handle. However, this behavior can often be handled easily by using binary variables to make

the model linear. Still, large models with many binary variables can be difficult to solve. One approach is to solve the model without integer constraints and then round fractional values to the nearest integer (0 or 1). Unfortunately, this approach is typically not very good because the rounded solution is often infeasible. Even if it is feasible, its objective value can be considerably worse than the optimal objective value.

F u n da m e n ta l I n s i g h t

■ If Tatham could choose a fractional amount of an investment, you could maximize its fractional amount of an investment, you could maximize its fractional NPV by deleting the binary constraint. The optimal solution to the resulting LP model has a total NPV of $17.064 million. All of investments 2, 4, and 6, and 44% of invest- ment 1 are chosen.14 Note that there is no way to round the decision variable cell values from this LP solution to obtain the optimal IP solution. Sometimes the solution to an IP model without the integer constraints bears little resemblance to the optimal IP solution.without the integer constraints bears little resemblance to the optimal IP solution.without

■ Any IP model involving 0–1 variables with only one constraint is called a knapsack problem. Think of the problem faced by a hiker going on an overnight hike. For exam- ple, suppose that the hiker’s knapsack can hold only 14 pounds, and she must choose which of several available items to take on the hike. The bene�t derived from each item is analogous to the NPV of each project, and the weight of each item is analogous to the cash required by each investment. The single constraint is analogous to the budget constraint—that is, only 14 pounds can �t in the knapsack. In a knapsack problem, the goal is to get the most value in the knapsack without overloading it. ■

14-7b Fixed-Cost Models

Fixed-cost models are used when a �xed cost is incurred if an activity is undertaken at any positive level. This cost is independent of the level of the activity and is known as a �xed cost (or �xed charge). Here are three examples of �xed costs:

■ Construction of a warehouse incurs a �xed cost that is the same whether the warehouse is used at partial or full capacity.

■ A cash withdrawal from a bank incurs a �xed cost, independent of the size of the withdrawal, due to the time spent at the bank.

■ A machine that is used to make several products must be set up for the production of each product. Regardless of the number of units of a product the company produces, the same �xed cost (lost production due to the setup time) is incurred.

In these examples a �xed cost is incurred if an activity is undertaken at any positive level, and zero �xed cost is incurred if the activity is not undertaken at all. Although it might not be obvious, this feature makes the problem inherently nonlinear, which means that a straightforward application of LP i s not possible. However, Example 14.9 illustrates how a clever use of binary variables results in a linear model.linear model.linear

14 If you try this with the Capital Budgeting.xlsx �le, delete the binary constraint, but don’t forget to constrain the decision variables to be nonnegative and less than or equal to 1.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 721

E X A M P L E 14.9 TEXTILE MANUFACTURING AT GREAT THREADS

Great Threads Company is capable of manufacturing shirts, shorts, pants, skirts, and jackets. Each type of clothing requires Great Threads to acquire the appropriate type Gjackets. Each type of clothing requires Great Threads to acquire the appropriate type G of machinery. The machinery needed to manufacture each type of clothing must be rented at the weekly rates shown in Table 14.6. This table also lists the amounts of cloth and labor required per unit of clothing, as well as the selling price and the unit variable cost for each type of clothing. There are 4000 labor hours and 4500 square yards (sq yd) of cloth available in a given week. The company wants to find a solution that maximizes its weekly profit.

Table 14.6 Data for Great Threads Example Rental Cost Labor Hours Cloth (sq yd) Selling Price Unit Variable Cost

Shirts $1500 2.0 3.0 $35 $20 Shorts $1200 1.0 2.5 $40 $10 Pants $1600 6.0 4.0 $65 $25 Skirts $1500 4.0 4.5 $70 $30 Jackets $1600 8.0 5.5 $110 $35

Objective To develop a linear model with binary variables that can be used to maxi- mize the company’s profit, correctly accounting for fixed costs and staying within resource availabilities.

Where Do the Numbers Come From? Except for the fixed costs, this is the same basic problem as the product mix problem (Examples 13.1 and 13.2) in the previous chapter. Therefore, the same discussion there about input variables applies here. As for the fixed costs, they are the given rental rates for the machinery.

Solution The variables and constraints required for this model are shown in Figure 14.50. (See the file Fixed Cost Manufacturing Big Picture.xlsx.) Note that the cost of producing x shirts during a week is 0 if x = 0, but it is 1500 + 20x0x0 ix ix f x > 0. This cost structure violates the proportionality assumption (discussed in the previous chapter) that is needed for a linear model. If proportionality were satisfied, the cost of making, say, 10 shirts would be double the cost of making five shirts. However, because of the fixed cost, the total cost of making five shirts is $1600, and the cost of making 10 shirts is only $1700 . This violation of proportionality requires you to use binary variables to obtain a linear model. Specifically, these binary variables model the fixed costs correctly, as explained in detail here.

Developing the Spreadsheet Model The spreadsheet model, shown in Figure 14.51, can now be developed as follows. (See the file Fixed Cost Manufacturing.xlsx.)

© C

e n g

a g

e L

e a rn

in g

Developing the Fixed- Cost Manufacturing Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

722 Chapter 14 Optimization Models

© C

e n g

a g

e L

e a rn

in g

Maximize Profit

Total Fixed Cost of Equipment

Fixed Cost of Equipment

Resources (labor and cloth) Used

Whether to Produce Any

Units Produced Effec�ve Capacity

Total Variable Cost

Total Revenue

Variable Cost Per Unit

Resources (labor and cloth) Per Unit

Resources (labor and cloth) Available

Selling Price Per Unit

<=

<=

Figure 14.50 Big Picture for Fixed-Cost Manufacturing Model

Figure 14.51 Fixed-Cost Clothing Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

KJIGFEDCBA Great Threads fixed cost clothing model Range names used:

Effec�ve_capacity =Model!$B$18:$F$18 Input data on products Rent_equipment =Model!$B$14:$F$14

Shirts Shorts Pants Skirts Jackets Profit =Model!$B$29 =Model!$D$22:$D$23Resource_available84612Labor hours/unit

Cloth (sq. yd.)/unit =Model!$B$22:$B$23Resource_used5.54.542.53 Units_produced =Model!$B$16:$F$16

Selling price/unit $t $110t $$70t $t $$65t $t $$40t $t $$35t $ Variable cost/unit $35$30$25$10$20 Fixed cost for equipment $t $1,500 $1,200 $1,600 $1,500 $1,600

Produc�on plan, constraints on capacity Shirts Shorts Pants Skirts Jackets

Rent equipment 10010

Units produced 379.3100965.520 <= <= <= <= <=

Effec�ve capacity 500.000.000.001800.000.00

Constraints on resources Resource used Available

Labor hours 4s 4s 4000s 4<=s 44000.00s 44000.00s 4 4500<=4500.00Cloth

Monetary outputs

Variable cost Fixed cost for equipment

Revenue

Profit

$80,345 $22,931

$2,800 $54,614 Objec�ve to maximize

s J

s 4s 4

H

y =

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 723

Shirts produced ≤ Maximum capacity × (0−1 variable for shirts) (14.4)

1. Inputs. Enter the given inputs. 2. Binary values for clothing types. Enter any trial values for the binary variables for

the various clothing types in the Rent_equipment range. For example, a 1 in cell C14 implies that some shorts are produced. More importantly, it implies that the machinery for making shorts is rented and its �xed cost is incurred.

3. Production quantities. Enter any trial values for the numbers of the various clothing types produced in the Units_produced range. At this point you could enter “illegal” val- ues, such as 0 in cell B14 and a positive value in cell B16. This is illegal because it implies that the company produces some shirts but doesn’t incur the �xed cost of the machinery for shirts. However, Solver will eventually disallow such illegal combinations.

4. Labor and cloth used. In cell B22 enter the formula

=SUMPRODUCT(B5:F5,Units_produced)

to calculate total labor hours, and copy this to cell B23 for cloth.

5. Effective capacities. Here is the tricky part of the model. You need to ensure that if any of a given type of clothing is produced, then its binary variable equals 1. This ensures that the model incurs the �xed cost of renting the machine for this type of clothing. You could easily implement these constraints with IF statements. For example, to imple- ment the constraint for shirts, you could enter the following formula in cell B14:

=IF(B16>0,1,0)

However, Solver is unable to deal with IF functions predictably. Therefore, the �xed- cost constraints are modeled in a different way, as follows:

There are similar inequalities for the other types of clothing. Here is the logic behind Inequality (14.4). If the 0–1 variable for shirts is 0, the

right side of the inequality is 0, which means that the left side must be 0—no shirts can be produced. That is, if the binary variable for shirts is 0, so that no �xed cost for shirts is incurred, then Inequality (14.4) does not allow Great Threads to “cheat” and produce a positive number of shirts. On the other hand, if the binary variable for shirts is 1, the inequality is certainly true and is essentially redundant. It simply states that the number of shirts produced must be no greater than the maximum number that could be produced. Inequality (14.4) rules out the one case that needs to be ruled out—namely, that Great Threads produces shirts but avoids the �xed cost.

To implement Inequality (14.4), a maximum capacity is required. To obtain this, suppose the company puts all of its resources into producing shirts. Then the number of shirts that can be produced is limited by the smaller of

Available labor hours Labor hours per shirt

and

Available square yards of cloth

Square yards of cloth per shirt

Therefore, the smaller of these—the most limiting—can be used as the maximum needed in Inequality (14.4).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

724 Chapter 14 Optimization Models

To implement this logic, calculate the effective capacity for shirts in cell B18 with the formula

=B14*MIN($D$22/B5,$D$23/B6) Then copy this formula to the range C16:F16 for the other types of clothing.15 By the way, this MIN formula causes no problems for Solver because it does not involve deci- sion variable cells, only input cells.

6. Monetary values. Calculate the total sales revenue and the total variable cost by enter- ing the formula

=SUMPRODUCT(B8:F8, Units_produced) in cell B26 and copying it to cell B27. Then calculate the total �xed cost in cell B28 with the formula

=SUMPRODUCT(B10:F10, Rent_equipment) Note that this formula sums the �xed costs only for those products with binary vari- ables equal to 1. Finally, calculate the total pro�t in cell B29 with the formula

=B26-B27-B28

Using Solver The Solver dialog box is shown in Figure 14.52. The goal is to maximize profit, subject to using no more labor hours or cloth than are available, and ensure that production is less

15Why not set the upper limit on shirts equal to a huge number like 1,000,000? The reason is that Solver works most ef�ciently when the upper limit is as tight—that is, as low—as possible. A tighter upper limit means fewer potential feasible solutions for Solver to search through.

Figure 14.52 Solver Dialog Box for Fixed-Cost Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 725

Figure 14.53 An Illegal (and Nonoptimal) Solution

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

FEDCBA Great Threads fixed cost clothing model

Input data on products Shirts Shorts Pants Skirts Jackets

84612Labor hours/unit Cloth (sq. yd.)/unit 5t 5.54.5t 54.5t 54t 54t 52.5t 52.5t 53t 53t 5

Selling price/unit $t $110t $$70t $t $$65t $t $$40t $t $$35t $ Variable cost/unit $35$30$25$10$20 Fixed cost for equipment $1,500 $1,200 $1,600 $1,500 $1,600

Produc�on plan, constraints on capacity Shirts Shorts Pants Skirts Jackets

Rent equipment 11010

Units produced 100.000500.00 450.000 <= <= <= <= <=

Effec�ve capacity 500.001000.000.001800.000.00

Constraints on resources Resource used Available

Labor hours 4s 4000s 4<=s 44000.00s 44000.00s 4 4500<=3600.00Cloth

Monetary outputs

Variable cost Fixed cost for equipment

Revenue

Profit

$60,250 $19,750

$4,300 $36,200 Objec�ve to maximize

d A s 4

d A s 4

© C

e n g

a g

e L

e a rn

in g

than or equal to effective capacity. The key is that this effective capacity is zero if none of a given type of clothing is produced. As usual, check the Non-Negative option, and set the Integer Optimality to zero (under the Options button). Importantly, note that by using binary decision variable cells, the resulting model is linear, which means that the simplex algorithm can be used.

Although Solver finds the optimal solution automatically, you should understand the effect of the logical upper-bound constraint on production. It rules out a solution such as the one shown in Figure 14.53. This solution calls for a positive production level of pants but does not incur the fixed cost of the pants equipment. The logical upper-bound constraint rules this out because it prevents a positive value in row 16 if the corresponding binary value in row 14 is 0. In other words, if the company wants to produce some pants, the constraint in Inequality (14.4) forces the associated binary variable to be 1, thus incur- ring the fixed cost for pants.

Note that Inequality (14.4) does not rule out the situation you see for skirts, where the not rule out the situation you see for skirts, where the not binary value is 1 and the production level is 0. However, Solver will never choose this type of solution as optimal. Solver recognizes that the binary value in this case can be changed to 0, so that the fixed cost for skirt equipment is not incurred.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

726 Chapter 14 Optimization Models

As always, adding constraints can only make the objective worse. In this case, it means decreased profit.

Figure 14.54 Fixed-Cost Model with Extra Constraint

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

F G H IH IEDCBA Great Threads fixed cost clothing model

Input data on products Shirts Shorts Pants Skirts Jackets

84612Labor hours/unit Cloth (sq. yd.)/unit 5t 5.54.5t 54.5t 54t 54t 52.5t 52.5t 53t 53t 5

Selling price/unit $t $110t $$70t $t $$65t $t $$40t $t $$35t $ Variable cost/unit $t $35t $$30t $t $$25t $t $$10t $t $$20t $ Fixed cost for equipment $1,500 $1,200 $1,600 $1,500 $1,600

Produc�on plan, constraints on capacity Shirts Shorts Pants Skirts Jackets Sum Required

Rent equipment 1 31 3 >= 31010

Units produced 379.310965.52 00 <= <= <= <= <=

Effec�ve capacity 500.001000.000.001800.000.00

Constraints on resources Resource used Available

Labor hours 4s 4000s 4<=s 44000.00s 44000.00s 4 4500<=4500.00Cloth

Monetary outputs

Variable cost Fixed cost for equipment

Revenue

Profit

$80,345 $22,931

$4,300 $53,114 Objec�ve to maximize

s 4s 4

© C

e n g

a g

e L

e a rn

in g

Discussion of the Solution The optimal solution appears in Figure 14.51. It indicates that Great Threads should pro- duce about 966 shorts and 379 jackets, but no shirts, pants, or skirts. The total profit is $54,614. Note that the binary variables for shirts, pants, and skirts are all 0, which forces production of these products to be 0. However, the binary variables for shorts and jackets, the products that are produced, are 1. This ensures that the fixed cost of producing shorts and jackets is included in the total cost.

It might be helpful to think of this solution as occurring in two stages. In the first stage Solver determines which products to produce—in this case, shorts and jackets only. Then in the second stage, Solver decides how many shorts and jackets to produce. If you knew that the company plans to produce shorts and jackets only, you could then ignore the fixed costs and determine the best production quantities with the same types of product mix models discussed in the previous chapter. Of course, these two stages—deciding which products to produce and how many of each to produce—are interrelated, and Solver con- siders both of them in its solution process.

The Great Threads management might not be very excited about producing shorts and jackets only. Suppose the company wants to ensure that at least three types of clothing are produced at positive levels. One approach is to add another constraint—namely, that the sum of the binary values in row 14 is greater than or equal to 3. You can check, how- ever, that when this constraint is added and Solver is rerun, the binary variable for skirts becomes 1, but no skirts are produced. Shorts and jackets are more profitable than skirts, so only shorts and jackets are produced. (See Figure 14.54.) The new constraint forces Great Threads to rent an extra piece of machinery (for skirts), but it doesn’t force the com- pany to use it. To force the company to produce some skirts, you would also need to add a constraint on the value in E16, such as E16 > = 100. Any of these additional constraints

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 727

will cost Great Threads money, but if, as a matter of policy, the company wants to produce more than two types of clothing, this is its only option.

Sensitivity Analysis Because the optimal solution currently calls for only shorts and jackets to be produced, an interesting sensitivity analysis is to see how much incentive is required for other products to be produced. One way to model this is to increase the selling price for a nonproduced product such as skirts in a one-way SolverTable. The results of this, keeping track of all binary variables and profit, are shown in Figure 14.55. When the selling price for skirts is $85 or less, the company continues to produce only shorts and jackets. However, when the selling price is $90 or greater, the company stops producing shorts and jackets and produces only skirts. You can check that the optimal production quantity of skirts is 1000 when the selling price of skirts is any value $90 or above. The only reason that the prof- or above. The only reason that the prof- or above. The only reason that the prof its in Figure 14.55 increase from row 9 down is that the revenues from these 1000 skirts increase.

Figure 14.55 Sensitivity of Binary Variables to Selling Price of Skirts

3

4 5 6 7 8 9

10 11

A BA B C DC D E FE F G

Selling price skirts (cell $E$8) values along side, output cell(s) along top R

en t_

eq u

ip m

en t_

1

R en

t_ eq

u ip

m en

t_ 2

R en

t_ eq

u ip

m en

t_ 3

R en

t_ eq

u ip

m en

t_ 4

R en

t_ eq

u ip

m en

t_ 5

P ro

fi t

$70 0 1 0 0 1 $54,614 $75 0 1 0 0 1 $54,614 $80 0 1 0 0 1 $54,614 $85 0 1 0 0 1 $54,614 $90 0 0 0 1 0 $58,500 $95 0 0 0 1 0 $63,500

$100 0 0 0 1 0 $68,500

0 1 0 1 0 1 0 1 0 0 0 0 0 0

0 1 0 1 0 1 0 1 0 0 0 0 0 0

0 0 0 0 0 0 0 0 0 1 0 1 0 1

0 0 0 0 0 0 0 0 0 1 0 1 0 1

2 1 Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

A Model with IF Functions In case you are still not convinced that the binary variable approach is required, and you think IF functions could be used instead, take a look at the last sheet in the finished version of the file. The resulting model looks the same as in Figure 14.51, but it incorporates the following changes:

■ The binary range is no longer part of the decision variable cells range. Instead, the formula =IF(B16>0,1,0) is entered in cell B14 and copied across to cell F14. Logically, this probably appears more natural. If a production quantity is positive, a 1 is entered in row 14, which means that the �xed cost is incurred.

■ The effective capacities are calculated in row 18 with IF functions. Speci�cally, the formula =IF(B16>0,MIN($D$22/2/2 B/B/ 5,$D$23/B/B/ 6),0) is entered in cell B18 and copied across to cell F18.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

728 Chapter 14 Optimization Models

Figure 14.56 Solver Dialog Box When IF Functions Are Used

© C

e n g

a g

e L

e a rn

in g

■ The Solver dialog box is modi�ed as shown in Figure 14.56. The Rent_equipment range is not part of the decision variable cells range, and there is no binary constraint. The simplex method cannot be used because the IF functions make the model nonlinear.

When we ran Solver on this modified model, we found inconsistent results, depend- ing on the initial production quantities entered in row 16. For example, when we entered initial values all equal to 0, the Solver solution was exactly that—all 0s. Of course, this solution is terrible because it leads to a profit of $0. However, when we entered initial production quantities all equal to 100, Solver found the correct optimal solution, the same as in Figure 14.51. Was this just lucky? To check, we tried another initial solution, where the production quantities for shorts and jackets were 0, and the production quantities for shirts, pants, and skirts were all 500. In this case Solver found a solution where only skirts are produced. Of course, we know this is not optimal.

Actually, the problem with using the GRG Nonlinear method indicated in Figure 14.56 is that this model is “nonsmooth,” and the GRG Nonlinear method doesn’t work well on nonsmooth models. Starting in Excel 2010, there is another option—the Evolutionary method. This method works well on nonsmooth models, but it guarantees only an approximately optimal solution, and it is relatively slow. It is not discussed fur- ther in this book.

In any case, the IF-function approach is not the way to go. Its success depends on the initial values in the decision variable cells, and this requires good guesses. The binary approach ensures that Solver finds the correct solution. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 729

14-7c Set-Covering Models

In a set-covering model, each member of a given set (set 1) must be “covered” by an acceptable member of another set (set 2). The objective in a set-covering problem is to minimize the number of members in set 2 necessary to cover all the members in set 1. For example, set 1 might consist of all the cities in a county and set 2 might consist of the cities in which a �re station is located. A member of set 2 covers, or handles the needs of, a city in set 1 if the �re station is located within, say, 10 minutes of the city. The goal is to mini- mize the number of �re stations needed to cover all cities. Set-covering models have been applied to areas as diverse as airline crew scheduling, truck dispatching, political redistrict- ing, and capital investment. Example 14.10 is a typical set-covering model.

E X A M P L E 14.10 HUB LOCATION AT WESTERN AIRLINES

Western Airlines has decided that it wants to design a hub system in the United States. Each hub is used for connecting flights to and from cities within 1000 miles of the hub. Western runs flights among the following cities: Atlanta, Boston, Chicago, Denver, Houston, Los Angeles, New Orleans, New York, Pittsburgh, Salt Lake City, San Francisco, and Seattle. The company wants to determine the smallest number of hubs it will need to cover all of these cities, where a city is “covered” if it is within 1000 miles of at least one hub. Table 14.7 lists the cities that are within 1000 miles of other cities.

Table 14.7 Data for Western Airlines Set-Covering Example Cities Within 1000 Miles

Atlanta (AT) AT, CH, HO, NO, NY, PI Boston (BO) BO, NY, PI Chicago (CH) AT, CH, NY, NO, PI Denver (DE) DE, SL Houston (HO) AT, HO, NO Los Angeles (LA) LA, SL, SF New Orleans (NO) AT, CH, HO, NO New York (NY) AT, BO, CH, NY, PI Pittsburgh (PI) AT, BO, CH, NY, PI Salt Lake City (SL) DE, LA, SL, SF, SE San Francisco (SF) LA, SL, SF, SE Seattle (SE) SL, SF, SE

© C

e n g

a g

e L

e a rn

in g

Objective To develop a binary model to find the minimum number of hub locations that can cover all cities.

Where Do the Numbers Come From? Western has evidently made a policy decision that its hubs will cover cities within a 1000-mile radius. Then the cities covered by any hub location can be found from a map. (In a later sensitivity analysis, we explore how the solution changes when the allowable coverage distance varies.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

730 Chapter 14 Optimization Models

Developing the Hub Location Model

Figure 14.58 Set-Covering Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

Western Airlines hub loca�on model

Input data: which ci�es are covered by which poten�al egnaRsbuh names used: Poten�al hub

93$B$!ledo=sbuh_latoTESFSLSIPYNONALOHEDHCOBTAytiC B$!ledo=Used_as_hub000111010101TA $21:$M$21

000110000010OB 000111000101HC 001000001000ED 000001010001OH 011000100000AL 000001010101ON 000110000111YN 000110000111IP 111000101000LS 111000100000FS 111000000000ES

Decisions: which ci�es to use as hubs

Used as hub AT BO CH DE HO LA NO NY PI SL SF SE

0 0 0 0 1 0 0 1 0 1 0 0

Constraints that each city must be covered by at least one hub City Hubs covered by Required

1=>2TA 1=>1OB 1=>1HC 1=>1ED 1=>1OH 1=>1AL 1=>1ON 1=>1YN 1=>1IP 1=>1LS 1=>1FS 1=>1ES

Objec�ve to minimize Total 3l 3l 3sl 3l 3bl 3l 3ul 3l 3hl 3

y Ry R

A BA B C DC D E FE F G HG H I JI J K LK L M NM N O PO P Q

Hubs_covered_by =y =Model!$B$25:$B$36 M M

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Solution The variables and constraints for this set-covering model appear in Figure 14.57. (See the file Locating Hubs Big Picture.xlsx.) The model is straightforward. There is a binary variable for each city to indicate whether a hub is located there. Then the number of hubs that cover each city is constrained to be at least one. There are no monetary costs in this version of the problem. The goal is to minimize the number of hubs.

Minimize Number of

City Used as Hub

Number of Hubs City is Covered by

1 Matrix of Ci�es Covered

by Poten�al Hubs

City to City Distance Matrix

>=

Figure 14.57 Big Picture for Locating Hubs Model

Developing the Spreadsheet Model The spreadsheet model for Western is shown in Figure 14.58. (See the file Locating Hubs .xlsx.) It can be developed as follows.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 731

Figure 14.59 Solver Dialog Box for Set-Covering Model

© C

e n g

a g

e L

e a rn

in g

1. Inputs. Enter the information from Table 14.7 in the input cells. A 1 in a cell indicates that the column city covers the row city, whereas a 0 indicates that the column city does not cover the row city. For example, the three 1s in row 7 indicate that Boston, New York, and Pittsburgh are the only cities within 1000 miles of Boston.

2. Binary values for hub locations. Enter any trial values of 0’s or 1’s in the Use_as_hub range to indicate which cities are used as hubs. These are the decision variable cells.

3. Cities covered by hubs. Calculate the total number of hubs within 1000 miles of Atlanta in cell B25 with the formula

=SUMPRODUCT(B6:M6,Use_as_hub) For any binary values in the decision variable cells range, this formula sums the num- ber of hubs that cover Atlanta. Then copy this to the rest of the Hubs_covered_by range. Note that a value in the Hubs_covered_by range can be 2 or greater. This indi- cates that a city is within 1000 miles of multiple hubs.

4. Number of hubs. Calculate the total number of hubs used in cell B39 with the formula =SUM(Use_as_hub)

Using Solver The completed Solver dialog box is shown in Figure 14.59. The goal is to minimize the total number of hubs, subject to covering each city by at least one hub and ensuring that the decision variable cells are binary.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

732 Chapter 14 Optimization Models

Figure 14.60 Graphical Solution to Set-Covering Model

© C

e n g

a g

e L

e a rn

in g

Discussion of the Solution Figure 14.60 is a graphical representation of the optimal solution, where the double ovals indicate hub locations and the large circles indicate ranges covered by the hubs. (These large

16There are multiple optimal solutions for this model, all requiring three hubs, so you might obtain a different solution from ours. 17We have warned you about using IF functions in Solver models. However, the current use affects only the inputs to the problem, not quantities that depend on the decision variable cells. Therefore, it causes no problems.

circles are not drawn to scale. In reality, they should be circles of radius 1000 miles centered at the hubs.) Three hubs—in Houston, New York, and Salt Lake City—are needed.16 Would you have guessed this? The Houston hub covers Houston, Atlanta, and New Orleans. The New York hub covers Atlanta, Pittsburgh, Boston, New York, and Chicago. The Salt Lake City hub covers Denver, Los Angeles, Salt Lake City, San Francisco, and Seattle. Note that Atlanta is the only city covered by two hubs; it can be serviced by New York or Houston.

Sensitivity Analysis An interesting sensitivity analysis for Western’s problem is to see how the solution is affected by the mile limit. Currently, a hub can service all cities within 1000 miles. What if the limit were 800 or 1200 miles, say? To answer this question, you must first collect data on actual distances among all of the cities. Once you have a table of these distances, you can build the binary table, corresponding to the range B6:M17 in Figure 14.58, with IF functions. The modified model appears in the file Locating Hubs with Distances.xlsx (not shown here). You can check that the typical formula in B24 is =IF(B8<=$B$4,1,0), which is then copied to the rest of the B24:M35 range.17 (not shown here). You can check that the typical formula in B24 is

17 (not shown here). You can check that the typical formula in B24 is

You can then run SolverTable, selecting cell B4 as the single input cell, letting it vary from 800 to 1200 in increments of 100, and designating the hub locations and the number of hubs as outputs. The SolverTable results in Figure 14.61 show the effect of the mile limit. When this limit is lowered to 800 miles, four hubs are required, but when it is increased to 1100 or 1200, only two hubs are required. Note that the solution shown for the 1000-mile limit is different from the previous solution in Figure 14.58, but it still requires three hubs. (This is a case of multiple optimal solutions.) ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-7 Integer Optimization Models 733

P R O B L E M S

Level A 48. Solve the following modifications of the Tatham capi-

tal budgeting model. (Solve each part independently of the others.) a. Suppose that at most two of projects 1 through 5

can be selected. b. Suppose that if investment 3 is selected, then

investment 1 must also be selected. c. Suppose that at least one of investments 1 and 2

must be selected.must be selected.must d. Suppose that investment 5 can be selected only if

both investments 2 and 3 are selected.

49. In the Tatham capital budgeting model we supplied the NPV for each investment. Suppose instead that you are given only the streams of cash inflows from each investment shown in the file P14_49.xlsx. This file also shows the cash requirements and the budget. You can assume that (1) all cash outflows occur at the beginning of year 1; (2) all cash inflows occur at the ends of their respective years; and (3) the company uses a 8% dis- count rate for calculating its NPVs. Which investments should the company make?

50. Solve the previous problem using the input data in the file P14_50.xlsx.

51. Solve Problem 49 with the extra assumption that the investments can be grouped naturally as follows: 1–4, 5–8, 9–12, 13–16, and 17–20. a. Find the optimal investments when at most one

investment from each group can be selected. b. Find the optimal investments when at least one

investment from each group must be selected. (If the budget isn’t large enough to permit this, increase the budget to a larger value.)

52. In the Tatham capital budgeting model, investment 4 has the largest ROI, but it is not selected in the optimal solu- tion. How much NPV is lost if Tatham is forced to select forced to select forced investment 4? Answer by solving a suitably modified model.

53. As it currently stands, investment 7 in the Tatham capital budgeting model has the lowest ROI, 10%. Keeping this same ROI, can you change the cash requirement and NPV for investment 7 in such a way that it is selected in the optimal solution? Does this lead to any general insights? Explain.

54. Expand the Tatham capital budgeting model so that there are now 20 possible investments. You can make up the data on cash requirements, NPVs, and the budget. However, use the following guidelines:

■ The cash requirements and NPVs for the various investments can vary widely, but the ratio of NPV to cost should be between 1.05 and 1.25 for each investment.

■ The budget should allow somewhere between 5 and 10 of the investments to be selected.

55. Suppose in the Tatham capital budgeting model that each investment requires $100,000 during year 2 and only $300,000 is available for investment during year 2. a. Assuming that available money uninvested at the

end of year 1 cannot be used during year 2, what combination of investments maximizes NPV?

b. Suppose that any uninvested money at the end of year 1 can be used for investment in year 2. Does your answer to part a change?

56. How difficult is it to expand the Great Threads model to accommodate another type of clothing? Answer by assuming that the company can also produce sweatshirts. The rental cost for sweatshirt equipment is $1100, the variable cost per unit and the selling price

Figure 14.61 Sensitivity to Mile Limit

3 2 1

4 5 6 7 8 9

A BA B C DC D E FE F G HG H I JI J K LK L M NM N

Mile limit (cell $B$4) values along side, output cell(s) along top

U se

d _a

s_ h

u b

_1

U se

d _a

s_ h

u b

_2

U se

d _a

s_ h

u b

_3

U se

d _a

s_ h

u b

_4

U se

d _a

s_ h

u b

_5

U se

d _a

s_ h

u b

_6

U se

d _a

s_ h

u b

_7

U se

d _a

s_ h

u b

_8

U se

d _a

s_ h

u b

_9

U se

d _a

s_ h

u b

_1 0

U se

d _a

s_ h

u b

_1 1

U se

d _a

s_ h

u b

_1 2

To ta

l_ h

u b

s

800 1 1 0 0 0 0 0 0 0 1 0 1 4 900 1 1 0 0 0 0 0 0 0 1 0 0 3

1000 1 1 0 0 0 0 0 0 0 1 0 0 3 1100 0 0 1 0 0 0 0 0 0 1 0 0 2 1200 0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2

0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 1

0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3

0 0 1 0 0 1 0 0 0 0 0 0 2 0 0 1 0 0 0 0 0 0 1 0 0 2 1 1 0 0 0 0 0 0 0 1 0 0 3

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 01 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 31 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 20 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 20 0 1 0 0 1 0 0 0 0 0 0 2

1 1 0 0 0 0 0 0 0 1 0 1 1 1 0 0 0 0 0 0 0 1 0 0 1 1 0 0 0 0 0 0 0 1 0 0 3 0 0 1 0 0 0 0 0 0 1 0 0 2 0 0 1 0 0 1 0 0 0 0 0 0 2

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

734 Chapter 14 Optimization Models

are $15 and $45, respectively, and each sweatshirt requires one labor hour and 3.5 square yards of cloth.

57. Referring to the previous problem, if it is optimal for the company to produce sweatshirts, use SolverTable to see how much larger the fixed cost of sweatshirt machinery would have to be before the company would not produce any sweatshirts. However, if the solution not produce any sweatshirts. However, if the solution not to the previous problem calls for no sweatshirts to be produced, use SolverTable to see how much lower the fixed cost of sweatshirt machinery would have to be before the company would start would start would producing sweatshirts.

58. In the Great Threads model, the production quantities in row 16 were not constrained to be integers. Presumably, any fractional values could be safely rounded to integers. See whether this is true. Constrain these quantities to be integers and then run Solver. Are the optimal integer values the same as the rounded fractional values in Figure 14.51?

59. In the optimal solution to the Great Threads model, the labor hour and cloth constraints are both binding—the company is using all it has. a. Use SolverTable to see what happens to the optimal

solution when the amount of available cloth increases from its current value. (You can choose the range of input values to use.) Capture all of the decision variable cells, the labor hours and cloth used, and the profit as outputs. The real issue here is whether the company can profitably use more cloth when it is already constrained by labor hours.

b. Repeat part a, but reverse the roles of labor hours and cloth. That is, use the available labor hours as the input for SolverTable.

60. In the optimal solution to the Great Threads model, no pants are produced. Suppose Great Threads has an order for 300 pairs of pants that must be produced. must be produced. must Modify the model appropriately and use Solver to find the new optimal solution. (Is it enough to put a lower bound of 300 on the production quantity in cell D16? Will this automatically force the binary value in cell D14 to be 1? Explain.) How much profit does the company lose because of having to produce pants?

61. In the original Western Airlines set-covering model, we assumed that each city must be covered by at least one hub. Suppose that for added flexibility in flight routing, Western requires that each city must be cov- ered by at least two hubs. How do the model and opti- mal solution change?

62. In the original Western Airlines set-covering model, we used the number of hubs as the objective to minimize. Suppose instead that there is a fixed cost of locating a hub in any city, where these fixed costs can vary across cities. Make up some reasonable fixed costs, modify the

model appropriately, and use Solver to find the solution that minimizes the sum of fixed costs.

63. Set-covering models such as the original Western Airlines model often have multiple optimal solutions. See how many alternative optimal solutions you can find. Of course, each must use three hubs because we know this is optimal. (Hint: Use various initial val- ues in the decision variable cells and then run Solver repeatedly.)18

64. How hard is it to expand a set-covering model to accommodate new cities? Answer this by modifying the second set-covering model. (See the file Locating Hubs with Distances.xlsx.) Add several cities that must be served: Memphis, Dallas, Tucson, Philadelphia, Cleveland, and Buffalo. You can look up the distances from these cities to each other and to the other cities on the Web, or you can make up approximate distances. a. Modify the model appropriately, assuming

that these new cities must be covered and are and are and candidates for hub locations.

b. Modify the model appropriately, assuming that these new cities must be covered but are not candidates for hub locations.

Level B 65. The models in this section are often called combinato-

rial models because each solution is a combination of rial models because each solution is a combination of rial the various 0’s and 1’s, and there are only a finite num- ber of such combinations. For the Tatham capital budg- eting model, there are seven investments, so there are 27 = 128 possible solutions (some of which are infea- sible). This is a fairly large number, but not too large. Solve the model without Solver by listing all without Solver by listing all without 128 solu- tions. For each, calculate the total cash requirement and total NPV for the model. Then manually choose the one that stays within the budget and has the largest NPV.

66. Make up an example, as described in Problem 54, with 20 possible investments. However, do it so that the ratios of NPV to cash requirement are in a very tight range, such as from 1.0 to 1.1. Then use Solver to find the optimal solution when the Solver Integer Optimality is set to its default value of 5%, and record the solution. Next, solve again with the Integer Optimality set to zero. Do you get the same solution? Try this on a few more instances of the model, where you keep tinkering with the inputs. The question is whether the Integer Optimality setting matters in these types of narrow-range problems.

67. In the Great Threads model, we found an upper bound on production of any clothing type by calculating the amount that could be produced if all of the resources all of the resources all were devoted to this clothing type.

18One of our colleagues at Indiana University, Vic Cabot, now deceased, worked for years trying to develop a general algorithm (not just trial and error) for �nding all alternative optimal solutions to optimization models. It all alternative optimal solutions to optimization models. It all turns out that this is a very dif�cult problem—and one that Vic never completely solved.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 735

a. What if you instead use a very large value such as 1,000,000 for this upper bound? Try it and see whether you get the same optimal solution.

b. Explain why any such upper bound is required. Exactly what role does it play in the model?

68. In the last sheet of the finished version of the Great Threads file, we illustrated one way to model the Great Threads problem with IF functions, but saw that this approach doesn’t work. Try a slightly different approach here. Eliminate the binary vari- ables in row 14 altogether, and eliminate the upper

bounds in row 18 and the corresponding upper bound constraints in the Solver dialog box. (The only constraints are now on resource availability.) However, use IF functions to calculate the total fixed cost of renting equipment, so that if the amount of any clothing type is positive, then its fixed cost is added to the total fixed cost. Is Solver able to handle this model? Does it depend on the initial values in the decision variable cells? (You will have to use Solver’s nonlinear algorithm, not the simplex method.)

14-8 NONLINEAR OPTIMIZATION MODELS In many optimization models the objective and/or the constraints are nonlinear functions of the decision variables. Such an optimization model is called a nonlinear programming (NLP) model. In this section we discuss how to use Excel’s Solver to �nd optimal solu- tions to NLP models. We then discuss a couple of interesting applications, including the important portfolio optimization model.

14-8a Basic Ideas of Nonlinear Optimization

When you solve an LP model with Solver, you are guaranteed that the solution obtained is an optimal solution. When you solve an NLP model, however, it is very possible that Solver will obtain a suboptimal solution. This is because a nonlinear function can have local optilocal optilocal - mal solutions that are not the global optimal solution. A global optimal solution. A global local optimal solution is one that

is better than all nearby points, whereas the global optimum is the one that beats all points in the entire feasible region. If there are indeed one or more local optimal solutions that are not globally optimal, then it is entirely possible that Solver will stop at one of them. Unfortunately, this is not what you want; you want the global optimum.

There are mathematical conditions that guar- antee the Solver solution is indeed the global opti- mum. However, these conditions are often dif�cult to check, and they aren’t always satis�ed. A much simpler approach is to run Solver several times, each time with different starting values in the deci- sion variable cells. In general, if Solver obtains the same optimal solution in all cases, you can be fairly con�dent—but still not absolutely sure—that Solver has found the global optimal solution. On the other hand, if you try different starting values for the decision variable cells and obtain several dif-the decision variable cells and obtain several dif-the decision variable cells and obtain several dif ferent solutions, you should keep the best solution found so far. That is, you should keep the solution with the lowest objective value (for a minimization problem) or the highest objective value (for a maxi- mization problem).

Local Optimal Solution Versus Global Optimal Solution Nonlinear objective functions can behave in many ways that make them difficult to optimize. In particular, they can have local optimal solutions that are not globally optimal, and nonlinear optimization algorithms can stop at such local optimal solutions. The important property of linear objectives that makes the simplex method so successful—namely, that the optimal solu- tion is a corner point—doesn’t hold for nonlinear objectives. Now any point in the feasible region can conceivably be optimal. This not only makes the search for the optimal solution more difficult, but it also makes it much more difficult to recognize whether a prom- ising solution (a local optimum) is indeed the global optimum. This is why researchers have spent so much effort trying to obtain conditions that, when true, guar-effort trying to obtain conditions that, when true, guar-effort trying to obtain conditions that, when true, guar antee that a local optimum must be a global optimum. Unfortunately, these conditions are often difficult to check, and they aren’t always satisfied.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

736 Chapter 14 Optimization Models

14-8b Managerial Economics Models

Many problems in economics are nonlinear but can be solved with Solver. Example 14.11 illustrates one such peak-load pricing example.

E X A M P L E 14.11 ELECTRICITY PRICING AT FLORIDA POWER AND LIGHT

Florida Power and Light (FPL) faces demands during both on-peak and off-peak times. FPL must determine the price per megawatt hour (mWh) to charge during both on-peak and off-peak periods.19

FPL must determine the price per megawatt hour (mWh) to charge during both on-peak 19

FPL must determine the price per megawatt hour (mWh) to charge during both on-peak The monthly demand for power during each period (in millions of

mWh) is related to price as follows:

DpDpD = 2.253 – 0.013PpPpP + 0.003Po (14.5) Do = 1.142 – 0.015 Po + 0.005PpPpP (14.6)

Here, DpDpD and PpPpP are demand and price during on-peak times, whereas Do and Po are demand and price during off-peak times. Note that these are linear demand linear demand linear functions, not the constant elasticity demand functions from the previous examples. (We do this for the sake of variety. The model would not differ substantially with constant elasticity demand functions.) Also, note from the signs of the coefficients that an increase in the on-peak price decreases the demand for power during the on-peak period but increases the demand for power during the off-peak period. Similarly, an increase in the price for the off-peak period decreases the demand for the off-peak period but increases the demand for the on- peak period. In economic terms, this implies that on-peak power and off-peak power are substitutes for one another. In addition, it costs FPL $75 per month to maintain one mWh of capacity. The company wants to determine a pricing strategy and a capacity level that maximize its monthly profit.

Objective To use a nonlinear model to determine prices and capacity when there are two different daily usage patterns: on-peak and off-peak.

Where Do the Numbers Come From? As usual, a cost accountant should be able to estimate the unit cost of capacity. The real difficulty here is estimating the demand functions in Equations (14.5) and (14.6). This requires either sufficient historical data on prices and demands (for both on-peak and off-peak periods) or educated guesses from management.

Solution The variables and constraints for this model are shown in Figure 14.62. (See the file Electricity Pricing Big Picture.xlsx.) The company must decide on two prices and the amount of capacity to maintain. Because this capacity level, once determined, is relevant for on-peak and off-peak periods, it must be large enough to meet demands for both peri- ods. This is the reasoning behind the constraints.

Due to the relationships between the demand and price variables, it is not obvious what FPL should do. The pricing decisions determine demand, and larger demand requires larger capacity, which costs money. In addition, revenue is price multiplied by demand, so it is not clear whether price should be low or high to increase revenue.

The positive coefficients of prices in these demand equations indi- cate substitute behavior. A larger price for one product tends to induce customers to demand more of the other.

The capacity must be at least as large as the on-peak and off-peak demands. Actually, there is no incentive for the capacity to be larger than the maximum of these two demands.

19The basic model is the same as in previous editions of the book, but the numbers have been changed to be more realistic.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 737

Developing the Spreadsheet Model The spreadsheet model appears in Figure 14.63. (See the file Electricity Pricing.xlsx.) It can be developed as follows:

1. Inputs. Enter the parameters of the demand functions and the cost of capacity in the light blue ranges.

2. Prices and capacity level. Enter any trial prices (per mWh) for on-peak and off-peak power in the Prices range, and enter any trial value for the capacity level in the Capacity cell. These are the three values FPL has control over, so they become the decision vari- able cells.

3. Demands. Calculate the demand for the on-peak period by substituting into Equation (14.5). That is, enter the formula

Figure 14.62 Big Picture for Electricity Pricing Model

Unit Cost of Capacity

Cost of CapacityOff-peak Demand

On-peak Demand

Revenue Parameters of Demand Func�ons

Capacity

On-peak Price

Off-peak Price

< =

< =

Maximize Profit

© C

e n g

a g

e L

e a rn

in g

Figure 14.63 Electricity Pricing Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

Electricity pricing model A BA B C DC D E FE F G HG H

Input egnaRatad names used: Coefficients of demand 51$B$!=ModelyticapaCsnoitcnuf

Common_Capacity =Model!$B$21:$C$21 On-peak demandOn-peak demand- On-peak demand =Model!$B$19:$C$19 =Model!$B$19:$C$19 Off-peak demand Prices =Model!$B$13:$C$13

Profit =Model!$B$26 Cost of capacity/mWh $75 of capacity/mWh $75

Decisions Off-Off-Of peak

Price per mWh

Capacity (millions of mWh) Capacity (millions of mWh)

Constraints on demand (in million of mWh) On-peak

On-peak

On-peak price Off-peak priceff-peak priceff

Off-Off-Of peak Demand

<= <= Capacity 0.692

Monetary summary ($ millions) Revenue 147.71 2 Cost of capacity 51.908 Profit 95.804ofit 95.804

e O

venue 147.71 of capacity

Capacity 0.692 Capacity 0.692

=Model!$B$19:$C$19 =Model!$B$19:$C$19 s =

0.692 0.692

0.692

$137.57

1.142 2.253

$75.85

=Model!$B$19:$C$19Demands =Model!$B$19:$C$19 Constant

0.005 0.01 =Model!$B$19:$C$19 0.01 =Model!$B$19:$C$19 =Model!$B$19:$C$193 =Model!$B$19:$C$19 =Model!$B$19:$C$190.003 =Model!$B$19:$C$19

0.015

0.692

© C

e n g

a g

e L

e a rn

in g

Developing the Electricity Pricing Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

738 Chapter 14 Optimization Models

=B6+SUMPRODUCT(Prices,C6:D6)

in cell B19. Similarly, enter the formula

=B7+SUMPRODUCT(Prices,C7:D7)

in cell C19 for the off-peak demand.

4. Copy capacity. To indicate the capacity constraints, enter the formula

=Capacity

in cells B21 and C21. The reason for creating these links is that the two demand cells in row 19 need to be paired with two capacity cells in row 21 so that the Solver constraints can be specified appropriately. (Solver doesn’t allow a “two versus one” constraint such as B19:C19 <= B15.) 5. Monetary values.  Calculate the daily revenue, cost of capacity, and profit in the

corresponding cells with the formulas

=SUMPRODUCT(Demands,Prices)

=Capacity*B9

and

=B24-B25

Using Solver The Solver dialog box should be filled in as shown in Figure 14.64. The goal is to maxi- mize profit by setting appropriate prices and capacity and ensuring that demand never exceeds capacity. You should also check the Non-Negative option (prices and capacity can- not be negative), and you should select the GRG Nonlinear method. Again, this is because prices are multiplied by demands, which are functions of prices, so that profit is a nonlin- ear function of the prices.

Discussion of the Solution The Solver solution in Figure 14.63 indicates that FPL should charge $137.57 per mWh during the on-peak period and $75.85 during the off-peak-load period.20 The Solver solution in Figure 14.63 indicates that FPL should charge $137.57 per mWh

20 The Solver solution in Figure 14.63 indicates that FPL should charge $137.57 per mWh

These prices generate demands of 0.692 million mWh in both periods, which is therefore the capacity required. The cost of this capacity is $51.908 million. When this is subtracted from the revenue of $147.712 million, the monthly profit becomes $95.804 million.

To gain some insight into this solution, consider what happens if FPL changes the peak-load price slightly from its optimal value of $137.57. If FPL decreases the price to $137, say, you can check that the on-peak demand increases to 0.700 and the off-peak demand decreases to 0.689. The net effect is that revenue increases slightly, to $148.118. However, the on-peak demand is now greater than capacity, so FPL must increase its capac- ity from 0.692 to 0.700. This increases the cost of capacity to $52.500, which more than offsets the increase in revenue. A similar chain of effects occurs if FPL increases the on- peak price to $138. In this case, on-peak demand decreases, off-peak demand increases, and total revenue decreases. Although FPL can get by with lower capacity, the net effect is slightly less pro�t. Fortunately, Solver evaluates all of these trade-offs for you when it �nds the optimal solution.

Varying the values of the decision variables slightly from their opti- mal values sometimes provides insight into the optimal solution.

20With these prices, if a typical customer uses 1.5 mWh in a month, two-thirds of which is on-peak usage, the bill for the month will be $137.57 + $75.85/2 = $175.50. This seems reasonable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 739

Figure 14.64 Solver Dialog Box for the Electricity Pricing Model

Is the Solver Solution Optimal? It is not difficult to show that the constraints for this model are linear and the objective is a concave function. This is enough to guarantee that there are no local maxima that are not globally optimal. In short, this guarantees that the Solver solution is optimal.

Sensitivity Analysis To gain even more insight, you can use SolverTable to see the effects of changing the unit cost of capacity, allowing it to vary from $60 to $80 in increments of $2. The results appear in Figure 14.65. They indicate that as the cost of capacity increases, the on-peak and off-peak prices both increase, the capacity decreases, and profit decreases. The latter two effects are probably intuitive, but we challenge you to explain the effects on price.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

740 Chapter 14 Optimization Models

14-8c Portfolio Optimization Models

Given a set of investments, how do �nancial analysts determine the portfolio that has the low- est risk and yields a high expected return? This question was answered by Harry Markowitz in the 1950s. For his work on this and other investment topics, he received the Nobel Prize in economics in 1991. The ideas discussed in this section are the basis for most methods of asset allocation used by Wall Street �rms. For example, portfolio optimization models are used to determine the percentage of assets to invest in stocks, gold, and Treasury bills. Before proceeding, however, you need to learn about some important formulas involving the expected value and variance of sums of random variables.

Weighted Sums of Random Variables Let Ri be the (random) return earned during a year on a dollar invested in investment i. For example, if Ri = 0.10, a dollar invested at the beginning of the year grows to $1.10 by the end of the year, whereas if Ri = – 0.20, a dollar invested at the beginning of the year decreases in value to $0.80 by the end of the year. We assume that n investments are available. Let xi be the fraction of our money invested in investment i. We assume that x1 + x2 + · · · + xn = 1, so that all of our money is invested. (To prevent shorting a stock—that is, selling shares we don’t own—we assume that xi ≥ 0.) Then the annual return on our investments is given by the random variable RpRpR , where

RpRpR = R1x1 + R2x2x2 2 + · · · + Rnxnxn n (The subscript p on RpRpR stands for “portfolio.”)

Let μi be the expected value (also called the mean) of Ri , let σ 2 i be the variance of Ri

(so that σi is the standard deviation of Ri), and let ρijiji be the correlation between Ri and RjRjR . To do any work with investments, you must understand how to use the following formulas, which relate the data for the individual investments to the expected return and the variance of return for a portfolio of investments.

Figure 14.65 Sensitivity to Cost of Capacity

Expected value of RpRpR = μ1x1 + μ2 x2 + · · · + μnxnxn n (14.7)

Variance of RpRpR = σ 2 1 x

2 1 + σ

2 2 x

2 2 + · · · + σ

2 n x

2 n +Σijiji ρijiji σiσjσjσ xjxj ixixi jxjx (14.8)

The latter summation in Equation (14.8) is over all pairs of investments. The quantities in Equations (14.7) and (14.8) are extremely important in portfolio selection because of the

3 2 1

4 5 6 7 8 9

10 11 12 13 14 15

A BA B C DC D E FE F G

Cost of capacity (cell $B$9) values along side, output cell(s) along top

Pr ic

es _1

Pr ic

es _2

Ca pa

ci ty

Pr of

it

$60 $62

$133.82 $72.10 0.730 106.466 $134.32 $72.60 0.725 105.012

$64 $134.82 $73.10 0.720 103.568 $66 $135.32 $73.60 0.715 102.134 $68 $135.82 $74.10 0.710 100.710 $70 $136.32 $74.60 0.705 99.295 $72 $136.82 $75.10 0.700 97.891 $74 $137.32 $75.60 0.695 96.497 $76 $137.82 $76.10 0.690 95.113 $78 $138.32 $76.60 0.685 93.738 $80 $138.82 $77.10 0.680 92.374

Oneway analysis for Solver model in Model worksheet

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 741

This allows you to calculate the portfolio variance very easily with Excel’s matrix func- tions, as explained next.

Matrix Functions in Excel Equation (14.9) for the variance of portfolio return looks intimidating, particularly if there are many potential investments. Fortunately, two built-in Excel matrix functions, MMULT and TRANSPOSE, simplify the calculation. In this subsection we illustrate how to use these two functions. Then in the next subsection we use them in the portfolio selection model.

A matrix is a rectangular array of numbers. The matrix is an matrix is a rectangular array of numbers. The matrix is an matrix i × j matrix if it consists j matrix if it consists j of i rows and j columns. For example,

A = a1 2 3 4 5 6

b is a 2 × 3 matrix, and

B = q 1 2 3 4 5 6

r

is a 3 × 2 matrix. If the matrix has only a single row, it is called a row vector. Similarly, if it has only a single column, it is called a column vector.

If matrix A has the same number of columns as matrix B has rows, it is possible to calculate the matrix product of matrix product of matrix product A and B, denoted AB. The entry in row i, column j of the product AB is obtained by summing the products of the values in row i of A with the corre- sponding values in column j of B. If A is an i × k matrix and B is a k × j matrix, the product j matrix, the product j AB is an i × j matrix.j matrix.j

For example, if

A = a1 2 3 2 4 5

b and

B = q 1 2 3 4 5 6

r

risk–return trade-off investors need to make. All investors want to choose portfolios with high return, measured by the expected value in Equation (14.7), but they also want portfo- lios with low risk, usually measured by the variance in Equation (14.8).

Equation (14.8) can be rewritten slightly by using covariances instead of correlations. The covariance between two stock returns is another measure of the relationship between the two returns, but unlike a correlation, it is not scaled to be between not scaled to be between not –1 and +1. This is because covariances are affected by the units in which the returns are measured. Although a covariance is a somewhat less intuitive measure than a correlation, it is used so frequently by �nancial analysts that we use it here as well. If cijiji is the estimated covariance between stocks i and j, then cijiji = rijiji sisjsjs . (Here, r is an estimated correlation, and r is an estimated correlation, and r s is an estimated standard deviation.) Using this equation and the fact that the correlation between any stock and itself is 1, we can also write cii = si

2 for each stock i. Therefore, an equivalent form of Equation (14.8) is the following.

Estimated variance of RpRpR = Σi, j cijiji xi xjxjx (14.9)

Matrix Multiplication in Excel

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

742 Chapter 14 Optimization Models

then AB is the following 2 × 2 matrix:

AB = a1(1) + 2(3) + 3(5) 1(2) + 2(4) + 3(6) 2(1) + 4(3) + 5(5) 2(2) + 4(4) + 5(6)

b = a22 28 39 50

b

The Excel MMULT function performs matrix multiplication in a single step. The spread- sheet in Figure 14.66 indicates how to multiply matrices of different sizes. (See the �le Matrix Multiplication.xlsx.) For example, to multiply matrix 1 by matrix 2 (which is possible because matrix 1 has three columns and matrix 2 has three rows), select the range B13:C14, type the formula

=MMULT(B4:D5,B7:C9) and press Ctrl+Shift+Enter (all three keys at once). Note that you should select a range with two rows and two columns because matrix 1 has two rows and matrix 2 has two columns.

The matrix multiplication in cell B24 indicates that (1) it is possible to multiply three matrices together by using MMULT twice, and (2) the TRANSPOSE function can be used to convert a column vector to a row vector (or vice versa), if necessary. Here, you want to multiply Column 1 by the product of Matrix 3 and Column 1. However, Column 1 is 3 × 1, and Matrix 3 is 3 × 3, so Column 1 multiplied by Matrix 3 doesn’t work. Instead, you must transpose Column 1 to make it 1 × 3. Then the result of multiplying all three together is a 1 × 1 matrix (a number). It can be calculated by selecting cell B24, typing the formula

=MMULT(TRANSPOSE(I4:I6),MMULT(B17:D19,I4:I6)) and pressing Ctrl+Shift+Enter. This formula uses MMULT twice because MMULT can multiply only two matrices at a time.

Figure 14.66 Examples of Matrix Multiplication in Excel

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

Matrix mul�plica�on in Excel

Typical mul�plica�on of two matricesTypical mul�plica�on of two matricesT Mul�plica�on of a matrix and a column Matrix 1 Column 1321

3542 4

Matrix 2 Matrix 1 �mes Column 1, with formula =MMULT(B4:D5,I4:I6)ormula =MMULT(B4:D5,I4:I6)ormula =MMUL43 Select range with 2 rows, 1 column, enter formula, press Ctrl+Shi�+Enter65

20 Matrix 1 �mes Matrix 2, with formula =MMULMatrix 1 �mes Matrix 2, with formula =MMULMatrix 1 �mes Matrix 2, with f T(B4:D5,B7:C9)ormula =MMULT(B4:D5,B7:C9)ormula =MMUL 63 Select range with 2 rows, 2 columns, enter formula, press Ctrl+Shi�+Enter.

Mul�plica�on of a row and a matrix woR5039

Mul�plica�on of a quadra�c form (row �mes matrix �mes column)

Quadra�c form

Row 1 �mes Matrix 1, with formula =MMULT(I14:J14,B4:D5)ormula =MMULT(I14:J14,B4:D5)ormula =MMUL Matrix 3 S3 Select range with 1 row, 3 columns, enter formula, press Ctrl+Shi�+Enter3 S33 S3 S13 S3 S23 S

1 –1 3728140

Mul�plica�on of a row and a column

Transpose of Column 1 �mes Matrix 3 �mes Column 1 Row 2

2

1 2

22 28 1 41 4 5

43 0

1 6 3

Formula is =MMULT(TRANSPOSE(I4:I6),MMULrmula is =MMULT(TRANSPOSE(I4:I6),MMULrmula is =MMUL T(B17:D19,I4:I6))T(TRANSPOSE(I4:I6),MMULT(B17:D19,I4:I6))T(TRANSPOSE(I4:I6),MMUL Select range with 1 row, 1 column, enter formula, press Ctrl+Shi�+Enter

Row 2 �mes Column 1, with formula =MMULT(I22:K22,I4:I6)ormula =MMULT(I22:K22,I4:I6)ormula =MMUL

123 Select range with 1 row, 1 column, enter formula, press Ctrl+Shi�+Enter

32

3 S3 S3 S

A BA B C DC D E FE F G HG H I JI J K LK L M NM N

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 743

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Excel Function: MMULT The MMULT and TRANSPOSE functions are useful for matrix operations. They are called array functions because they operate on an entire range, not just a single cell. The MMULT function multiplies two matrices and has the syntax =MMULMMULMMU T(range1,range2), where range1 must have as many columns as range2 has rows. To use this function, select a range that has as many rows as range1 and as many columns as range2, type the formula, and press Ctrl+Shift+Enter. The resulting formula will have curly brackets around it in the Excel formula bar. You should not type these curly brackets. Excel enters them automatically to remind you that this is an array formula.

�e Portfolio Selection Model Most investors have two objectives in forming portfolios: to obtain a large expected return and to obtain a small variance (to minimize risk). The problem is inherently nonlinear because the portfolio variance is nonlinear in the investment amounts. The most common way of handling this two-objective problem is to specify a minimal required expected return and then minimize the variance subject to the constraint on the expected return. The following example illustrates how to do this.

E X A M P L E 14.12 PORTFOLIO OPTIMIZATION AT PERLMAN & BROTHERS

The investment company Perlman & Brothers intends to invest a given amount of money in three stocks. From past data, the means and standard deviations of annual returns have been estimated as shown in Table 14.8. The correlations between the annual returns on the stocks are listed in Table 14.9. The company wants to find a minimum-variance portfolio that yields an expected annual return of at least 0.12 (that is, 12%).

Table 14.8 Estimated Means and Standard Deviations of Stock Returns Stock Mean Standard Deviation

1 0.14 0.20 2 0.11 0.15 3 0.10 0.08

Table 14.9 Estimated Correlations between Stock Returns Combination Correlation

Stocks 1 and 2 0.6 Stocks 1 and 3 0.4 Stocks 2 and 3 0.7

Objective To use NLP to find the portfolio that minimizes the risk, measured by portfo- lio variance, subject to achieving an expected return of at least 12%.

Where Do the Numbers Come From? Financial analysts typically estimate the required means, standard deviations, and correla- tions for stock returns from historical data. However, you should be aware that there is no guarantee that these estimates, based on historical return data, are relevant for historical return data, are relevant for historical future returns. If analysts have new information about the stocks, they should incorporate this new information into their estimates.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

744 Chapter 14 Optimization Models

Solution The variables and constraints for this model appear in Figure 14.67. (See the file Portfolio Selection Big Picture.xlsx.) One interesting aspect of this model is that it is not necessary not necessary not to specify the amount of money invested—it could be $100, $1000, $1,000,000, or any other amount. The model determines the fractions of this amount to invest in the various stocks, and these fractions are then relevant for any investment amount. The only require- ment is that the fractions should sum to 1, so that all of the money is invested. Besides this, the fractions are constrained to be nonnegative to prevent shorting stocks.21 ment is that the fractions should sum to 1, so that all of the money is invested. Besides

21 ment is that the fractions should sum to 1, so that all of the money is invested. Besides

Finally, the expected portfolio return is constrained to be at least as large as a specified expected return, such as 12%.

© C

e n g

a g

e L

e a rn

in gStandard Devia�ons

of Returns

Correla�ons Between Returns

Mean Returns

Actual Mean Por�olio Return

Sum of Investment Weights

Required Mean Por�olio Return

Investment Weights

Minimize Variance (or standard devia�on) of

Por�olio Return1= 1= 1= 1= 1= 1=

>=

Figure 14.67 Big Picture for Portfolio Selection Model

Developing the Spreadsheet Model The individual steps are now listed. (See Figure 14.68 and the file Portfolio Selection.xlsx.) 1. Inputs. Enter the inputs in the input cells. These include the estimates of means, stand-

ard deviations, and correlations, as well as the required expected return.

2. Fractions invested.Fractions invested.Fractions in Enter any trial values in the Investment_weights range for the fractions of Perlman’s money placed in the three investments. Then sum these with the SUM function in cell B19.

3. Expected annual return. Use Equation (14.7) to calculate the expected annual return in cell B23 with the formula

=SUMPRODUCT(B5:D5,Investment_weights)

4. Covariance matrix. Equation (14.9) is used to calculate the portfolio variance. To do this, you must �rst calculate a matrix of covariances. Using the general formula for covariance, cij = rijsisjsjs (which holds even when i = j, because rii = 1), these can be calculated from the inputs by using lookups. Speci�cally, enter the formula

=HLOOKUP($F9,$B$4:$D$6,3)*B9*HLOOKUP(G$8,$B$4:$D$6,3)

21If you want to allow shorting, do not check the Non-Negative option in the Solver dialog box.

Developing the Portfolio Selection Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 745

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 2 27 28 29 30 31 32 33 34

6

A BA B C DC D E FE F G HG H I Por�olio selec�on model

Range names used:

Mean_por�olio_return =Model!$B$23 Investment_weights =Model!$B$15:$D$15

Stock input data

Por�olio_stdev =Model!$B$26

Stock 1 Stock 2 Stock 3

Por�olio_variance =Model!$B$25

Mean return

=Model!$D$23Required_mean_return

0.10.110.14 StDev of return

=Model!$B$19Total_weights

0.080.152.0

ock 1Correla�ons SSts SStock 1s Sock 1 tock 2 Stock 3 Covariances Stock 1 Stock 2 Stock 3 Stock 1 Stock 10.40.61 0.04 0.018 0.0064 Stock 2 Stock 20.710.6 0.018 0.0225 0.0084 Stock 3 Stock 30.70.4 04 0St4 0Stock 4 0ock 34 0314 010.74 00.7 .0064 0.0084 0.0064

Investment decisions Stock 1 Stock 2 Stock 3

Investment weights 0.500 0.000 0.500

Constraint on inves�ng everything Total weights Required value

1=1.00

Constraint on expected por�olio return Mean por�olio return Required mean return

0.120 >= 0= 0.120

Por�olio variance 0.0148 Por�olio stdev 0.1217

1 S

1 S3 Cs Ss S

4 0

8 0 5 0 4 0

0.04 0.01 8 0 4 0

3 C

4 0

1 S

s R

0 >

turn =Model!$B$23 ghts =Model!$B$15:$D$15

e =

v 0

Figure 14.68 Portfolio Optimization Model

© C

e n g

a g

e L

e a rn

in g

in cell G9, and copy it to the range G9:I11. (Note that the term B9 captures the relevant correlation. The two HLOOKUP terms capture the appropriate standard deviations.)

5. Portfolio variance. Although the mathematical details are not presented here, it can be shown that the summation in Equation (14.9) is the product of three matrices: a row of fractions invested multiplied by the covariance matrix multiplied by a column of fractions invested. To calculate it, enter the formula

=MMULT(Investment_weights,MMULT(G9:I11,TRANSPOSE(Investment_weights)))

in cell B25 and press Ctrl+Shift+Enter. (Remember that Excel puts curly brackets around this formula. You should not type these curly brackets.) Note that this formula not type these curly brackets.) Note that this formula not uses two MMULT functions. Again, this is because MMULT can multiply only two matrices at a time. The formula �rst multiplies the last two matrices and then multi- plies this product by the �rst matrix.

6. Portfolio standard deviation. Most �nancial analysts talk in terms of portfolio vari- ance. However, it is probably more intuitive to talk about portfolio standard deviation because it is in the same units as the returns. Calculate the standard deviation in cell B26 with the formula

=SQRT(Portfolio_variance)

Actually, either cell B25 or B26 can be used as the objective cell to minimize. Minimizing the square root of a function is equivalent to minimizing the function itself.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

746 Chapter 14 Optimization Models

Discussion of the Solution The solution in Figure 14.68 indicates that the company should put half of its money in each of stocks 1 and 3, and it should not invest in stock 2 at all. This might be somewhat surprising, given that the ranking of riskiness of the stocks is 1, 2, 3, with stock 1 being the most risky but also having the highest expected return. However, the correlations play an important role in portfolio selection, so you can usually not guess the optimal portfolio on the basis of the means and standard deviations of stock returns alone.

The portfolio standard deviation of 0.1217 can be interpreted in a probabilistic sense. Specifically, if stock returns are approximately normally distributed, the actual portfolio return will be within one standard deviation of the expected return with probability about 0.68, and the actual portfolio return will be within two standard deviations of the expected return with probability about 0.95. Given that the expected return is 0.12, this implies a lot of risk—two standard deviations below this mean is a negative return (or loss) of slightly more than 12%.

Figure 14.69 Solver Dialog Box for Portfolio Model

© C

e n g

a g

e L

e a rn

in g

Using Solver The completed Solver dialog box is shown in Figure 14.69. The constraints specify that the expected return must be at least as large as the minimal required return, and all of the company’s money must be invested. The decision variable cells are constrained to be non- negative (to avoid short selling), but because of the squared terms in the variance formula, you must select the GRG Nonlinear method.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-8 Nonlinear Optimization Models 747

Is the Solver Solution Optimal? The constraints for this model are linear, and it can be shown that the portfolio variance is a convex function of the investment fractions. This is sufficient to guarantee that the Solver convex function of the investment fractions. This is sufficient to guarantee that the Solver convex solution is indeed optimal.

Sensitivity Analysis This model begs for a sensitivity analysis on the minimum required return. When the com- pany requires a larger expected return, it must assume a larger risk. This behavior is illus- trated in Figure 14.70, where SolverTable has been used with cell D23 as the single input cell, varied from 0.10 to 0.14 in increments of 0.005. Note that values outside this range are of little interest. Stock 3 has the minimum expected return, 0.10, and stock 1 has the high- est expected return, 0.14, so no portfolio can have an expected return outside of this range.

3

4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29

A BA B C DC D E FE F G HG H I

Required return (cell $D$23) values along side, output cell(s) along top 2 1 Oneway analysis for Solver model in Model worksheet

Po r�

o lio

_s td

ev

In ve

st m

en t_

w ei

gh ts

_1

In ve

st m

en t_

w ei

gh ts

_2

In ve

st m

en t_

w ei

gh ts

_3

M ea

n _p

o r�

o lio

_r et

u rn

0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140

0.000 0.125 0.250 0.375 0.500 0.625 0.750 0.875 1.000

0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000 0.000

1.000 0.875 0.750 0.625 0.500 0.375 0.250 0.125 0.000

0.100 0.105 0.110 0.115 0.120 0.125 0.130 0.135 0.140

0.0800 0.0832 0.0922 0.1055 0.1217 0.1397 0.1591 0.1792 0.2000

0.150

0.140

0.130

0.110

0.120

0.100

0.090

0.080 0.0500 0.0700 0.0900 0.1100 0.1300 0.1500 0.1700 0.1900 0.2100

M ea

n p

o r

o lio

r et

u rn

Standard devia�on of por olio return (risk)

Efficient Fron�er

Figure 14.70 The Efficient Frontier

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

748 Chapter 14 Optimization Models

The results indicate that the company should put more and more into risky stock 1 as the required return increases—and stock 2 continues to be unused. The accompanying scatter chart (with the option to “connect the dots”) shows the risk–return trade-off. As the company assumes more risk, as measured by portfolio standard deviation, the expected return increases, but at a decreasing rate.

The curve in this chart is called the efficient frontier. Points on the efficient fron- tier can be achieved by appropriate portfolios. Points below the efficient frontier can be achieved, but they are not as good as points on the efficient frontier because they have a lower expected return for a given level of risk. In contrast, points above the efficient fron- tier are unachievable—the company cannot achieve this high an expected return for a given level of risk.

Modeling Issues ■ Typical real-world portfolio selection problems involve a large number of potential

investments, certainly many more than three. This admittedly requires more input data, particularly for the correlation matrix, but the basic model does not change at all. In particular, the matrix formula for portfolio variance is exactly the same. This shows the power of using Excel’s matrix functions. Without them, the formula for portfolio variance would be a long, involved sum.

■ If Perlman is allowed to short a stock, the fraction invested in that stock is allowed to be negative. To implement this, you can eliminate the nonnegativity constraints on the decision variable cells.

■ An alternative objective might be to minimize the probability that the portfolio loses money. This possibility is illustrated in one of the problems. ■

P R O B L E M S

Level A 69. In the electricity pricing model, the demand functions

have positive and negative coefficients of prices. The negative coefficients indicate that as the price of a product increases, demand for that product decreases. that product decreases. that The positive coefficients indicate that as the price of a product increases, demand for the other product other product other increases. a. Increase the magnitudes of the negative coefficients

from –0.013 and –0.015 to –0.018 and –0.023, and rerun Solver. Are the changes in the optimal solution intuitive? Explain.

b. Increase the magnitudes of the positive coefficients from 0.005 and 0.003 to 0.007 and 0.005, and rerun Solver. Are the changes in the optimal solution intuitive? Explain.

c. Make the changes in parts a and b simultaneously and rerun Solver. What happens now?

70. In the electricity pricing model, we assumed that the capacity level is a decision variable. Assume now that capacity has already been set at 0.65 million of mWh . (Note that the cost of capacity is now a sunk cost, so it is irrelevant to the decision problem.) Change the model appropriately and run Solver. Then use SolverTable to see how sensitive the optimal solution is to the capacity level, letting it vary over some relevant range. Does it appear that the optimal prices will be set so that demand is always equal to capacity for at least one of the two periods of the day?

71. For each of the following, answer whether it makes sense to multiply the matrices of the given sizes. In each case where it makes sense, demonstrate an exam- ple in Excel, where you make up the numbers. a. AB, where A is 3 × 4 and B is 4 × 1 b. AB, where A is 1 × 4 and B is 4 × 1 c. AB, where A is 4 × 1 and B is 1 × 4 d. AB, where A is 1 × 4 and B is 1 × 4 e. ABC, where A is 1 × 4, B is 4 × 4, and C is 4 × 1

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-9 Conclusion 749

f. ABC, where A is 3 × 3, B is 3 × 3, and C is 3 × 1 g. ATBTBT , where A is 4 × 3 and B is 4 × 3, and AT

denotes the transpose of A

72. Add a new stock, stock 4, to the portfolio optimiza- tion model. Assume that the estimated mean and standard deviation of return for stock 4 are 0.125 and 0.175, respectively. Also, assume the correlations between stock 4 and the original three stocks are 0.3 , 0.5, and 0.8. Run Solver on the modified model, where the required expected portfolio return is again 0.12. Is stock 4 in the optimal portfolio? Then run SolverTable as in the example. Is stock 4 in any of the optimal portfolios on the efficient frontier?

73. In the portfolio optimization model, stock 2 is not in the optimal portfolio. Use SolverTable to see whether it ever enters the optimal portfolio as its correlations with stocks 1 and 3 vary. Specifically, use a two-way SolverTable with two inputs, the correlations between stock 2 and stocks 1 and 3, each allowed to vary from 0.1 to 0.9 in increments of 0.1. Capture as outputs the three decision variable cells. Discuss the results. (Note: You will have to change the model slightly. For example, if you use cells B10 and C11 as the two SolverTable input cells, you will have to ensure that cells C9 and D10 change accordingly. This is easy. Just put formulas in these latter two cells.)

74. The stocks in the portfolio optimization model are all positively correlated. What happens when they are negatively correlated? Answer for each of the following scenarios. In each case, two of the three correlations are the negatives of their original values. Discuss the differences between the optimal portfolios in these three scenarios. a. Change the signs of the correlations between

stocks 1 and 2 and between stocks 1 and 3. (Here, stock 1 tends to go in a different direction from stocks 2 and 3.)

b. Change the signs of the correlations between stocks 1 and 2 and between stocks 2 and 3. (Here, stock 2 tends to go in a different direction from stocks 1 and 3.)

c. Change the signs of the correlations between stocks 1 and 3 and between stocks 2 and 3. (Here,

stock 3 tends to go in a different direction from stocks 1 and 2.)

75. The file P14_75.xlsx contains historical monthly returns for 28 companies. For each company, calculate the estimated mean return and the estimated variance of return. Then calculate the estimated correlations between the companies’ returns. Note that “return” here means monthly return.

76. This problem continues using the data from the previ- ous problem. The file P14_76.xlsx includes all of the previous data. It also contains fractions in row 3 for creating a portfolio. These fractions are currently all equal to 1/28, but they can be changed to any values you like, so long as they continue to sum to 1. For any such fractions, find the estimated mean, variance, and standard deviation of the resulting portfolio return.

Level B 77. Continuing the previous problem, find the portfolio

that achieves an expected monthly return of at least 0.01 (1%) and minimizes portfolio variance. Then use SolverTable to sweep out the efficient frontier. Create a chart of this efficient frontier from your SolverTable results. What are the relevant lower and upper limits on the required expected monthly return?

78. In many cases you can assume that the portfolio return is at least approximately normally distributed. Then you can use Excel’s NORM.DIST function as in Chapter 5 to calculate the probability that the portfolio return is negative. The relevant formula is =NORM.DIST(0,mean,stdtdt eded v,TRUE), where mean and stdev are the expected portfolio return and stand- ard deviation of portfolio return, respectively. a. Modify the portfolio optimization model slightly,

and then run Solver to find the portfolio that achieves at least a 0.12 (12%) expected return and minimizes the probability of a negative return. Do you get the same optimal portfolio as before? What is the probability that the return from this portfolio will be negative?

b. Using the model in part a, create a chart of the efficient frontier. However, this time put the probability of a negative return on the horizontal axis.

14-9 CONCLUSION This chapter has led you through spreadsheet optimization models of many diverse prob- lems. No standard procedure can be used to model all problems. However, there are several keys to most models.

■ First, determine the decision variable cells. For example, in blending problems it is important to realize that the decision variable cells are the amounts of inputs used to produce outputs, and in employee scheduling problems, it is important to realize that the decision variable cells are the number of employees who start their �ve-day shift each day of the week.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

750 Chapter 14 Optimization Models

■ Set up the model so that you can easily calculate what you wish to maximize or minimize (usually pro�t or cost). For example, in the aggregate planning model it is a good idea to calculate total cost by calculating the monthly cost of the various activities in separate rows and then summing the subtotals.

■ Set up the model so that the relationships between the cells in the spreadsheet and the constraints of the problem are readily apparent. For example, in the employee scheduling model it is convenient to calculate the number of people working each day of the week adjacent to the minimum required number of people for each day of the week.

■ Optimization models do not always fall into ready-made categories. A model might involve a combination of the ideas discussed in the production scheduling, blending, and aggregate planning examples. In fact, many real applications are not strictly analogous to any of the models we have discussed. However, exposure to the models in this chapter should give you the insights you need to solve a wide variety of interesting problems.

Summary of Key Terms

Term Explanation Page

Employee scheduling models Models for choosing the staffing levels to meet workload requirements

663

Multiple optimal solutions Situation where several solutions obtain the same optimal objective value

668

Blending models Models where inputs must be mixed in the right proportions to produce outputs

670

Logistics models Models where goods must be shipped from one set of locations to another at minimal cost

676

Flow balance constraint Constraint that relates the flow into a node and the flow out of the node

682

Aggregate planning models Models where workforce levels and production levels must be set to meet customer demand

693

Integer programming (IP) models Models where at least some of the decision variables must be integers

714

Binary variable Integer variable that must be 0 or 1; used to indicate whether an activity takes place

714

Capital budgeting models Models where a subset of investment activities is chosen from a set of possible activities

714

Fixed-cost models Models where fixed costs are incurred for various activities if they are done at any positive level

720

Set-covering models Models where members of one set must be selected to cover services to members of another set

729

Nonlinear programming (NLP) models Models where either the objective function or the constraints (or both) are nonlinear functions of the decision variables

735

Global optimum Solution that is the best in the entire feasible region 735

Local optimal solution Solution that is better than all nearby solutions (but might not be optimal globally)

735

Portfolio optimization models Models that attempt to find the portfolio of securities that achieves the best balance between risk and return

740

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-9 Conclusion 751

P R O B L E M S

Conceptual Exercises C.1. The employee scheduling model in this chapter was

purposely made small (only seven decision variable cells). What would make a similar problem for a company like McDonald’s much harder? What types of constraints would be required? How many deci- sion variable cells (approximately) might there be?

C.2. Explain why it is problematic to include a constraint such as the following in an LP model for a blending problem:

Total octane in gasoline 1 blend

Barrels of gasoline 1 blended daily ≥ 10

C.3. “It is essential to constrain all shipments in a transportation problem to have integer values to ensure that the optimal LP solution consists entirely of integer- valued shipments.” Is this statement true or false? Why?

C.4. What is the relationship between transportation models and more general logistics models? Explain how these two types of linear optimization models are similar and how they are different.

C.5. Unlike the small logistics models presented here, real- world logistics problems can be huge. Imagine the global problem a company like FedEx faces each day. Describe as well as you can the types of decisions and constraints it has. How large (number of decision vari- ables, number of constraints) might such a problem be?

C.6. Suppose that you formulate and solve an integer pro- gramming model with a cost-minimization objective. Assume that the optimal solution yields an objective cell value of $500,000. Now, consider the same linear optimization model without the integer restrictions. That is, suppose that you drop the requirement that the decision variable cells be integer-valued and reoptimize with Solver. How does the optimal objec- tive cell value for this modified model (called the LP relaxation of the IP model) compare to the original total cost value of $500,000? Explain your answer.

C.7. The portfolio optimization model presented here is the standard model: minimize the variance (or standard deviation) of the portfolio, as a measure of risk, for a given required level of expected return. In general, the goal is to keep risk low and expected return high. Can you think of other ways to model the problem to achieve these basic goals? Is high variability all bad risk?bad risk?bad

Level A 79. A bus company believes that it will need the following

numbers of bus drivers during each of the next five years: 60 drivers in year 1; 70 drivers in year 2; 50 driv- ers in year 3; 65 drivers in year 4; 75 drivers in year 5.

At the beginning of each year, the bus company must decide how many drivers to hire or fire. It costs $4000 to hire a driver and $2000 to fire a driver. A driver’s salary is $45,000 per year. At the beginning of year 1 the com- pany has 50 drivers. A driver hired at the beginning of a year can be used to meet the current year’s requirements and is paid full salary for the current year. a. Determine how to minimize the bus company’s

salary, hiring, and firing costs over the next five years. b. Use SolverTable to determine how the total number

hired, total number fired, and total cost change as the unit hiring and firing costs each increase by the same percentage.

80. A pharmaceutical company produces the drug NasaMist from four chemicals. Today, the company must produce 1000 pounds of the drug. The three active ingredients in NasaMist are A, B, and C. By weight, at least 8% of NasaMist must consist of A, at least 4% of B, and at least 2% of C. The cost per pound of each chemical and the amount of each active ingredient in one pound of each chemical are given in the file P14_80.xlsx. It is necessary that at least 100 pounds of chemical 2 and at least 450 pounds of chemical 3 be used. a. Determine the cheapest way of producing today’s

batch of NasaMist. b. Use SolverTable to see how much the percentage

of requirement of A is really costing the company. Let the percentage required vary from 6% to 12%.

81. A bank is attempting to determine where to invest its assets during the current year. At present, $500,000 is available for investment in bonds, home loans, auto loans, and personal loans. The annual rates of return on each type of investment are known to be the following: bonds, 6%; home loans, 8%; auto loans, 5%; personal loans, 10%. To ensure that the bank’s portfolio is not too risky, the bank’s investment manager has placed the following three restrictions on the bank’s portfolio:

■ The amount invested in personal loans cannot exceed the amount invested in bonds.

■ The amount invested in home loans cannot exceed the amount invested in auto loans.

■ No more than 25% of the total amount invested can be in personal loans.

Help the bank maximize the annual return on its investment portfolio.

82. A fertilizer company blends silicon and nitrogen to produce two types of fertilizers. Fertilizer 1 must be at least 40% nitrogen and sells for $70 per pound. Fertilizer 2 must be at least 70% silicon and sells for $40 per pound. The company can purchase up to 8000

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

752 Chapter 14 Optimization Models

pounds of nitrogen at $15 per pound and up to 10,000 pounds of silicon at $10 per pound. a. Assuming that all fertilizer produced can be sold,

determine how the company can maximize its profit. b. Use SolverTable to explore the effect on profit

of changing the minimum percentage of nitrogen required in fertilizer 1.

c. Suppose the availabilities of nitrogen and silicon both increase by the same percentage from their current values. Use SolverTable to explore the effect of this change on profit.

83. Optimization models are used by many Wall Street firms to select a desirable bond portfolio. The follow- ing is a simplified version of such a model. A com- pany is considering investing in four bonds; $1 million is available for investment. The expected annual return, the worst-case annual return on each bond, and the duration of each bond are given in the file P14_83.xlsx. (The duration of a bond is a measure of the bond’s sensitivity to interest rates.) The company wants to maximize the expected return from its bond investments, subject to three constraints:

■ The worst-case return of the bond portfolio must be at least 8%.

■ The average duration of the portfolio must be at most 6. For example, a portfolio that invests $600,000 in bond 1 and $400,000 in bond 4 has an average duration of [600,000(3) + 400,000(9)]/1,000,000 = 5.4.

■ Because of diversification requirements, at most 40% of the total amount invested can be invested in a single bond.

Determine how the company can maximize the expected return on its investment.

84. At the beginning of year 1, you have $10,000. Investments A and B are available; their cash flows are shown in the file P14_84.xlsx. Assume that any money not invested in A or B earns interest at an annual rate of 2%. a. Determine how to maximize your cash on hand at

the beginning of year 4. b. Use SolverTable to determine how a change in the

year 2 return for investment A changes the optimal solution to the problem.

c. Use SolverTable to determine how a change in the year 3 return of investment B changes the optimal solution to the problem.

85. An oil company produces two types of gasoline, G1 and G2, from two types of crude oil, C1 and C2. G1 is allowed to contain up to 4% impurities, and G2 is allowed to contain up to 3% impurities. G1 sells for $48 per barrel, whereas G2 sells for $72 per barrel. Up to 4200 barrels of G1 and up to 4300 barrels of G2 can be sold. The cost per barrel of each crude, their availability, and the level of impurities in each crude are listed in the file P14_85.xlsx. Before blending the

crude oil into gas, any amount of each crude can be “purified” for a cost of $3.00 per barrel. Purification eliminates half of the impurities in the crude oil. a. Determine how to maximize profit. b. Use SolverTable to determine how an increase in

the availability of C1 affects the optimal profit. c. Use SolverTable to determine how an increase in

the availability of C2 affects the optimal profit. d. Use SolverTable to determine how a change in the

profitability of G2 changes profitability and the types of gas produced.

86. The government is auctioning off oil leases at two sites: 1 and 2. At each site 10,000 acres of land are to be auctioned. Cliff Ewing, Blake Barnes, and Alexis Pickens are bidding for the oil. Government rules state that no bidder can receive more than 40% of the land being auctioned. Cliff has bid $10,000 per acre for site 1 land and $20,000 per acre for site 2 land. Blake has bid $9000 per acre for site 1 land and $22,000 per acre for site 2 land. Alexis has bid $11,000 per acre for site 1 land and $19,000 per acre for site 2 land. a. Determine how to maximize the government’s

revenue. b. Use SolverTable to see how changes in the

government’s rule on 40% of all land being auctioned affect the optimal revenue. Why can the optimal revenue not decrease if this percentage required increases? Why can the optimal revenue not increase if this percentage required decreases?

87. An automobile company produces cars in Los Angeles and Detroit and has a warehouse in Atlanta. The company supplies cars to customers in Houston and Tampa. The costs of shipping a car between various points are listed in the file P14_87.xlsx, where a blank means that a shipment is not allowed. Los Angeles can produce up to 1100 cars, and Detroit can produce up to 2900 cars. Houston must receive 2400 cars, and Tampa must receive 1500 cars. a. Determine how to minimize the cost of meeting

demands in Houston and Tampa. b. Modify the answer to part a if shipments between

Los Angeles and Detroit are not allowed. c. Modify the answer to part a if shipments between a if shipments between a

Houston and Tampa are allowed at a cost of $5 per car.

88. An oil company produces oil from two wells. Well 1 can produce up to 150,000 barrels per day, and well 2 can produce up to 200,000 barrels per day. It is possible to ship oil directly from the wells to the company’s customers in Los Angeles and New York. Alternatively, the company could transport oil to the ports of Mobile and Galveston and then ship it by tanker to New York or Los Angeles, respectively. Los Angeles requires 160,000 barrels per day, and New York requires 140,000 barrels per day. The costs of shipping 1000 barrels between various locations

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

14-9 Conclusion 753

are shown in the file P14_88.xlsx, where a blank indicates shipments that are not allowed. Determine how to minimize the transport costs in meeting the oil demands of Los Angeles and New York.

89. Based on Bean et al. (1987). Boris Milkem’s firm owns six assets. The expected selling price (in millions of dollars) for each asset is given in the file P14_89 .xlsx. For example, if asset 1 is sold in year 2, the firm receives $20 million. To maintain a regular cash flow, Milkem must sell at least $20 million of assets during year 1, at least $30 million worth during year 2, and at least $35 million worth during year 3. Determine how Milkem can maximize his total revenue from assets sold during the next three years.

90. Based on Sonderman and Abrahamson (1985). In treat- ing a brain tumor with radiation, physicians want the maximum amount of radiation possible to bombard the tissue containing the tumors. The constraint is, however, that there is a maximum amount of radiation that nor- mal tissue can handle without suffering tissue damage. Physicians must therefore decide how to aim the radia- tion so as to maximize the radiation that hits the tumor tissue subject to the constraint of not damaging the normal tissue. As a simple example of this situation, sup- pose there are six types of radiation beams (beams differ in where they are aimed and their intensity) that can be aimed at a tumor. The region containing the tumor has been divided into six regions: three regions contain tumors and three contain normal tissue. The amount of radiation delivered to each region by each type of beam is shown in the file P14_90.xlsx. If each region of normal tissue can handle at most 60 units of radia- tion, which beams should be used to maximize the total amount of radiation received by the tumors?

91. A leading hardware company produces three types of computers: Pear computers, Apricot computers, and Orange computers. The relevant data are given in the file P14_91.xlsx. The equipment cost is a fixed cost; it is incurred if any of this type of computer is produced. A total of 30,000 chips and 12,000 hours of labor are available. The company wants to produce at least two types of computers. a. Determine how the company can maximize its profit. b. For any computer type not in the optimal product not in the optimal product not

mix, use SolverTable to find how much larger its unit margin would have to be before it would enter the optimal product mix.

92. A food company produces tomato sauce at five different plants. The tomato sauce is then shipped to one of three warehouses, where it is stored until it is shipped to one of the company’s four customers. All of the inputs for the problem are given in the file P14_92.xlsx, as follows:

■ The plant capacities (in tons) ■ The cost per ton of producing tomato sauce at each

plant and shipping it to each warehouse

■ The cost of shipping a ton of sauce from each warehouse to each customer

■ The customer requirements (in tons) of sauce ■ The fixed annual cost of operating each plant and

warehouse.

The company must decide which plants and warehouses to open, and which routes from plants to warehouses and from warehouses to customers to use. All customer demand must be met. A given customer’s demand can be met from more than one warehouse, and a given plant can ship to more than one warehouse. a. Determine the minimum-cost method for meeting

customer demands. b. Use SolverTable to see how a change in the

capacity of plant 1 affects the total cost. c. Use SolverTable to see how a change in the

customer 2 demand affects the total cost.

93. You are given the following means, standard devia- tions, and correlations for the annual return on three potential investments. The means are 0.12, 0.15, and 0.20. The standard deviations are 0.20, 0.30, and 0.40. The correlation between stocks 1 and 2 is 0.65, between stocks 1 and 3 is 0.75, and between stocks 2 and 3 is 0.41. You have $100,000 to invest and can invest no more than half of your money in any single investment. Determine the minimum-variance portfolio that yields an expected annual return of at least 0.14.

94. You have $50,000 to invest in three stocks. Let Ri be the random variable representing the annual return on $1 invested in stock i. For example, if Ri = 0.12, then $1 invested in stock i at the beginning of a year is worth $1.12 at the end of the year. The means are E(R1) = 0.14, E(R2) = 0.11, and E(R3) = 0.10. The variances are VaVaV r R1 = 0.20, VaVaV r R2 = 0.08, and VaVaV r R3 = 0.18. The correlations are r12 = 0.8, r13 = 0.7, and r23 = 0.9. Determine the minimum- variance portfolio that attains an expected annual return of at least 0.12.

Level B 95. The risk index of an investment can be obtained by

taking the absolute values of percentage changes in the value of the investment for each year and averag- ing them. Suppose you are trying to determine the percentages of your money to invest in stocks, 3-month Treasury bills, and 10-year Treasury bonds. The file P14_95.xlsx lists the annual returns (percentage changes in value) for these investments since 1970. Let the risk index of a portfolio be the weighted average of the risk indices of these investments, where the weights are the fractions of the portfolio assigned to the invest- ments. Suppose that the amount of each investment must be between 20% and 50% of the total invested. You would like the risk index of your portfolio to equal 0.12, and your goal is to maximize the expected return

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

754 Chapter 14 Optimization Models

on your portfolio. Determine the maximum expected return on your portfolio, subject to the stated con- straints. Use the average return earned by each invest- ment during these years as your estimate of expected return.

96. Broker Sonya Wong is currently trying to maximize her profit in the bond market. Four bonds are available for purchase and sale at the bid and ask prices shown in the file P14_96.xlsx. Sonya can buy up to 1000 units of each bond at the ask price or sell up to 1000 units of each bond at the bid price. During each of the next three years, the person who sells a bond will pay the owner of the bond the cash payments listed in the same file. Sonya’s goal is to maximize her revenue from selling bonds minus her payment for buying bonds, subject to the constraint that after each year’s payments are received, her current cash position (due only to cash payments from bonds and not purchases or sales of bonds) is nonnegative. Note that her current cash position can depend on past coupons and that cash accumulated at the end of each year earns 2.5% annual interest. Determine how to maximize net profit from buying and selling bonds, subject to the constraints previously described. Why do you think we limit the number of units of each bond that can be bought or sold?

97. A financial company is considering investing in three projects. If it fully invests in a project, the realized cash flows (in millions of dollars) will be as listed in the file P14_97.xlsx. For example, project 1 requires a cash outflow of $3 million today and returns $5.5 million three years from now. The company currently has $2 million in cash. At each time point (0, 6, 12, 18, 24, and 30 months from now), the company can, if desired, bor- row up to $2 million at 3.5% interest (per six months). Leftover cash earns 3% interest (per six months). For example, if after borrowing and investing at the cur- rent time, the company has $1 million, it will receive $30,000 in interest six months from now. The compa- ny’s goal is to maximize cash on hand after cash flows three years from now are accounted for. What invest- ment and borrowing strategy should it use? Assume that the company can invest in a fraction of a project. For example, if it invests in one-half of project 3, it has cash outflows of –$1 million now and six months from now.

98. You are a CFA (chartered financial analyst). An over- extended client has come to you because she needs help paying off her credit card bills. She owes the amounts on her credit cards listed in the file P14_98 .xlsx. The client is willing to allocate up to $5000 per month to pay off these credit cards. All cards must be paid off within 36 months. The client’s goal is to minimize the total of all her payments. To solve this problem, you must understand how interest on a loan works. To illustrate, suppose the client pays $5000 on Saks during month 1. Then her Saks balance at the beginning of month 2 is 20,000 –

[5000 – 0.005(20,000)]. This follows because she incurs 0.005(20,000) in interest charges on her Saks card during month 1. Help the client solve her prob- lem. Once you have solved this problem, give an intuitive explanation of the solution found by Solver.

99. A food company produces two types of turkey cutlets for sale to fast-food restaurants. Each type of cutlet con- sists of white meat and dark meat. Cutlet 1 sells for $4 per pound and must consist of at least 70% white meat. Cutlet 2 sells for $3 per pound and must consist of at least 60% white meat. At most 6000 pounds of cutlet 1 and 2000 pounds of cutlet 2 can be sold. The two types of turkey used to manufacture the cutlets are purchased from a turkey farm. Each type 1 turkey costs $10 and yields five pounds of white meat and two pounds of dark meat. Each type 2 turkey costs $8 and yields three pounds of white meat and three pounds of dark meat. Determine how the company can maximize its profit.

100. Each hour from 10 a.m. to 7 p.m., a bank receives checks and must process them. Its goal is to process all checks the same day they are received. The bank has 13 check processing machines, each of which can process up to 500 checks per hour. It takes one worker to operate each 0 checks per hour. It takes one worker to operate each 0 machine. The bank hires both full-time and part-time workers. Full-time workers work 10 a.m. to 6 p.m., 11 a.m. to 7 p.m., or noon to 8 p.m. and are paid $160 per day. 0 per day. 0 Part-time workers work either 2 p.m. to 7 p.m. or 3 p.m. to 8 p.m. and are paid $75 per day. The numbers of checks received each hour are listed in the file P14_100.xlsx. In the interest of maintaining continuity, the bank believes that it must have at least three full-time workers under contract. Develop a work schedule that processes all checks by 8 p.m. and minimizes daily labor costs.

101. An oil company has oil fields in San Diego and Los Angeles. The San Diego field can produce up to 500,000 barrels per day, and the Los Angeles field can produce up to 400,000 barrels per day. Oil is sent from the fields to a refinery, either in Dallas or in Houston. (Assume that each refinery has unlimited capacity.) To refine 100,000 barrels costs $700 at Dallas and $900 at Houston. Refined oil is shipped to customers in Chicago and New York. Chicago customers require 400,000 barrels per day, and New York customers require 300,000 barrels per day. The costs of shipping 100,000 barrels of oil (refined or unrefined) between cities are shown in the file P14_101.xlsx. a. Determine how to minimize the total cost of

meeting all demands. b. If each refinery had a capacity of 380,000 barrels

per day, how would you modify the model in part a?

102. An electrical components company produces capacitors at three locations: Los Angeles, Chicago, and New York. Capacitors are shipped from these locations to public utilities in five regions of the country: northeast (NE), northwest (NW), midwest (MW), southeast (SE),

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

755

and southwest (SW). The cost of producing and ship- ping a capacitor from each plant to each region of the country is given in the file P14_102.xlsx. Each plant has an annual production capacity of 100,000 capaci- tors. Each year, each region of the country must receive the following number of capacitors: NE, 55,000; NW, 50,000; MW, 60,000; SE, 60,000; SW, 45,000. The company believes that shipping costs are too high, and it is therefore considering building one or two more production plants. Possible sites are Atlanta and Houston. The costs of producing a capacitor and shipping it to each region of the country are given in the same file. It costs $3 million (in current dollars) to build a new plant, and operating each plant incurs a fixed cost (in addition to variable shipping and production costs) of $50,000 per year. A plant at Atlanta or Houston will have the capacity to produce 100,000 capaci- tors per year. Assume that future demand patterns and production costs will remain unchanged. If costs are discounted at a rate of 12% per year, how can the com- pany minimize the net present value (NPV) of all costs associated with meeting current and future demands?

103. Based on Bean et al. (1988). The owner of a shop- ping mall has 10,000 square feet of space to rent and wants to determine the types of stores that should occupy the mall. The minimum number and maxi- mum number of each type of store and the square footage of each type are given in the file P14_103 .xlsx. The annual profit made by each type of store depends on the number of stores of that type in the mall. This dependence is given in the same file, where all profits are in units of $10,000. For example, if there are two department stores in the mall, each department store will earn $210,000 profit per year.

Each store pays 5% of its annual profit as rent to the owner of the mall. Determine how the owner of the mall can maximize its rental income.

104. A city (labeled C for convenience) is trying to sell municipal bonds to support improvements in recreational facilities and highways. The face values (in thousands of dollars) of the bonds and the due dates (years from now) at which principal comes due are listed in the file P14_104.xlsx. An underwriting company (U) wants to underwrite C’s bonds. A proposal to C for underwriting this issue consists of the following: (1) an interest rate, 3%, 4%, 5%, 6%, or 7%, for each bond, where coupons are paid annually, and (2) an up-front premium paid by U to C. U has determined the set of fair prices (in thou- sands of dollars) for the bonds listed in the same file. For example, if U underwrites bond 2 maturing two years from now at 5%, it will charge C $444,000 for that bond. U is constrained to use at most three different interest rates. U wants to make a profit of at least $46,000, where its profit is equal to the sale price of the bonds minus the face value of the bonds minus the premium U pays to C. To maximize the chance that U will get C’s business, U wants to minimize the total cost of the bond issue to C, which is equal to the total interest on the bonds minus the premium paid by U. For example, if bond 1 is issued at a 4% rate, then C must pay two years of coupon interest: 2(0.04) ($700,000) = $56,000. What assign- ment of interest rates to each bond and up-front premi- ums ensure that U will make the desired profit (assuming it gets the contract) and maximize the chance of U getting C’s business? To maximize this chance, you can assume that U minimizes the net cost to C, that is, the cost of its coupon payments minus the premium from U to C.

C A S E 14.1 GIANT MOTOR COMPANY

22The idea for this case came from Eppen, Martin, and Schrage, “A Scenario Approach to Capacity Planning.” Operations Research 37, no. 4 (July–August 1989): 517–527.

This problem deals with strategic planning issues for a large company.22his problem deals with strategic planning issues 22his problem deals with strategic planning issues The main issue is planning the company’s production capacity for the coming year. At issue is the overall level of capacity and the type of capacity—for example, the degree of flexibility in the manufacturing system. The main tool used to aid the company’s planning process is a mixed integer programming model. A mixed integer program has mixed integer program has mixed both integer and continuous variables.

Problem Statement Giant Motor Company (GMC) produces three lines of cars for the domestic (U.S.) market: Lyras, Libras, and Hydras. The Lyra is a relatively inexpensive

subcompact car that appeals mainly to first-time car owners and to households using it as a second car for commuting. The Libra is a sporty compact car that is sleeker, faster, and roomier than the Lyra. Without any options, the Libra costs slightly more than the Lyra; additional options increase the price further. The Hydra is the luxury car of the GMC line. It is significantly more expensive than the Lyra and Libra, and it has the highest profit margin of the three cars.

Case 14.1 Giant Motor Company 755 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

756 Chapter 14 Optimization Models

Retooling Options for Capacity Expansion Currently GMC has three manufacturing plants in the United States. Each plant is dedicated to producing a single line of cars. In its planning for the coming year, GMC is considering the retooling of its Lyra and/or Libra plants. Retooling either plant would represent a major expense for the company. The retooled plants would have significantly increased production capacities. Although having greater fixed costs, the retooled plants would be more efficient and have lower marginal production costs—that is, marginal production costs—that is, marginal higher marginal profit contributions. In addition, the marginal profit contributions. In addition, the marginal retooled plants would be flexible: They would have the capability of producing more than one line of cars.

The characteristics of the current plants and the retooled plants are given in Table 14.10. The retooled Lyra and Libra plants are prefaced by the word new. The fixed costs and capacities in Table 14.10 are given on an annual basis. A dash in the profit margin section indicates that the plant cannot manufacture that line of car. For example, the new Lyra plant would be capable of producing both Lyras and Libras but not Hydras. The new Libra plant would be capable of producing any of the three lines of cars. Note, however, that the new Libra plant has a slightly lower profit margin for producing Hydras than the Hydra plant does. The flexible new Libra plant is capable of producing the luxury Hydra model but is not quite as efficient as the current Hydra plant that is dedicated to Hydra production.

The fixed costs are annual costs that are incurred by GMC independent of the number of cars that are produced by the plant. For the current plant configurations, the fixed costs include property taxes, insurance, payments on the loan that was taken out to construct the plant, and so on. If a plant is retooled, the fixed costs will include the previous fixed costs plus the additional cost of the renovation. The additional renovation cost will be an annual cost representing the cost of the renovation amortized over a long period.

Demand for GMC Cars Short-term demand forecasts have been very reliable in the past and are expected to be reliable in the future. (Longer-term forecasts are not so accurate.) The demand for GMC cars for the coming year is given in Table 14.11.

A quick comparison of plant capacities and demands in Tables 14.10 and 14.11 indicates that GMC is faced with insufficient capacity. Partially offsetting the lack of capacity is the phenomenon of demand diversion. If a potential car buyer walks into a GMC dealer showroom wanting to buy a Lyra but the dealer is out of stock, frequently the salesperson can convince the customer to purchase the better Libra car, which is in stock. Unsatisfied demand for the Lyra is said to be diverted to the Libra. Only rarely diverted to the Libra. Only rarely diverted in this situation can the salesperson convince the customer to switch to the luxury Hydra model.

From past experience GMC estimates that 30% of unsatisfied demand for Lyras is diverted to demand for Libras and 5% to demand for Hydras. Similarly, 10% of unsatisfied demand for Libras is diverted to demand for Hydras. For example, if the demand for Lyras is 1,400,000 cars, then the unsatisfied demand will be 400,000 if no capacity is added. Out of this unsatisfied demand, 120,000 (= 400,000 × 0.3) will materialize as demand for Libras, and 20,000 (= 400,000 × 0.05) will materialize as demand for Hydras. Similarly, if the demand for Libras is 1,220,000 cars (1,100,000 original demand plus 120,000 demand diverted from Lyras), then the unsatisfied demand for Lyras would be 420,000 if no capacity is added. Out of this unsatisfied demand, 42,000 (= 420,000 × 0.1) will materialize as demand

Table 14.10 Plant Characteristics Lyra Libra Hydra New Lyra New Libra

Capacity (in 1000s) 1000 800 900 1600 1800 Fixed cost (in $millions) 2000 2000 2600 3400 3700

Profit Margin by Car Line (in $1000s) Lyra 2 — — 2.5 2.3 Libra — 3 — 3.0 3.5 Hydra — — 5 — 4.8

Table 14.11 Demand for GMC Cars Demand (in 1000s)

Lyra 1400 Libra 1100 Hydra 800

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

for Hydras. All other unsatisfied demand is lost to competitors. The pattern of demand diversion is summarized in Table 14.12.

Questions GMC wants to decide whether to retool the Lyra and Libra plants. In addition, GMC wants to determine its production plan at each plant in the coming year. Based on the previous data, develop a mixed integer programming model (some variables integer- constrained, some not) for solving GMC’s production planning–capacity expansion problem for the coming year. According to the optimal solution, what should GMC do? How sensitive is the optimal solution to key inputs? The file C14_01.xlsx gets you started.

Table 14.12 Demand Diversion Matrix Lyra Libra Hydra

Lyra NA 0.3 0.05 Libra 0 NA 0.10 Hydra 0 0.0 NA

C A S E 14.2 GMS STOCK HEDGING

Kate Torelli, a security analyst for LionFund, has identified a gold-mining stock (ticker symbol GMS) as a particularly attractive investment. Torelli believes that the company has invested wisely in new mining equipment. Furthermore, the company has recently purchased mining rights on land that has high potential for successful gold extraction. Torelli notes that gold has underperformed in the stock market for the last decade and believes that the time is ripe for a large increase in gold prices. In addition, she reasons that conditions in the global monetary system make it likely that investors may once again turn to gold as a safe haven in which to park assets. Finally, supply and demand conditions have improved to the point where there could be significant upward pressure on gold prices.

GMS is a highly leveraged company, so it is quite a risky investment by itself. Torelli is mindful of a passage from the annual report of a competitor, Baupost, which has an extraordinarily successful investment record: “Baupost has managed a decade of consistently profitable results despite, and perhaps in some respect due to, consistent emphasis on the avoidance of downside risk. We have frequently carried both high cash balances and costly market hedges. Our results are particularly satisfying when considered in the light of this

sustained risk aversion.” She would therefore like to hedge the stock purchase—that is, reduce the risk of an investment in GMS stock.

Currently GMS is trading at $100 per share. Torelli has constructed seven scenarios for the price of GMS stock one month from now. These scenarios and corresponding probabilities are shown in Table 14.13.

To hedge an investment in GMS stock, Torelli can invest in other securities whose prices tend to move in the direction opposite to that of GMS stock. In particular, she is considering over-the-counter put options on GMS stock as potential hedging instruments. The value of a put option increases as the price of the underlying stock decreases. For example, consider a put option with a strike price of $100 and a time to expiration of one month. This means that the owner of the put has the right to sell GMS stock at $100 per share one month in the future. Suppose that the price of GMS falls to $80 at that time. Then the holder of the put option can exercise the option and receive $20 (= 100 − 80). If the price of GMS falls to $70, the option would be worth $30 (= 100 − 70). However, if the price of GMS rises to $100 or more, the option expires worthless.

Table 14.13 Scenarios and Probabilities for GMS Stock in 1 Month Scenario

1 Scenario

2 Scenario

3 Scenario

4 Scenario

5 Scenario

6 Scenario

7

Probability 0.05 0.10 0.20 0.30 0.20 0.10 0.05 GMS stock price($) 150 130 110 100 90 80 70

Case 14.2 GMS Stock Hedging 757 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

758 Chapter 14 Optimization Models

Table 14.14 Put Option Prices (Today) for GMS Case Study Put Option A Put Option B Put Option C

Strike Price ($) 90 100 110 Option Price ($) 2.20 6.40 12.50

Torelli called an options trader at a large investment bank for quotes. The prices for three European-style put options are shown in Table 14.14. (A European put can be exercised only at the expiration date, not before.) Torelli wishes to invest $10 million in GMS stock and put options.

Questions 1. Based on Torelli’s scenarios, what is the expected

return of GMS stock? What is the standard deviation of the return of GMS stock?

2. After a cursory examination of the put option prices, Torelli suspects that a good strategy is to buy one put option A for each share of GMS stock purchased. What are the mean and standard deviation of return for this strategy?

3. Assuming that Torelli’s goal is to minimize the standard deviation of the portfolio return, what is the optimal portfolio that invests all $10 million? (For simplicity, assume that fractional numbers of stock shares and put options can be purchased. Assume that the amounts invested in each security must be nonnegative. However,

the number of options purchased need not equal not equal not the number of shares of stock purchased.) What are the expected return and standard deviation of return of this portfolio? How many shares of GMS stock and how many of each put option does this portfolio correspond to?

4. Suppose that short selling is permitted—that is, the nonnegativity restrictions on the portfolio weights are removed. Now what portfolio minimizes the standard deviation of return?

(Hint: A good way to attack this problem is to create a table of security returns, as indicated in Table 14.15, where only a few of the table entries are shown. To correctly calculate the standard deviation of portfolio return, you will need to incorporate the scenario probabilities. If ri is the portfolio return in scenario i,i,i and pi is the probability of scenario i, then the standard deviation of portfolio return is

Å a 7

i =1 Pi(ri − μ)

2 Å

where μ = o7i =1piri is the expected portfolio i is the expected portfolio i return.)

Table 14.15 Table of Security Returns GMS Stock Put Option A Put Option B Put Option C

Scenario 1 –100% 2 30% ⋮ 7 220%

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

759

DEVELOPING BOARDING STRATEGIES AT AMERICA WEST

Management science often attempts to solve problems that we all experience. One such problem is the boarding process for airline flights. As customers, we all hate to wait while travelers boarding ahead of us store their luggage and block the aisles. But this is also a big problem for the airlines. Airlines lose money when their airplanes are on the ground, so they have a real incentive to reduce the turnaround time from when a plane lands until it departs on its next flight. Of course, the turnaround time is influenced by several factors, including passenger deplaning, baggage unloading, fueling, cargo unloading, airplane maintenance, cargo loading, baggage loading, and passenger boarding. Airlines try to perform all of these tasks as efficiently as possible, but passenger boarding is particularly difficult to shorten. Although the airlines want passengers to board as quickly as possible, they don’t want to use measures that might antagonize their passengers.

One study by van den Briel et al. (2005) indicates how a combination of management science methods, including simulation, was used to make passenger boarding more efficient at America West Airlines. America West (which merged with US Airways in 2006) was a major U.S. carrier based in Phoenix, Arizona. It served more destinations nonstop than any other airline. The airline’s fleet consisted of Airbus A320s, Airbus A319s, Boeing 757s, Boeing 737s, and Airbus A318s.

At the time of the study, airlines used a variety of boarding strategies, but the predominant strategy was the back-to-front (BF) strategy where, after boarding first-class passengers and passengers with special needs, the rest of the passengers are boarded in groups, starting with rows in the back of the plane. As the authors suspected (and most of us have experienced),

Introduction to Simulation Modeling

C H A P T E R

15

C a ro

/A la

m y

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

760 Chapter 15 Introduction to Simulation Modeling

this strategy still results in significant congestion. Within a given section of the plane (the back, say), passengers storing luggage in overhead compartments can block an aisle. Also, people in the aisle or middle seat often need to get back into the aisle to let window- seat passengers be seated. The authors developed an integer programming (IP) model to minimize the number of such aisle blockages. The decision variables determined which groups of seats should be boarded in which order. Of course, the BF strategy was one possible feasible solution, but it turned out to be a suboptimal solution. The IP model suggested that the best solution was an outside-in (OI) strategy, where groups of passengers in window seats board first, then groups in the middle seats, and finally groups in aisle seats, with all of these groups going essentially in a back-to-front order.

The authors recognized that their IP model was at best an idealized model of how passengers actually behave. Its biggest drawback is that it ignores the inherent random- ness in passenger behavior. Therefore, they followed up their optimization model with a simulation model. As they state, “We used simulation to validate the analytical model and to obtain a finer level of detail.” This validation of an approximate or idealized analytical model is a common use for simulation. To make the simulation as realistic as possible, they used two cameras, one inside the plane and one inside the bridge leading to the plane, to tape customer behavior. By analyzing the tapes, they were able to estimate the required inputs to their simulation model, such as the time between passengers, walk- ing speed, blocking time, and time to store luggage in overhead compartments. After the basic simulation model was developed, it was used as a tool to evaluate various board- ing strategies suggested by the IP model. It also allowed the authors to experiment with changes to the overall boarding process that might be beneficial. For example, reducing congestion inside the airplane is not very helpful if the gate agent at the entrance to the bridge processes passengers too slowly. Their final recommendation, based on a series of simulation experiments, was to add a second gate agent (there had been only one before) and to board passengers in six groups using an OI strategy. The simulation model suggested that this could reduce the boarding time by about 37%.

The authors’ recommendations were implemented first as a pilot project and then systemwide. The pilot results were impressive, with a 39% reduction in boarding times. By September 2003, the new boarding strategies had been implemented in 80% of America West’s airports, with a decrease in departure delays as much as 60.1%. Besides this obvious benefit to the airline, customers also appear to be happier. Now they can easily understand when to queue up for boarding, and they experience less blocking after they get inside the plane. ■

15-1 INTRODUCTION A simulation model is a computer model that imitates a real-life situation. It is like other mathematical models, but it explicitly incorporates uncertainty in one or more input vari- ables. When you run a simulation, you allow these random input variables to take on vari- ous values, and you keep track of any resulting output variables of interest. In this way, you are able to see how the outputs vary as a function of the varying inputs.

The fundamental advantage of a simulation model is that it provides an entire distri- bution of results, not simply a single bottom-line result. As an example, suppose an auto- mobile manufacturer is planning to develop and market a new model car. The company is ultimately interested in the net present value (NPV) of the cash �ows from this car over the next 10 years. However, there are many uncertainties surrounding this car, including the yearly customer demands for it, the cost of developing it, and others. The company could develop a spreadsheet model for the 10-year NPV, using its best guesses for these uncertain quantities. It could then report the NPV based on these best guesses. However,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-1 Introduction 761

this analysis would be incomplete and probably misleading—there is no guarantee that the NPV based on best-guess inputs is representative of the NPV that will actually occur. It is much better to treat the uncertainty explicitly with a simulation model. This involves enter- ing probability distributions for the uncertain quantities and seeing how the NPV varies as the uncertain quantities vary.

Each different set of values for the uncertain quantities is a scenario. Simulation allows the company to generate many scenarios, each leading to a particular NPV. In the end, it sees a whole distribution of NPVs, not a single best guess. The company can see what the NPV will be on average, and it can also see worst-case and best-case results.

These approaches are summarized in Figures 15.1 and 15.2. Figure 15.1 indicates that the deterministic (nonsimulation) approach, using best guesses for the uncertain inputs, is generally not the appropriate method. It leads to the “�aw of averages,” as we will discuss not the appropriate method. It leads to the “�aw of averages,” as we will discuss not later in the chapter. The problem is that the outputs from the deterministic model are often not representative of the true outputs. The appropriate method is shown in Figure 15.2. Here the uncertainty is modeled explicitly with random inputs, and the end result is a prob- ability distribution for each of the important outputs.

Simulation models are also useful for determining how sensitive a system is to changes in operating conditions. For example, the operations of a supermarket could be simulated. Once the simulation model has been developed, it could then be run (with suitable modi�- cations) to ask a number of what-if questions. For example, if the supermarket experiences a 20% increase in business, what will happen to the average time customers must wait for service?

A huge bene�t of computer simulation is that it enables managers to answer these types of what-if questions without actually changing (or building) a physical system. For example, the supermarket might want to experiment with the number of open registers to see the effect on customer waiting times. The only way it can physically experiment with more registers than it currently owns is to purchase more equipment. Then if it determines that this equipment is not a good investment—customer waiting times do not decrease appreciably—the company is stuck with expensive equipment it doesn’t need. Computer simulation is a much less expensive alternative. It provides the company with an electronic replica of what would happen if the new equipment were purchased. Then, if the simulaif the new equipment were purchased. Then, if the simulaif - tion indicates that the new equipment is worth the cost, the company can be con�dent that purchasing it is the right decision. Otherwise, it can abandon the idea of the new equipment before the equipment has been purchased.

Spreadsheet simulation modeling is quite similar to the other modeling applications in this book. You begin with input variables and then relate these with appropriate Excel®

Spreadsheet simulation modeling is quite similar to the other modeling applications in ®

Spreadsheet simulation modeling is quite similar to the other modeling applications in for-

mulas to produce output variables of interest. The main difference is that simulation uses

© C

e n g

a g

e L

e a rn

in g

Figure 15.2 Appropriate Simulation Model

Figure 15.1 Inappropriate Deterministic Model

Probability distributions for uncertain inputs

Simulation model Probability distributions for

important outputs

Best guesses for uncertain inputs

Deterministic (nonsimulation) model

Best guesses for important outputs

Usually not correct: the “flaw of averages”

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

762 Chapter 15 Introduction to Simulation Modeling

random numbers to drive the whole process. These random numbers are generated with special functions that we will discuss in detail. Each time the spreadsheet recalculates, all of the random numbers change. This provides the ability to model the logical process once and then use Excel’s recalculation ability to generate many different scenarios. By collect- ing the data from these scenarios, you can see the most likely values of the outputs and the best-case and worst-case values of the outputs.

In this chapter we begin by illustrating spreadsheet models that can be developed with built-in Excel functionality. However, because simulation is such an important tool for analyzing real problems, add-ins to Excel have been developed to streamline the process of developing and analyzing simulation models. Therefore, we then introduce @RISK, one of the most popular simulation add-ins. This add-in not only augments the simulation capa- bilities of Excel, but it also enables you to analyze models much more quickly and easily.

The purpose of this chapter is to introduce basic simulation concepts, show how simu- lation models can be developed in Excel, and demonstrate the capabilities of @RISK. Then in the next chapter, armed with the necessary simulation tools, we will explore a variety of simulation models.

Before proceeding, you might ask whether simulation is really used in the business world. The answer is a resounding “yes.” The chapter opener described an airline example, and many other examples can be found online. For example, if you visit www.palisade.com, you will see descriptions of interesting @RISK applications from companies that regularly use this add-in. Simulation has always been a powerful tool, but until the introduction of Excel add-ins such as @RISK, it had limited use for several reasons. It typically required specialized software that was either expensive and dif�cult to learn, or it required tedi- ous computer programming. Fortunately, in the past two decades, spreadsheet simulation, together with Excel add-ins such as @RISK, has put this powerful methodology in the hands of the masses—people like you and the companies you are likely to work for. Many businesses now understand that there is no longer any reason to ignore uncertainty; they can model it directly with spreadsheet simulation.

15-2 PROBABILITY DISTRIBUTIONS FOR INPUT VARIABLES In this section we discuss the building blocks of spreadsheet simulation models: probability distributions for input variables that capture uncertainty. All spreadsheet simulation mod- els are similar to the spreadsheet models from previous chapters. They have a number of cells that contain values of input variables. The other cells then contain formulas that embed the logic of the model and eventually lead to the output variable(s) of interest. The primary difference between the spreadsheet models you have developed so far and simulation mod- els is that at least one of the input variable cells in a simulation model contains random numbers. Each time the spreadsheet recalculates, the random numbers change, and the new random values of the inputs produce new values of the outputs. This is the essence of simulation—it enables you to see how outputs vary as random inputs change.

Excel Tip: Recalculation Key The easiest way to make a spreadsheet recalculate is to press the F9 key. This is often called the “recalc” key.

Technically speaking, input cells do not contain random numbers; they contain prob- ability distributions. In general, a probability distribution indicates the possible values of a variable and the probabilities of these values. As a very simple example, you might indicate by an appropriate formula (to be described later) that you want a probability distribution with possible values 50 and 100, and corresponding probabilities 0.7 and 0.3. If you force the sheet

In spreadsheet simulation models, input cells can contain random numbers. Any output cells then vary as these random inputs change.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 763

to recalculate repeatedly and watch this input cell, you will see the value 50 about 70% of the time and the value 100 about 30% of the time. No other values besides 50 and 100 will appear.

When you enter a given probability distribution in a random input cell, you are describ- ing the possible values and the probabilities of these values that you believe mirror reality. There are many probability distributions to choose from, and you should always attempt to choose an appropriate distribution for each speci�c problem. This is not necessarily an easy task. Therefore, we address it in this section by answering several key questions:

■ What types of probability distributions are available, and why do you choose one probability distribution rather than another in any particular simulation model?

■ Which probability distributions can you use in simulation models, and how do you invoke them with Excel formulas?

In later sections we address one additional question: Does the choice of input probability distribution really matter—that is, are the outputs from the simulation sensitive to this choice?

15-2a Types of Probability Distributions

Imagine a toolbox that contains the probability distributions you know and understand. As you obtain more experience in simulation modeling, you will naturally add probabil- ity distributions to your toolbox that you can then use in future simulation models. We begin by adding a few useful probability distributions to this toolbox. However, before adding any speci�c distributions, it is useful to provide a brief review of some impor- tant general characteristics of probability distributions.1 adding any speci�c distributions, it is useful to provide a brief review of some impor

1 adding any speci�c distributions, it is useful to provide a brief review of some impor

These include the following distinctions:

■ Discrete versus continuous

■ Symmetric versus skewed

■ Bounded versus unbounded

■ Nonnegative versus unrestricted

1Most of this material was covered in Chapters 2, 4, and 5, but it is reviewed here.

Choosing Probability Distributions for Uncertain Inputs In simulation models, it is important to choose appropriate probability distributions for all uncertain inputs. These choices can strongly affect the results. Unfortunately,

there are no “right answers.” You need to choose the probability distributions that best describe your uncertainty, and this is not necessarily easy. However, the properties discussed in this section provide you with useful guidelines for making reasonable choices.

F u n da m e n ta l I n s i g h t

Basic Elements of Spreadsheet Simulation A spreadsheet simulation model requires three elements: (1) a method for entering random quanti- ties from specified probability distributions in input cells, (2) the usual types of Excel formulas for relating

outputs to inputs, and (3) the ability to make the spreadsheet recalculate many times and capture the resulting outputs for statistical analysis. Excel has some capabilities for performing these steps, but Excel add-ins such as @RISK provide excellent tools for automating the process.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

764 Chapter 15 Introduction to Simulation Modeling

Discrete Versus Continuous A probability distribution is discrete if it has a �nite number of possible values.2 For example, if you throw two dice and look at the sum of the faces showing, there are only 11 discrete possibilities: the integers 2 through 12. In contrast, a probability distribution is continuous if its possible values are essentially a continuum. An example is the amount of rain that falls during a month in Indiana. It could be any decimal value from 0 to, say, 15 inches.

The graph of a discrete distribution is a series of spikes, as shown in Figure 15.3.3 The height of each spike is the probability of the corresponding value.

In contrast, a continuous distribution is characterized by a density function, a smooth curve as shown in Figure 15.4. Recall from Chapter 5 that the height of the density func- tion above any value indicates the relative likelihood of that value, and probabilities can be calculated as areas under the curve.

Sometimes it is convenient to treat a discrete probability distribution as continuous, and vice versa. For example, consider a student’s random score on an exam that has 1000 possible points. If the grader scores each exam to the nearest integer, then even though the score is really discrete with many possible integer values, it is probably more convenient to model its distribution as a continuum. Continuous probability distributions are typically more intuitive and easier to work with than discrete distributions in cases such as this, where there are many possible values. In contrast, continuous distributions are sometimes discretized for simplicity. discretized for simplicity. discretized In this case, the continuum of possible values is replaced by a few typical values.

Symmetric Versus Skewed A probability distribution can either be symmetric or skewed to the left or right. Figures 15.4, 15.5, and 15.6 provide examples of each of these. You typically choose between a symmetric and skewed distribution on the basis of realism. For example, if you want to model a stu- dent’s score on a 100-point exam, you will probably choose a left-skewed distribution. This is because a few poorly prepared students typically “pull down the curve.” On the other hand, if you want to model the time it takes to serve a customer at a bank, you will probably choose a right-skewed distribution. This is because most customers take only a minute or two, but a few

2Actually, it is possible for a discrete variable to have a countably in�nite number of possible values, such as all the nonnegative integers 0, 1, 2, and so on. However, this is not an important distinction for practical applications. 3 the nonnegative integers 3 the nonnegative integers This �gure and several later �gures have been captured from Palisade’s @RISK add-in.

Figure 15.3 A Typical Discrete Probability Distribution

The heights above a density function are not probabilities, but they still indicate relative likelihoods of the possible values.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 765

Figure 15.4 A Typical Continuous Probability Distribution

Figure 15.5 A Positively Skewed Probability Distribution

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Figure 15.6 A Negatively Skewed Probability Distribution

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

766 Chapter 15 Introduction to Simulation Modeling

customers take a long time. Finally, if you want to model the monthly return on a stock, you might choose a distribution symmetric around zero, reasoning that the stock return is just as likely to be positive as negative and there is no obvious reason for skewness in either direction.

Bounded Versus Unbounded A probability distribution is bounded if there are values bounded if there are values bounded A and B such that no possible value can be less than A or greater than B. The value A is then the minimum possible value, and the value B is the maximum possible value. The distribution is unbounded if there are no unbounded if there are no unbounded such bounds. Actually, it is possible for a distribution to be bounded in one direction but not the other. As an example, the distribution of scores on a 100-point exam is bounded between 0 and 100. In contrast, the distribution of the amount of damages Mr. Jones sub- mits to his insurance company in a year is bounded on the left by 0, but there is no natural upper bound. Therefore, you might model this amount with a distribution that is bounded by 0 on the left but is unbounded on the right. Alternatively, if you believe that no damage amount larger than $20,000 can occur, you could model this amount with a distribution that is bounded in both directions.

Nonnegative versus Unrestricted One important special case of bounded distributions is when the only possible values are nonnegative. For example, if you want to model the random cost of manufacturing a new product, you know for sure that this cost must be nonnegative. There are many other such examples. In such cases, you should model the randomness with a probability distribution that is bounded below by 0. This rules out negative values that make no practical sense.

15-2b Common Probability Distributions

Now that you know the types of probability distributions available, you can add some com- mon probability distributions to your toolbox. The �le Probability Distributions.xlsx was developed to help you learn and explore these. Each sheet in this �le illustrates a particular probability distribution. It describes the general characteristics of the distribution, indicates how you can generate random numbers from the distribution either with Excel’s built-in functions or with @RISK functions, and it includes histograms of these distributions from simulated data to illustrate their shapes.4 functions or with @RISK functions, and it includes histograms of these distributions from

4 functions or with @RISK functions, and it includes histograms of these distributions from

It is important to realize that each of the following distributions is really a family of distributions. Each member of the family is speci�ed by one or more parameters. For exam- ple, there is not a single normal distribution; there is a normal distribution for each possible mean and standard deviation you specify. Therefore, when you try to �nd an appropriate input probability distribution in a simulation model, you �rst have to choose an appropriate family, and then you have to select the appropriate parameters for that family.

Uniform Distribution The uniform distribution is the “�at” distribution illustrated in Figure 15.7. It is bounded by a minimum and a maximum, and all values between these two extremes are equally likely. You can think of this as the “I have no idea” distribution. For example, a manager might realize that a building cost is uncertain. If she can state only that, “I know the cost will be between $20,000 and $30,000, but other than this, I have no idea what the cost will be,” then a uniform distribution from $20,000 to $30,000 is a natural choice. However, even though some people do sometimes use the uniform distribution in such situations, the

4In later sections of this chapter, and all through the next chapter, we discuss much of @RISK’s functionality. For this section, the only functionality we use is @RISK’s collection of functions, such as RISKNORMAL and RISKTRIANG, for generating random numbers from various probability distributions. You can skim the details of these functions for now and refer back to them as necessary in later sections.

Think of the Probability Distributions.xlsx file as a “dictionary” of the most commonly used distributions. Keep it handy for reference.

A family of distributions has a common name, such as “normal.” Each member of the family is specified by one or more numerical parameters.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 767

Figure 15.7 Uniform Distribution

The RAND function is Excel’s “building block” function for generating random numbers.

RAND and RANDBETWEEN Functions

© C

e n g

a g

e L

e a rn

in g

uniform is usually not very realistic. If the manager really thinks about it, she can probably provide more information about the uncertain cost, such as, “The cost is more likely to be close to $25,000 than to either of the extremes.” Then some distribution other than the uniform is more appropriate.

Regardless of whether the uniform distribution is an appropriate candidate as an input distribution, it is important for another reason. All simulation software packages, including Excel, are capable of generating random numbers uniformly distributed between 0 and 1. These are the building blocks of most simulated random numbers, in that random numbers from other probability distributions are generated from them.

In Excel, you can generate a random number between 0 and 1 by entering the formula

=RAND()

in any cell. (The parentheses to the right of RAND indicate that this is an Excel function with no arguments. These parentheses must be included.)

Excel Function: RARAR NDNDN To generate a random number equally likely to be anywhere between 0 and 1, enter the formula =RANDRANDRAN () into any cell. Press the F9 key, or recalculate in any other way, to make it change randomly.

In addition to being between 0 and 1, the numbers created by this function have two important properties.

■ Uniform property. Each time you enter the RAND function in a cell, all numbers between 0 and 1 have the same chance of occurring. This means that approximately 10% of the numbers generated by the RAND function will be between 0.0 and 0.1; 10% of the numbers will be between 0.65 and 0.75; 60% of the numbers will be

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

768 Chapter 15 Introduction to Simulation Modeling

between 0.20 and 0.80; and so on. This property explains why the random numbers are said to be uniformly distributed between uniformly distributed between uniformly distributed 0 and 1.

■ Independence property. Different random numbers generated by RAND functions are probabilistically independent. This implies that when you generate a random number in cell A5, say, it has no effect on the values of any other random numbers generated in the spreadsheet. For example, if one call to the RAND function yields a large random number such as 0.98, there is no reason to suspect that the next call to RAND will yield an abnormally small (or large) random number; it is unaffected by the value of the �rst random number.

Excel Function: RANDBETWEEN Besides the RARAR ND function, there is one other function built into Excel that generates random numbers, the RANDBETWEEN function. It takes two integer arguments, as in =RANDRANDRAN BETWEEN(1,6), and returns a random integer between these values (including the endpoints) so that all such integers are equally likely.

To illustrate the RAND function, open a new workbook, enter the formula =RAND() in cell A4, and copy it to the range A4:A503. This generates 500 random numbers. Figure 15.8 displays a possible set of values. However, when you try this on your PC, you

1 2 3 4 5 6 7 8 9

10 500 501 502 503

A B C 500 random numbers from RAND func�on

Random # 0.429866189 0.96337384

0.411422456 0.909329143 0.54307235 0.75894605

0.920756879 0.720597182 0.054328298 0.265368444 0.402328268

A BFigure 15.8 Uniformly Distributed Random Numbers Generated by the RAND Function

© C

e n g

a g

e L

e a rn

in g

will undoubtedly obtain different random numbers. This is an inherent characteristic of different random numbers. This is an inherent characteristic of different simulation—no two answers are ever exactly alike. Now press the recalc (F9) key. All of the random numbers will change. In fact, each time you press the F9 key or do anything to make your spreadsheet recalculate, all of the cells containing the RAND function will change.

A histogram of the 500 random numbers appears in Figure 15.9. (Again, if you try this on your PC, the shape of your histogram will not be identical to the one shown in Figure 15.9, because it will be based on different random numbers.) From property different random numbers.) From property different 1, you would expect equal numbers of observations in the equal numbers of observations in the equal 10 categories. Obviously, the heights of the bars are not exactly equal, but the differences are due to chance—not to a faulty random not exactly equal, but the differences are due to chance—not to a faulty random not number generator.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 769

Technical Note: Pseudo-random Numbers The “random” numbers generated by the RARAR ND function (or by the random number generator in any simulation software package) are not really random. They are sometimes called pseudo-in any simulation software package) are not really random. They are sometimes called pseudo-in any simulation software package) are not really random. They are sometimes called random numbers. Each successive random number follows the previous random number by a complex arithmetic operation. If you happen to know the details of this arithmetic operation, you can predict ahead of time exactly which random numbers will be generated by the RARAR ND function. This is quite different from using a “true” random mechanism, such as spinning a wheel, to get the next random number—a mechanism that would be impractical to implement on a computer. Mathematicians and computer scientists have studied many ways to produce random numbers that have the two properties we just discussed, and they have developed many competing random number generators such as the RARAR ND function in Excel. The technical details are not important here. The important point is that these random number generators produce numbers that appear to be random and are useful for simulation modeling.

It is simple to generate a uniformly distributed random number with a minimum and maximum other than 0 and 1. For example, the formula

=200+100*RAND()

generates a number uniformly distributed between 200 and 300. (Make sure you see why.) Alternatively, you can use the @RISK formula5 generates a number uniformly distributed between

5 generates a number uniformly distributed between

=RISKUNIFORM(200,300)

You can take a look at this and other properties of the uniform distribution on the Uniform sheet in the Probability Distributions.xlsx �le. (See Figure 15.10.)

@RISK Function: RISKUNIFORM To generate a random number from any uniform distribution, enter the formula =RISRISRI KUNKUNKU ININ FOIFOI RM(MinVal,Ma,Ma, xMaxMa Val) l) l in any cell. Here, MinVal and MaxVal are the minimum and maximum possible values. Note that if MinVal is 0 and MaxVal is 1, this function is equiva- lent to Excel’s RARAR ND function.

5As we have done with other Excel functions, we capitalize the @RISK functions, such as RISKUNIFORM, in the text. However, this is not necessary when you enter the formulas in Excel.

Histogram of Random Numbers

40

50

70

0

10

20

30

[0.0, 0.1] [0.1, 0.2] [0.2, 0.3] [0.3, 0.4] [0.4, 0.5] [0.5, 0.6] [0.6, 0.7] [0.7, 0.8] [0.8, 0.9] [0.9, 1.0]

60

Figure 15.9 Histogram of the 500 Random Numbers Generated by the RAND Function

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

770 Chapter 15 Introduction to Simulation Modeling

Freezing Random Numbers The automatic recalculation of random numbers can be useful sometimes and annoying at other times. There are situations when you want the random numbers to stay �xed—that is, you want to freeze random numbers at their current values. The following three-step method does this.

1. Select the range that you want to freeze, such as A4:A503 in Figure 15.8.

2. Press Ctrl+c to copy this range. 3. With the same range still selected, select the Paste Values option from the Paste drop-

down menu on the Home ribbon. This procedure pastes a copy of the range onto itself, except that the entries are now numbers, not formulas. Therefore, whenever the spreadsheet recalculates, these numbers do not change.

Each sheet in the Probability Distributions.xlsx �le has a list of 500 random numbers that have been frozen. The histograms in the sheets are based on the frozen random numbers. However, we encourage you to enter “live” random numbers in column B over the frozen ones and see how the histogram changes when you press F9.

15-2c Using @RISK to Explore Probability Distributions

The Probability Distributions.xlsx �le illustrates a few frequently used probability dis- tributions, and it shows the formulas required to generate random numbers from these distributions. Another option is to use Palisade’s @RISK add-in, which allows you to experiment with probability distributions with its distribution functions. Essentially, it allows you to see the shapes of various distributions and to calculate probabilities for them, all in a user-friendly graphical interface.

To run @RISK, click the Windows Start button, go to the Programs tab, locate the Palisades DecisionTools®

To run @RISK, click the Windows Start button, go to the Programs tab, locate the ®

To run @RISK, click the Windows Start button, go to the Programs tab, locate the Suite, and select @RISK. After a few seconds, you will see the

welcome screen, which you can close. At this point, you should have an @RISK tab and corresponding ribbon. (You will also see a Project button in the Tools group if you have Microsoft Project installed on your computer.) Select a blank cell in your worksheet, and then click the De�ne Distributions button on the @RISK ribbon (see Figure 15.11). You

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17

A BA B C DC D E FE F Uniform distribu�on

Characteris�cs Con nuous Symmetric Bounded in both direc ons Not necessarily posi ve (depends on bounds)

Parameters 50MinVal

100MaxVal

ExampleExcel =MinVal + (MaxVal−MinVal)*RAND() 92.310980

@RISK =RISKUNIFORM(MinVal,MaxVal) 77.276447) 7

G

This is a flat distribu on between two values, labeled here MinVal and MaxVal. Note that if MinVal=0 and MaxVal=1, then you can just use Excel’s RAND func on.

Figure 15.10 Properties of Uniform Distribution

Random numbers that have been frozen do not change when you press the F9 key.

© C

e n g

a g

e L

e a rn

in g

Exploring Distributions with @RISK

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 771

will see one of several galleries of distributions, depending on the tab you select. For exam- ple, Figure 15.12 shows the gallery of common distributions. Highlight one of the distribu- tions and click Select Distribution. For example, choose the uniform distribution and enter 75 and 150 as the Min and Max parameters. You will see the shape of the distribution and a list of summary measures to the right, as shown in Figure 15.13. For example, it indicates that the mean and standard deviation of this uniform distribution are 112.5 and 21.65.

Figure 15.12 Gallery of Common Distributions

Figure 15.11 @RISK Ribbon

The interactive capabilities of @RISK’s Define Distribution window, with its sliders, make it perfect for finding probabilities or percentiles for any given distribution.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Everything in this window is interactive. Suppose you want to �nd the probability that a value from this distribution is less than 95. You can drag the left-hand “slider” in the diagram (the vertical line with the triangle at the top) to the position 95, as shown in Figure 15.13. You see immediately that the left-hand probability is 0.267. Similarly, if you want the prob- ability that a value from this distribution is greater than 125, you can drag the right-hand slider to the position 125 to see that the required probability is 0.3333. (Rather than sliding, you can enter the numbers, such as 95 and 125, directly into the areas above the sliders.)

You can also enter probabilities instead of values. For example, if you want the value such that there is probability 0.10 to the left of it—the 10th percentile—you can enter 10% in the left space above the chart. You will see that the corresponding value is 82.5. Similarly, if you want the value such that there is probability 0.10 to the right of it, you can enter 10% in the right space above the chart, and you will see that the corresponding value is 142.5.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

772 Chapter 15 Introduction to Simulation Modeling

The De�ne Distribution window in @RISK is quick and easy. We urge you to use it and experiment with some of its options. By the way, you can click the third button from the left at the bottom of the window to copy the chart into an Excel worksheet. However, you then lose the interactive capabilities, such as moving the sliders.

Discrete Distribution A discrete distribution is useful for many situations, either when the uncertain quantity is not really continuous (the number of televisions demanded, for example) or when you want a discrete approximation to a continuous variable. All you need to specify are the possible values and their probabilities, making sure that the probabilities sum to 1. Because of this �exibility in specifying values and probabilities, discrete distributions can have practically any shape.

As an example, suppose a manager estimates that the demand for a particular brand of television during the coming month will be 10, 15, 20, or 25, with respective probabilities 0.1, 0.3, 0.4, and 0.2. This typical discrete distribution is illustrated in Figure 15.14.

The Discrete sheet of the Probability Distributions.xlsx �le indicates how to work with a discrete distribution. (See Figure 15.15.) As you can see, there are two quite differ- ent ways to generate a random number from this distribution. We discuss the Excel way in detail in Section 15-4. For now, we simply mention that this is one case (of many) where it is much easier to generate random numbers with @RISK functions than with built-in Excel functions. Assuming that @RISK is loaded, all you need to do is enter the function RISKDISCRETE with two arguments, a list of possible values and a list of their prob- abilities, as in

=RISKDISCRETE(B11:B14,C11:C14)

The Excel way, which requires cumulative probabilities and a lookup table, takes more work and is harder to remember.

Figure 15.13 Uniform Distribution (from @RISK)

@RISK’s way of generating a discrete random number is much simpler and more intuitive than Excel’s method, which requires cumulative probabilities and a lookup function.

© C

e n g

a g

e L

e a rn

in g

Generating Random Numbers with Excel Functions

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 773

Figure 15.14 Discrete Distribution (from @RISK)

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

A BA B C DC D E FE F G HG H

General discrete distribu�on

Characteris�cs

Discrete

Can be symmetric or skewed (or bumpy, i.e., basically any shape)

Bounded in both direc�ons

Not necessarily posi�ve (depends on possible values)

Parameters Lookup table required for Excel method

Values Probabili�es CumProb Value

1000.110

15 0.3 0.1 15

20 0.4 0.4 20

25 0.2 0.8 25

ExampleExcel

=VLOOKUP(RAND(),LookupTable,2) 25

@RISK

15=RISKDISCRETE(Values,Probs)

This can have any shape, depending on the list of possible values and their probabili�es.

Figure 15.15 Properties of a Discrete Distribution

@RISK Function: RISKDISCRETE To generate a random number from any discrete probability distribution, enter the formula =RISRISRI KDISISI CRETECRETECRET (valRange,probRange) into any cell. Here valRange is the range with the possible values, and probRange is the range with their probabilities.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

774 Chapter 15 Introduction to Simulation Modeling

Figure 15.16 Normal Distribution (from @RISK)

At this point, a relevant question is why a manager would choose this particular discrete distribution. First, it is clearly an approximation. After all, if it is possible to have demands of 20 and 25, it should also be possible to have demands between these values. Here, the manager approximates a discrete distribution with many possible values—all integers from 0 to 50, say—with a discrete distribution with a few typical values. This is fairly common in simulation modeling. Second, where do the prob- abilities come from? They are probably a blend of historical data (perhaps demand was near 15 in 30% of previous months) and the manager’s subjective feelings about demand next month.

Normal Distribution The normal distribution is the familiar bell-shaped curve that was discussed in detail in Chapter 5. (See Figure 15.16.) It is useful in simulation modeling as a continuous input distribution. However, it is not always the most appropriate distribution. It is symmetric, not always the most appropriate distribution. It is symmetric, not which can be a drawback when a skewed distribution is more realistic. Also, it allows nega- tive values, which are not appropriate in many situations.

The selected input distributions for any simulation model reflect historical data and an analyst’s best judgment as to what will happen in the future.

© C

e n g

a g

e L

e a rn

in g

A tip-off that a normal distribution might be an appropriate candidate for an input variable is a statement such as, “We believe the most likely value of demand is 100, and the chances are about 95% that demand will be no more than 40 units on either of side of this most likely value.” Because a normally distributed value is within two standard deviations of its mean with probability 0.95, this statement translates easily to a mean of 100 and a standard deviation of 20. This does not imply that a normal distribution is the only candidate for the distribution of demand, but the statement naturally leads to this distribution.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 775

The Normal sheet in the Probability Distributions.xlsx �le indicates how you can generate normally distributed random numbers in Excel, either with or without @RISK. (See Figure 15.17.) This is one case where an add-in is not really necessary. The formula

=NORM.INV(RAND(),Mean,Stdev)

always works. Still, this is not as easy to remember as @RISK’s formula

=RISKNORMAL,(Mean,Stdev)

@RISK Function: RISKNORMAL To generate a normally distributed random number, enter the formula =RISRISRI KNORMAL (Mean,Stdev) in any cell. Here, Mean and Stdev are the mean and standard deviation of the normal distribution.

Triangular Distribution The triangular distribution is somewhat similar to the normal distribution in that its density function rises to some point and then falls, but it is more �exible and intuitive than the normal distribution. Therefore, it is an excellent candidate for many continuous input variables. The shape of a triangular density function is literally a triangle, as shown in Figure 15.18. It is speci�ed by three easy-to-understand parameters: the minimum pos- sible value, the most likely value, and the maximum possible value. The high point of the triangle is above the most likely value. Therefore, if a manager states, “We believe the most likely development cost is $1.5 million, and we don’t believe the development cost could possibly be less than $1.2 million or greater than $2.1 million,” the triangular distribution with these three parameters is a natural choice. As in this numerical example, note that the triangular distribution can be skewed if the mostly likely value is closer to one extreme than another. Of course, it can also be symmetric if the most likely value is right in the middle.

Figure 15.17 Properties of the Normal Distribution

A triangular distribution is a good choice in many simulation models because it can have a variety of shapes and its parameters are easy to understand.

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17

A BA B C DC D E FE F Normal distribu�on

Characteris�cs Con�nuous Symmetric (bell-shaped) Unbounded in both direc�ons Is both posi�ve and nega�ve

Parameters 100Mean

10Stdev

ExampleExcel =NORMINV(RAND(),Mean,Stdev) 83.60485164

@RISK =RISKNORMAL(Mean,Stdev) 85.03237755) 8

This is the familiar bell-shaped curve, defined by two parameters: the mean and the standard devia�on.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

776 Chapter 15 Introduction to Simulation Modeling

The Triangular sheet of the Probability Distributions.xlsx �le indicates how to generate random values from this distribution. (See Figure 15.19.) As you can see, there is no easy way to do it with Excel functions only. However, it is easy with @RISK, using the RISKTRIANG function, as in

=RISKTRIANG(B10,B11,B12)

This function takes three arguments: the minimum value, the most likely value, and the maximum value—in this order and separated by commas. You will see this function in many of our examples. Just remember that it has an abbreviated spelling: RISKTRIANG, not RISKTRIANGULAR.

Figure 15.18 Triangular Distribution (from @RISK)

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18

A BA B C DC D E FE F G HG HG H Triangular distribu�on

Characteris�cs Con�nuous Can be symmetric or skewed in either direc�on Bounded in both direc�ons Not necessarily posi�ve (depends on bounds)

Parameters 50Min 85

100 MostLikely Max

Example

Excel There is no easy way to do it except by wri�ng a macro.

89.8069462 @RISK =RISKTRIANG(Min,MostLikely,Max)

The density of this distribu�on is literally a triangle. The “top” of the triangle is above the most likely value, and the base of the triangle extends from the minimum value to the maximum value. It is intui�ve for users because the three parameters have a natural meaning.

Figure 15.19 Properties of the Triangular Distribution

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 777

@RISK Function: RISKTRIANG To generate a random number from a triangular distribution, enter the formula =RISRISRI KTRIKTRIKT ANRIANRI GANGAN (MinVal,MLVal,MaxVal) in any cell. Here, MinVal is the minimum possible value, MLVal is the most likely value, and MaxVal is the maximum value.

Binomial Distribution The binomial distribution is a discrete distribution that was discussed extensively in Chapter 5. Recall that the binomial distribution applies to a very speci�c situation: when a number of independent and identical trials occur, and each trial results in a success or failure. Then the binomial random number is the number of successes in these trials. The two parameters of this distribution, n and p, are the number of trials and the probability of success on each trial.

As an example, suppose an airline company sells 170 tickets for a �ight and estimates that 80% of the people with tickets will actually show up for the �ight. How many people will actually show up? It is tempting to state that exactly 80% of 170, or 136 people, will show up, but this neglects the inherent randomness. A more realistic way to model this situation is to say that each of the 170 people, independently of one another, will show up with probability 0.8. Then the number of people who actually show up is then binomially distributed with n = 170 and p = 0.8. (This assumes independent behavior across passen- gers, which might not be the case, for example, if whole families either show up or don’t.) This distribution is illustrated in Figure 15.20.

The Binomial sheet of the Probability Distributions.xlsx �le indicates how to gener- ate random numbers from this distribution. (See Figure 15.21.) Although it is possible to do this with Excel using the built-in BINOM.INV function and the RAND function, it is not very intuitive or easy to remember. Clearly, the @RISK way is preferable. In the airline example, you would generate the number who show up with the formula

=RISKBINOMIAL(170,0.8)

Figure 15.20 Binomial Distribution (from @RISK)

A random number from a binomial distribution indicates the number of successes in a certain number of identical trials.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

778 Chapter 15 Introduction to Simulation Modeling

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

A BA B C DC D E FE F G

Binomial distribu�on

Characteris�cs

Discrete

Can be symmetric or skewed

Bounded below by 0, bounded above by Ntrials

Nonnega�ve

Parameters

170NTrials

0.8PSuccess

ExampleExcel

=BINOM.INV(NTrials,PSuccess,RAND()) 138

@RISK

=RISKBINOMIAL(NTrials,PSuccess) 130

This distribu�on is of the number of “successes” in a given number of iden�cal, independent trials, when the probability of success is constant on each trial.

Figure 15.21 Properties of the Binomial Distribution

Note that the histogram in this �gure is approximately bell-shaped. This is no accident. When the number of trials n is reasonably large and p isn’t too close to 0 or 1, the binomial distribution can be well approximated by the normal distribution.

@RISK Function: RISKBINOMIAL To generate a random number from a binomial distribution, enter the formula =RISRISRI KBINKBINKBI OMIALMIALMI (NTrials,PSuccess) in any cell. Here, NTrials is the number of trials, and PSuccess is the probability of a success on each trial.

It is natural to ask which distribution to use for a given uncertain quantity such as the price of oil, the demand for laptops, and so on. Admittedly, the choices we make in later examples are sometimes fairly arbitrary. However, in real business situations the choice is not always clear-cut, and it can make a difference in the results. Stanford professor Sam Savage and two of his colleages discuss this choice in a series of two articles on “Probability Management.” (These articles are available online at http://lionhrtpub.com/orms/orms-2-06/ frprobability.html and http://lionhrtpub.com/orms/orms-4-06/frprobability.html.) They argue that with the increasing importance of simulation models in today’s business world, input distributions should not only be chosen carefully, but they should be kept and maintained as important corporate assets. They shouldn’t just be chosen in some ad hoc fashion every time they are needed. For example, if the price of oil is an important input in many of a company’s decisions, then experts within the company should assess an appropriate distribution for the price of oil and modify it as necessary when new information arises. The authors even sug- gest a new company position, Chief Probability Of�cer, to control access to the company’s probability distributions.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-2 Probability Distributions for Input Variables 779

So as you are reading these �nal two chapters, keep Savage’s ideas in mind. The choice of probability distributions for inputs is not easy, but it is also not arbitrary. The choice can make a difference in the results. This is the reason why you want as many families of prob- ability distributions in your toolbox as possible. You then have more �exibility in choosing a distribution that is appropriate for your situation.

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. Use the RAND function and the Copy command to

generate a set of 100 random numbers. a. What fraction of the random numbers are smaller

than 0.5? b. What fraction of the time is a random number less than

0.5 followed by a random number greater than 0.5? c. What fraction of the random numbers are larger

than 0.8? d. Freeze these random numbers. However, instead

of pasting them over the original random numbers, paste them onto a new range. Then press the F9 recalculate key. The original random numbers should change, but the pasted copy should remain the same.

2. Use Excel’s functions (not @RISK) to generate 1000 random numbers from a normal distribution with mean 100 and standard deviation 10. Then freeze these random numbers. a. Calculate the mean and standard deviation of these

random numbers. Are they approximately what you would expect?

b. What fraction of these random numbers are within k standard deviations of the mean? Answer for k standard deviations of the mean? Answer for k k = 1; for k = 2; for k = 3. Are the answers close to what they should be (according to the empirical rules you learned in Chapters 2 and 5)?

c. Create a histogram of the random numbers using 10 to 15 categories of your choice. Does this histogram have approximately the shape you would expect?

3. Use @RISK’s Define Distributions tool to show a uniform distribution from 400 to 750. Then answer the following questions. a. What are the mean and standard deviation of this

distribution? b. What are the 5th and 95th percentiles of this

distribution? c. What is the probability that a random number from

this distribution is less than 450?

d. What is the probability that a random number from this distribution is greater than 650?

e. What is the probability that a random number from this distribution is between 500 and 700?

4. Use @RISK’s Define Distributions tool to draw a normal distribution with mean 500 and standard deviation 100. Then answer the following questions. a. What is the probability that a random number from

this distribution is less than 450? b. What is the probability that a random number from

this distribution is greater than 650? c. What is the probability that a random number from

this distribution is between 500 and 700?

5. Use @RISK’s Define Distributions tool to show a triangular distribution with parameters 300, 500, and 900. Then answer the following questions. a. What are the mean and standard deviation of this

distribution? b. What are the 5th and 95th percentiles of this

distribution? c. What is the probability that a random number from

this distribution is less than 450? d. What is the probability that a random number from

this distribution is greater than 650? e. What is the probability that a random number from

this distribution is between 500 and 700?

6. Use @RISK’s Define Distributions tool to show a binomial distribution that results from 50 trials with probability of success 0.3 on each trial, and use it to answer the following questions. a. What are the mean and standard deviation of this

distribution? b. You have to be more careful in interpreting @RISK

probabilities with a discrete distribution such as this binomial. For example, if you move the left slider to 11, you find a probability of 0.139 to the left of it. But is this the probability of “less than 11” or “less than or equal to 11”? One way to check is to use Excel’s BINOMDIST function. Use this function to interpret the 0.139 value from @RISK.

c. Using part b to guide you, use @RISK to find the probability that a random number from this

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

780 Chapter 15 Introduction to Simulation Modeling

distribution will be greater than 17. Check your answer by using the BINOMDIST function appropriately in Excel.

7. Use @RISK’s Define Distributions tool to draw a triangular distribution with parameters 200, 300, and 600. Then superimpose a normal distribution on this drawing, choosing the mean and standard deviation to match those from the triangular distribution. (Click the Add Overlay button at the bottom of the window and then choose the distribution to superimpose.) a. What are the 5th and 95th percentiles for these two

distributions? b. What is the probability that a random number from

the triangular distribution is less than 400? What is this probability for the normal distribution?

c. Experiment with the sliders to answer questions similar to those in part b. Would you conclude that these two distributions differ most in the extremes (right or left) or in the middle? Explain.

8. We all hate to keep track of small change. By using random numbers, it is possible to eliminate the need for change and give the store and the customer a fair deal. This problem indicates how it could be done. a. Suppose that you buy something for $0.20. How

could you use random numbers (built into the cash register system) to decide whether you should pay $1.00 or nothing?

b. If you bought something for $9.60, how would you use random numbers to eliminate the need for change?

c. In the long run, why is this method fair to both the store and the customers? Would you personally (as a customer) be willing to abide by such a system?

Level B 9. A company is about to develop and then market a

new product. It wants to build a simulation model for the entire process, and one key uncertain input is the development cost. For each of the following scenarios,

choose an appropriate distribution together with its parameters, justify your choice in words, and use @RISK’s Define Distributions tool to show your cho- sen distribution. a. Company experts have no idea what the

distribution of the development cost is. All they can state is “we are 95% sure it will be at least $450,000, and we are 95% sure it will be no more than $650,000.”

b. Company experts can still make the same statement as in part a, but now they can also state: “We believe the distribution is symmetric, reasonably bell-shaped, and its most likely value is about $550,000.”

c. Company experts can still make the same statement as in part a, but now they can also state: “We believe the distribution is skewed to the right, and its most likely value is about $500,000.”

10. Continuing the preceding problem, suppose that another key uncertain input is the development time, which is measured in an integer number of months. For each of the following scenarios, choose an appropriate distribution together with its parameters, justify your choice in words, and use @RISK’s Define Distributions tool to show your chosen distribution. a. Company experts believe the development time

will be from 6 to 10 months, but they have absolutely no idea which of these will result.

b. Company experts believe the development time will be from 6 to 10 months. They believe the probabilities of these five possible values will increase linearly to a most likely value at 8 months and will then decrease linearly.

c. Company experts believe the development time will be from 6 to 10 months. They believe that 8 months is twice as likely as either 7 months or 9 months and that either of these latter possibilities is three times as likely as either 6 months or 10 months.

15-3 SIMULATION AND THE FLAW OF AVERAGES To help motivate simulation modeling in general, we present a simple example in this section. It will clearly show the distinction between Figure 15.1 (a deterministic model with best-guess inputs) and Figure 15.2 (an appropriate simulation model). In doing so, it will illustrate a pitfall called the “�aw of averages.”6 with best-guess inputs) and Figure 15.2 (an appropriate simulation model). In doing so,

6 with best-guess inputs) and Figure 15.2 (an appropriate simulation model). In doing so,

6As far as we know, the term “�aw of averages” was coined by Sam Savage, the same Stanford professor quoted earlier.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-3 Simulation and the Flaw of Averages 781

E X A M P L E 15.1 ORDERING CALENDARS AT WALTON BOOKSTORE

In August, Walton Bookstore must decide how many of next year’s nature calendars to order. Each calendar costs the bookstore $7.50 and sells for $10. After January 1, all unsold calendars will be returned to the publisher for a refund of $2.50 per calendar. Walton believes that the number of calendars it can sell by January 1 follows some prob- ability distribution with mean 200. Walton believes that ordering to the average demand, that is, ordering 200 calendars, is a good decision. Is it?

Objective To illustrate the difference between a deterministic model with a best guess for uncertain inputs and a simulation model that incorporates uncertainty explicitly.

Where Do the Numbers Come From? The monetary values are straightforward. The mean demand is probably an estimate based on historical demands for similar calendars.

Solution The variables for this model are shown in Figure 15.22. (See the file Ordering Calendars Big Picture.xlsx.) Note that in addition to the “Big Picture” conventions illustrated in the two previous chapters, we use a green rectangle with a rounded top for uncertain quanti- ties. (For most of the rest of this chapter, you can refer back to this diagram.) An order quantity is chosen and demand is then observed. The ordering cost is based on the order quantity, the revenue is based on the smaller of the order quantity and demand, and there is a refund if demand is less than the order quantity.

The Flaw of Averages

Figure 15.22 Big Picture for Ordering Model

© C

e n g

a g

e L

e a rn

in g

Profit

Order Quan�tyDemand Distribu�on Demand

Unit Refund

Unit Cost

Order Cost

Revenue from Sales Refund from Le�overs

Unit Price

A deterministic model appears in Figure 15.23. (See the file Ordering Calendars - Flaw of Averages.xlsx.) Assuming the best guess for demand, Walton orders to this aver- age value, and it appears that the company’s best guess for profit is $500. (The formulas in cells B16:F16 are straightforward and are listed in row 18. Before reading further, do you believe that the average profit will be $500 when uncertainty in demand is intro- duced explicitly (and the company still orders 200 calendars)? Think what happens to profit when demand is less than 200 and when it is greater than 200. Are these two cases symmetric?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

782 Chapter 15 Introduction to Simulation Modeling

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18

A BA B C DC D E FE F Walton’s bookstore - determinis�c model

Cost data Unit cost $7.50 Unit price $10.00 Unit refund $2.50

Uncertain quan�ty Demand (average shown) 200

Decision variable Order quan�ty

Formulas

200

Profit model Demand Revenue Cost Refund Profit

200

=B11 =B6*B14 =C18-D18+E18=B7*MIN(B11,B14) =B8*MAX(B14-B11,0)4 ==B8*MAX(B14-B11,0)4 =

$2,000.00 $1,500.00 $0.00 $500.00

4 =4 =

This determinis�c model gives no hint of what will happen when demand is treated explicitly as random. From the simula�on model on the next sheet, we see that the average profit is nowhere near the $500 value in this sheet.

Figure 15.23 Deterministic Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16

A BA B C DC D E FE F Walton’s bookstore - simula�on model

Cost data Unit cost $7.50 Unit price $10.00 Unit refund $2.50

Uncertain quan�ty (assumed normal with mean 200, stdev 40) Demand (random) 254

Decision variable Order quan­ty 200

Profit model Demand Revenue Cost Refund Profit

254 $2,000.00 $1,500.00 $0.00 $500.00

Figure 15.24 Simulation Model

We now contrast this with a simulation model where the demand in cell B9 is replaced by a random number. For this example, we assume that demand is normally distributed with mean 200 and standard deviation 40, although these specific assumptions are not crucial for the qualitative aspects of the example. Specifically, cell B9 should contain the formula =ROUND1RISKNORMAL(200,40),0) where the ROUND function has been used to round to the nearest integer. (We assume that @RISK has been loaded.) Now the model appears as in Figure 15.24.

The random demand in cell B9 is now live, as are its dependents in row 16, so each time you press the F9 key, you get a new demand and associated profit. (This assumes that the @RISK “dice” button is toggled to colored, its “random” setting. More will be said about this setting later in the chapter.) Do you get about $500 in profit on average? Absolutely not! The situation isn’t symmetric. The largest profit you can get is largest profit you can get is largest $500, which occurs about half the time, whenever demand is greater than 200. A typical such situation appears in the figure, where the excess demand of 54 is simply lost. However, when demand is less than 200, the profit is less than $500, and it keeps decreasing as demand decreases.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 783

We ran @RISK with 1000 iterations (which will be explained in detail in Section 15-5) and found the resulting histogram of 1000 simulated profits shown in Figure 15.25. The large spike on the right is due to the cases where demand is 200 or more and profit is $500. All the little spikes to the left are where demand is less than 200 and profit is less than $500, some- times considerably less. You can see on the right that the mean profit, the average of the 1000 simulated profits, is only about $380, well less than the $500 suggested by the deterministic model.

The point of this simple example is that a deterministic model can be very misleading. In particular, the output from a deterministic model that uses best guesses for uncertain inputs is not necessarily equal to, or even close to, the average of the outputs from a simu-not necessarily equal to, or even close to, the average of the outputs from a simu-not lation. This is exactly what “the flaw of averages” means. ■

The Flaw of Averages If a model contains uncertain inputs, it can be very misleading to build a deterministic model by using the means of the inputs to predict an output.

The resulting output value can be considerably different—lower or higher—than the mean of the or higher—than the mean of the or output values obtained from running a simulation with uncertainty incorporated explicitly.

F u n da m e n ta l I n s i g h t

15-4 SIMULATION WITH BUILT-IN EXCEL TOOLS In this section, we show how spreadsheet simulation models can be developed and analyzed with Excel’s built-in tools without using add-ins. As you will see, this is certainly possible, but it presents two problems. First, the @RISK functions illustrated in the Probability Distributions.xlsx �le are not available. You are able to use only Excel’s RAND function and transformations of it to generate random numbers from various probability distribu- tions. (You can also use the RANDBETWEEN function, but except for special cases, this

Figure 15.25 Histogram of Simulated Profits

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

784 Chapter 15 Introduction to Simulation Modeling

E X A M P L E 15.2 SIMULATING WITH EXCEL ONLY AT WALTON BOOKSTORE

Recall that Walton Bookstore must decide how many of next year’s nature calendars to order. Each calendar costs the bookstore $7.50 and sells for $10. After January 1, all unsold calendars will be returned to the publisher for a refund of $2.50 per calendar. In this version, we assume that demand for calendars (at the full price) is given by the probability distribution shown in Table 15.1. Walton wants to develop a simulation model to help it decide how many calendars to order.

Objective To use built-in Excel tools—including the RAND function and data tables, but no add-ins—to simulate profit for several order quantities and ultimately choose the “best” order quantity.

Where Do the Numbers Come From?Where Do the Numbers Come From? The numbers in Table 15.1 are the key to the simulation model. They are discussed in more detail next.

Solution We first discuss the probability distribution in Table 15.1. It is a discrete distribution with only five possible values: 100, 150, 200, 250, and 300. In reality, it is clear that other values of demand are possible. For example, there could be demand for exactly 187 calendars. In spite of its apparent lack of realism, we use this discrete distribution for two reasons. First,

Table 15.1 Probability Distribution of Demand for Walton Example Demand Probability

100 0.30 150 0.20 200 0.30 250 0.15 300 0.05

© C

e n g

a g

e L

e a rn

in g

doesn’t help much.) Second, there is a bookkeeping problem. Once you build an Excel model with output cells linked to appropriate random input cells, you can press the F9 key as often as you like to see how the outputs vary. However, there is no quick way to keep track of these output values and summarize them. This bookkeeping feature is the real strength of a simulation add-in such as @RISK. It can be done with Excel, usually with data tables, but the summarization of the resulting data is completely up to the user—you. Therefore, we strongly recommend that you use the “Excel-only” method described in this section only if you don’t have an add-in such as @RISK.

To illustrate the Excel-only procedure, we continue to analyze the calendar problem from Example 15.1. This general problem occurs when a company (such as a news ven- dor) must make a one-time purchase of a product (such as a newspaper) to meet customer demands for a certain period of time. If the company orders too few newspapers, it will lose potential pro�t by not having enough on hand to satisfy its customers. If it orders too many, it will have newspapers left over at the end of the day that, at best, can be sold at a loss. More generally, the problem is to match supply to an uncertain demand, a very com- mon problem in business. In much of the rest of this chapter, we will discuss variations of this problem, generally referred to as the newsvendor problem.newsvendor problem.newsvendor

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 785

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

1016 1017 1018 1019

A B C Simula�on of Walton’s bookstore Range names used:

Cost data Unit cost Unit price Unit refund

Demand distribu�on

Decision variable Order quan�ty

Simula�on Distribu�on of profit

Summary measures for simula�on below Average profit Stdev of profit Minimum profit Maximum profit

$204.13 $328.04

�$250.00 $500.00

Demand 150 100 100 200 100 100 150 150

Revenue $1,500 $1,000 $1,000 $2,000 $1,000 $1,000 $1,500 $1,500

Cost $1,500 $1,500 $1,500 $1,500 $1,500 $1,500 $1,500 $1,500

Refund $125 $250 $250

$0 $250 $250 $125 $125

Value �250

125 500

Frequency 299 191 510

Rel. Freq. 0.299 0.191

0.51

200

e R A B D

e R E

e R LookupTableupTableupT Order_quan�ty Profit Unit_cost Unit_price Unit_refund

=Model!$D$5:$F$9 =Model!$B$9 =Model!$G$19:$G$1018 =Model!$B$4 =Model!$B$5 =Model!$B$6

F e R

G e R

H I J KJ K

Replica�on 1 2 3 4 5

998 999

1000

$7.50 $10.00

$2.50

Cum Prob 0.00 0.30 0.50 0.80 0.95

Demand 100 150 200 250 300

Probability 0.30 0.20 0.30 0.15 0.05

Random # 0.4695 0.0022 0.2614 0.6220 0.1417 0.1005 0.3798 0.4530

Profit $125

�$250 �$250

$500 �$250 �$250

$125 $125

Figure 15.26 Walton Bookstore Simulation Model

its simplicity is a nice feature to get you started with simulation modeling. Second, discrete distributions are often used in real business simulation models. Even though the discrete distribution is only an approximation to reality, it can still provide important insights into the actual problem.

As for the probabilities listed in Table 15.1, they are typically drawn from historical data or (if historical data are lacking) educated guesses. In this case, the manager of Walton Bookstore has presumably looked at demands for calendars in previous years, and he has used any information he has about the market for next year’s calendars to estimate, for example, that the probability of a demand for 200 calendars is 0.30. The five probabilities in this table must sum to must sum to must 1. Beyond this requirement, they should be as reasonable and consistent with reality as possible.

It is important to realize that this is really a decision problem under uncertainty. Walton must choose an order quantity before knowing the demand for calendars. Unfortunately, Solver cannot be used because of the uncertainty.7

knowing the demand for calendars. Unfortunately, 7

knowing the demand for calendars. Unfortunately, Therefore, we develop a simulation

model for any fixed order quantity. Then we run this simulation model with various order fixed order quantity. Then we run this simulation model with various order fixed quantities to see which one appears to be best.

Developing the Simulation Model Now we discuss the ordering model. For any fixed order quantity, we show how Excel can be used to simulate 1000 replications (or any other number of replications). Each replica- tion is an independent replay of the events that occur. To illustrate, suppose you want to simulate profit if Walton orders 200 calendars. Figure 15.26 illustrates the results obtained

© C

e n g

a g

e L

e a rn

in g

Developing the Walton Model with Excel Tools Only

7@RISK contains a tool called RISKOptimizer that can be used for optimization in a simulation model, but we will not discuss it here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

786 Chapter 15 Introduction to Simulation Modeling

This rather cumbersome procedure for generating a discrete random number is not necessary when you use @RISK.

by simulating 1000 independent replications for this order quantity. (See the file Ordering Calendars - Excel Only 1.xlsx.) Note that there are many hidden rows in Figure 15.26. To develop this model, use the following steps.

1. Inputs. Enter the cost data in the range B4:B6, the probability distribution of demand in the range E5:F9, and the proposed order quantity, 200, in cell B9. Pay particular attention to the way the probability distribution is entered (and compare to the Discrete sheet in the Probability Distributions.xlsx file). Columns E and F contain the possible demand values and the probabilities from Table 15.1. It is also necessary (see step 2 for the reasoning) to have the cumulative probabilities in column D. To obtain these, first enter the value 0 in cell D5. Then enter the formula

=F5+D5

in cell D6 and copy it to the range D7:D9.

2. Generate random demands. The key to the simulation is the generation of a cus- tomer demand in column C from a random number generated by the RAND func- tion in column B and the probability distribution of demand. Here is how it works. The interval from 0 to 1 is split into five segments: 0.0 to 0.3 (length 0.3), 0.3 to 0.5 (length 0.2), 0.5 to 0.8 (length 0.3), 0.8 to 0.95 (length 0.15), and 0.95 to 1.0 (length 0.05). Note that these lengths are the probabilities of the various demands. Then a demand is associated with each random number, depending on which interval the random number falls in. For example, if a random number is 0.5279, this falls in the third interval, so it is associated with the third possible demand value, 200.

To implement this procedure, you use a VLOOKUP function based on the range D5:F9 (named LookupTable). This table has the cumulative probabilities in column D and the possible demand values in column E. In fact, the whole purpose of the cumulative probabilities in column D is to allow the use of the VLOOKUP function. To generate the simulated demands, enter the formula

=VLOOKUP(RAND(),LookupTable,2)

in cell C19. This formula compares any RAND value to the values in D5:D9 and returns the appropriate demand from E5:E9. (In the file, you will note that random cells are colored green. This coloring convention is not required, but we use it con- sistently to identify the random cells.)

This step is the key to the simulation, so make sure you understand exactly what it entails. The rest is bookkeeping, as indicated in the following steps.

3. Revenue. Once the demand is known, the number of calendars sold is the smaller of the demand and the order quantity. For example, if 150 calendars are demanded, 150 will be sold. But if 250 are demanded, only 200 can be sold (because Walton orders only 200). Therefore, to calculate the revenue in cell D19, enter the formula

=Unit_price*MIN(C19,Order_quantity)

4. Ordering cost. The cost of ordering the calendars does not depend on the demand; it is the unit cost multiplied by the number ordered. Calculate this cost in cell E19 with the formula

=Unit_cost*Order_quantity

5. Refund. If the order quantity is greater than the demand, there is a refund of $2.50 for each calendar left over; otherwise, there is no refund. Therefore, calculate the refund in cell F19 with the formula

=Unit_refund*MAX(Order_quantity-C19,0)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 787

For example, if demand is 150, then 50 calendars are left over, and this MAX is 50, the larger of 50 and 0. However, if demand is 250, then no calendars are left over, and this MAX is 0, the larger of −50 and 0. (This calculation could also be accomplished with an IF function instead of a MAX function.)

6. Profit. Calculate the profit in cell G19 with the formula

=D19+F19-E19

7. Copy to other rows. This is a “one-line” simulation, where all of the logic is cap- tured in a single row, row 19. For one-line simulations, you can replicate the logic with new random numbers very easily by copying down. Copy row 19 down to row 1018 to generate 1000 replications.

8. Summary measures. Each profit value in column G corresponds to one randomly generated demand. You usually want to see how these vary from one replication to another. First, calculate the average and standard deviation of the 1000 profits in cells B12 and B13 with the formulas

=AVERAGE(G19:G1018)

and

=STDEV.S(G19:G1018)

Similarly, calculate the smallest and largest of the 1000 profits in cells B14 and B15 with the MIN and MAX functions.

9. Distribution of simulated profits. There are only three possible profits, −$250, $125, or $500 (depending on whether demand is 100, 150, or at least 200—see the following discussion). You can use the COUNTIF function to count the number of times each of these possible profits is obtained. To do so, enter the formula

=COUNTIF($G$19:$G$1018,I19)

in cell J19 and copy it down to cell J21.

Checking Logic with Deterministic Inputs It can be difficult to check whether the logic in your model is correct, because of the ran- dom numbers. The reason is that you usually get different output values, depending on the particular random numbers generated. Therefore, it is sometimes useful to enter well- chosen fixed values for the random inputs, just to see whether your logic is correct. We call fixed values for the random inputs, just to see whether your logic is correct. We call fixed these deterministic checks. In the present example, you might try several fixed demands, at least one of which is less than the order quantity and at least one of which is greater than the order quantity. For example, if you enter a fixed demand of 150, the revenue, cost, refund, and profit should be $1500, $1500, $125, and $125, respectively. Or if you enter a fixed demand of 250, these outputs are $2000, $1500, $0, and $500. There is no random- ness in these values; every correct model should get these same values. If your model doesn’t get these values, there must be a logic error in your model that has nothing to do with random numbers or simulation. Of course, you should fix any such logical errors before reentering the random demand and running the simulation.

You can make a similar check by keeping the random demand, repeatedly pressing the F9 key, and watching the outputs for the different random demands. For example, if the refund is not $0 every time demand exceeds the order quantity, you know you have a

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

788 Chapter 15 Introduction to Simulation Modeling

For this particular model, the output distribution is also discrete: There are only three possible profits for an order quantity of 200.

logical error in at least one formula. The advantage of deterministic checks is that you can compare your results with those of other users, using agreed-upon test values of the ran- dom quantities. You should all get exactly the same outputs.

Discussion of the Simulation Results At this point, it is a good idea to stand back and see what you have accomplished. First, in the body of the simulation, rows 19 through 1018, you randomly generated 1000 possible demands and the corresponding profits. Because there are only five possible demand values (100, 150, 200, 250, and 300), there are only five possible profit values: −$250, $125, $500, $500, and $500. Also, note that for the order quantity 200, the profit is $500 regardless of whether demand is 200, 250, or 300. (Make sure you understand why.) A tally of the profit values in these rows, including the hidden rows, indicates that there are 299 rows with profit equal to −$250 (demand 100), 191 rows with profit equal to $125 (demand 150), and 510 rows with profit equal to $500 (demand 200, 250, or 300). The average of these 1000 profits is $204.13, and their standard deviation is $328.04. (Again, however, remember that your answers will probably differ from these because of different random numbers.)

Typically, a simulation model should capture one or more output variables, such as profit. These output variables depend on random inputs, such as demand. The goal is to estimate the probability distributions of the outputs. In the Walton simulation the estimated probability distribution of profit is

P(Profit = −$250) = 299/1000 = 0.299

P(Profit = $125) = 191/1000 = 0.191

P(Profit = $500) = 510/1000 = 0.510

The estimated mean of this distribution is $204.13 and the estimated standard deviation is $328.04. It is important to realize that if the entire simulation is run again with different random numbers (such as the ones you might have generated on your PC), the answers will probably be slightly different. For illustration, we pressed the F9 key five times and got the following average profits: $213.88, $206.00, $212.75, $219.50, and $189.50. So this is truly a case of “answers will vary.”

Notes about Confidence Intervals It is common in computer simulations to estimate the mean of some distribution by the average of the simulated observations. The usual practice is then to accompany this esti- mate with a confidence interval, which indicates the accuracy of the estimate. You should recall from Chapter 8 that to obtain a confidence interval for the mean, you start with the estimated mean and then add and subtract a multiple of the standard error of the estimated standard error of the estimated standard error mean. If the estimated mean (that is, the average) is X, the confidence interval is given in the following formula.

Confidence Interval for the Mean X ± Multiple × Standard Error of X

We repeat these basic facts about confidence intervals from Chapter 8 here for your convenience.

The confidence interval provides a measure of accuracy of the mean profit, as estimated from the simulation.

The standard error of X is the standard deviation of the observations divided by the square root of n, the number of observations:

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 789

Here, s is the symbol for the standard deviation of the observations. You can obtain it with the STDEV.S function in Excel.

The multiple in the confidence interval formula depends on the confidence level and the number of observations. If the confidence level is 95%, for example, the multiple is very close to 2, so a good guideline is to go out two standard errors on either side of the average to obtain an approximate 95% confidence interval for the mean.

The idea is to choose the number of iterations large enough so that the resulting confidence interval will be sufficiently narrow.

Approximate 95% Confidence Interval for the Mean X ± 2s/!n!n!!

Sample Size Determination

n = 4 × (Estimated standard deviation)2

B2

Standard Error of X s/!n!n!!

Analysts often plan a simulation so that the confidence interval for the mean of some important output will be sufficiently narrow. The reasoning is that narrow confidence inter- vals imply more precision about the estimated mean of the output variable. If the confi- dence level is fixed at some value such as 95%, the only way to narrow the confidence interval is to simulate more replications. Assuming that the confidence level is 95%, the following value of n is required to ensure that the resulting confidence interval will have a half-length approximately equal to some specified value B:

This formula requires an estimate of the standard deviation of the output variable. For example, in the Walton simulation the 95% confidence interval with n = 1000 has half- length ($224.46 − $183.79)/2 = $20.33. Suppose that you want to reduce this half-length to $12.50—that is, you want B = $12.50. You do not know the exact standard deviation of the profit distribution, but you can estimate it from the simulation as $328.04. Therefore, to obtain the required confidence interval half-length B, you need to simulate n replications, where

n = 4(328.04)2

12.502 ≈ 2755

(When this formula produces a noninteger, it is common to round upward.) The claim, then, is that if you rerun the simulation with 2755 replications rather than 1000 replica- tions, the half-length of the 95% confidence interval for the mean profit will be close to $12.50.

Finding the Best Order Quantity We are not yet finished with the Walton example. So far, the simulation has been run for only a single order quantity, 200. Walton’s ultimate goal is to find the best order quanbest order quanbest - tity. Even this statement must be clarified. What does “best” mean? As in Chapter 6, one possibility is to use the expected profit—that is, EMV—as the optimality criterion, expected profit—that is, EMV—as the optimality criterion, expected but other characteristics of the profit distribution could influence the decision. You can

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

790 Chapter 15 Introduction to Simulation Modeling

obtain the required outputs with a data table. Specifically, you can use a data table to rerun the simulation for other order quantities. This data table and a corresponding chart are shown in Figure 15.27. (This is still part of the finished version of the Ordering Calendars - Excel Only 1.xlsx file.)

17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44

M NM N O PO P Q RQ R S TS T Data table for average profit versus order quan�ty

Order quan�ty

100 125 150 175 200 225 250 275 300

Average Profit $204.13 $250.00 $256.81 $258.00 $237.44 $209.75 $118.50

$12.63 ($95.88)

($196.13)

($250.00) ($200.00) ($150.00) ($100.00)

($50.00) $0.00

$300.00 $250.00 $200.00 $150.00 $100.00

$50.00

100 125 150 175 200 225 250

Order Quan�ty

Average Profit

275275 300300

Figure 15.27 Data Table for Walton Bookstore Simulation

To optimize in simulation models, try various values of the decision variable(s) and run the simulation for each of them.

© C

e n g

a g

e L

e a rn

in g

To create this table, enter the trial order quantities shown in the range M20:M28, enter the link =B12 to the average profit in cell N19, and select the data table range M19:N28. Then select Data Table from the What-If Analysis dropdown list on the Data ribbon, specifying that the column input cell is B9. (See Figure 15.26.) Finally, construct a column chart of the average profits in the data table. Note that an order quantity of 150 appears to maximize the average profit. Its average profit of $258.00 is slightly higher than the average profits from nearby order quantities and much higher than the profit gained from an order of 200 or more calendars. However, again keep in mind that this is a simula- tion, so that all of these average profits depend on the particular random numbers gener- ated. If you rerun the simulation with different random numbers, it is conceivable that some other order quantity could be best.

Excel Tip: Calculation Settings with Data Tables Sometimes you will create a data table and the values will be constant the whole way down. This could mean you did something wrong, but more likely it is due to a calculation setting. To check, go to the Formulas ribbon and click the Calculation Options dropdown arrow. If it isn’t Automatic (the default setting), you need to click the Calculate Now (or Calculate Sheet) button or press the F9 key to make the data table calculate correctly. (The Calculate Now and F9 key recalculate everything in your workbook. The Calculate Sheet option recalculates only the active sheet.) Note that the Automatic Except for Data Tables setting is there for a reason.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 791

Through row 19, the only difference between this model and the previous model is that the RAND function is embedded in the VLOOKUP function for demand in cell B19. This makes the model slightly more compact. As before, it uses the given data at the top of the spreadsheet to construct a typical “prototype” of the simulation in row 19. This time, however, you do not copy row 19 down. Instead, you create a data table in the range A23:B1023 to replicate the basic simulation 1000 times. In column A, you list the repli- cation numbers, 1 to 1000. Next, you enter the formula =F19 in cell B23. This forms a link to the profit from the prototype row for use in the data table. Then you create a data table and enter any blank cell (such as C23) as the column input cell. (No row input cell any blank cell (such as C23) as the column input cell. (No row input cell any blank cell is necessary, so its box should be left empty.) This tricks Excel into repeating the row 19 calculations 1000 times, each time with a new random number, and reporting the profits in column B of the data table. (If you wanted to see other simulated quantities, such as rev- enue, for each replication, you could add extra output columns to the data table.)

17 18 19 20 21 22 23 24 25 26 27

1021 1022 1023

A BA B C DC D E FE F

Demand Revenue Cost Refund Profit 200 $2,000 $1,500 $0 $500

Data table for replica�ons, each shows profit from that replica�on

Simula�on

Replica on Profit $500

1 $125 2 –$250 3 $500 4 –$250 5 $125

998 $125 999 $500

1000 $500

28

Figure 15.28 Using a Data Table to Simulate Replications

Data tables, especially those based on complex simulations, can take a lot of time to recalcu- late, and with the default setting, this recalculation occurs every time anything changes in your workbook. So the Automatic Except for Data Tables setting is handy to prevent data tables from recalculating until you force them to by pressing the F9 key or clicking one of the Calculate buttons.

Using a Data Table to Repeat Simulations The Walton simulation is a particularly simple one-line simulation model. All of the logic—generating a demand and calculating the corresponding profit—can be captured in a single row. Then to replicate the simulation, you can simply copy this row down as far as you like. Many simulation models are significantly more complex and require more than one row to capture the logic. Nevertheless, they still result in one or more output quantities (such as profit) that you want to replicate. We now illustrate another method of replicating with Excel tools only that is more general (still using the Walton example). It uses a data table to generate the replications. Refer to Figure 15.28 and the file Ordering Calendars - Excel Only 2.xlsx.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

792 Chapter 15 Introduction to Simulation Modeling

The key to simulating many replications in Excel (without an add-in) is to use a data table with any blank cell as the column input cell.

17 18 19 20 21 22 23 24 25 26 27 28

1021 1022 1023

A BA B C DC D E FE F G HG H I JI J Simula�on

Demand Revenue Cost Refund Profit 100 $1,000 $1,500 $250 –$250

Data table showing profit for replica�ons with various order quan��es Order quan tyReplica on

($250.00) 1 2 3 4 5

998 999

1000

100 $250 $250 $250 $250 $250 $250 $250 $250

125 $313 $125 $313 $125 $125 $125 $313 $125

150 $375 $375

$0 $375

$0 $375 $375 $375

175 –$125

$250 $438 $438

–$125 $438

–$125 $438

200 $500

–$250 $500 $500

–$250 –$250

$125 $500

225 –375 –375

375 0

375 0

375 0

250 625

–500 625 250 250

–500 –125

625

275 125 125

–250 –625 –625 –625

125 –625

300 –375 –375 –750 –750 –750 –375 –750 –750

Figure 15.29 Using a Two-Way Data Table for the Simulation Model

Excel Tip: How Data Tables Work To understand this procedure, you must understand exactly how data tables work. When you create a data table, Excel takes each value in the left column of the data table (here, column A), substitutes it into the cell designated as the column input cell, recalculates the spreadsheet, and returns the output value (or values) you have requested in the top row of the data table (such as profit). It might seem silly to substitute each replication number from column A into a blank cell such as cell C23, but this part is really irrelevant. The important part is the recalculation. Each recalculation leads to a new random demand and corresponding profit, and these profits are the quantities you want to keep track of. Of course, this means that you should not freeze the quantity in cell B19 before forming the data table. The whole point of the data table is to use a different random number for each replication, and this will occur only if the random demand in row 19 is “live.”

Using a Two-Way Data Table You can carry this method one step further to see how the profit depends on the order quantity. Here you use a two-way data table with the replication number along the side and possible order quantities along the top. See Figure 15.29 and the file Ordering Calendars - Excel

© C

e n g

a g

e L

e a rn

in g

Only 3.xlsx. Now the data table range is A23:J1023, and the driving formula in cell A23 is again the link =F19. The column input cell should again be any blank cell, and the row input cell should be B9 (the order quantity). Each cell in the body of the data table shows a simulated profit for a particular replication and a particular order quantity, and each is based on a different random demand.different random demand.different

By averaging the numbers in each column of the data table (see row 14 in the finished version of the file), you can see which is the best order quantity. It is also helpful to con- struct a column chart of these averages, as in Figure 15.30. Now, however, assuming you have not frozen anything, the data table and the corresponding chart will change each time you press the F9 key. To see whether 150 is always the best order quantity, you can press the F9 key and see whether the bar above 150 continues to be the highest. (It usually is, but not always.) ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-4 Simulation with Built-in Excel Tools 793

P R O B L E M S

Level A 11. Suppose you own an expensive car and purchase auto

insurance. This insurance has a $1000 deductible, so that if you have an accident and the damage is less than $1000, you pay for it out of your pocket. However, if the damage is greater than $1000, you pay the first $1000 and the insurance pays the rest. In the current year there

is probability 0.025 that you will have an accident. If you have an accident, the damage amount is normally distributed with mean $3000 and standard deviation $750. a. Use Excel to simulate the amount you have to pay

for damages to your car. This should be a one-line simulation, so run 5000 iterations by copying it down. Then find the average amount you pay, the standard deviation of the amounts you pay, and a

By now you should appreciate the usefulness of data tables in spreadsheet simulations. They allow you to take a prototype simulation and replicate its key results as often as you like. This method makes summary statistics (over the entire group of replications) and cor- responding charts fairly easy to obtain. Nevertheless, it takes some work to create the data tables and charts. In the next section you will see how the @RISK add-in does a lot of this work for you.

–$300.00

–$200.00

–$100.00

$0.00

$400.00

$300.00

$200.00

$100.00

100 125 150 175 200 225

Order Quan�ty

Average Profit

275 300250

Figure 15.30 Column Chart of Average Profits for Different Order Quantities

© C

e n g

a g

e L

e a rn

in g

Decisions Based on Simulation Results Given the emphasis in Chapter 6 on the EMV criter-MV criter-MV criter ion for decision making under uncertainty, you might believe that the mean of an output from a simulation is the only summary measure of the output relevant for decision making. However, this is not necessar-owever, this is not necessar-owever, this is not necessar ily true. When you run a simulation, you approximate the entire distribution of an output, including its mean,

its standard deviation, its percentiles, and more. As a decision maker, you could base your decision on any of these summary measures, not just the mean. For exam- ple, you could focus on making the standard deviation small, making the 5th percentile large, or others. The point is that the results from a simulation provide a lot more information about an output than simply its mean, and this information can be used for decision making.

F u n da m e n ta l I n s i g h t

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

794 Chapter 15 Introduction to Simulation Modeling

95% confidence interval for the average amount you pay. (Note that many of the amounts you pay will be 0 because you have no accidents.)

b. Continue the simulation in part a by creating a two-way data table, where the row input is the deductible amount, varied from $500 to $2000 in multiples of $500. Now find the average amount you pay, the standard deviation of the amounts you pay, and a 95% confidence interval for the average amount you pay for each deductible amount.

c. Do you think it is reasonable to assume that damage amounts are normally distributed? What would you criticize about this assumption? What might you suggest instead?

12. In August of the current year, a car dealer is trying to determine how many cars of the next model year to order. Each car ordered in August costs $20,000 . The demand for the dealer’s next year models has the probability distribution shown in the file P15_12. xlsx. Each car sells for $25,000. If demand for next year’s cars exceeds the number of cars ordered in August, the dealer must reorder at a cost of $22,000 per car. Excess cars can be disposed of at $17,000 per car. Use simulation to determine how many cars to order in August. For your optimal order quantity, find a 95% confidence interval for the expected profit.

13. In the Walton Bookstore example, suppose that Walton receives no money for the first 50 excess calendars returned but receives $2.50 for every calendar after the first 50 returned. Does this change the optimal order quantity?

14. A sweatshirt supplier is trying to decide how many sweatshirts to print for the upcoming NCAA basketball championships. The final four teams have emerged from the quarterfinal round, and there is now a week left until the semifinals, which are then followed in a couple of days by the finals. Each sweatshirt costs $10 to produce and sells for $25. However, in three weeks, any leftover sweatshirts will be put on sale for half price, $12.50. The supplier assumes that the demand for his sweatshirts during the next three weeks (when interest in the tournament is at its highest) has the distribution shown in the file P15_14.xlsx. The residual demand, after the sweatshirts have been put on sale, has the distribution also shown in this file. The supplier, being a profit maximizer, realizes that every sweatshirt sold, even at the sale price, yields a profit. However, he also realizes that any sweatshirts produced but not sold (even at the sale price) must be thrown away, resulting in a $10 loss per sweatshirt. Analyze the supplier’s problem with a simulation model.

Level B 15. In the Walton Bookstore example with a discrete

demand distribution, explain why an order quantity other than one of the possible demands cannot maximize the expected profit. (Hint: Consider an order of 190 calendars, for example. If this maximizes expected profit, then it must yield a higher expected profit than an order of 150 or 100. But then an order of 200 calendars must also yield a larger expected profit than 190 calendars. Why?)

15-5 INTRODUCTION TO @RISK Spreadsheet simulation modeling has become extremely popular in recent years, both in the academic and corporate communities. Much of the reason for this popularity is due to simu- lation add-ins such as @RISK. There are two primary advantages to using such an add-in. First, an add-in gives you easy access to many probability distributions you might want to use in your simulation models. You already saw in Section 15-2 how the RISKDISCRETE, RISKNORMAL, and RISKTRIANG functions, among others, are easy to use and remem- ber. Second, an add-in allows you to perform simulations much more easily than is possible with Excel alone. To replicate a simulation in Excel, you typically need to build a data table. Then you have to calculate summary statistics, such as averages, standard deviations, and percentiles, with built-in Excel functions. If you want graphs to enhance the analysis, you have to create them. In short, you have to perform a number of time-consuming steps for each simulation. Simulation add-ins such as @RISK perform much of this work automatically.

Although we will focus only on @RISK in this book, it is not the only simulation add- in available for Excel. Two worthy competitors are Crystal Ball, available from Oracle, and Risk Solver Platform, available from Frontline Systems, the developer of Solver. Both Crystal Ball and Risk Solver Platform have much of the same functionality as @RISK. However, the authors have a natural bias for @RISK—we have been permitted by its devel- oper, Palisade Corporation, to provide the academic version free with this book. If it were

@RISK provides a number of functions for simulating from various distributions, and it takes care of all the bookkeeping in spreadsheet simulations. Excel simulations without @RISK require much more work for the user.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 795

not included, you would have to purchase it from Palisade at a fairly steep price. Indeed, Microsoft Of�ce does not include @RISK, Crystal Ball, Risk Solver Platform, or any other simulation add-in—you must purchase them separately.

15-5a @RISK Features

Here is an overview of some of @RISK’s features. We will discuss all of these in more detail in this section.

■ @RISK contains a number of functions such as RISKNORMAL and RISKDISCRETE that make it easy to generate observations from a wide variety of probability distributions. You saw some of these in Section 15-2.

■ You can designate any cell or range of cells in your simulation model as output cells. When you run the simulation, @RISK automatically keeps summary measures (averages, standard deviations, percentiles, and others) from the values generated in these output cells across the replications. It also creates graphs such as histograms based on these values. In other words, @RISK takes care of tedious bookkeeping operations for you.

■ @RISK has a special function, RISKSIMTABLE, that allows you to run the same simulation several times, using a different value of some key input variable each time. This input variable is often a decision variable. For example, suppose that you would like to simulate an inventory ordering policy (as in the Walton Bookstore example). Your ultimate purpose is to compare simulation outputs across a num- ber of possible order quantities such as 100, 150, 200, 250, and 300.If you use an appropriate formula involving the RISKSIMTABLE function, the entire simulation is performed for each of these order quantities separately—with one click of a button. You can then compare the outputs to choose the best order quantity.

15-5b Loading @RISK

To build simulation models with @RISK, you need to have Excel open with @RISK added in. The �rst step, if you have not already done so, is to install the Palisade DecisionTools suite with its Setup program. Then you can load @RISK by clicking the Windows Start button, selecting the Programs group, selecting the Palisade DecisionTools group, and selecting @RISK. If Excel is already open, this loads @RISK inside Excel. If Excel is not yet open, this launches Excel and @RISK simultaneously.8 selecting @RISK. If Excel is already open, this loads @RISK inside Excel. If Excel is not

8 selecting @RISK. If Excel is already open, this loads @RISK inside Excel. If Excel is not

After @RISK is loaded, you see an @RISK tab and the corresponding @RISK ribbon in Figure 15.31.9

After @RISK is loaded, you 9

After @RISK is loaded, you

8We have had the best luck when we (1) close other applications we are not currently using, and (2) launch Excel and @RISK together by starting @RISK. However, you can also start @RISK after Excel is already running.after Excel is already running.after 9 and @RISK together by starting @RISK. However, you can also start @RISK 9 and @RISK together by starting @RISK. However, you can also start @RISK If you have been using a previous version of @RISK, you will see some changes in the version 7.0 we are using

here. However, the basic functionality and the user interface are essentially the same.

Figure 15.31 @RISK Ribbon ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

796 Chapter 15 Introduction to Simulation Modeling

@RISK Tip: Learning the Software When you launch @RISK, you will see a Welcome screen. (This Welcome screen is also available at any time from the @RISK Help menu.) Among other things, this Welcome screen has a Quick Start link, which guides beginners through the basic features of @RISK. It also has a Guided Tours link to a series of videos on @RISK’s basic to advanced features. All of these videos were created for Palisade by Albright. (He also developed a number of similar videos that accompany this book.)

15-5c @RISK Models with a Single Random Input Variable

In the remainder of this section we will illustrate some of @RISK’s functionality by revisit- ing the Walton Bookstore example. The next chapter demonstrates the use of @RISK in a number of interesting simulation models. Throughout this discussion, you should keep one very important idea in mind. The development of a simulation model is basically a two- step procedure. The �rst step is to build the model itself. This step requires you to enter all of the logic that transforms inputs (including @RISK functions such as RISKDISCRETE) into outputs (such as pro�t). This is where most of the work and thinking go, exactly as in models from previous chapters, and @RISK cannot do this for you. It is your job to enter your job to enter your the formulas that link inputs to outputs appropriately. However, once this logic has been incorporated, @RISK takes over in the second step. It automatically replicates your model, with different random numbers on each replication, and it reports any summary measures that you request in tabular or graphical form. Therefore, @RISK greatly decreases the amount of busy work you need to do, but it is not a magic bullet.

We begin by analyzing an example with a single random input variable.

This is the same Walton Bookstore model as before, except that a triangular distribution for demand is used.

E X A M P L E 15.3 USING @RISK AT WALTON BOOKSTORE

Recall that Walton Bookstore buys calendars for $7.50, sells them at the regular price of $10, and gets a refund of $2.50 for all calendars that cannot be sold. In contrast to Example 15.2, we assume now that Walton estimates a triangular probability distribution for demand, where the minimum, most likely, and maximum values of demand are 100, 175, and 300, respectively. The company wants to use this probability distribution, together with @RISK, to simulate the profit for any particular order quantity, with the ultimate goal of finding the best order quantity.

Objective To learn about @RISK’s basic functionality by revisiting the Walton Bookstore problem.

Where Do the Numbers Come From? The monetary values are the same as before. The parameters of the triangular distribution of demand are probably Walton’s best subjective estimates, possibly guided by its experi- ence with previous calendars. As in many simulation examples, the triangular distribution is chosen for simplicity. In this case, the manager would need to estimate only three quanti- ties: the minimum possible demand, the maximum possible demand, and the most likely demand.

Solution We use this example to illustrate important features of @RISK. We first show how it helps you to implement an appropriate input probability distribution for demand. Then we show

The majority of the work (and thinking) goes into developing the model. Setting up @RISK and then running it are relatively easy.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 797

how it can be used to build a simulation model for a specific order quantity and generate outputs from this model. Finally, we show how the RISKSIMTABLE function can be used to simultaneously generate outputs from several order quantities so that you can choose the optimal order quantity.

Developing the Simulation Model The spreadsheet model for profit is essentially the same model developed previously with- out @RISK, as shown in Figure 15.32. (See the file out @RISK, as shown in Figure 15.32. (See the file out Ordering Calendars - @RISK.xlsx.) There are only a few new things to be aware of.

@RISK Tip: Settings When Opening a Workbook When you open a workbook with an @RISK model, such as those that accompany this chapter, you might be asked whether you want to change the current @RISK settings to match those stored in the workbook. You should generally click Yes. This changes settings, such as the number of iterations, to those you stored previously with the workbook instead of using @RISK default settings.

Figure 15.32 Simulation Model with a Fixed Order Quantity

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

A BA B C DC D E FE F G HG H I JI J Simula�on of Walton’s Bookstore using @RISK Range names used:

Order_quan�ty =Model!$B$9 Cost data Demand distribu�on - triangular

Unit_cost =Model!$B$4Unit cost =Model!$B$5Unit_price

100Minimum$7.50 Unit price $10.00 Most likely

=Model!$B$6Unit_refund 175

Unit refund $2.50 Maximum 300

Decision variable Order quan�ty 200

Simula�on Demand Revenue Cost Refund Profit

192 $1,920 $1,500 $20 $440

Summary measures of profit from @RISK - based on 1000 itera�ons Minimum –$242.50 Maximum $500.00 Average $337.48 Standard devia�on $189.09 5th percen�le –$47.50 95th percen�le $500.00 P(profit <= 300) 0.360 P(profit > 400) 0.514

Profit =Model!$F$13

1. Input distribution. To generate a random demand, enter the formula

=ROUND(RISKTRIANG(E4,E5,E6),0)

in cell B13 for the random demand. This uses the RISKTRIANG function to generate a demand from the triangular distribution. (As before, our convention is to color random input cells green.) Excel’s ROUND function is used to round demand to the nearest integer. Recall from the discussion in Section 15-3 that Excel has no built-in functions to generate random numbers from a triangular distribution, but this is easy with @RISK.

2. Output cell. When the simulation runs, you want @RISK to keep track of profit. In @RISK’s terminology, you need to designate the Profit cell, F13, as an output cell. To do this, select cell F13 and then click the Add Output button on the @RISK ribbon.

Developing the Walton Model with @RISK

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

798 Chapter 15 Introduction to Simulation Modeling

(See Figure 15.31.) This adds RISKOUTPUT(“label”)+ to the cell’s formula. (Here, “label” is a label that @RISK uses for its reports. In this case it makes sense to use “Profit” as the label.) The formula in cell F13 changes from

=C13+E13-D13

to

=RISKOUTPUT(''Profit'')+C13+E13-D13

The plus sign following RISKOUTPUT is simply @RISK’s way of indicating that you want to keep track of the value in this cell (for reporting reasons) as the simulation progresses. Any number of cells can be designated in this way as output cells. They are typically the “bottom line” values of primary interest. Our convention is to color such cells gray for emphasis.

3. Summary functions (optional). There are several places where you can store @ RISK results. One of these is to use @RISK statistical functions to place results in your model worksheet. @RISK provides several functions for summarizing output values. Some of these are illustrated in the range B16:B23 of Figure 15.32. They con- tain the formulas

=RISKMIN(F13)

=RISKMAX(F13)

=RISKMEAN(F13)

=RISKSTDDEV(F13)

=RISKPERCENTILE(F13,0.05)

=RISKPERCENTILE(F13,0.95)

=RISKTARGET(F13,300)

and

=1-RISKTARGET(F13,400)

The values in these cells are not meaningful until you run the simulation (so do not be alarmed if they contain errors when you open the file). However, once the simulation runs, these formulas capture summary statistics of profit. For example, RISKMEAN calculates the average of the 1000 simulated profits, RISKPERCENTILE finds the value such that the specified percentage of simulated profits are less than or equal to this value, and RISKTARGET finds the percentage of simulated profits less than or equal to the specified value. Although these same summary statistics also appear in other @RISK reports, it is handy to have them in the same worksheet as the model. (You can find a list of all @RISK statistical functions from the Simulation Result group in the Insert Function dropdown list on the @RISK ribbon.)

@RISK Feature: Color Coding One very handy @RISK feature is its optional color coding. This option is in the Utilities group of the @RISK ribbon. It is a toggle. If it is toggled off, you see our blue/red/gray/ green coloring. If it is toggled on, you see @RISK’s color coding: blue for random input cells, red for output cells, green for statistical functions, and yellow for decision cells (for RISKOptimizer models). @RISK even allows you to change the coloring scheme if you prefer.

The RISKOUTPUT function indicates that a cell is an output cell, so that @RISK will keep track of its values throughout the simulation.

These @RISK summary functions allow you to show simulation results on the same sheet as the model. However, they are totally optional.

New Color Coding Feature

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 799

Running the Simulation After you develop the model, the rest is straightforward. The procedure is always the same: (1) specify simulation settings, (2) run the simulation, and (3) examine the results.

1. Simulation settings. You must first choose some simulation settings. To do so, the buttons on the left in the Simulation group (see Figure 15.33) are useful. We typically do the following:

■ Set Iterations to a number such as 1000. (@RISK calls replications “iterations.”) Any number can be used, but because the academic version of @RISK allows only 1000 uninterrupted iterations, we typically choose 1000.

■ Set Simulations to 1. In a later section, we will explain why you might want to request multiple simulations.

■ The “dice” button is a toggle for what appears in your worksheet. If it is colored (Random), all random cells appear random (they change when you press the F9 key). If it is white (Static), only the means appear in random input cells and the F9 key has no effect. We tend to prefer the Random setting, but this setting is irrelevant when you run the simulation.

■ Many more settings are available by clicking the Simulation Settings button to the left of the “dice” button, but the ones we mentioned should suf�ce. In addi- tion, more permanent settings can be chosen from Application Settings in the Utilities dropdown list on the @RISK ribbon. You can experiment with these, but the only one we like to change is the Place Reports In setting in the Reports group. The default is to place reports in a new workbook. If you like the reports to be in the same workbook as your model, you can change this setting to Active Workbook.

@RISK Technical Issues: Latin Hypercube Sampling and Mersenne Twister Generator Two settings you shouldn’t change are the Sampling Type and Generator settings (avail- able from the Simulation Settings button and then the Sampling tab). They should remain at the default Latin Hypercube and Mersenne Twister settings. The Mersenne Twister is one of many algorithms for generating random numbers, and it has been shown to have very good statistical properties. (Not all random number generators do.) Latin Hypercube sampling is a more ef�cient way of sampling than the other option (Monte Carlo) because it produces a more accurate estimate of the output distribution. In fact, we were surprised how accurate it is. In repeated runs of this model, always using different random numbers, we virtually always got a mean pro�t within a few pennies of $337.7.7 50. It turns out that this is the true mean pro�t for this input distribution of demand. Amazingly, simulation estimates it correctly—almost exactly—on virtually every run. However, this means that a con�dence interval for the mean, based on @RISK’s outputs and the usual con�dence interval formula (which assumes Monte Carlo sampling), is much wider (more pessimistic) than it should be. Therefore, we do not even calculate such con�dence inter- vals from here on. However, it is not impossible. The accompanying video explains a

Leave Latin Hyper-cube sampling on. It  produces more accurate results.

Latin Hypercube vs Monte Carlo Sampling

Simulation and Application Settings in @RISK

Figure 15.33 Simulation Group on @RISK Ribbon

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

800 Chapter 15 Introduction to Simulation Modeling

method called Batch Means for calculating con�dence intervals when Latin Hypercube sampling is used.sampling is used.sam

2. Run the simulation. To run the simulation, click the Start Simulation button on the @RISK ribbon. When you do so, @RISK repeatedly generates a random number for each random input cell, recalculates the worksheet, and keeps track of all output cell values. You can watch the progress at the bottom left of the screen. Also, if the Automatically Show Output Graph button (to the right of the dice button) is toggled to colored, you will see a histogram of the currently selected input or output cell being built as the simulation runs. If you find this annoying, you can toggle this button to white.

3. Examine the results. The big questions are (1) which results you want and (2) where you want them. @RISK provides a lot of possibilities, and we mention the most frequently used.

■ You can ask for summary measures in your model worksheet by using the @RISK statistical functions, such as RISKMEAN, discussed earlier.

■ The quickest way to get results is to select an input or output cell (we chose the pro�t cell, F13) and then click the Browse Results button in the Results group of the @RISK ribbon. (See Figure 15.34.) This provides an interactive graph of the selected value, as shown in Figure 15.35. You can move the “sliders” (the two vertical bars) on this graph to see probabilities of various outcomes. Note that the window you see from Browse Results is temporary—it goes away when you click Close. You can make a permanent copy of the chart by clicking the third button from the left (see the bottom of Figure 15.35) and choosing one of the copy options.

For a quick graph of the distribution of an output or input, select the output or input cell and click @RISK’s Browse Results button.

Figure 15.34 Results Group on @RISK Ribbon

Figure 15.35 Interactive Graph of Profit Distribution

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 801

@RISK Tip: Graph Type Once you get an @RISK graph such as the one in Figure 15.35, you can display it in several ways by clicking the fourth button at the bottom of the graph win- dow. In particular, if your graph doesn’t look quite like the ones shown here, try changing from Discrete Probability to Probability Density or vice versa.

@RISK Tip: Percentiles Displayed on Graphs When we displayed the graph in Figure 15.35 the �rst time, it had the right slider on 500 but 0 but 0 showed 5% to the right of it. By default, @RISK puts the sliders at the 5th and 95th percen- tiles, so that 5% is on either side of them. For this example, 500 is indeed the 0 is indeed the 0 95th percentile (why?), but the picture is a bit misleading because there is no chance of a pro�t greater than 500. When we manually moved the right slider away from 500 and back again, it displayed 0 and back again, it displayed 0 as in Figure 15.35, correctly indicating that there is no probability to the right of 500.

@RISK Tip: Saving Graphs and Tables When you run a simulation with @RISK and then save your �le, it asks whether you want to save your graphs and tables. We suggest that you save them. This makes your �le slightly larger, but when you reopen it, the temporary graphs and tables, such as the histogram in Figure 15.35, are still available. Otherwise, you will have to rerun the simulation.

■ You can click the Summary button (again, see Figure 15.34) to see the window in Figure 15.36 with the summary measures for Pro�t. In general, this report shows the summary for all designated inputs and outputs. By default, this Results Summary all designated inputs and outputs. By default, this Results Summary all window shows a mini graph for each output and a number of numerical summary measures. It is also easy to customize. If you right-click anywhere on this table and choose Columns for Table, you can check or uncheck various options. For most of the later screenshots in this book, we elected not to show the Error column, but not to show the Error column, but not instead to show the standard deviation column.

If you want permanent copies of the simulation results, click on @RISK’s Excel Reports buttons and check the reports you want. They will be placed in new worksheets.

Figure 15.36 Summary Table of Profit Output

■ You can click the Excel Reports button (again, see Figure 15.34) to choose from a number of reports that are placed on new worksheets. This is a good option if you want permanent (but non-interactive) copies of reports in your workbook. As an example, Figure 15.37 shows part of the Quick Reports option you can request. It has the same information as the summary report in Figure 15.36, plus more.

© C

e n g

a g

e L

e a rn

in g

For a quick (and customizable) report of the results, click @RISK’s Summary button.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

802 Chapter 15 Introduction to Simulation Modeling

Discussion of the Simulation Results The strength of @RISK is that it keeps track of any outputs you designate and then allows you to show the corresponding results as graphs or tables, in temporary windows or in permanent worksheets. As you have seen, @RISK provides several options for displaying results, and we encourage you to explore the possibilities. However, don’t lose sight of the overall goal: to see how outputs vary as random inputs vary, and to generate reports that tell the story most effectively. For this particular example, the results in Figures 15.32, 15.35, 15.36, and 15.37 allow you to conclude the following:

■ The smallest simulated pro�t (out of 1000) was –$242.50, the largest was $500, the average was $337.48, and the standard deviation of the 1000 pro�ts was $189.09. Of all simulated pro�ts, 5% were –$47.50 or below, 95% were $500 or above, 36% were less than or equal to $300, and 51.4% were larger than $400. (See Figure 15.32. These results are also available from the summary table in Figure 15.36 or the quick report in Figure 15.37.)

■ The pro�t distribution for this particular order quantity is extremely skewed to the left, with a large bar at $500. (See Figure 15.35.) Do you see why? It is because pro�t is exactly $500 if demand is greater than or equal to the order quantity, 200. In other words, the probability that pro�t is $500 equals the probability that demand is at least 200. (This probability is 0.4.) Lower demands result in decreasing pro�ts, which explains the gradual decline in the histogram from right to left.

Figure 15.37 @RISK Quick Report

B 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

C

Profit

Profit

Simula�on Summary Informa�on

Summary Sta�s�cs for Profit Sta�s�cs Minimum Maximum Mean Std Dev Variance Skewness Kurtosis Median Mode Le­ X

Right X

Diff X Diff P #Errors Filter Min Filter Max #Filtered

Right P

Le­ P

Percen�le

Workbook Name Ordering Calendars - @RI: 1 1000 1 1 La�n Hypercube 8/25/2015 11:58 00:00:01 Mersenne Twister 1

Number of Simula�ons

Simula�on Start Time Simula�on Dura�on Random # Generator Random Seed

Number of Itera�ons Number of Inputs Number of Outputs Sampling Type

Minimum −$242.50 $500.00 $337.48 $189.09

1000

Maximum Mean Std Dev Values

−$48

−$ 30

0

$3 00

$4 00

$5 00

$6 00

−$ 20

0

$2 00

−$ 10

0

$1 00$0

$500

5.0% 45%

40%

35%

30%

25%

20%

15%

10%

5% 0%

D E F G H I JE F G H I J

Profit

Profit

Minimum −$242.50

−$243 5% −$48 $43 $103 $163 $208 $253 $290 $328 $373

10% 15% 20% 25% 30% 35% 40% 45%

$410 $455 $500 $500 $500 $500 $500 $500 $500 $500

50% 55% 60% 65% 70% 75% 80% 85% 90% 95%

$500 $337 $189 35754.13508 −0.947766786

−$48 5%

95% $548 90% 0

0

Off Off

$500

2.792008113 $410 $500

$500.00 $337.48 $189.09

1000

Maximum Mean Std Dev Values

−$48

−$ 30

0

$3 00

$4 00

$5 00

$6 00

−$ 20

0

$2 00

−$ 10

0

$1 00$0

$500

5.0% 1.0

0.0

0.2

0.4

0.6

0.8

90.0%

90.0%

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 803

Using RISKSIMTABLE Walton’s ultimate goal is to choose an order quantity that provides a large average profit. You could rerun the simulation model several times, each time with a different order quan- tity in the order quantity cell, and compare the results. However, this has two drawbacks. First, it takes a lot of time and work. The second drawback is more subtle. Each time you run the simulation, you get a different set of random demands. Therefore, one of the order different set of random demands. Therefore, one of the order different quantities could win the contest just by luck. For a fairer comparison, it is better to test each order quantity on the same set of random demands.

The RISKSIMTABLE function in @RISK enables you to obtain a fair comparison quickly and easily. This function is illustrated in Figure 15.38. (See the file Ordering Calendars - RiskSimtable.xlsx.) There are two modifications to the previous model. First, the order quantities to test are listed in row 9. (We chose these as representative order quantities. You could change, or add to, this list.) Second, instead of entering a number in number in number cell B9, you enter the formula

=RISKSIMTABLE(D9:H9)

Note that the list does not need to be entered in the spreadsheet (although it is a good idea to do so). You could instead enter the formula

=RISKSIMTABLE({150,175,200,225,250})

where the list of numbers must be enclosed in curly brackets. In either case, the worksheet displays the first member of the list, 150, and the corresponding calculations for this first order quantity. However, the model is now set up to run the simulation for all order quantiall order quantiall - ties in the list.

The RISKSIMTABLE function allows you to run several simulations at once—one for each value of some variable (often a decision variable).

Figure 15.38 Model with a RISKSIMTABLE Function

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

A BA B C DC D E FE F G HG H I JI J K Simula�on of Walton’s Bookstore using @RISK Range names used:

Order_quan�ty =Model!$B$9 Cost data Demand distribu�on - triangular

Unit_cost =Model!$B$4 Profit =Model!$F$13

Unit cost =Model!$B$5Unit_price

100Minimum$7.50 Unit price $10.00 Most likely

=Model!$B$6Unit_refund 175

Unit refund $2.50 Maximum 300

Decision variable Order quan��es to try Order quan�ty 150 150 175 200 225 250

Simulated quan��es Demand Revenue Cost Refund Profit

178 $1,500 $1,125 $0 $375

Summary measures of profit from @RISK - based on 1000 itera�ons for each simula�on 54321Simula�on

Order quan�ty 150 175 200 225 250 Minimum $22.50 –$102.50 –$227.50 –$352.50 –$477.50 Maximum $375.00 $437.50 $500.00 $562.50 $625.00 Average $354.20 $367.22 $337.51 $270.32 $175.02 Standard devia�on $58.94 $121.81 $189.01 $247.01 $286.95 5th percen�le $202.50 $77.50 –$47.50 –$172.50 –$297.50 95th percen�le $375.00 $437.50 $500.00 $562.50 $625.00

K RK RK RK R

n $

K RK R

To implement this, only one setting needs to be changed. As before, enter 1000 for the number of iterations, but also enter 5 for the number of simulations. @RISK then runs five simulations of 1000 iterations each, one simulation for each order quantity in the list, and it uses the same 1000 random demands for each simulation. This provides a fair comparison.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

804 Chapter 15 Introduction to Simulation Modeling

@RISK Function: RISKSIMTABLE To run several simulations all at once, enter the formula =RISRISRI KSIMTIMTI ABLMTABLMT EABLEABL (InputRange) in any cell. Here, InputRange refers to a list of the values to be simulated, such as various order quantities. Before running the simulation, make sure the number of simulations is set to the number of values in the InputRange list.

You can again get results from the simulation in various ways. Here are some possibilities.

■ You can enter the same @RISK statistical functions in cells in the model work sheet, as shown in rows 18–23 of Figure 15.38. The trick is to realize that each such function has an optional last argument that speci�es the simulation number. For example, the formulas in cells C20 and C22 are

=RISKMEAN($F$13,C16)

and

=RISKPERCENTILE($F$13,0.05,C16)

Remember that the results in these cells are meaningless (or show up as errors) until you run the simulation.

■ You can select the pro�t cell and click the Browse Results button to see a histogram of pro�ts, as shown in Figure 15.39. By default, the histogram shown is for the �rst simulation, where the order quantity is 150. However, if you click the red histogram button with the pound sign, you can select any of the simulations. As an example, Figure 15.40 shows the histogram of pro�ts for simulation 5, where the order quan- tity is 250. (Do you see why these two histograms are so different? When the order quantity is 150, there is a high probability of selling out, so the spike on the right is large. But the probability of selling out with an order quantity of 250 is much lower, so its spike at the right is much less dominant.)

■ You can click the Summary button to get the results from all simulations shown in Figure 15.41. (These results match those in Figure 15.38.)

■ You can click the Excel Reports button to get any of a number of reports on per- manent worksheets. Again, Quick Reports is a good choice. This produces several graphs and summary measures for each simulation, each on a different worksheet. This provides a lot of information with almost no work.

Figure 15.39 Histogram of Profit with Order Quantity 150

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 805

Figure 15.40 Histogram of Profit with Order Quantity 250

Figure 15.41 Summary Report for All Five Simulations

For this particular example, the results in Figures 15.38–15.41 are illuminating. You can see that an order quantity of 175 provides the largest mean profit. However, is this nec- essarily the optimal order quantity? This depends on the company’s attitude toward risk. Certainly, larger order quantities incur more risk (their histograms are more spread out, their 5th and 95th percentiles are more extreme), but they also have more upside potential. On the other hand, a smaller order quantity, while having a somewhat smaller mean, might be preferable because of less variability. It is not an easy choice, but at least the simulation not an easy choice, but at least the simulation not results provide plenty of information for making the decision. ■

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

806 Chapter 15 Introduction to Simulation Modeling

15-5d Some Limitations of @RISK

The academic version of @RISK included with the book has some limitations you should be aware of. (The commercial version of @RISK doesn’t have these limitations. Also, the exact limitations could change as newer academic versions become available.)

■ The simulation model must be contained in a single workbook with at most four worksheets, and each worksheet is limited to 300 rows and 100 columns.

■ The number of @RISK input probability distribution functions, such as RISKNORMAL, is limited to 100.

■ The number of unattended iterations is limited to 1000. You can request more than 1000, but you have to click a button after each 1000 iterations.

■ All @RISK graphs contain a watermark.

■ The Distribution Fitting tool can handle only 250 observations.

The �rst limitation shouldn’t cause problems, at least not for the fairly small models discussed in this book. However, we strongly urge you to close all other workbooks when you are running an @RISK simulation model, especially if they also contain @RISK func- tions. @RISK does a lot of recalculation, both in your active worksheet and in all other worksheets or workbooks that are open. So if you are experiencing extremely slow simula- tions, this is probably the reason.

The second limitation can be a problem, especially in multiperiod problems. For exam- ple,  if you are simulating 52 weeks of a year, and each week requires two random inputs, you are already over the 100-function limit. One way to get around this is to use built-in Excel functions for random inputs rather than @RISK functions whenever possible. For example, if you want to simulate the �ip of a fair coin, the formula =IF(RAND()<0.5,"Heads","Tails") works just as well as the formula =IF(RISKUNIFORM(0, 1)<0.5,"Heads","Tails"), but the former doesn’t count against the 100-function limit.

15-5e @RISK Models with Several Random Input Variables

We conclude this section with another modi�cation of the Walton Bookstore example. To this point, there has been a single random variable, demand. Often there are several random variables, each re�ecting some uncertainty, and you want to include each of these in the simulation model. Example 15.4 illustrates how this can be done, and it also illustrates a very useful feature of @RISK, its sensitivity analysis.

To avoid potential problems, close all other workbooks when running an @RISK model.

E X A M P L E 15.4 ADDITIONAL UNCERTAINTY AT WALTON BOOKSTORE

As in the previous Walton Bookstore example, Walton needs to place an order for next year’s calendar. We continue to assume that the calendars sell for $10 and customer demand for the calendars at this price is triangularly distributed with minimum value, most likely value, and maximum value equal to 100, 175, and 300. However, there are now two other sources of uncertainty. First, the maximum number of calendars Walton’s supplier can supply is uncertain and is modeled with a triangular distribution. Its parameters are 125 (mini- mum), 200 (most likely), and 250 (maximum). Once Walton places an order, the supplier will charge $7.50 per calendar if he can supply the entire Walton order. Otherwise, he will charge if he can supply the entire Walton order. Otherwise, he will charge if only $7.25 per calendar. Second, unsold calendars can no longer be returned to the supplier for a refund. Instead, Walton will put them on sale for $5 apiece after January 1. At that price,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 807

Walton believes the demand for leftover calendars is triangularly distributed with parameters 0, 50, and 75. Any calendars still left over, say, after March 1, will be thrown away. Walton still left over, say, after March 1, will be thrown away. Walton still again wants to use simulation to analyze the resulting profit for various order quantities.

Objective To develop and analyze a simulation model with multiple sources of uncer- tainty using @RISK, and to introduce @RISK’s sensitivity analysis features.

Where Do the Numbers Come From? As in Example 15.3, the monetary values are straightforward, and the parameters of the triangular distributions are probably educated guesses, possibly based on experience with previous calendars.

Solution The variables for this model, including the three sources of uncertainty, are shown in Figure 15.42. (See the file Ordering Calendars - More Uncertainty Big Picture.xlsx.) Using this as a guide, the first step, as always, is to develop the model. Then you can run the simulation with @RISK and examine the results.

The Walton Model with Multiple Uncertain Inputs

© C

e n g

a g

e L

e a rn

in g

Profit

Order Quan�ty

Unit Cost if Less than Full Supply

Unit Cost if Full Supply

Order Cost

Actual Supply

Supplier Capacity

Regular Price Demand

Sale Price Demand

Number Le�over

Revenue from Sale Price Sales

Revenue from Regular Price Sales

Regular Price Sale Price

Figure 15.42 Big Picture for Ordering Model with More Uncertainty

Developing the Simulation Model The completed model is shown in Figure 15.43. (See the file Ordering Calendars - More Uncertainty.xlsx.) The model itself requires a bit more logic than the previous Walton model. It can be developed with the following steps.

1. Random inputs. There are three random inputs in this model: the maximum supply the supplier can provide Walton, the customer demand when the selling price is $10, and the customer demand for sale-price calendars. Generate these in cells B14, E14, and H14 (using the ROUND function to obtain integers) with the formulas

=ROUND(RISKTRIANG(I5,I6,I7),0)

=ROUND(RISKTRIANG (E5,E6,E7),0)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

808 Chapter 15 Introduction to Simulation Modeling

and

=ROUND(RISKTRIANG (F5,F6,F7),0)

Note that the formula in cell H14 generates the random potential demand for potential demand for potential calendars at the sale price, even though there might not be any calendars left to put on sale.

2. Actual supply. The number of calendars supplied to Walton is the smaller of the number ordered and the maximum the supplier is able to supply. Calculate this value in cell C14 with the formula

=MIN(B14,Order_quantity)

3. Order cost. Walton gets the reduced price, $7.25, if the supplier cannot supply the entire order. Otherwise, Walton must pay $7.50 per calendar. Therefore, calculate the total order cost in cell D14 with the formula (using the obvious range names)

=IF(B14>=Order_quantity,Unit_cost_1,Unit_cost_2)*C14

4. Other quantities. The rest of the model is straightforward. Calculate the revenue from regular-price sales in cell F14 with the formula

=Regular_price*MIN(C14,E14)

Calculate the number left over after regular-price sales in cell G14 with the formula

=MAX(C14-E14,0)

Calculate the revenue from sale-price sales in cell I14 with the formula

=Sale_price*MIN(G14,H14)

Finally, calculate profit in cell J14 with the formula

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

A B C Simula�on of Walton’s Bookstore with more uncertainty

Cost data Unit cost 1 Unit cost 2 Regular price Sale price

Demand distribu�on: triangular

Decision variable Order quan�ty

Simulated quan��es

Range names used:Summary measures of profit from @RISK - based on 1000 itera�ons for each simula�on Simula�on Order quan�ty Minimum Maximum Average Standard devia�on 5th percen�le 95th percen�le

1 150

$5.00 $409.75 $361.43

$43.11 $260.00 $375.00

2 175

�$82.50 $478.50 $389.48

$94.37 $167.50 $456.50

3 200

�$195.00 $547.25 $395.41 $148.47

$46.50 $528.00

4 225

�$377.50 $616.00 $395.58 $178.22 -$22.75 $572.00

5 250

�$372.00 $665.50 $398.06 $180.45 -$33.25 $585.75

Order_quan�ty Regular_price Sale_price Unit_cost_1 Unit_cost_2

=Model!$B$10 =Model!$B$6 =Model!$B$7 =Model!$B$4 =Model!$B$5

150150 175 200 225 250

Maximum supply 177

Actual supply 150

Cost $1,125

Demand 139

Revenue $1,390

Le� over 11

Demand 57

Revenue $55

Profit $320

A B D E F G H I J

$7.50 $7.25

$10.00 $5.00

Minimum Most likely Maximum

Order quan��es to try

Minimum Most likely Maximum

Regular price 100 175 300

Supply distribu�on: triangular 125 200 250

Sale price 0

50 75

At regular price At sale price

Figure 15.43 @RISK Simulation Model with Three Random Inputs

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-5 Introduction to @RISK 809

On each iteration, @RISK generates a new set of random inputs and calculates the corresponding output(s).

=F14+I14-D14

Then designate this cell as an @RISK output cell. If you like, you can also designate other cells (the revenue cells, for example) as output cells.

5. Order quantities. As before, enter the following RISKSIMTABLE formula in cell B10 so that Walton can try different order quantities:

=RISKSIMTABLE(D10:H10)

Running the Simulation As usual, the next steps are to specify the simulation settings (we chose 1000 iterations and 5 simulations), and run the simulation. It is important to realize what @RISK does when it runs a simulation when there are several random input cells. In each iteration, @RISK generates a random value for each input variable independently. In this example, it generates a maximum supply in cell B14 from one triangular distribution, it generates a regular-price demand in cell E14 from another triangular distribution, and it generates a sale-price demand in cell H14 from a third triangular distribution. With these input values, it then calculates profit. For each order quantity, it then iterates this procedure 1000 times and keeps track of the corresponding profits.10 it then calculates profit. For each order quantity, it then iterates this procedure

10 it then calculates profit. For each order quantity, it then iterates this procedure

Discussion of the Simulation Results Selected results are listed in Figure 15.43 (at the bottom), and the profit histogram for an order quantity of 200 is shown in Figure 15.44. (The histograms for the other order quanti- ties are similar to what you have seen before, with more skewness to the left and a larger spike to the right as the order quantity decreases.) For this particular order quantity, the results indicate an average profit of $395.41, a 5th percentile of $46.50, a 95th percentile of $528, and a distribution of profits that is again skewed to the left.

10It is also possible to correlate the inputs, as we demonstrate in the next section.

Figure 15.44 Histogram of Simulated Profits for Order Quantity 200

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

810 Chapter 15 Introduction to Simulation Modeling

Figure 15.45 Tornado Graph for Sensitivity Analysis

A tornado graph indicates which of the random inputs have large effects on an output.

© C

e n g

a g

e L

e a rn

in g

Sensitivity Analysis We now demonstrate a feature of @RISK that is particularly useful when there are several random input cells. This feature lets you see which of these inputs has the most effect on an output cell. To perform this analysis, select the profit cell, J14, and click the Browse Results button. You will see a histogram of profit, as we have already discussed, with a number of buttons at the bottom of the window. Click the red button with the pound sign to select a simulation. We chose #3, where the order quantity is 200. Then click the “tor- nado” button (the fifth button from the left) and choose Change in Output Mean. This pro- duces the graph in Figure 15.45. (The Regression and Correlation options produce similar results, and you can choose any of them if you like.)

This figure shows graphically and numerically how each of the random inputs affects profit: the longer the bar, the stronger the relationship between that input and profit. Specifically, each bar shows how the mean profit varies as each input varies over its range (and the other inputs are held constant). In this sense, you can see that the regular-price demand has by far the largest effect on profit. The other two inputs, maximum supply and sale-price demand, have much smaller effects. Identifying important input variables is important for real applications. If a random input has a large effect on an important output, then it is probably worth the time and money to learn more about this input and possibly reduce the amount of uncertainty involving it. ■

P R O B L E M S

Level A 16. If you add several normally distributed random

numbers, the result is normally distributed, where the mean of the sum is the sum of the individual

means, and the variance of the sum is the sum of the individual variances. (Remember that variance is the square of standard deviation.) This is a difficult result to prove mathematically, but it is easy to demonstrate with simulation. To do so, run a

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-6 The Effects of Input Distributions on Results 811

simulation where you add three normally distributed random numbers, each with mean 100 and standard deviation 10. Your single output variable should be the sum of these three numbers. Verify with @RISK that the distribution of this output is approximately normal with mean 300 and variance 300 (hence, standard deviation !3!3! 00! = 17.32).

17. In Problem 11 from the previous section, we stated that the damage amount is normally distributed. Suppose instead that the damage amount is triangu- larly distributed with parameters 500, 1500, and 7000.That is, the damage in an accident can be as low as $500 or as high as $7000, the most likely value is $1500,and there is definite skewness to the right. (It turns out, as you can verify in @RISK, that the mean of this distribution is $3000, the same as in Problem 11.) Use @RISK to simulate the amount you pay for damage. Run 5000 iterations. Then answer the following questions. In each case, explain how the indicated event would occur. a. What is the probability that you pay a positive

amount but less than $750? b. What is the probability that you pay more than

$600? c. What is the probability that you pay exactly $1000

(the deductible)?

18. Continuing the previous problem, assume, as in Problem 11, that the damage amount is normally distributed with mean $3000 and standard deviation $750. Run @RISK with 5000 iterations to simulate the amount you pay for damage. Compare your results with those in the previous problem. Does it appear to matter whether you assume a triangular distribution or a normal distribution for damage amounts? Why isn’t this a totally fair comparison? (Hint: Use @RISK’s Define Distributions tool to find the standard deviation for the triangular distribution.)

19. In Problem 12 of the previous section, suppose that the demand for cars is normally distributed with mean 100 and standard deviation 15. Use @RISK to determine the “best” order quantity—in this case, the one with the largest mean profit. Using the statistics and/or graphs from @RISK, discuss whether this order quan- tity would be considered best by the car dealer. (The point is that a decision maker can use more than just mean profit in making a decision.)

20. Use @RISK to analyze the sweatshirt situation in Problem 14 of the previous section. Do this for the discrete distributions given in the problem. Then do it for normal distributions. For the normal case, assume that the regular demand is normally distributed with mean 9800 and standard deviation 1300 and that the demand at the reduced price is normally distributed with mean 3800 and standard deviation 1400.

Level B 21. Although the normal distribution is a reasonable

input distribution in many situations, it does have two potential drawbacks: (1) it allows negative values, even though they may be extremely improbable, and (2) it is a symmetric distribution. Many situations are modeled better with a distribution that allows only positive values and is skewed to the right. Two of these that have been used in many real applications are the gamma and lognormal distributions. @RISK enables you to generate observations from each of these distributions. The @RISK function for the gamma distribution is RISKGAMMA, and it takes two arguments, as in =RISKGAMMA(3,10). The first argument, which must be positive, determines the shape. The smaller it is, the more skewed the distribution is to the right; the larger it is, the more symmetric the distribution is. The second argument determines the scale, in the sense that the product of it and the first argument equals the mean of the distribution. (The mean in this example is 30.) Also, the product of the second argument and the square root of the first argument is the standard deviation of the distribution. (In this example, it is !3!3!! (10) = 17.32.) The @RISK function for the lognormal distribution is RISKLOGNORM. It has two arguments, as in =RISKLOGNORM(40,10). These arguments are the mean and standard deviation of the distribution. Rework Example 15.2 for the following demand distributions. Do the simulated outputs have any different qualitative properties with these skewed distributions than with the triangular distribution used in the example? a. Gamma distribution with parameters 2 and 85 b. Gamma distribution with parameters 5 and 35 c. Lognormal distribution with mean 170 and

standard deviation 60

15-6 THE EFFECTS OF INPUT DISTRIBUTIONS ON RESULTS In Section 15-2, we discussed input distributions. The randomness in input variables causes the variability in the output variables. We now brie�y explore whether the choice of input distribution(s) makes much difference in the distribution of an output variable such as

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

812 Chapter 15 Introduction to Simulation Modeling

For a fair comparison of alternative input distributions, the distributions should have (at least approximately) equal means and standard deviations.

E X A M P L E 15.5 EFFECT OF DEMAND DISTRIBUTION AT WALTON BOOKSTORE

We continue to explore the demand for calendars at Walton Bookstore. We keep the same unit cost, unit price, and unit refund for leftovers as in Example 15.3. However, in that example we assumed a triangular distribution for demand with parameters 100, 175, and 300. Assuming that Walton orders 200 calendars, is the distribution of profit affected if a normal distribution of demand is used instead?normal distribution of demand is used instead?normal

Objective To see whether a triangular distribution with some skewness gives the same profit distribution as a normal distribution for demand.

Where Do the Numbers Come From? The numbers here are the same as in Example 15.3. However, as discussed next, the param- eters of the normal distribution are chosen to provide a fair comparison with the triangular distribution used earlier.

Solution It is important in this type of analysis to make a fair comparison. When you select a normal distribution for demand, you must choose a mean and standard deviation for this distribution. Which values should you choose? It seems only fair to choose the same mean and standard deviation that the triangular distribution has. To find the mean and standard deviation for a triangular distribution with given minimum, most likely, and maximum values, you can take advantage of @RISK’s Define Distributions tool. Select any blank cell, click the Define Distributions button, select the triangular distribution, and enter the parameters 100, 175, and 300. You will see that the mean and standard deviation are 191.67 and 41.248, respectively. Therefore, for a fair comparison you should use a normal

pro�t. This is an important question. If the choice of input distributions doesn’t matter much, then you do not need to agonize over this choice. However, if it does make a differ- ence, then you have to be more careful about choosing an appropriate input distribution for any particular situation. Unfortunately, it is impossible to answer the question de�ni- tively. The best we can say in general is, “It depends.” Some models are more sensitive to changes in the shape or parameters of input distributions than others. Still, the issue is worth exploring.

We discuss two types of sensitivity analysis in this section. First, we check whether the shape of the input distribution matters. In the Walton Bookstore example, we assumed a triangularly distributed demand with some skewness. Are the results basically the same if a symmetric distribution such as the normal distribution is used instead? Second, we check whether the independence of input variables that have been assumed implicitly to this point is crucial to the output results. Many random quanti- ties in real situations are not independent; they are positively or negatively correlated. not independent; they are positively or negatively correlated. not Fortunately, @RISK enables you to build correlation into a model. We analyze the effect of this correlation.

15-6a Effect of the Shape of the Input Distribution(s)

We �rst explore the effect of the shape of the input distribution(s). As Example 15.5 indicates, if parameters that allow for a fair comparison are used, the shape can have a relatively minor effect.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-6 The Effects of Input Distributions on Results 813

Look for ways to use the RISKSIMTABLE function. It can really improve efficiency because it runs several simulations at once.

distribution with mean 191.67 and standard deviation 41.248. In fact, @RISK allows you to see a comparison of these two distributions, as in Figure 15.46. To get this chart, click the Add Overlay button, select the normal distribution from the gallery, and enter 191.67 and 41.248 as its mean and standard deviation.

Developing the Simulation Model The logic in this model is almost exactly the same as before. (See Figure 15.47 and the file Ordering Calendars - Different Demand Distributions.xlsx.) However, a clever use of the RISKSIMTABLE function allows you to run two simulations at once, one for the triangular distribution and one for the corresponding normal distribution. The following two steps are required.

1. RISKSIMTABLE function. It is useful to index the two distributions as 1 and 2. To indicate that you want to run the simulation with both of them, enter the formula

=RISKSIMTABLE({1,2})

in cell B11. Note that when you enter actual numbers in this function, rather than cell references, you must put curly brackets around the list.

2. Demand. When the value in cell B11 is 1, the demand distribution is triangular. When it is 2, the distribution is normal. Therefore, enter the formula

=ROUND(IF(B11=1,RISKTRIANG(E4,E5,E6),RISKNORMAL(H4,H5)),0) in cell B15. The effect is that the first simulation will use the triangular distribution, and the second will use the normal distribution.

Running the Simulation The only @RISK setting to change is the number of simulations. It should now be set to 2, the number of values in the RISKSIMTABLE formula. Other than this, you run the simulation exactly as before.

The Walton Model with Alternative Input Distributions

Figure 15.46 Triangular and Normal Distributions for Demand

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

814 Chapter 15 Introduction to Simulation Modeling

Discussion of the Simulation Results The comparison is shown numerically in Figure 15.48 and graphically in Figure 15.49. As you can see, there is more chance of really low profits when the demand distribution is normal, but each simulation results in the same maximum profit. Both of these state- ments make sense. The normal distribution, being unbounded on the left, allows for very low demands, and these occasional low demands result in very low profits. On the other side, Walton’s maximum profit is $500 regardless of the input distribution (provided that it allows demands greater than the order quantity). This occurs when Walton’s sells all it orders, in which case excess demand has no effect on profit. Note that the mean profits for the two distributions differ by only about $5.

Figure 15.47 @RISK Model for Comparing Two Input Distributions

Simula�on of Walton’s Bookstore using @RISK - two possible demand distribu�ons

Range names used: Order_quan�ty =Model!$B$9 Profit =Model!$F$15

Cost data Demand distribu�on 1 - triangular Demand distribu�on 2 - normal

Unit_cost =Model!$B$4

Unit cost Mean100$7.50

=Model!$B$5Unit_price

191.67 Unit price $10.00

=Model!$B$6Unit_refund

41.248Stdev175 Unit refund 300$2.50

Decision variable Order quan�ty 200

Demand distribu�on to use 1 Formula is = RiskSimtable({1,2})

Simulated quan��es Demand Revenue Cost Refund Profit

209 $2,000 $1,500 $0 $500

Summary measures of profit from @RISK - based on 1000 itera�ons for each simula�on 21Simula�on

Minimum –$235.00 –$632.50 $500.00$500.00Maximum $342.79$337.51

Distribu�on Triangular Normal

$189.06 $201.88 –$47.50 –$70.00

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24

A BA B C DC D E FE F G HG H I

Average Standard devia�on 5th percen�le

Minimum Most likely Maximum

Figure 15.48 Summary Results for Comparison Model

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

It is probably safe to conclude that the profit distribution in this model is not greatly affected by the choice of demand distribution, at least not when (1) the candidate input distributions have the same mean and standard deviation, and (2) their shapes are not too dissimilar. We would venture to guess that this general conclusion about insensitivity

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-6 The Effects of Input Distributions on Results 815

of output distributions to shapes of input distributions can be made in many simulation models. However, it is always worth checking, as we have done here, especially when there is a lot of money at stake. ■

Figure 15.49 Graphical Results for Comparison Model

Shape of the Output Distribution Predicting the shape of the output distribution from the shape(s) of the input distribution(s) is difficult. For example, normally distributed inputs don’t nec- essarily produce normally distributed outputs. It is also difficult to predict how sensitive the shape of the output distribution is to the shape(s) of the input

distribution(s). For example, normally and triangularly distributed inputs (with the same means and standard deviations) are likely to lead to similar output distri- butions, but there could be differences, say, in the tails of the output distributions. In any case, you should examine the entire output distribution carefully, not just a few of its summary measures.

F u n da m e n ta l I n s i g h t

15-6b Effect of Correlated Input Variables

Until now, all of the random numbers generated with @RISK functions have been proba- bilistically independent. This means, for example, that if a random value in one cell is much larger than its mean, the random values in other cells are completely unaffected. They are no more likely to be abnormally large or small than if the �rst value had been average or below average. Sometimes, however, independence is unrealistic. In such cases, correlated inputs are more appropriate. If they are positively correlated, then large num- bers will tend to go with large numbers, and small with small. If they are negatively cor- related, then large will tend to go with small and small with large. As an example, you might expect daily stock price changes for two companies in the same industry to be positively correlated. If the price of one oil company increases, you might expect the price of another oil company to increase as well. You can create correlated inputs in @RISK with the RISKCORRMAT function, as we illustrate in the following continuation of the Walton example.

Input variables in real-world problems are often correlated, which makes the material in this section particularly important.

E X A M P L E 15.6 CORRELATED DEMANDS FOR TWO CALENDARS AT WALTON BOOKSTORE

Suppose that Walton Bookstore must order two different calendars. To simplify the example, we assume that the calendars each have the same unit cost, unit selling price, and unit refund value as in previous examples. Also, we assume that each has a triangularly distributed demand with parameters 100, 175, and 300. However, we now assume they are

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

816 Chapter 15 Introduction to Simulation Modeling

“substitute” products, so that their demands are negatively correlated. This simply means that if a customer buys one, the customer is not likely to buy the other. Specifically, we assume a correlation of −0.9 between the two demands. How do these correlated inputs affect the distribution of profit, as compared to the situation where the demands are uncor- related (correlation 0) or very positively correlated (correlation 0.9)?

Objective To see how @RISK enables us to simulate correlated demands, and to see the effect of correlated demands on profit.

Where Do the Numbers Come From? The only new input here is the correlation. It is probably negative because the calendars are substitute products, but it is a difficult number to estimate accurately. This is a good candidate for a sensitivity analysis.

Solution The key to building in correlation is @RISK’s RISKCORRMAT (correlation matrix) func- tion. To use this function, you must include a correlation matrix in the model, as shown in the range J5:K6 of Figure 15.50. (See the file Ordering Calendars - Correlated Demands .xlsx.) A correlation matrix must always have 1’s along its diagonal (because a variable is always perfectly correlated with itself) and the correlations between variables elsewhere. Also, the matrix must be symmetric, so that the correlations above the diagonal are a mir- ror image of those below it. (You can enforce this by entering the formula =J6 in cell K5. Alternatively, @RISK allows you to enter the correlations only below the diagonal, or only above the diagonal, and it then infers the mirror images.)

Figure 15.50 Simulation Model with Correlated Demands

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26

KJIHGFEDCBA Simula�on of Walton’s Bookstore using @RISK - correlated demands

Cost data - same for each product Demand distribu�on for each product- triangular Correla�on matrix between demands Unit cost Product 1100Minimum$7.50 Product 2 Unit price Most likely$10.00 Product 1175 1 –0.9 Unit refund Product 2300Maximum$2.50 –0.9 19 1

Decision variables Possible correla�ons to try Order quan�ty 1 200 –0.9 0 00 0.9 Order quan�ty 2 200

Range names used: Simulated quan��es Order_quan�ty_1

Order_quan�ty_2 =Model!$B$9 =Model!$B$10

Profit =Model!$F$16 ProfitRefundCostRevenueDemand

Product 1 =Model!$B$4Unit_cost

$20$160$1,500$1,360136 Product 2

=Model!$B$5Unit_price $328$58$1,500$1,770177

=Model!$B$6Unit_refund $348$218$3,000$3,130313Totals

Summary measures of profit from @RISK - based on 1000 itera�ons Simula�on 1 21 2 3 Correla�on –0.9 09 0 0.9

$250.00Minimum –$282.50 –$425.00 $1,000.00$1,000.00$1,000.00Maximum

$675.03$675.03$675.03Average Standard devia�on $159.27 $264.41 $365.90 5th percen�le $392.50 $167.50 –$42.50 95th percen�le $917.50 $1,000.00 $1,000.00

Note RISKSIMTABLE func�on in cell J6.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-6 The Effects of Input Distributions on Results 817

To enter random values in any cells that are correlated, you start with a typical @RISK formula, such as

=RISKTRIANG(E4,E5,E6)

Then you add an extra argument, the RISKCORRMAT function, as follows:

=RISKTRIANG(E4,E5,E6,RISKCORRMAT(J5:K6,1))

The first argument of the RISKCORRMAT function is the correlation matrix range. The second is an index of the variable. In this example, the first calendar demand has index 1 and the second has index 2.

@RISK Function: RISKCORRMAT This function enables you to correlate two or more input variables. The function has the form RISKCORRMAT(CorrMat,Index)RISKCORRMAT(CorrMat,Index)RISKCORRMAT(CorrMat,Index , where CorrMat is a matrix of correlations and Index CorrMat is a matrix of correlations and Index CorrMat is a matrix of correlations and is an index of the variable being correlated to others. For example, if there are three correlated variables, Index is 1 for the first variable, 2 is for the second, and 3 is for the third. The RISKCORRMAT function is not entered by itself. Rather, it is entered as the last argument of a random @RISK function, such as =RISRISRI KTRIKTRIKT ANRIANRI GANGAN (1(1( 0,0,0 15,5,5 30,0,0 RISRISRI KCORRMAT(Corrrrr MarMar t,t,t 2)).

Developing the Simulation Model Armed with this knowledge, the simulation model in Figure 15.50 is straightforward and can be developed as follows.

1. Inputs. Enter the inputs in the blue ranges in columns B and E.

2. Correlation matrix. For the correlation matrix in the range J5:H6, enter 1’s on the diagonal, and enter the formula

=J6

in cell K5 (or leave cell K5 blank). Then enter the formula

=RISKSIMTABLE(I9:K9)

in cell J6. This allows you to simultaneously simulate negatively correlated demands, uncorrelated demands, and positively correlated demands.

3. Order quantities. Assume for now that the company orders the same number of each calendar, 200, so enter this value in cells B9 and B10. However, the simulation is set up so that you can experiment with any order quantities in these cells, includ- ing unequal values.

4. Correlated demands. Generate correlated demands by entering the formula

=ROUND(RISKTRIANG(E4,E5,E6,RISKCORRMAT(J5:K6,1)),0)

in cell B14 for demand 1 and the formula

=ROUND(RISKTRIANG(E4,E5,E6,RISKCORRMAT(J5:K6,2)),0)

in cell B15 for demand 2. The only difference between these is the index of the vari- able being generated. The first has index 1; the second has index 2.

5. Other formulas. The other formulas in rows 14 and 15 are identical to ones developed in previous examples, so they aren’t presented again here. The quantities in row 16 are simply sums of rows 14 and 15. Also, the only @RISK output we designated is the total profit in cell F16, but you can designate others as output cells if you like.

The RISKCORRMAT function is “tacked on” as an extra argument to a typical random @RISK function.

The Walton Model with Correlated Demands

Correlations in @RISK Models

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

818 Chapter 15 Introduction to Simulation Modeling

Running the Simulation You should set up and run @RISK exactly as before. For this example, set the number of iterations to 1000 and the number of simulations to 3 (because three different correlations are being tested).

Discussion of the Simulation Results Selected numerical and graphical results are shown in Figures 15.51 and 15.52. You will probably be surprised to see that the mean total profit is the same, regardless of the cor- relation. This is no coincidence. In each of the three simulations, @RISK uses the same random numbers but “shuffles” them in different orders to get the correct correlations. This means that averages are unaffected. (The idea is that the average of the numbers 30, 26, and 48 is the same as the average of the numbers 48, 30, and 26.)

Figure 15.52 Graphical Results for Correlated Model

Figure 15.51 Summary Results for Correlated Model

However, the correlation has a definite effect on the distribution of total profit. You can see this in Figure 15.51, for example, where the standard deviation of total profit increases as the correlation goes from negative to zero to positive. This same increase in variability is apparent in the histograms in Figure 15.52. Do you see intuitively why this increase in variability occurs? It is basically the “Don’t put all of your eggs in one basket” effect. When the correlation is negative, high demands for one product tend to cancel low

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-6 The Effects of Input Distributions on Results 819

With the RISKCORRMAT function, you can correlate random numbers from any distributions.

demands for the other product, so extremes in profit are rare. However, when the correla- tion is positive, high demands for the two products tend to go together, as do low demands. These make extreme profits on either end much more likely.

This same phenomenon would occur if you simulated an investment portfolio con- taining two stocks. When the stocks are positively correlated, the portfolio is much riskier (more variability) than when they are negatively correlated. Of course, this is the reason for diversifying a portfolio.

Modeling Issues We illustrated the RISKCORRMAT function for triangularly distributed values. However, it can be used with any of @RISK’s distributions by tacking on RISKCORRMAT as a last argument. You can even mix them. For example, assuming CMat is the range name for a 2 × 2 correlation matrix, you could enter the formulas

=RISKNORMAL(10,2,RISKCORRMAT(CMat,1))

and

=RISKUNIFORM(100,200,RISKCORRMAT(CMat,2))

into any two cells. When you run the simulation, @RISK generates a sequence of normally distributed random numbers based on the first formula and another sequence of uniformly distributed random numbers based on the second formula. Then it shuffles them in some complex way until their correlation is approximately equal to the specified correlation in the correlation matrix. ■

Correlated Inputs When you enter random inputs in an @RISK simula- tion model and then run the simulation, each iteration generates independent values for the random inputs. independent values for the random inputs. independent If you know or suspect that some of the inputs are

positively or negatively correlated, you should build this correlation structure into the model explicitly with the RISKCORRMAT function. This function might not change the mean of an output, but it can definitely affect the variability and shape of the output distribution.

F u n da m e n ta l I n s i g h t

P R O B L E M S

Level A 22. Fizzy Company produces six-packs of soda cans. Each

can is supposed to contain at least 12 ounces of soda. If the total weight in a six-pack is less than 72 ounces, Fizzy is fined $100 and receives no sales revenue for the six-pack. Each six-pack sells for $3.00. It costs Fizzy $0.02 per ounce of soda put in the cans. Fizzy can control the mean fill rate of its soda-filling machines. The amount put in each can by a machine is normally distributed with standard deviation 0.10 ounce. a. Assume that the weight of each can in a six-pack

has a 0.8 correlation with the weight of the other cans in the six-pack. What mean fill quantity maximizes expected profit per six-pack? Try mean fill rates from 12.00 to 12.35 in increments of 0.05.

b. If the weights of the cans in the six-pack are probabilistically independent, what mean fill quantity maximizes expected profit per six-pack? Try the same mean fill rates as in part a.

c. How can you explain the difference in the answers to parts a and b?

23. When you use @RISK’s correlation feature to generate correlated random numbers, how can you verify that they are correlated? Try the following. Use the RISKCORRMAT function to generate two normally distributed random numbers, each with mean 100 and standard deviation 10, and with correlation 0.7. To run a simulation, you need an output variable, so sum these two numbers and designate the sum as an output variable. Now run @RISK with 500 itera- tions. Click @RISK’s Excel Reports button and check

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

820 Chapter 15 Introduction to Simulation Modeling

the Simulation Data option to see the actual simulated data. a. Use Excel’s CORREL function to calculate the

correlation between the two input variables. It should be close to 0.7. Then create a scatterplot of these two input variables. The plot should indicate a definite positive relationship.

b. Are the two input variables correlated with the output? Use Excel’s CORREL function to find out. Interpret your results intuitively.

24. Work the previous problem, but make the correlation between the two inputs equal to −0.7. Explain how the results change.

25. Work Problem 23, but now make the second input variable triangularly distributed with parameters 50, 100, and 500. This time, verify not only that the correlation between the two inputs is approximately 0.7, but also that the shapes of the two input distributions are approximately what they should be: normal for the first and triangular for the second. Do this by creating histograms in Excel. The point is that you can use @RISK’s RISKCORRMAT function to correlate random numbers from different distributions.

26. Suppose you are going to invest equal amounts in three stocks. The annual return from each stock is normally distributed with mean 0.01 (1%) and standard deviation 0.06. The annual return on your portfolio, the output variable of interest, is the average of the three stock returns. Run @RISK, using 1000 iterations, on each of the following scenarios. a. The three stock returns are highly correlated. The

correlation between each pair is 0.9. b. The three stock returns are practically independent.

The correlation between each pair is 0.1. c. The first two stocks are moderately correlated. The

correlation between their returns is 0.4. The third stock’s return is negatively correlated with the other two. The correlation between its return and each of the first two is −0.8.

d. Compare the portfolio distributions from @RISK for these three scenarios. What do you conclude?

e. You might think of a fourth scenario, where the correlation between each pair of returns is a pair of returns is a pair large negative number such as −0.8. But explain intuitively why this makes no sense. Try to run the

simulation with these negative correlations and see what happens.

27. The effect of the shapes of input distributions on the distribution of an output can depend on the output function. For this problem, assume there are 10 input variables. The goal is to compare the case where these 10 inputs each have a normal distribution with mean 1000 and standard deviation 250 to the case where they each have a triangular distribution with parameters 600, 700, and 1700. (You can check with @RISK’s Define Distributions window that even though this triangular distribution is very skewed, it has the same mean and approximately the same stand- ard deviation as the normal distribution.) For each of the following outputs, run two @RISK simulations, one with the normally distributed inputs and one with the triangularly distributed inputs, and comment on the differences between the resulting output distributions. For each simulation run 1000 iterations. a. Let the output be the average of the inputs. b. Let the output be the maximum of the inputs. c. Calculate the average of the inputs. Then the output

is the minimum of the inputs if this average is less than 1000; otherwise, the output is the maximum of the inputs.

Level B 28. The Business School at State University currently

has three parking lots, each containing 155 spaces. Two hundred faculty members have been assigned to each lot. On a peak day, an average of 70% of all lot 1 parking sticker holders show up, an average of 72% of all lot 2 parking sticker holders show up, and an average of 74% of all lot 3 parking sticker holders show up. a. Given the current situation, estimate the probability

that on a peak day, at least one faculty member with a sticker will be unable to find a spot. Assume that the number who show up at each lot is independent of the number who show up at the other two lots. Compare two situations: (1) each person can park only in the lot assigned to him or her, and (2) each person can park in any of the lots (pooling). (Hint: Use the RISKBINOMIAL function.)

b. Now suppose the numbers of people who show up at the three lots are highly correlated (correlation 0.9). How are the results different from those in part a?

15-7 CONCLUSION Simulation has traditionally not received the attention it deserves in management science courses (or in business). The primary reason for this has been the lack of easy-to-use simulation software. Now, with Excel’s built-in simulation capabilities, plus powerful and affordable add-ins such as @RISK, simulation is receiving its rightful emphasis. The world

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-7 Conclusion 821

is full of uncertainty, which is what makes simulation so valuable. Simulation models provide important insights that are missing in models that do not incorporate uncertainty explicitly. In addition, simulation models are relatively easy to understand and develop. In this chapter we have illustrated the basic ideas of simulation, how to perform simulation with Excel built-in tools, and how @RISK greatly enhances Excel’s basic capabilities. In the next chapter we will build on this knowledge to develop and analyze simulation models in a variety of business areas.

Summary of Key Terms

Term Explanation Excel Page

Simulation model Model with random inputs that affect one or more outputs, where the randomness is modeled explicitly

760

F9 key The “recalc” key, used to make a spreadsheet recalculate

762

Probability distributions for input variables

Specification of the possible values and their proba- bilities for random input variables; these distributions must be specified in any simulation model

762

Uniform distribution The flat distribution, where all values in a bounded continuum are equally likely

766

RAND function Excel’s built-in random number generator; generates uniformly distributed random numbers between 0 and 1

=RAND() 767

RANDBETWEEN function Excel’s built-in function for generating equally likely random integers over an indicated range

=RANDBETWEEN (min,max)

768

Freeze random numbers Change “volatile” random numbers into “fixed” numbers

Copy range, paste it onto itself with the Paste Values option

770

@RISK random functions A set of functions, including RISKNORMAL and RISKTRIANG, for generating random numbers from various distributions

=RISKNORMAL (mean,stdev) or =RISKTRIANG (min,mostlikely,max), for example

771

Discrete distribution A general distribution where a discrete number of possible values and their probabilities are specified

772

Triangular distribution Literally a triangle-shaped distribution, specified by a minimum value, a most likely value, and a maximum value

775

Replicating with Excel tools only

Useful when an add-in such as @RISK is not available

Develop simulation model, use a data table with any blank column input cell to replicate one or more outputs

791

@RISK A powerful simulation add-in developed by Palisade

@RISK ribbonK ribbonK 794

RISKSIMTABLE function Used to run an @RISK simulation model for several values of some variable, often a decision variable

=RISKSIMTABLE (list)

795

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

822 Chapter 15 Introduction to Simulation Modeling

Term Explanation Excel Page

RISKOUTPUT function Used to indicate that a cell contains an output that will be tracked by @RISK

=RISKOUTPUT (“Profit”) +Revenue- Cost, for example

798

Latin Hypercube sampling An efficient way of simulating random numbers for a simulation model, where the results are more accurate than with other sampling methods

799

RISKCORRMAT function Used to correlate two or more random input variables

=RISKNORMAL (100,10, RISKCORRMAT (CorrMat, 2)), for example

815

Correlated inputs Random quantities, such as returns from stocks in the same industry, that tend to go together (or possibly go in opposite directions from one another)

815

P R O B L E M S

Conceptual Questions C.1. You are making several runs of a simulation model,

each with a different value of some decision variable (such as the order quantity in the Walton calendar model), to see which decision value achieves the largest mean profit. Is it possible that one value beats another simply by random luck? What can you do to minimize the chance of a “better” value losing out to a “poorer” value?

C.2. If you want to replicate the results of a simulation model with Excel functions only, not @RISK, you can build a data table and let the column input cell be any blank cell. Explain why this works.

C.3. Suppose you simulate a gambling situation where you place many bets. On each bet, the distribution of your net winnings (loss if negative) is highly skewed to the left because there are some possibilities of really large losses but not much upside potential. Your only simulation output is the average of the results of all the bets. If you run @RISK with many iterations and look at the resulting histogram of this output, what will it look like? Why?

C.4. You plan to simulate a portfolio of investments over a multiyear period, so for each investment (which could be a particular stock or bond, for example), you need to simulate the change in its value for each of the years. How would you simulate these changes in a realistic way? Would you base it on historical data? What about correlations? Do you think the changes for different investments in a particular year would

be correlated? Do you think changes for a particular investment in different years would be correlated? Do you think correlations would play a significant role in your simulation in terms of realism?

C.5. Big Hit Video must determine how many copies of a new video to purchase. Assume that the company’s goal is to purchase a number of copies that maxi- mizes its expected profit from the video during the next year. Describe how you would use simulation to shed light on this problem. Assume that each time a video is rented, it is rented for one day.

C.6. Many people who are involved in a small auto acci- dent do not file a claim because they are afraid their insurance premiums will be raised. Suppose that City Farm Insurance has three rates. If you file a claim, you are moved to the next higher rate. How might you use simulation to determine whether a particular claim should be filed?

C.7. A building contains 1000 lightbulbs. Each bulb lasts at most five months. The company maintaining the building is trying to decide whether it is worthwhile to practice a “group replacement” policy. Under a group replacement policy, all bulbs are replaced every T months (where T months (where T T is to be determined). Also, bulbs are replaced when they burn out. Assume that it costs $0.05 to replace each bulb during a group replacement and $0.20 to replace each burned-out bulb if it is replaced individually. How would you use simulation to determine whether a group replacement policy is worthwhile?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-7 Conclusion 823

C.8. Why is the RISKCORRMAT function necessary? How does @RISK generate random inputs by default, that is, when RISKCORRMAT is not used?

C.9. Consider the claim that normally distributed inputs in a simulation model are bound to lead to normally distributed outputs. Do you agree or disagree with this claim? Defend your answer.

C.10. It is very possible that when you use a correlation matrix as input to the RISKCORRMAT function in an @RISK model, the program will inform you that this is an invalid correlation matrix. Provide an example of an obviously invalid correlation matrix involving at least three variables, and explain why it is invalid.

C.11. When you use a RISKSIMTABLE function for a decision variable, such as the order quantity in the Walton model, explain how this provides a “fair” comparison across the different values tested.

C.12. Consider a situation where there is a cost that is either incurred or not. It is incurred only if the value of some random input is less than a specified cutoff value. Why might a simulation of this situation give a very different average value of the cost incurred than a deterministic model that treats the random input as fixed at its mean? What does this have to do with the fixed at its mean? What does this have to do with the fixed “flaw of averages”?

Level A 29. Six months before its annual convention, the American

Medical Association must determine how many rooms to reserve. At this time, the AMA can reserve rooms at a cost of $150 per room. The AMA believes the number of doctors attending the convention will be normally distributed with a mean of 5000 and a standard deviation of 1000. If the number of people attending the convention exceeds the number of rooms reserved, extra rooms must be reserved at a cost of $250 per room. a. Use simulation with @RISK to determine the

number of rooms that should be reserved to minimize the expected cost to the AMA. Try possible values from 4100 to 4900 in increments of 100.

b. Redo part a for the case where the number attending has a triangular distribution with minimum value 2000, maximum value 7000, and most likely value 5000. Does this change the substantive results from part a?

30. You have made it to the final round of the show Let’s Make a Deal. You know that there is a $1 million prize behind either door 1, door 2, or door 3. It is equally likely that the prize is behind any of the three doors. The two doors without a prize have nothing behind them. You randomly choose door 2. Before you see

whether the prize is behind door 2, host Monty Hall opens a door that has no prize behind it. Specifically, suppose that before door 2 is opened, Monty reveals that there is no prize behind door 3. You now have the opportunity to switch and choose door 1. Should you switch? Simulate this situation 1000 times. For each replication use an @RISK function to generate the door that leads to the prize. Then use another @RISK function to generate the door that Monty will open. Assume that Monty plays as follows: Monty knows where the prize is and will open an empty door, but he cannot open door 2. If the prize is really behind door 2, Monty is equally likely to open door 1 or door 3. If the prize is really behind door 1, Monty must open door 3. If the prize is really behind door 3, Monty must open door 1.

31. A new edition of a very popular textbook will be published a year from now. The publisher currently has 2000 copies on hand and is deciding whether to do another printing before the new edition comes out. The publisher estimates that demand for the book during the next year is governed by the probability distribution in the file P15_31.xlsx. A production run incurs a fixed cost of $10,000 plus a variable cost of $15 per book printed. Books are sold for $130 per book. Any demand that cannot be met incurs a penalty cost of $20 per book, due to loss of goodwill. Up to 500 of any leftover books can be sold to Barnes & Noble for $35 per book. The publisher is interested in maximizing expected profit. The following print- run sizes are under consideration: 0 (no production run) to 16,000 in increments of 2000. What decision would you recommend? Use simulation with 1000 replications. For your optimal decision, the publisher can be 90% certain that the actual profit associated with remaining sales of the current edition will be between what two values?

32. A hardware company sells a lot of low-cost, high- volume products. For one such product, it is equally likely that annual unit sales will be low or high. If sales are low (60,000), the company can sell the product for $10 per unit. If sales are high (100,000), a competitor will enter and the company will be able to sell the product for only $8 per unit. The variable cost per unit has a 25% chance of being $6, a 50% chance of being $7.50, and a 25% chance of being $9. Annual fixed costs are $30,000. a. Use simulation to estimate the company’s expected

annual profit. b. Find a 95% interval for the company’s annual

profit, that is, an interval such that about 95% of the actual profits are inside it.

c. Now suppose that annual unit sales, variable cost, and unit price are equal to their respective expected values—that is, there is no uncertainty. expected values—that is, there is no uncertainty. expected

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

824 Chapter 15 Introduction to Simulation Modeling

Determine the company’s annual profit for this scenario.

d. Can you conclude from the results in parts a and c that the expected profit from a simulation is equal to the profit from the scenario where each input assumes its expected value? Explain.

33. W. L. Brown, a direct marketer of women’s clothing, must determine how many telephone operators to schedule during each part of the day. W. L. Brown estimates that the number of phone calls received each hour of a typical eight-hour shift can be described by the probability distribution in the file P15_33.xlsx. Each operator can handle 15 calls per hour and costs the company $20 per hour. Each phone call that is not handled is assumed to cost the company $6 in lost profit. Considering the options of employing 6, 8, 10, 12, 14, or 16 operators, use simulation to determine the number of operators that minimizes the expected hourly cost (labor costs plus lost profits).

34. Assume that all of a company’s job applicants must take a test, and that the scores on this test are normally distributed. The selection ratio is the cutoff point used by the company in its hiring process. For example, a selection ratio of 20% means that the company will accept applicants for jobs who rank in the top 20% of all applicants. If the company chooses a selection ratio of 20%, the average test score of those selected will be 1.40 standard deviations above average. Use simulation to verify this fact, proceeding as follows. a. Show that if the company wants to accept only

the top 20% of all applicants, it should accept applicants whose test scores are at least 0.842 standard deviation above average. (No simulation is required here. Just use the appropriate Excel normal function.)

b. Now generate 1000 test scores from a normal distribution with mean 0 and standard deviation 1. The average test score of those selected is the average of the scores that are at least 0.842. To determine this, use Excel’s DAVERAGE function. To do so, put the heading Score in cell A3, generate the 1000 test scores in the range A4:A1003, and name the range A3:A1003 Data. In cells C3 and C4, enter the labels Score and >0.842. (The range C3:C4 is called the criterion range.) Then calculate the average of all applicants who will be hired by entering the formula =DAVERAGE(Data, "Score", C3:C4) in any cell. This average should be close to the theoretical average, 1.40. This formula works as follows. Excel finds all observations in the Data range that satisfy the criterion described in the range C3:C4 (Score>0.842). Then it averages the values in the Score column (the second argument of DAVERAGE) corresponding to these entries.

See online help for more about Excel’s database “D” functions.

c. What information would the company need to determine an optimal selection ratio? How could it determine the optimal selection ratio?

35. Lemington’s is trying to determine how many Jean Hudson dresses to order for the spring season. Demand for the dresses is assumed to follow a normal distribution with mean 400 and standard deviation 100. The contract between Jean Hudson and Lemington’s works as follows. At the beginning of the season, Lemington’s reserves x units of capacity. x units of capacity. x Lemington’s must take delivery for at least 0.8x dresses and can, if desired, take delivery on up to x dresses. Each dress sells for $160 and Hudson charges $50 per dress. If Lemington’s does not take delivery on all x dresses, it owes Hudson a $5 penalty for each unit of reserved capacity that is unused. For example, if Lemington’s orders 450 dresses and demand is for 400 dresses, Lemington’s will receive 400 dresses and owe Jean 400($50) + 50($5). How many units of capacity should Lemington’s reserve to maximize its expected profit?

36. Dilbert’s Department Store is trying to determine how many Hanson T-shirts to order. Currently the shirts are sold for $21, but at later dates the shirts will be offered at a 10% discount, then a 20% discount, then a 40% discount, then a 50% discount, and finally a 60% discount. Demand at the full price of $21 is believed to be normally distributed with mean 1800 and standard deviation 360. Demand at various discounts is assumed to be a multiple of full-price demand. These multiples, for discounts of 10%, 20%, 40%, 50%, and 60% are, respectively, 0.4, 0.7, 1.1, 2, and 50. For example, if full-price demand is 2500, then at a 10% discount customers would be willing to buy 1000 T-shirts. The unit cost of purchasing T-shirts depends on the number of T-shirts ordered, as shown in the file P15_36.xlsx. Use simulation to determine how many T-shirts the company should order. Model the problem so that the company first orders some quantity of T-shirts, then discounts deeper and deeper, as necessary, to sell all of the shirts.

Level B 37. The annual return on each of four stocks for each

of the next five years is assumed to follow a normal distribution, with the mean and standard deviation for each stock, as well as the correlations between stocks, listed in the file P15_37.xlsx. You believe that the stock returns for these stocks in a given year are correlated, according to the correlation matrix given, but you believe the returns in different years are uncorrelated. For example, the returns for stocks 1 and 2 in year 1 have correlation 0.55, but the correlation

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

15-7 Conclusion 825

between the return of stock 1 in year 1 and the return of stock 1 in year 2 is 0, and the correlation between the return of stock 1 in year 1 and the return of stock 2 in year 2 is also 0. The file has the formulas you might expect for this situation in the range C20:G23. You can check how the RISKCORRMAT function has been used in these formulas. Just so that there is an @RISK output cell, calculate the average of all returns in cell B25 and designate it as an @RISK output. (This cell is not really important for the problem, but it is included because @RISK requires at least one output cell.) a. Using the model exactly as it stands, run @RISK

with 1000 iterations. The question is whether the correlations in the simulated data are close to what they should be. To check this, go to @RISK’s Report Settings and check the Input Data option before you run the simulation. This gives you all of the simulated returns on a new sheet. Then calculate correlations for all pairs of columns in the resulting Inputs Data Report sheet. (StatTools can be used to create a matrix of all correlations for the simulated data.) Comment on whether the correlations are different from what they should be.

b. Recognizing that this is a common situation (correlation within years, no correlation across years), @RISK allows you to model it by adding a third argument to the RISKCORRMAT third argument to the RISKCORRMAT third function: the year index in row 19 of the P15_37. xlsx file. For example, the RISKCORRMAT part of the formula in cell C20 becomes =RISKNORMAL($B5,$C5, RISKCORRMAT ($B$12:$E$15,$B20,C$19)). Make this change to the formulas in the range C20:G23, rerun the simulation, and redo the correlation analysis in part a. Verify that the correlations between inputs are now more in line with what they should be.

38. It is surprising (but true) that if 23 people are in the same room, there is about a 50% chance that at least two people will have the same birthday. Suppose you want to estimate the probability that if 30 people are in the same room, at least two of them will have the same birthday. You can proceed as follows. a. Generate random birthdays for 30 different people.

Ignoring the possibility of a leap year, each person has a 1/365 chance of having a given birthday (label the days of the year 1 to 365). You can use the RANDBETWEEN function to generate birthdays.

b. Once you have generated 30 people’s birthdays, how can you tell whether at least two people have the same birthday? One way is to use Excel’s RANK function. (You can learn how to use this function in Excel’s online help.) This function returns the rank of a number relative to a given group of numbers. In the case of a tie, two numbers are given the same rank. For example, if the set of

numbers is 4, 3, 2, 5, the RANK function returns 2, 3, 4, 1. (By default, RANK gives 1 to the largest number.) If the set of numbers is 4, 3, 2, 4, the RANK function returns 1, 3, 4, 1.

c. After using the RANK function, you should be able to determine whether at least two of the 30 people have the same birthday. What is the (estimated) probability that this occurs?

39. United Electric (UE) sells refrigerators for $400 with a one-year warranty. The warranty works as follows. If any part of the refrigerator fails during the first year after purchase, UE replaces the refrigerator for an average cost of $100. As soon as a replacement is made, another one-year warranty period begins for the customer. If a refrigerator fails outside the warranty period, we assume that the customer immediately purchases another UE refrigerator. Suppose that the amount of time a refrigerator lasts follows a normal distribution with a mean of 1.8 years and a standard deviation of 0.3 year. a. Estimate the average profit per year UE earns from

a customer. b. How could the approach of this problem be used to

determine the optimal warranty period?

40. A Flexible Savings Account (FSA) plan allows you to put money into an account at the beginning of the calendar year that can be used for medical expenses. This amount is not subject to federal tax. As you pay medical expenses during the year, you are reimbursed by the administrator of the FSA until the money is exhausted. From that point on, you must pay your medical expenses out of your own pocket. On the other hand, if you put more money into your FSA than the medical expenses you incur, this extra money is lost to you. Your annual salary is $80,000 and your federal income tax rate is 30%. a. Assume that your medical expenses in a year are

normally distributed with mean $2000 and standard deviation $500. Build an @RISK model in which the output is the amount of money left to you after paying taxes, putting money in an FSA, and paying any extra medical expenses. Experiment with the amount of money put in the FSA, using a RISKSIMTABLE function.

b. Rework part a, but this time assume a gamma distribution for your annual medical expenses. Use 16 and 125 as the two parameters of this distribution. These imply the same mean and standard deviation as in part a, but the distribution of medical expenses is now skewed to the right, which is probably more realistic. Using simulation, see whether you should now put more or less money in an FSA than in the symmetric case in part a.

41. At the beginning of each week, a machine is in one of four conditions: 1 = excellent; 2 = good; 3 = average;

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

826 Chapter 15 Introduction to Simulation Modeling

4 = bad. The weekly revenue earned by a machine in state 1, 2, 3, or 4 is $100, $90, $50, or $10, respec- tively. After observing the condition of the machine at the beginning of the week, the company has the option, for a cost of $200, of instantaneously replacing the machine with an excellent machine. The quality of the machine deteriorates over time, as shown in the file P15_41.xlsx. Four maintenance policies are under consideration:

■ Policy 1: Never replace a machine.

■ Policy 2: Immediately replace a bad machine.

■ Policy 3: Immediately replace a bad or average machine.

■ Policy 4: Immediately replace a bad, average, or good machine.

Simulate each of these policies for 50 weeks (using at least 250 iterations each) to determine the policy that maximizes expected weekly profit. Assume that the machine at the beginning of week 1 is excellent.

42. Simulation can be used to illustrate a number of results from statistics that are difficult to understand with nonsimulation arguments. One is the famous central limit theorem, which says that if you sample enough values from any population distribution and then average these values, the resulting average will be approximately normally distributed. Confirm this by using @RISK with the following population distributions (run a separate simulation for each): (a) discrete with possible values 1 and 2 and probabilities 0.2 and 0.8; (b) exponential with mean 1 (use the RISKEXPON function with the single argument 1); (c) triangular with minimum, most likely, and maximum values equal to 1, 9, and 10. (Note that each of these distributions is very skewed.) Run each simulation with 10 values in each average, and run 1000 iterations to simulate 1000 averages. Create a histogram of the averages to see whether it is indeed bell-shaped. Then repeat, using 30 values in each average. Are the histograms based on 10 values qualitatively different from those based on 30?

43. In statistics we often use observed data to test a hypothesis about a population or populations. The basic method uses the observed data to calculate a test statistic (a single number), as discussed in Chapter 9. If the magnitude of this test statistic is sufficiently large, the null hypothesis is rejected in favor of the research hypothesis. As an example, consider a researcher who believes teenage girls sleep longer than teenage boys on average. She collects observations on n = 40 randomly selected girls and n = 40 randomly selected boys. (Each observation is the average sleep time over several nights for a given person.) The aver- ages are X1 = 7.9 hours for the girls and X2X2X = 7.6 hours for the boys. The standard deviation of the 40

observations for girls is s1 = 0.5 hour; for the boys it is s2 = 0.7 hour. The researcher, consulting Chapter 9, then calculates the test statistic

X1 − X2X2X

"s"s" 21/40 + s22/40" =

7.9 − 7.6 !0!0! .25/40 + 0.49/40!

= 2.206

Based on the fact that 2.206 is “large,” she claims that her research hypothesis is confirmed—girls do sleep longer than boys.

You are skeptical of this claim, so you check it out by running a simulation. In your simulation you assume that girls and boys have the same mean and standard deviation of sleep times in the entire population, say, 7.7 and 0.6. You also assume that the distribution of sleep times is normal. Then you repeatedly simulate observations of 40 girls and 40 boys from this distribution and calculate the test statistic. The question is whether the observed test statistic, 2.206, is “extreme.” If it is larger than most or all of the test statistics you simulate, then the researcher is justified in her claim; otherwise, this large a statistic could have happened easily by chance, even if the girls and boys have identical population means. Use @RISK to see which of these possibilities occurs.

44. A technical note in the discussion of @RISK indicated that Latin Hypercube sampling is more efficient than Monte Carlo sampling. This problem allows you to see what this means. The file P15_44.xlsx gets you started. There is a single output cell, B5. You can enter any random value in this cell, such as RISKNORMAL(500,100). There are already @RISK statistical formulas in rows 9–12 to calculate summary measures of the output for each of 10 simulations. On the @RISK ribbon, click on the button to the left of the “dice” button to bring up the Simulation Settings dialog box, click on the Sampling tab, and make sure the Sampling Type is Latin Hypercube. Run 10 simulations with at least 1000 iterations each, and then paste the results in rows 9–12 as values in rows 17–20. Next, get back in Simulations Settings and change the Sampling Type to Monte Carlo, run the 10 simulations again, and paste the results in rows 9–12 as values into rows 23–26. For each row, 17–20 and 23–26, summarize the 10 numbers in that row with AVERAGE and STDEV. What do you find? Why do we say that Latin Hypercube sampling is more efficient? (Thanks to Harvey Wagner at University of North Carolina for suggesting this problem.)

45. We are continually hearing reports on the nightly news about natural disasters—droughts in Texas, hurricanes in Florida, floods in California, and so on. We often hear that one of these was the “worst in over 30 years,” or some such statement. Are natural disasters getting worse these days, or does it just appear so? How might you use simulation to answer this question? Here is

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

one possible approach. Imagine that there are N areas of the country (or the world) that tend to have, to some extent, various types of weather phenomena each year. For example, hurricanes are always a potential problem for Florida, and fires are always a potential problem in southern California. You might model the severity of the problem for any area in any year by a normally distributed random number with mean 0 and standard deviation 1, where negative values are interpreted as good years and positive values are

interpreted as bad years. (We suggest the normal distribution, but there is no reason other distributions couldn’t be used instead.) Then you could simulate such values for all areas over a period of several years and keep track, say, of whether any of the areas have worse conditions in the current year than they have had in the past several years, where “several” could be 10, 20, 30, or any other number of years you want to test. What might you keep track of? How might you interpret your results?

C A S E 15.1 SKI JACKET PRODUCTION

Egress, Inc., is a small company that designs, produces, and sells ski jackets and other coats. The creative design team has labored for weeks over its new design for the coming winter season. It is now time to decide how many ski jackets to produce in this production run. Because of the lead times involved, no other production runs will be possible during the season. Predicting ski jacket sales months in advance of the selling season can be quite tricky. Egress has been in operation for only three years, and its ski jacket designs were quite successful in two of those years. Based on realized sales from the last three years, current economic conditions, and professional judgment, 12 Egress employees have independently estimated demand for their new design for the upcoming season. Their estimates are listed in Table 15.2.

To assist in the decision on the number of units for the production run, management has gathered the data in Table 15.3. Note that S is the price Egress charges retailers. Any ski jackets that do not sell during the season can be sold by Egress to discounters for V per jacket. The fixed cost of plant

and equipment is F. This cost is incurred regardless of the size of the production run.

Questions 1. Egress management believes that a normal

distribution is a reasonable model for the unknown demand in the coming year. What mean and standard deviation should Egress use for the demand distribution?

2. Use a spreadsheet model to simulate 1000 possible outcomes for demand in the coming year. Based on these scenarios, what is the expected profit if Egress produces Q = 7800 ski jackets? What is the expected profit if Egress produces Q = 12,000 ski jackets? What is the standard deviation of profit in these two cases?

3. Based on the same 1000 scenarios, how many ski jackets should Egress produce to maximize expected profit? Call this quantity Q.

4. Should Q equal mean demand or not? Explain.

5. Create a histogram of profit at the production level Q. Create a histogram of profit when the production level Q equals mean demand. What is the probability of a loss greater than $100,000 in each case?

Table 15.3 Monetary Values

Variable production cost per unit (C): $80 Selling price per unit (S): $100 Salvage value per unit (V)V)V : $30 Fixed production cost (F)F)F : $100,000

© C

e n g

a g

e L

e a rn

in g

Table 15.2 Estimated Demands

14,000 16,000 13,000 8000 14,000 5000 14,000 11,000 15,500 8000 10,500 15,000

© C

e n g

a g

e L

e a rn

in g

Case 15.1 Ski Jacket Production 827 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 15.2 EBONY BATH SOAP

Management of Ebony, a leading manufacturer of bath soap, is trying to control its inventory costs. The weekly cost of holding one unit of soap in inventory is $30 (one unit is 1000 cases of soap). The marketing department estimates that weekly demand averages 120 units, with a standard deviation of 15 units, and is reasonably well modeled by a normal distribution. If demand exceeds the amount of soap on hand, those sales are lost—that is, there is no lost—that is, there is no lost backlogging of demand. The production department can produce at one of three levels: 110, 120, or 130 units per week. The cost of changing the production level from one week to the next is $3000.

Management would like to evaluate the following production policy. If the current inventory is less than L = 30 units, they will produce 130 units in the next week. If the current inventory is greater than U = 80 units, they will produce 110 units in the next week. Otherwise, Ebony will continue at the previous week’s production level.

Ebony currently has 60 units of inventory on hand. Last week’s production level was 120.

Questions 1. Develop a simulation model for 52 weeks of

operation at Ebony. Graph the inventory of soap over time. What is the total cost (inventory cost plus production change cost) for the 52 weeks?

2. Run the simulation for 500 iterations to estimate the average 52-week cost with values of U ranging from 30 to 80 in increments of 10. Keep L = 30 throughout.

3. Report the sample mean and standard deviation of the 52-week cost under each policy. Using the simulated results, is it possible to construct valid 90% confidence intervals for the average 52-week cost for each value of U? In any case, graph the average 52-week cost versus U. What is the best value of U for U for U L = 30?

4. What other production policies might be useful to investigate?

828 Chapter 15 Introduction to Simulation Modeling Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

829

MERRILL LYNCH LYNCH L IMPROVES LIQUIDITY RISK MANAGEMENT FOR REVOLVING CREDIT LINES

The Merrill Lynch banking group comprises several Merrill Lynch affiliates, including Merrill Lynch Bank USA (ML Bank USA). (Its parent company is Bank of America.) ML Bank USA has assets of more than $60 billion (as of June 30, 2005, when the following article was written, closer to $70 billion by 2010). The bank acts as an intermediary, accepting deposits from Merrill Lynch retail customers and using the deposits to fund loans and make investments. One way ML Bank USA uses these assets is to provide revolving credit lines to institutional and large corporate borrowers. Currently, it has a portfolio of about $13 billion in credit-line commitments with more than 100 companies. When it makes these commitments, it must be aware of the liquidity risk, defined as the ability to meet all cash obligations when due. In other words, if a borrower asks for funds as part of its revolving credit-line agreement, the bank must have the funds available to honor the request, typically on the same day the request is made. This liquidity requirement poses a huge risk to the bank. The bank must keep enough cash or liquid investments (i.e., investments that can be converted to cash quickly) in reserve to honor its customers’ requests whenever they occur. If the bank knew when, and in what quantities, these requests would occur, it could manage its cash reserves more prudently, essentially holding a smaller amount in liquid investments for credit requests and investing the rest in other more illiquid and profitable investments.

Duffy et al. (2005) discuss their role as members of Merrill Lynch’s Banking Group and Management Science Group in developing a model

Simulation Models

C H A P T E R

16

S tu

a rt

P e a rc

e /A

la m

y

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

830 Chapter 16 Simulation Models

to manage the liquidity risk for ML Bank USA’s revolving credit lines. The revolving credit lines give borrowers access to a specified amount of cash on demand for short-term funding needs in return for a fee paid to the bank. The bank also earns an interest rate on advances that compensates it for the liquidity and other risks it takes. These credit lines are therefore profitable for the bank, but they are not the borrowers’ primary sources of funding. Customers typically use these credit lines to retire maturing commercial paper (available at cheaper interest rates) during the process of rolling it over (i.e., attempting to reissue new commercial paper notes), and/or when their credit rating falls. The essence of the problem is that when a customer’s credit ratings (measured by the Moody rating scale, for example) fall, the customers are less likely to obtain funds from cheaper sources such as commercial paper, so they then tend to rely on their credit lines from ML Bank USA and other banks. This poses problems for ML Bank USA. It must honor its commitments to the borrowers, as spelled out in the credit-line agreements, but customers with low credit ratings are the ones most likely to default on their loans.

Two other aspects of the problem are important. First, the credit-line agreements often have a “term-out” option, which allows the borrower to use funds for an additional period after expiration, typically for one year. A customer who is experiencing financial difficulties and has seen its credit rating fall is the type most likely to use its term-out option. Second, movements in credit ratings for customers in the same industry or even in different industries tend to be positively correlated because they can all be affected by movements in their industry or the overall economy. This increases the liquidity risk for ML Bank USA because it increases the chance that poor economic conditions will lead many customers to request additional credit.

The authors built a rather complex simulation model to track the demand for usage of these credit facilities. The model simulates monthly credit-line usage for each customer over a five-year period. During this period, some credit lines are renewed, some expire and are not renewed, and some customers exercise their term-out options. The model has several significant features: (1) it models the probabilistic changes in credit ratings for its customers, where a customer’s credit rating can move from one level to another level in a given month with specified probabilities; (2) these probabili- ties are chosen in such a way that movements in credit ratings are positively correlated across customers; and (3) expert-system business rules are used to determine whether the company will renew or terminate expiring lines of credit and whether customers will exercise their term-out options. For example, a typical rule is that the bank does not renew a credit line if the borrower’s credit rating is below a certain threshold.

The authors developed a user-friendly Excel-based system to run their model. It actually invokes and executes the simulation behind the scenes in a simulation package called Arena. Users of the system can change many of the parameters of the model, such as the business-rule cutoffs, to customize the simulation.

The model has helped ML Bank USA manage its revolving credit lines. The output of the model provides a scientific and robust measure of liquidity risk that the bank has confidence in—and therefore uses. The model has led to two tangible financial benefits. First, the model reduced the bank’s liquidity requirement from 50% to 20% of outstand- ing commitments, thus freeing up about $4 billion of liquidity for other profitable illiquid investments. Second, during the first 21 months after the system was implemented, the bank’s portfolio expanded from $8 billion in commitments and 80 customers to $13 billion and more than 100 customers. The bank continues to use the model for its long-range planning. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-1 INTRODUCTION In the previous chapter, we introduced most of the important concepts for developing and analyzing spreadsheet simulation models. We also discussed many of the features available in the powerful simulation add-in, @RISK, that you receive with this book. Now we apply the tools to a wide variety of problems that can be analyzed with simulation. For conveni- ence, we group the applications into four general areas: (1) operations models, (2) �nancial models, (3) marketing models, and (4) games of chance. The only overriding theme in this chapter is that simulation models can yield important insights in all of these areas. You do not need to cover all of the models in this chapter or cover them in any particular order. You can cover the ones of most interest to you in practically any order.

16-2 OPERATIONS MODELS Whether we are discussing the operations of a manufacturing or a service company, there is likely to be uncertainty that can be modeled with simulation. In this section, we look at examples of bidding for a government contract (uncertainty in the bids by competitors), warranty costs (uncertainty in the time until failure of an appliance), and drug production (uncertainty in the yield and timing).

16-2a Bidding for Contracts

In situations where a company must bid against competitors, simulation can often be used to determine the company’s optimal bid. Usually the company does not know what its com- petitors will bid, but it might have an idea about the range of the bids its competitors will choose. In this section, we show how to use simulation to determine a bid that maximizes the company’s expected pro�t.

E X A M P L E 16.1 BIDDING FOR A GOVERNMENT CONTRACT

Miller Construction Company must decide whether to make a bid on a construction project. Miller believes it will cost the company $10,000 to complete the project (if it wins the contract), and it will cost $350 to prepare a bid. However, there is uncertainty about each of these. Upon further reflection, Miller assesses that the cost to complete the project has a triangular distribution with minimum, most likely, and maximum values $9000, $10,000, and $15,000. Similarly, Miller assesses that the cost to prepare a bid has a triangular distribution with parameters $300, $350, and $500. (Note the skewness in these distributions. Miller recognizes that cost overruns are much more likely than cost under- runs.) Four potential competitors are going to bid against Miller. The lowest bid wins the contract, and the winner is then given the winning bid amount to complete the project. Based on past history, Miller believes that each potential competitor will bid, indepen- dently of the others, with probability 0.5. Miller also believes that each competitor’s bid will be a multiple of its (Miller’s) most likely cost to complete the project, where this multiple has a triangular distribution with minimum, most likely, and maximum values 0.9, 1.3, and 1.8, respectively. If Miller decides to prepare a bid, its bid amount will be a multiple of $500 in the range $10,500 to $15,000. The company wants to use simulation to determine which strategy to use to maximize its expected profit.

Objective To simulate the profit to Miller from any particular bid, and to see which bid amount is best.

16-2 Operations Models 831 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

832 Chapter 16 Simulation Models

Where Do the Numbers Come From? The data required here are the parameters of the distributions of Miller’s costs, those of the competitors’ bids, and the probability that a given competitor will place a bid. Triangular distributions are chosen for simplicity, although Miller could try other types of distribu- tions. The parameters of these distributions are probably educated guesses, possibly based on previous contracts and bidding experience against these same competitors. The prob- ability that a given competitor will place a bid can be estimated from these same competi- tors’ bidding history.

Solution The logic is shown in Figure 16.1. (See the file Contract Bidding Big Picture.xlsx.) You first simulate the number of competitors who will bid and then simulate their bids. Then for any bid Miller makes, you see whether Miller wins the contract, and if so, what its profit is.

Miller’s Bid

Number of Poten�al Compe�tors

Number of Compe�ng Bids

Miller’s Cost to Prepare a Bid

Miller’s Cost to Complete Project

Compe�ng Bids (if any)

minimum Compe�ng Bid (if any)

Miller Wins Bid?

Miller’s Profit

Probability a Given Compe�tor Bids

Figure 16 .1 Big Picture for Bidding Simulation Model

Developing the Simulation Model The simulation model appears in Figure 16.2. (See the file Contract Bidding.xlsx.) It can be developed with the following steps. (Note that this model does not check the possibility of Miller not bidding at all. But this case is easy. If Miller opts not to bid, the profit is a certain $0.)

1. Inputs. Enter the inputs in the blue cells.

2. Miller’s bid. You can test all of Miller’s possible bids simultaneously with the RISKSIMTABLE function. To set up for this, enter the formula

=RISKSIMTABLE(D16:M16)

in cell B16. As with all uses of this function, the spreadsheet shows the simulated values for the �rst bid, �rst bid, �rst $10,500. However, when you run the simulation, you see outputs for all of the bids.

Recall that the RISKSIMTABLE function allows you to run a separate simulation for each value in its list.

Contract Bidding Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 833

3. Miller’s costs. Generate Miller’s cost to prepare a bid in cell B19 with the formula

=RISKTRIANG(B5,C5,D5)

Then copy this to cell B20 to generate Miller’s cost to complete the project.

4. Competitors and their bids. First, generate the random number of competitors who bid. This has a binomial distribution with four trials and probability of “suc- cess” equal to 0.5 for each trial, so enter the formula

=RISKBINOMIAL(B8,B9)

in cell B21. Then generate random bids for the competitors who bid in row 23 by enter- ing the formula

=IF(B22<=$B$21,RISKTRIANG($B$12,$B$13,$B$14)*$C$6,"")

in cell B23 and copying across. This generates a random bid for all competitors who bid, and it enters a blank for those who don’t. (Remember that the random value is the multiple of Miller’s most likely cost to complete the project.) Calculate the smallest of these (if there are any) in cell B24 with the formula

=IF(B21>=1,MIN(B23:E23),"")

Of course, Miller will not see these other bids until it has submitted its own bid.

5. Win contract? See whether Miller wins the bid by entering the formula

=IF(OR(B16<B24,B21=0),1,0)

in cell B26. Here, 1 means that Miller wins the bid, and 0 means a competitor wins the bid. Of course, if there are no competing bids, Miller wins for sure. Then designate this cell as an @RISK output cell. Recall that to designate a cell as an @RISK output cell,

Figure 16.2 Bidding Simulation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27

MLKJIHGFEDCBA Bidding for a contract

Inputs Miller’s costs, triangular distributed Min Most likely Max

$500$350$300Cost to prepare a bid Cost to complete project $9,000 $10,000 $15,000

Number of poten�al compe�tors 4 Probability a given compe�tor bids 0.5

0.9Min 1.3Most likely 1.8Max

Possible bids for Miller Miller's bid $10,500

Simula�on Miller’s cost to prepare a bid $459 Miller’s cost to complete project $11,111 Number of compe�ng bids 2 Compe�tor index 4321 Compe�tors’ bids $12,818 Minimum compe�tor bid $12,818

Miller wins bid? (1 if yes, 0 if no) 1 Miller’s profit –t –$1,069

n M y M

d $

Parameters of triangular distribu�ons for each compe�tor’s bid (expressed as mul�ple of Miller’s most likely cost to complete project)roject)

$15,000$14,500$14,000$13,500$13,000$12,500$12,000$11,500$11,000$10,500

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

834 Chapter 16 Simulation Models

you select the cell and then click the Add Output button on @RISK’s ribbon. You can then label this output appropriately. We used the label Wins Bid.

6. Miller’s profit. If Miller submits a bid, the bid cost is lost for sure. Beyond that, the profit to Miller is the bid amount minus the cost of completing the project if the bid is won. Otherwise, Miller makes nothing. So enter the formula

=IF(B26=1,B16-B20,0)−B19

in cell B27. Then designate this cell as an additional @RISK output cell. (We named it Pro�t.)

Running the Simulation Set the number of iterations to 1000, and set the number of simulations to 10 because there are 10 bid amounts Miller wants to test.

Discussion of the Simulation Results The summary results appear in Figure 16.3. For each simulation—that is, each bid amount—there are two outputs: 1 or 0 to indicate whether Miller wins the contract and Miller’s profit. The only interesting results for the 0–1 output are in the Mean column, which shows the fraction of iterations that resulted in 1’s. So you can see, for example, that if Miller bids $12,000 (simulation #4), the probability of winning the bid is estimated to be about 0.6. This probability clearly decreases as Miller’s bid increases.

Figure 16.3 Summary Results for Bidding Simulation

© C

e n g

a g

e L

e a rn

in g

In terms of net profit, if you concentrate only on the Mean column, a bid amount of $13,000 (simulation #6) is the best. But as the other numbers in this figure indicate, the mean doesn’t tell the whole story. For example, if Miller bids $13,000, it could win the bid but still lose a considerable amount of money because of cost overruns. The histogram of profit in Figure 16.4 indicates this more clearly. It shows that in spite of the positive mean, many of the outcomes are negative.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 835

16-2b Warranty Costs

When you buy a new product, it usually carries a warranty. A typical warranty might state that if the product fails within a certain period such as one year, you will receive a new product at no cost, and it will carry the same warranty. However, if the product fails after the warranty period, you have to bear the cost of replacing the product. Due to random life- times of products, we need a way to estimate the warranty costs (to the manufacturer) of a product. The following example illustrates how this can be accomplished with simulation.

So what should Miller do? If it doesn’t bid at all, its profit is a certain $0. If Miller is an expected profit maximizer, then the fact that several of the means in Figure 16.3 are posexpected profit maximizer, then the fact that several of the means in Figure 16.3 are posexpected - itive indicates that bidding is better than not bidding, with a bid of $13,000 being the best bid. However, potential cost overruns and the corresponding losses are certainly a concern. Depending on Miller’s degree of risk aversion, the company might decide to (1) not bid at all, or (2) bid higher than $13,000 to minimize its worse loss. Still, we would caution Miller not to be too conservative. Rather than focusing on the Min (worst case) column in Figure 16.3, we would suggest focusing on the 5% column. This shows nearly how bad things could get (5% of the time it would be worse than this), and this 5th percentile remains fairly constant for higher bids. ■

E X A M P L E 16.2 WARRANTY COSTS FOR A CAMERA

Yakkon Company sells a popular camera for $400. This camera carries a warranty such that if the camera fails within 1.5 years, the company gives the customer a new cam- era for free. If the camera fails after 1.5 years, the warranty is no longer in effect. Every replacement camera carries exactly the same warranty as the original camera, and the cost to the company of supplying a new camera is always $225. Use simulation to estimate, for a given sale, the number of replacements under warranty and the NPV of profit from the sale, using a discount rate of 8%.

Figure 16.4 Histogram of Profit with $13,000 Bid

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

836 Chapter 16 Simulation Models

The gamma distribution is a popular distribution, especially when you want a right-skewed distribution of a nonnegative quantity.

You can learn about distributions from @RISK’s Define Distribution window.

Objective To use simulation to estimate the number of replacements under warranty and the total NPV of profit from a given sale.

Where Do the Numbers Come From? The warranty information is a policy decision made by the company. The hardest input to estimate is the probability distribution of the lifetime of the product. We discuss this next.

Solution The only randomness in this problem concerns the time until failure of a new camera. Yakkon could estimate the distribution of time until failure from historical data. This would probably indicate a right-skewed distribution, as shown in Figure 16.5. If you look through the list of distributions available in @RISK under Define Distributions, you will see sev- eral with this same basic shape. The one shown in Figure 16.5 is a commonly used distri- bution called the gamma distribution. We will use a gamma distribution in this example, although other choices such as the triangular are certainly possible.

Figure 16.5 Right-Skewed Gamma Distribution

© C

e n g

a g

e L

e a rn

in g

Selecting a Gamma Distribution The gamma distribution is characterized by two parameters, α and β. These determine its shape and location. It can be shown that the mean and standard deviation are μ = αβ and σ = !α!α!! β. Alternatively, for any desired values of the mean and standard deviation, these equations can be solved for α and β, which leads to α = μ2/σ2 and β = σ2/μ. So, for example, if you want a gamma distribution with mean 2.5 and standard deviation 1 (which in this example would be based on camera lifetime data from the past), you should choose α = 2.52/12 = 6.25 and β = 12/2.5 = 0.4. These are the values shown in Figure 16.5 and the ones used for this example. The values in the figure (from @RISK) imply that the probability of failure before 1.5 years is about 0.15, so that the probability of failure out of warranty is about 0.85.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 837

Developing the Simulation Model The variables for the model are shown in Figure 16.6, and the simulation model itself appears in Figure 16.7. (See the files Warranty Costs Big Picture.xlsx and Warranty Costs.xlsx.) The particular random numbers in Figure 16.7 indicate an example (a rather unusual one) where there are two failures within warranty. However, because the lifetime of the second replacement (cell D17) is greater than 1.5, the company incurs only two replacement costs, as shown in cells B19 and C19. The model can be developed with the following steps.

1. Inputs. Enter the inputs in the blue cells.

2. Parameters of gamma distribution. As discussed previously, if you enter a desired mean and standard deviation (in cells B5 and B6), you have to calculate the param- eters of the gamma distribution. Do this by entering the formulas

=B5^2/B6^2

and

=B6^2/B5

in cells B7 and B8.

3. Lifetimes and times of failures. Generate at most five lifetimes and correspond- ing times of failures. (Why only five? You could generate more, but it is extremely unlikely that this same customer would experience more than five failures within warranty, so five suffices.) As soon as a lifetime is greater than 1.5, the warranty period, no further lifetimes are required, in which case blanks can be recorded in row 17. With this in mind, enter the formulas

=RISKGAMMA(B7,B8)

=IF(B17<B10,RISKGAMMA(B7,B8),"")

Warranty Cost Model

Failures within Warranty

NPV of Profit from Customer

Warranty Period Life�me of Camera

Time of Failure

Discount Rate Discounted Cost

Cost to Company Replacement Cost

(to company)

Cost of New Camera (to customer)

Figure 16.6 Big Picture for Warranty Simulation Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

838 Chapter 16 Simulation Models

Excel’s NPV function can be used only for cash flows that occur at the ends of the respective years. Otherwise, you have to discount cash flows manually.

Figure 16.7 Warranty Simulation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

FEDCBA Warranty costs for camera

Inputs Parameters of �me to failure distribu�on of any new camera (Gamma)

2.5Desired mean Desired stdev 1 Implied alpha 6.250 Implied beta 0.400

Warranty period 1.5 Cost of new camera (to customer) $400 Replacement cost (to company) $225 Discount rate 8%

Simula�on of new camera and its replacements (if any) 54321Camera

4.3331.4261.288Life�me 7.0472.7141.288Time of failure

000225225Cost to company 0.000.000.00182.59203.77Discounted cost

2.000Failures within warranty NPV of profit from customer ($211.36) ©

C e n g

a g

e L

e a rn

in g

and

=IF(C17="","",IF(C17<$B$10,RISKGAMMA($B$7,$B$8),""))

in cells B17, C17, and C17, and copy the latter formula to cells E17 and F17. These formulas guarantee that once a blank is recorded in a cell, all cells to its right will also contain blanks. To get the actual times of failures, relative to time 0 when the customer originally purchases the camera, enter the formulas

=B17

and

=IF(C17="","",B18+C17)

in cells B18 and C18, and copy the latter across row 18. These values will be used for the NPV calculation because this requires the exact timing of cash �ows.

@RISK Function: RISKGAMMA To generate a random number from the gamma distribution, use the RISKGAMMA func- tion in the form =RISKGAMMA(alpha,beta). The mean and standard deviation of this distribution are μ = αβ and σ = !α!α! β! . Equivalently, α = μ2/σ2 and β = σ2/μ.

4. Costs and discounted costs. In row 19, enter the replacement cost ($225) or 0, depending on whether a failure occurs within warranty, and in row 20 discount these costs back to time 0, using the failure times in row 18. To do this, enter the formulas

=IF(B17<B10,B12,0)

and

=IF(C17="",0,IF(C17<$B$10,$B$12,0))

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 839

Figure 16.8 Histogram of Number of Failures

© C

e n g

a g

e L

e a rn

in g

in cells B19 and C19, and copy this latter formula across row 19. Then enter the formula

=IF(B19>0,B19/(1+$B$13)^B18,0)

in cell B20 and copy it across row 20. This formula uses the well-known fact that the present value of a cash �ow at time t is the cash �ow multiplied by t is the cash �ow multiplied by t 1/(1 + r)t, where r is the discount rate.r is the discount rate.r

5. Outputs. Calculate two outputs, the number of failures within warranty and the NPV of profit, with the formulas

=COUNTIF(B17:F17,"<"&$B$10)

and

=B11−B12−SUM(B20:F20)

in cells B22 and B23. Then designate these two cells as @RISK output cells. Note that the NPV is the margin from the sale (undiscounted) minus the sum of the discounted costs from replacements under warranty.

Running the Simulation The @RISK setup is typical. Run 1000 iterations of a single simulation (because there is no RISKSIMTABLE function).

Discussion of the Simulation Results The @RISK summary statistics and histograms for the two outputs appear in Figures 16.8 and 16.9. They show a fairly clear picture. About 85% of the time, there are no failures under warranty and the company makes a profit of $175, the margin from the camera sale. However, there is about a 12% chance of exactly one failure under warranty, in which case the company’s NPV of profit will be an approximate $50 loss (before discount- ing). Additionally, there is about a 3% chance that there will be even more failures under warranty, in which case the loss will be even greater. Note that in our 1000 iterations,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

840 Chapter 16 Simulation Models

the maximum number of failures under warranty was 4, and the maximum net loss was $559.56. On average, the NPV of profit was $139.38.

These results indicate that Yakkon is not suffering terribly from warranty costs. However, there are several ways the company could decrease the effects of warranty costs. First, it could increase the price of the camera. Second, it could decrease the warranty period, say, from 1.5 years to 1 year. Third, it could change the terms of the warranty. For example, it could stipulate that if the camera fails within a year, the customer gets a new camera for free, whereas if the time to failure is between 1 and 1.5 years, the customer pays some pro rata share of the replacement cost. Finally, it could try to sell the customer an extended warranty—at a hefty price. We ask you to explore these possibilities in the problems. ■

16-2c Drug Production with Uncertain Yield

In many manufacturing settings, products are produced in batches, and the usable yields from these batches are uncertain. This is particularly true in the drug industry. The following example illustrates how a drug manufacturer can take this uncertainty into account when planning production.

E X A M P L E 16.3 TRYING TO MEET AN ORDER DUE DATE AT WOZAC

Wozac Company is a drug manufacturer. Wozac has recently accepted an order from its best customer for 8000 ounces of a new miracle drug, and Wozac wants to plan its production schedule to meet the customer’s promised delivery date of December 1. There are three sources of uncertainty that make planning difficult. First, the drug must be pro- duced in batches, and there is uncertainty in the time required to produce a batch, which could be anywhere from 5 to 11 days. This uncertainty is described by the discrete distribu- tion in Table 16.1. Second, the yield (usable quantity) from any batch is uncertain. Based on historical data, Wozac believes the yield can be modeled by a triangular distribution with minimum, most likely, and maximum values equal to 600, 1000, and 1100 ounces, respec- tively. Third, all batches must go through a rigorous inspection once they are completed.

Figure 16.9 Histogram of NPV of Profit

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 841

Table 16.1 Distribution of Days to Complete a Batch Days Probability

 5 0.05  6 0.10  7 0.20  8 0.30  9 0.20 10 0.10 11 0.05

The probability that a typical batch passes inspection is only 0.8. With probability 0.2, the batch fails inspection, and none of it can be used to help fill the order. Wozac wants to use simulation to help decide how many days prior to the due date it should begin production.

Objective To use simulation to determine when Wozac should begin production for this order so that there is a high probability of completing it by the due date.

Where Do the Numbers Come From? The important inputs here are the probability distributions of the time to produce a batch, the yield from a batch, and the inspection result. The probabilities we have assumed would undoubtedly be based on previous production data. For example, the company might have observed that about 80% of all batches in the past passed inspection. Of course, a discrete distribution is natural for the number of days to produce a batch, and a continuous distribu- tion is appropriate for the yield from a batch.

Solution The variables for this model are shown in Figure 16.10. (See the file Drug Production Big Picture.xlsx.) The idea is to simulate successive batches—their days to complete, their yields, and whether they pass inspection—and keep a running total of the usable ounces obtained so far. IF functions can then be used to check whether the order is complete or another batch is required. You need to simulate only as many as batches as are required

© C

e n g

a g

e L

e a rn

in g

Days to Produce Batch

Batch Passes Inspec on

Probability Batch Passes Inspec on

Due Date

Yield of Batch

Day to Start

Has enough been Produced?

Amount of Drug Required

Total Days to Complete

Batches Required

Cumula ve Yield

Figure 16.10 Big Picture for Drug Production Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

842 Chapter 16 Simulation Models

to meet the order, and you should keep track of the days required to produce all of these batches. In this way, you can “back up” to see when production must begin to meet the due date. For example, if the simulation indicates that the order takes 96 days to complete, then production must begin on August 27, 96 days before the due date. (For simplicity, the model assumes that production occurs seven days a week.)

Developing the Simulation Model The completed model appears in Figure 16.11. (See the file Drug Production.xlsx.) It can be developed as follows.

1. Inputs. Enter all of the inputs in the blue cells.

2. Batch indexes. We don’t know ahead of time how many batches will be required to fill the order. There should be enough rows in the simulation to cover the worst case that is likely to occur. After some experimentation, it is apparent that 25 batches are almost surely enough. Therefore, enter the batch indexes 1 through 25 in column A of the simulation section. (If 25 were not enough, you could always add more rows.) The idea, then, is to fill the entire range B16:F40 with formulas. However, you can use appropriate IF functions in these formulas so that if enough has already been produced to fill the order, blanks are inserted in the remaining rows. For exam- ple, the scenario shown in Figure 16.11 is one where 11 batches were required, so blanks appear below row 26.

Figure 16.11 Drug Production Simulation Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

Planning produc�on of a drug

A

Input sec�on

Simula�on model

Ounces required

Due date

Distribu�on of days needed to produce a batch (discrete)

Distribu�on of yield (ounces) from each batch (triangular)

Prob of passing inspec�on

Batch

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

Enough?

No

No

No

No

No

No

No

No

No

No

Yes

Outputs

Batches required

Days to complete

Day to start

Sta�s�cal summary measures

Max batches reqd

Avg days reqd

Min days reqd

Max days reqd

5th perc days reqd

95th perc days reqd

Range names used

Batches_required

Days_to_complete

Due_date

Probability _pass

Ounces_required

18

93

62

147

73

121

B CB C D ED E F GF G H IH I J KJ K L ML M

=Model!$l$15

=Model!$l$16

=Model!$B$5

=Model!$B$11

=Model!$B$4

Probability of mee�ng due date

30-Aug

30-Sep

7-Jul

19-Sep

2-Aug

Probability

0.995

0.957

0.845

0.503

0.127

Start date

15-Jul

1-Aug

15-Aug

1-Sep

15-Sep

8000

1-Dec

Min

600

0.8

Most likely

1000

Max

1100

Days

5

6

7

8

9

10

11

Probability

0.05

0.10

0.20

0.30

0.20

0.10

0.05

Days

7

8

9

6

8

10

9

11

10

8

10

CumYield

874.4

1696.9

2517.5

3196.9

4041.6

4864.3

5795.0

6494.4

6494.4

7461.5

8302.3

Yield

874.4

822.4

820.7

679.4

844.6

822.7

930.7

699.4

928.5

967.1

840.8

Pass?

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

No

Yes

Yes

11

96

27-Aug

© C

e n g

a g

e L

e a rn

in g

Drug Production Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 843

You can use Excel’s RAND function inside an IF function to simulate whether some event occurs.

3. Days for batches. Simulate the days required for batches in column B. To do this, enter the formulas

=RISKDISCRETE(G6:G12,H6:H12)

and

=IF(F16<>"No","",RISKDISCRETE($G$6:$G$12,$H$6:$H$12))

in cell B16 and B17, and copy the latter formula down to cell B40. Note how the IF function enters a blank in this cell if there is not a No in column F for the previous batch, that is, if the order was just completed in the previous batch or it has been com- pleted for some time. Similar logic appears in later formulas.

4. Batch yields. Simulate the batch yields in column C. To do this, enter the formulas

=RISKTRIANG(B9,C9,D9)

and

=IF(F16<>"No","",RISKTRIANG($B$9,$C$9,$D$9))

in cells C16 and C17, and copy the latter formula down to cell C40.

5. Pass inspection? Check whether each batch passes inspection with the formulas

=IF(RAND()<Probability_pass,"Yes","No")

and

=IF(F16<>"No","",IF(RAND()<Probability_pass,"Yes","No"))

in cells D16 and D17, and copy the latter formula down to cell D40. Note that you could use @RISK’s RISKUNIFORM(0,1) function instead of RAND(), but there is no real advantage to doing so. They are essentially equivalent. (Besides, the academic version of @RISK imposes an upper limit of 100 @RISK input functions per model, so it is often a good idea to substitute built-in Excel®

@RISK input functions per model, ®

@RISK input functions per model, functions when possible.)

6. Order filled? To keep track of the cumulative usable production and whether the order has been filled in columns E and F, first enter the formulas

=IF(D16="Yes",C16,0)

and

=IF(E16>=Ounces_required,"Yes","Not yet")

in cells E16 and F16 for batch 1. Then enter the general formulas

=IF(F16<>"No","",IF(D17="Yes",C17+E16,E16))

and

=IF(F16<>"No","",IF(E17>=Ounces_required,"Yes","Not yet"))

in cells E17 and F17, and copy them down to row 40. Note that the entry in column F is “Not yet” if the order is not yet complete. In the row that completes the order, it changes to “Yes,” and then it is blank in succeeding rows.

7. Summary measures. Calculate the batches and days required in cells I15 and I16 with the formulas

=INDEX(A16:A40,MATCH("Yes",F16:F40,0))

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

844 Chapter 16 Simulation Models

and

=SUM(B16:B40)

These are the two cells used as output cells for @RISK, so designate them as such. Also, calculate the day the order should be started to just meet the due date in cell I17 with the formula

=Due_date−I16

This formula uses date subtraction to �nd an elapsed time. (Again, the assumption is that production occurs every day of the week.)

This completes the simulation model development. The other entries in columns H through J are explained shortly.

Dealing with Uncertain Timing Many simulations that model a process over multiple time periods must deal with uncertain timing of events, such as when the manufacturing of an order will fin- ish, which year sales of a new product will begin, and many others. Essentially, the spreadsheet model must generate random numbers that determine the timing

and then play out the events. This can require tricky and then play out the events. This can require tricky and then pla IF functions and possibly other functions. However, the hard work often involves getting the logic correct for the first period or two. Then this logic can be copied down for the other periods. In other words, some time spent on developing the first row or two can result in a very powerful model.

F u n da m e n ta l I n s i g h t

Running the Simulation Set the number of iterations to 1000 and the number of simulations to 1, and then run the simulation as usual.

Discussion of the Simulation Results After running the simulation, you can obtain the distributions of the number of batches required and the number of days required in Figures 16.12 and 16.13.

Figure 16.12 Distribution of Batches Required

© C

e n g

a g

e L

e a rn

in g

Date subtraction in Excel allows you to calculate the number of days between two given dates.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-2 Operations Models 845

How should Wozac use this information? The key questions are how many batches will be required and (2) when production should start. To answer these questions, it is helpful to use several of @RISK’s statistical functions. Recall that these functions can be entered directly into the Excel model worksheet. (Also, recall that they provide useful information only after the simulation has been run.) These functions provide no new information you after the simulation has been run.) These functions provide no new information you after don’t already have from other @RISK windows, but they allow you to see (and manipulate) this information directly in the spreadsheet.

For the first question, enter the formula

=RISKMAX(Batches_required)

in cell I20. (Refer to Figure 16.11.) It shows that the worst case from the 1000 iterations, in terms of batches required, is 18 batches. (If this maximum were 25, you would add more rows to the simulation model and run the simulation again.)

You can answer the second question in two ways. First, you can calculate summary measures for days required and then back up from the due date. This is done in the range I22:J26. The formulas in column I are

=INT(RISKMEAN(Days_to_complete))

=RISKMIN(Days_to_complete)

=RISKMAX(Days_to_complete)

=RISKPERCENTILE(Days_to_complete,0.05)

and

=RISKPERCENTILE(Days_to_complete,0.95)

(The first uses the INT function to produce an integer.) You can then subtract each of these from the due date to obtain the potential starting dates in column J. Wozac should realize the pros and cons of these starting dates. For example, if the company wants to be 95% sure of meeting the due date, it should start production on August 2. In contrast, if Wozac starts production on September 19, there is only a 5% chance of meeting the due date.

Figure 16.13 Distribution of Days Required

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

846 Chapter 16 Simulation Models

Alternatively, you can get a more direct answer to the question by using @RISK’s RISKTARGET function. This allows you to find the probability of meeting the due date for any starting date, such as the trial dates in the range L22:L26. To do it, enter the formula

=RISKTARGET(Days_to_complete,Due_date-L22)

in cell M22 and copy it down. This function returns the fraction of iterations where the (random) value in the first argument is less than or equal to the (fixed) value in the sec- ond argument. For example, you can see that 84.5% of the iterations have a value of days required less than or equal to 108, the number of days from August 15 to the due date.

What is our recommendation to Wozac? We suggest going with the 95th percentile— begin production on August 2. Then there is only a 5% chance of failing to meet the due date. But the table in the range L22:M26 also provides useful information. For each poten- tial starting date, Wozac can see the probability of meeting the due date. ■

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. In Example 16.1, the possible profits vary from negative

to positive for each of the 10 possible bids examined. a. For each of these, use @RISK’s RISKTARGET

function to find the probability that Miller’s profit is positive. Do you believe these results should have any bearing on Miller’s choice of bid?

b. Use @RISK’s RISKPERCENTILE function to find the 10th percentile for each of these bids. Can you explain why the percentiles have the values you obtain?

2. If the number of competitors in Example 16.1 doubles, how does the optimal bid change?

3. Referring to Example 16.1, if the average bid for each competitor stays the same, but their bids exhibit less variability, does Miller’s optimal bid increase or decrease? To study this question, assume that each competitor’s bid, expressed as a multiple of Miller’s cost to complete the project, follows each of the following distributions. a. Triangular with parameters 1.0, 1.3, and 2.4 b. Triangular with parameters 1.2, 1.3, and 2.2 c. Use @RISK’s Define Distributions window

to check that the distributions in parts a and b have the same mean as the original triangular distribution in the example, but smaller standard deviations. What is the common mean? Why is it not the same as the most likely value, 1.3?

4. In Example 16.2, the gamma distribution was used to model the skewness to the right of the lifetime distribution. Experiment to see whether the triangu- lar distribution could have been used instead. Let its

minimum value be 0, and choose its most likely and maximum values so that this triangular distribution has approximately the same mean and standard devia- tion as the gamma distribution in the example. (Use @RISK’s Define Distributions window and trial and error to do this.) Then run the simulation and comment on similarities or differences between your outputs and the outputs in the example.

5. See how sensitive the results in Example 16.2 are to the following changes. For each part, make the change indicated, run the simulation, and comment on any differences between your outputs and the outputs in the example. a. The cost of a new camera is increased to $450. b. The warranty period is decreased to one year. c. The terms of the warranty are changed. If the

camera fails within one year, the customer gets a new camera for free. However, if the camera fails between 1 year and 1.5 years, the customer pays a pro rata share of the new camera, increasing linearly from 0 to full price. For example, if it fails at 1.2 years, which is 40% of the way from 1 to 1.5, the customer pays 40% of the full price.

d. The customer pays $50 up front for an extended warranty. This extends the warranty to three years. This extended warranty is just like the original, so that if the camera fails within three years, the customer gets a new camera for free.

6. In Example 16.3, we commented on the 95th percen- tile on days required and the corresponding date. If the company begins production on this date, then it is 95% sure to complete the order by the due date. We found this date to be August 2. Do you always get this answer? Find out by (1) running the simulation 10 more times, each with 1000 iterations, and finding the 95th percentile and corresponding date in each,

Using @RISK summary functions such as RISKMEAN, RISKPERCENTILE, and others enables you to capture simulation results in the same work-sheet as the simu- lation model. These functions do not provide relevant results until the simulation is run.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 847

and (2) running the simulation once more, but with 10,000 iterations. Comment on the difference between simulations (1) and (2) in terms of accuracy. Given these results, when would you recommend that pro- duction should begin?

7. In Example 16.3, suppose you want to run five simula- tions, where the probability of passing inspection is varied from 0.6 to 1.0 in increments of 0.1. Use the

RISKSIMTABLE function appropriately to do this. Comment on the effect of this parameter on the key outputs. In particular, does the probability of passing inspection have a large effect on when production should start? (Note: When this probability is low, it might be necessary to produce more than 25 batches, the maximum built into the model. Check whether this maximum should be increased.)

16-3 FINANCIAL MODELS There are many �nancial applications where simulation can be applied. Future cash �ows, future stock prices, and future interest rates are some of the many uncertain variables �nan- cial analysts must deal with. In every direction they turn, they see uncertainty. In this section, we analyze a few typical �nancial applications that can bene�t from simulation modeling.

16-3a Financial Planning Models

Many companies, such as GM, Eli Lilly, Procter & Gamble, and P�zer, use simulation in their capital budgeting and �nancial planning processes. Simulation can be used to model the uncertainty associated with future cash �ows. In particular, simulation can be used to answer questions such as the following:

■ What are the mean and variance of a project’s net present value (NPV)?

■ What is the probability that a project will have a negative NPV?

■ What are the mean and variance of a company’s pro�t during the next �scal year?

■ What is the probability that a company will have to borrow more than $2 million during the next year?

The following example illustrates how simulation can be used to evaluate the �nancial success of a new car.

E X A M P L E 16.4 DEVELOPING A NEW CAR AT GF AUTO

General Ford (GF) Auto Corporation is developing a new model of compact car. This car is assumed to generate sales for the next five years. GF has gathered information about the following quantities through focus groups with the marketing and engineering departments.

■ Fixed cost of developing car. This cost is assumed to $700 million. The �xed cost is incurred at the beginning of year 1, before any sales are recorded.

■ Margin per car. This is the unit selling price minus the variable cost of producing a car. GF assumes that in year 1, the margin will be $4000. Every other year, GF assumes the margin will decrease by 4%.1 car. GF assumes that in year 1, the margin will be

1 car. GF assumes that in year 1, the margin will be

■ Sales. The demand for the car is the uncertain quantity. In its �rst year, GF assumes sales—number of cars sold—will be triangularly distributed with parameters 50,000, 75,000, and 85,000. Every year after that, the company assumes that sales will decrease

1The margin decreases because the company assumes variable costs tend to increase through time, whereas selling prices tend to remain fairly constant through time.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

848 Chapter 16 Simulation Models

by some percentage, where this percentage is triangularly distributed with parameters 5%, 8%, and 10%. GF also assumes that the percentage decreases in successive years are independent of one another.

■ Depreciation and taxes. The company will depreciate its development cost on a straight-line basis over the lifetime of the car. The corporate tax rate is 40%.

■ Discount rate. GF �gures its cost of capital at 10%.

Given these assumptions, GF wants to develop a simulation model that will evaluate its NPV of after-tax cash flows for this new car over the five-year time horizon.

Objective To simulate the cash flows from the new car model, from the development time to the end of its life cycle, so that GF can estimate the NPV of after-tax cash flows from this car.

Where Do the Numbers Come From? There are many inputs to this problem. As we indicated, they are probably obtained from experts within the company and from focus groups of potential customers.

Solution The variables for the model are shown in Figure 16.14. (See the file New Car Development Big Picture.xlsx.) This model is like most financial multiyear spreadsheet models. The completed model extends several years to the right, but most of the work is for the first year or two. From that point, you can copy to the other years to complete the model.

New Car Development Model

NPV of Cash Flows

Unit Sales Year 1 Contribu�onYear 1 Contribu�onY

Unit Contribu�on

Deprecia�on

Before Tax Profit

A�er Tax ProfitTax Rate

Cash Flow

Discount Rate

Annual Decrease in Contribu�on

Revenue minus Variable Cost

Fixed Development Cost

Figure 16.14 Big Picture for GF Auto Simulation Model

Developing the Simulation Model The simulation model for GF appears in Figure 16.15. (See the file New Car Development. xlsx.) It can be formed as follows.

1. Inputs. Enter the various inputs in the blue cells.

2. Unit sales. Generate first-year sales in cell B12 with the formula

=RISKTRIANG(E5,F5,G5)

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 849

Figure 16.15 GF Auto Simulation Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

New car simula�on

A

Inputs

Simula�on

Fixed development cost

Year 1 contribu onYear 1 contribu onY

Annual decrease in contribu on

Tax rate

Discount rate

Parameters of triangular distribu ons

Year 1 salesYear 1 salesY

Annual decay rate

End of year

Unit sales

Unit contribu on

Revenue minus variable cost

Deprecia on

Before tax profit

A�er tax profit

Cash flow

NPV of cash flows

B CB C D ED E F GF G

$700,000,000

$4,000

4%

40%

10%

1

75974

$4,000

$303,896,278

$140,000,000

$163,896,278

$98,337,767

$238,337,767

$83,847,540

2

70796

$3,840

$271,858,000

$140,000,000

$131,858,000

$79,114,800

$219,114,800

3

66380

$3,686

$244,703,708

$140,000,000

$104,703,708

$62,822,225

$202,822,225

4

61292

$3,539

$216,910,485

$140,000,000

$76,910,485

$46,146,291

$186,146,291

5

56723

$3,397

$192,710,610

$140,000,000

$52,710,610

$31,626,366

$171,626,366

Min

50000

5%

Most likely

75000

8%

Max

85000

10%

© C

e n g

a g

e L

e a rn

in g

Then generate the reduced sales in later years by entering the formula

=B12*(1−RISKTRIANG($E$6,$F$6,$G$6))

in cell C12 and copying it across row 12. Note that each sales �gure is a random fraction of the previous sales �gure.

3. Contributions. Calculate the unit contributions in row 13 by entering the formulas

=B5

and

=B13*(1−$B$6)

in cells B13 and C13, and copying the latter across. Then calculate the contributions in row 14 as the product of the corresponding values in rows 12 and 13.

4. Depreciation. Calculate the depreciation each year in row 15 as the development cost in cell B4 divided by 5. This is exactly what “straight-line depreciation” means.

5. Before-tax and after-tax profits. To calculate the before-tax profit in any year, subtract the depreciation from total contribution, so each value in row 16 is the difference between the corresponding values in rows 14 and 15. The reason is that depreciation isn’t taxed. To calculate the after-tax profits in row 17, multiply each before-tax profit by one minus the tax rate in cell B7. Finally, each cash flow in row 18 is the sum of the corresponding values in rows 15 and 17. Here depreciation is added back to get the cash flow.

6. NPV. Calculate the NPV of cash flows in cell B20 with the formula

=−B4+NPV(B8,B18:F18)

Depreciation is subtracted to get before-tax profit, but it is then added back after taxes have been deducted.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

850 Chapter 16 Simulation Models

and designate it as an @RISK output cell (the only output cell). Here, we are assuming that the development cost is incurred right now, so that it isn’t discounted, and that all other cash �ows occur at the ends of the respective years. This allows the NPV func- tion to be used directly.

Running the Simulation Set the number of iterations to 1000 and the number of simulations to 1, and then run the simulation as usual.

Discussion of the Simulation Results After running @RISK, you obtain the histogram in Figure 16.16. These results are some- what comforting, but also a cause of concern for GF. On the bright side, the mean NPV is about $31.56 million, and there is some chance that the NPV could go well above that figure, even above $145 million. However, there is also a downside, as shown by the two sliders in the histogram. One slider has been placed over an NPV of 0. As the histogram indicates, there is a 71.5% chance of a positive NPV, but there is a 28.5% chance of it being negative. The second slider has been positioned at its default 5th percentile setting. Financial analysts often call this percentile the value at risk at the 5% level, or VaR 5%, because it indicates nearly the worst possible outcome. From this simulation, you can see that GF’s VaR 5% is approximately a $67.37 million loss.

Figure 16.16 Histogram of NPV

© C

e n g

a g

e L

e a rn

in g

The value at risk at the 5% level, or VaR 5%, is the 5th percentile of a distribution, and it is often used in �nancial models. It indicates nearly the worst possible outcome.

What is most responsible for this huge variability in NPV, the variability in first-year sales or the variability in annual sales decreases? This can be answered with @RISK’s tornado graph, which lets you see which random inputs have the most effect on a specified

Financial analysts typically look at VaR 5% to see how bad— or more precisely, almost how bad— things could get.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 851

If you create a deterministic model using the most likely values of the uncertain inputs, you can possibly get an output value that is nowhere near the mean of that output.

Figure 16.17 Tornado Graph for NPV

© C

e n g

a g

e L

e a rn

in g

output. (See Figure 16.17.) To get this graph, click the tornado button below the histogram in Figure 16.16 and select the Change in Output Mean option. This graph answers the question emphatically. Variability in first-year sales is by far the largest influence on NPV. It is very highly correlated with NPV. The annual decreases in sales are not unimportant, but they have much less effect on NPV. If GF wants to get a more favorable NPV dis- tribution, it should do all it can to boost first-year sales—and make the first-year sales distribution less variable.

Before finishing this example, we revisit the flaw of averages. What if GF used a deterministic model to estimate NPV? Would the results match those from the simu- lation? We tried this two ways, once by entering the most likely values of the inputs instead of the random numbers, and once by entering the means instead of the random numbers. The results (not shown here) are available in the last sheet of the finished version of the file. As you can check, the difference between the two NPVs is huge. In this case, the NPV by using means is very close to the mean NPV from the simulation, about $31 million. But if the company used most likely values for the inputs in its deter- ministic model, which certainly seems sensible, the NPV would be off by a factor of more than two, another variation of the flaw of averages. Besides this problem, neither deterministic model provides even a hint that the company has about a 28.5% chance of a negative NPV.2 deterministic model provides even a hint that the company has about a

2 deterministic model provides even a hint that the company has about a

2It turns out that the NPV in this model is linear in the two random inputs. When an output is linear in the inputs, linear in the two random inputs. When an output is linear in the inputs, linear the deterministic model using means of inputs always gives the correct mean output, so that the �aw of averages in the form from the previous chapter does not occur. Even so, a deterministic model still provides no indication of how bad or how good things could get.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

852 Chapter 16 Simulation Models

E X A M P L E 16.5 MAINTAINING A MINIMAL CASH BALANCE AT ENTSON

The Entson Company believes that its monthly sales during the period from November of the current year to July of next year are normally distributed with the means and standard deviations given in Table 16.2. Each month Entson incurs fixed costs of $250,000. In March taxes of $150,000 and in June taxes of $50,000 must be paid. Dividends of $50,000 must also be paid in June. Entson estimates that its receipts in a given month are a weighted sum of sales from the current month, the previous month, and two months ago, with weights 0.2, 0.6, and 0.2. In symbols, if R

t and S

t represent receipts and sales in month

t represent receipts and sales in month

t t,

then

Table 16.2 Monthly Sales (in Thousands of Dollars) for Entson Nov. Dec. Jan. Feb. Mar. Apr. May Jun. Jul.

Mean 1500 1600 1800 1500 1900 2600 2400 1900 1300 Standard Deviation 70 75 80 80 100 125 120 90 70

Rt = 0.2St − 2 + 0.6St − 1 + 0.2St (16.1)

The materials and labor needed to produce a month’s sales must be purchased one month in  advance, and the cost of these averages to 80% of the product’s sales. For example, if sales in February are $1,500,000, then the February materials and labor costs are $1,200,000, but these must be paid in January.

At the beginning of January, Entson has $250,000 in cash. The company wants to ensure that each month’s ending cash balance never falls below $250,000. This means that

© C

e n g

a g

e L

e a rn

in g

The Mean Isn’t Everything Many discussions of simulation focus on the mean of some output variable. This makes sense, given the importance of EMV for decision making, as discussed in Chapter 6. After all, EMV is just the mean of a monetary output. However, analysts in many areas, including finance, are often at least as interested in the extreme values of an output distribution. For example, the VaR 5% discussed in this example indicates nearly how bad things could

get if unlucky outcomes occur. If large amounts of money are at stake, particularly potential losses, companies might not want to play the averages by focusing only on the mean. They should be aware of potential disasters as well. Of course, simula- tion also shows the bright side, the extremes on the right that could occur if lucky outcomes occur. Managers shouldn’t be so conservative that they focus only on the negative outcomes and ignore the upside potential.

F u n da m e n ta l I n s i g h t

16-3b Cash Balance Models

All companies track their cash balance over time. As speci�c payments come due, com- panies sometimes need to take out short-term loans to keep a minimal cash balance. The following example illustrates one such application.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 853

Entson might have to take out short-term (one-month) loans. For example, if the ending cash balance at the end of March is $200,000, Entson will take out a loan for $50,000, which it will then pay back (with interest) one month later. The interest rate on a short-term loan is 1% per month. At the beginning of each month, Entson earns interest of 0.5% on its cash balance. The company wants to use simulation to estimate the maximum loan it will need to take out to meet its desired minimum cash balance. Entson also wants to analyze how its loans will vary over time, and it wants to estimate the total interest paid on these loans.

Objective To simulate Entson’s cash flows and the loans the company must take out to meet a minimum cash balance.

Where Do the Numbers Come From? Although there are many monetary inputs in the problem statement, they should all be easily accessible. Of course, Entson chooses the minimum cash balance of $250,000 as a matter of company policy.

Solution The variables for this model appear in Figure 16.18. (See the file Cash Balance Big Picture.xlsx.) Clearly, there is a considerable amount of bookkeeping in this simulation, so it is a good idea to list the events in chronological order that occur each month. We assume the following:

■ Entson observes its beginning cash balance.

■ Entson receives interest on its beginning cash balance.

■ Receipts arrive and expenses are paid (including payback of the previous month’s loan, if any, with interest).

■ If necessary, Entson takes out a short-term loan.

■ The �nal cash balance is observed, which becomes next month’s beginning cash balance.

Total Interest on Loans

Maximum Loan

Loan Amount (if any)

Final Cash Balance

Cash Balance before Loan

Interest on Cash Balance

Beginning Cash Balance

Loab Payback (principal + interest)

Receipts Interest Rate

on Cash Ini�al Cash in

January

Tax, Dividend Expenses

Interest Rate on Loan

Minimum Cash Balance

Sales

Fixed Costs

Timing of Receipts

Material, Labor Cost as % of Sales

Material, Labor Cost

Figure 16.18 Big Picture for Cash Balance Simulation Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

854 Chapter 16 Simulation Models

Developing the Simulation Model The completed simulation model appears in Figure 16.19. (See the file Cash Balance. xlsx.) It requires the following steps.

1. Inputs. Enter the inputs in the blue cells. Note that loans are simulated (in row 42) only for the period from January to June of next year. However, sales figures are required (in row 28) in November and December of the current year to generate receipts for January and February. Also, July sales are required for next year to gen- erate the material and labor costs paid in June.

2. Actual sales. Generate the sales in row 28 by entering the formula

=RISKNORMAL(B6,B7)

in cell B28 and copying across.

Cash Balance Model

Figure 16.19 Cash Balance Simulation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46

A BA B C DC D E FE F G HG H I JI J Entson cash balance simula�on

Inputs Distribu�on of monthly sales (normal)

Nov Dec Jc Jan Feb Mb Mar Apr Mr May Jun Jn Jul 130000912400260019001500180016001500Mean

St Dev 700912012510080807570

Monthly fixed cost 250250250250250250 Tax, dividend expenses 0010005100

Receipts in any month are of form: A*(sales from 2 months ago)+B*(previous month’s sales)+C*(current month’s sales), where: A BA B C

0.2 0.6 0.2

Cost of materials and labor for next month, spent this month, is a percentage of product’s sales from next month, where the percentage is: 80%

Ini�al cash in January Minimum cash balance

250 250

Monthly interest rates Interest rate on loan 1.0% Interest rate on cash 0.5%

Simula�on Nov Dec Jc Jan Feb Mb Mar Apr Mr May Jun Jn Jul

Actual sales 1516.008 1518.567 1809.091 1498.674 1952.505 2382.129 2391.557 1966.894 1443.801

Cash, receipts Beginning cash balance 250.000

250 250 250 250

Interest on cash balance 1.892 1.250 1.2501.892 378.471 257.263 250.000 250.000

1.250 250.000

1.250 1688.903 1651.523 1947.664 2298.090 2304.7391576.160Receipts

Costs Fixed costs Tax, dividend expenses 0

250 10000 150

250 0

Material, labor expenses 1198.939 1562.004 1905.704 1913.245 1573.515 1155.041 399.258

3.993 866.419

8.664 645.631

6.456 Loan payback (principal) 0.0000.000000.0 Loan payback (interest) 0.0000.000000.0

Cash balance before loan 257.263 645.631

257.263

378.471

378.471

–395.631

250.000 250.000 250.000 647.697 866.419

–616.419 –9 –149.258 399.258 0.000

647.697 Loan amount (if any) 0.0000.000 Final cash balance

Maximum loan 866.419 Total interest on loans 19.113

b

All monetary values are in $1000s.

One user suggested that the formula for total interest in cell B46 should sum only through June, i.e., not include July. You could argue it either way, so feel free to change the formula in cell B46 if you like.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 855

The loan amounts are determined by the random cash inflows and outflows and the fact that Entson’s policy is to maintain a minimum cash balance.

3. Beginning cash balance. For January of next year, enter the cash balance with the formula

=B19

in cell D31. Then for the other months enter the formula

=D43

in cell E31 and copy it across row 31. This re�ects that the beginning cash balance for one month is the �nal cash balance from the previous month.

4. Incomes. Entson’s incomes (interest on cash balance and receipts) are entered in rows 32 and 33. To calculate these, enter the formulas

=$B$24*D31

and

=SUMPRODUCT($B$14:$D$14,B28:D28)

in cells D32 and D33 and copy them across rows 32 and 33. This latter formula, which is based on Equation (16.1), multiplies the �xed weights in row 14 by the relevant sales and adds these products to calculate receipts.

5. Expenses. Entson’s expenses (fixed costs, taxes and dividends, material and labor costs, and payback of the previous month’s loan) are entered in rows 35 through 39. Calculate these by entering the formulas

=D9

=D10

=$B$17*E28

=D42

and

=D42*$B$23

in cells D35, D36, D37, E38, and E39, respectively, and copying these across rows 35 through 39. (For the loan payback, we are assuming that no loan payback is due in January.)

6. Cash balance before loan. Calculate the cash balance before the loan (if any) by entering the formula

=SUM(D31:D33)−SUM(D35:D39)

in cell D41 and copying it across row 41.

7. Amount of loan. If the value in row 41 is below the minimum cash balance ($250,000), Entson must borrow enough to bring the cash balance up to this mini- mum. Otherwise, no loan is necessary. Therefore, enter the formula

=MAX($B$20−D41,0)

in cell D42 and copy it across row 42. (You could use an IF function, rather the MAX function, to accomplish the same result.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

856 Chapter 16 Simulation Models

8. Final cash balance. Calculate the final cash balance by entering the formula

=D41+D42

in cell D43 and copying it across row 43.

9. Maximum loan, total interest. Calculate the maximum loan from January to June in cell B45 with the formula

=MAX(D42:I42)

Then calculate the total interest paid on all loans in cell B46 with the formula

=SUM(E39:J39)

10. Output range. In the usual way, designate cells B45 and B46 as output cells. Also, designate the entire range of loans, D42:I42, as an output range. To do this, select this range and click the @RISK Add Output button. It will ask you for a name of the output. We suggest “Loans.” Then a typical formula in this range, such as the formula for cell E42, will be

=RISKOUTPUT("Loans",2)+MAX($B$20−E41,0)

This indicates that cell E42 is the second cell in the Loans output range.

Running the Simulation Set the number of iterations to 1000 and the number of simulations to 1. Then run the simulation in the usual way.

Discussion of the Simulation Results After running the simulation, you will obtain the summary results in Figure 16.20. They indicate that the maximum loan varies considerably, from a low of about $470,000 to a high of about $1,514,000. The average is about $951,046. You can also see that Entson is spending close to $20,000 on average in interest on the loans, although the actual amounts vary considerably from one iteration to another.

An @RISK output range, as opposed to a single output cell, allows you to obtain a summary graph that shows the whole simulated range at once. This range is typically a time series.

Figure 16.20 Summary Measures for Cash Balance Simulation

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 857

Figure 16.21 Summary Trend Graph of Loans Through Time

© C

e n g

a g

e L

e a rn

in g

You can also gain insights from the summary trend graph of the series of loans, shown in Figure 16.21. To obtain this graph, click the third button at the bottom of the Results Summary window in Figure 16.20. (This button is also available in any distribution graph window.) This graph clearly shows how the loans vary through time. The middle line is the expected loan amount. The inner bands extend to one standard deviation on either side of the mean, and the outer bands extend to the 5th and 95th percentiles. (@RISK lets you customize these bands in a number of ways by right-clicking the graph.) You can see that the largest loans are required in March and April.

Is it intuitively clear why the required loans peak in March and April? After all, why should Entson need money in months when its sales tend to be relatively high? There are two factors working here. First, Entson has to pay its costs early. For example, it has to pay 80% of its April sales for labor and material expenses in March. Second, most of its receipts arrive late. For example, 80% of its receipts from sales in March are not received until after March. Therefore, the answer to the question is that the timing and amounts of after March. Therefore, the answer to the question is that the timing and amounts of after loans are fairly complex. Of course, this is why Entson goes to the trouble of building a simulation model. ■

E X A M P L E 16.6 INVESTING FOR RETIREMENT

Attorney Sally Evans has just begun her career. At age 25, she has 40 years until retirement, but she realizes that now is the time to start investing. She plans to invest $1000 at the beginning of each of the next 40 years. Each year, she plans to put fixed percentages—the same each year—of this $1000 into stocks, Treasury bonds (T-bonds), and Treasury bills (T-bills). However, she is not sure which percentages to use. (We call these percentages investment weights.) She does have historical annual returns from stocks,

16-3c Investment Models

Individual investors typically want to choose investment strategies that meet some pre- speci�ed goal. The following example is typical. Here, a person wants to meet a retirement goal, starting at an early age.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

858 Chapter 16 Simulation Models

T-bonds, and T-bills from 1946 to 2007. These are listed in the file Retirement Planning. xlsx. This file also includes inflation rates for these years. For example, for 1993 the annual returns for stocks, T-bonds, and T-bills were 9.99%, 18.24%, and 2.90%, respectively, and the inflation rate was 2.75%. Sally would like to use simulation to help decide what invest- ment weights to use, with the objective of achieving a large investment value, in today’s dollars, at the end of 40 years.

Objective To use simulation to estimate the value of Sally’s future investments, in today’s dollars, from several investment strategies in T-bills, T-bonds, and stocks.

Where Do the Numbers Come From? Historical returns and inflation rates, such as those quoted here, are widely available on the Web. In fact, you might want to find more recent data than we have provided here.

Solution The variables for this model appear in Figure 16.22. (See the file Retirement Planning Big Picture.xlsx.) The most difficult modeling aspect is settling on a way to use historical returns and inflation factors to generate future values of these quantities. We suggest using a scenario approach. You can think of each historical year as a possible scenario, where the scenario specifies the returns and inflation factor for that year. Then for any future year, you randomly choose one of these scenarios. It seems intuitive that more recent scenarios ought to have a greater chance of being chosen. To implement this idea, you can give a weight (not to be confused with the investment weights) to each scenario, starting with weight 1 for 2007. Then the weight for any year is a damping factor multiplied by the damping factor multiplied by the damping factor weight from the next year. For example, the weight for 1996 is the damping factor multi- plied by the weight for 1997. To change these weights to probabilities, you can divide each weight by the sum of all the weights. The damping factor illustrated here is 0.98. Others could be used instead, and it is not clear which produces the most realistic results.

The other difficult part of the solution is choosing “good” investment weights. This is really an optimization problem: find three weights that add to 1 and produce the largest mean final cash. (@RISK contains a powerful tool, RiskOptimizer, that solves this type of opti- mization–simulation problem, but we will not use it here.) This example illustrates several sets of weights, where some percentage is put into stocks and the remainder is split evenly between T-bonds and T-bills, and see which does best. You can try other sets if you like.

You can simulate future scenarios by randomly choosing past scenarios, giving higher probabilities to more recent scenarios.

Without a tool like RiskOptimizer, you cannot find the “best” set of investment weights, but the simulation model lets you experiment with various sets of weights.

Final Cash (today’s dollars)

Deflator for Infla on

Senario Returns, Infla on

Investment Weights

Ending Cash

Amount to Invest each Yeareach Yeareach Y

Historical Returns and Infla on

Damping Factor for Probabili es

Probabili es of Scenarios

Beginning Cash Future Scenarios

Figure 16.22 Big Picture for Retirement Planning Simulation Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 859

Developing the Simulation Model The historical data and the simulation model (each with some rows hidden) appear in Figures 16.23 and 16.24. (Again, see the Retirement Planning.xlsx file.) It can be devel- oped as follows.

1. Inputs. Enter the data in the blue regions of Figures 16.23 and 16.24.

Investing for Retirement Model

Figure 16.23 Historical Data, Inputs, and Probabilities

1 2 3 4 5 6 7 8 9

58 59 60 61 62 63 64 65 66 67

A BA B C DC D E FE F G

Historical data and probabili�es

Planning for re�rement

Year 1946 1947 1948 1949 1950 1999 2000 2001 2002 2003 2004 2005 2006 2007

ProbWts 0.2916 0.2976 0.3036 0.3098 0.3161 0.8508 0.8681 0.8858 0.9039 0.9224 0.9412 0.9604 0.9800 1.0000

35.7115

Probability 0.0082 0.0083 0.0085 0.0087 0.0089 0.0238 0.0243 0.0248 0.0253 0.0258 0.0264 0.0269 0.0274 0.0280 1.0000

Historical data and probabili�es T-Bonds –0.0010 –0.0263

0.0340 0.0645 0.0006

–0.0825 0.1666 0.0557 0.1512 0.0038 0.0449 0.0287 0.0196 0.0488

Stocks –0.0807

0.0571 0.0550 0.1879 0.3171 0.2089

–0.0903 –0.1185 –0.2198

0.2841 0.1070 0.0485 0.1563 0.1021

Infla on 0.1817 0.0901 0.0271

–0.0180 0.0579 0.0270 0.0340 0.0160 0.0159 0.0227 0.0268 0.0339 0.0324 0.0285

Sums—>

T-Bills 0.0035 0.0050 0.0081 0.0110 0.0120 0.0439 0.0537 0.0573 0.0180 0.0180 0.0218 0.0431 0.0488 0.0548

© C

e n g

a g

e L

e a rn

in g

2. Weights.Weights.W The investment weights used for the model are in rows 10 through 12 of Figure 16.23. (For example, the first set puts 80% in stocks and 10% in each of T-bonds and T-bills.) You can simulate all three sets of weights simultaneously with a RISKSIMTABLE and VLOOKUP combination as follows. First, enter the formula

=RISKSIMTABLE(51,2,36) in cell I16. Then enter the formula

=VLOOKUP($I$16,LTable1,2)

in cell J16 and copy it to cells K16 and L16. Then modify the formulas in these latter two cells, changing the last argument of the VLOOKUP to 3 and 4, respectively. For example, the formula in cell L16 should end up as

=VLOOKUP($I$16,LTable1,4)

The effect is that you can run three simulations, one for each set of weights in rows 10 through 12.

3. Probabilities. Enter value 1 in cell F66. Then enter the formula

=$J$4*F66

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

860 Chapter 16 Simulation Models

in cell F65 and copy it up to cell F5. Sum these values with the SUM function in cell F67. Then to convert them to probabilities (numbers that add to 1), enter the formula

=F5/$F$67

in cell G5 and copy it down to cell G66. Note how the probabilities for more recent years are considerably larger. When scenarios are selected randomly, recent years will have a greater chance of being chosen. (The SUM formula in cell G67 con�rms that the probabilities sum to 1.)

4. Scenarios. Moving to the model in Figure 16.24, the goal is to simulate 40 scenarios in columns K through O, one for each year of Sally’s investing. To do this, enter the formulas

=RISKDISCRETE($A$5:$A$66,$G$5:$G$66)

and

=1+VLOOKUP($K24,LTable2,L$22)

in cells K24 and L24, and copy this latter formula to the range M24:O24. Then copy all of these formulas down to row 63. Make sure you understand how the RISKDISCRETE and VLOOKUP functions combine to achieve the goal. (Also, check the list of range

Figure 16.24 Retirement Simulation Model

3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 56 57 58 59

I JI J K LK L M NM N O PO P Q Inputs Damping factor 0.98 Range names used Yearly investment =Model!$I$10:$L$12LTable1$1,000 Planning horizon =Model!$A$5:$E$66LTable2years40

Weights =Model!$J$16:$L$16 Alterna�ve sets of weights to test

Index T-Bills T-Bonds Stocks 1 0.10 0.10 0.80 2 0.20 0.20 0.60 3 0.30 0.30 0.40

Weights used Index T-Bills T-Bonds Stocks

1 0.10 0.10 0.80

Output from simula�on below Final cash (today’s dollars) $47,921

Simula�on model 2 3 4 5 Future year

1 2 3 4 5 6

33 34 35 36

Beginning cash $1,000 $1,889 $3,026 $4,165 $5,555 $6,428

$102,516 $135,562 $182,967 $181,887

Scenario 1973 1992 2005 1968 1981 1968 1975 1958 1990 1961

T-Bills 1.0693 1.0351 1.0431 1.0521 1.1471 1.0521 1.0580 1.0154 1.0781 1.0213

T-Bonds 0.9889 1.0805 1.0287 0.9974 1.0185 0.9974 1.0919 0.9390 1.0618 1.0097

Stocks 0.8534 1.0767 1.0485 1.1106 0.9509 1.1106 1.3720 1.4336 0.9683 1.2689

Ending cash $889

$2,026 $3,165 $4,555 $5,428 $7,029

$134,562 $181,967 $180,887 $221,579

Deflator 0.919 0.893 0.864 0.825 0.757 0.723 0.194 0.191 0.180 0.179

Column offset for lookup2

Infla�on 1.0880 1.0290 1.0339 1.0472 1.0894 1.0472 1.0701 1.0176 1.0611 1.0067 ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 861

names used at the top of Figure 16.24.) The RISKDISCRETE randomly generates a year from column A, using the probabilities in column G. Then the VLOOKUP captures the data from this year. (You add 1 to the VLOOKUP to get a value such as 1.08, rather than 0.08.) This is the key to the simulation. (By the way, do you see why Excel’s RANDBETWEEN function isn’t used to generate the years in column K? The reason is that this function makes all possible years equally likely, and the goal is to make more recent years more likely.)

5. Beginning, ending cash. The bookkeeping part is straightforward. Begin by enter- ing the formula

=J5

in cell J24 for the initial investment. Then enter the formulas

=J24*SUMPRODUCT(Weights,L24:N24)

and

=$J$5+P24

in cells P24 and J25 for ending cash in the �rst year and beginning cash in the second year. The former shows how the beginning cash grows in a given year. You should think it through carefully. The latter implies that Sally reinvests her previous money, plus she invests an additional $1000. Copy these formulas down columns J and P.

6. Deflators. You eventually need to deflate future dollars to today’s dollars. The proper way to do this is to calculate deflators (also called deflation factors). Do this by entering the formula

=1/O24

in cell Q24. Then enter the formula

=Q24/O25

in cell Q25 and copy it down. The effect is that the de�ator for future year 20, say, in cell Q43, is 1 divided by the product of all 20 in�ation factors up through that year. (This is similar to discounting for the time value of money, but the relevant discount rate, now the in�ation rate, varies from year to year.)

7. Final cash. Calculate the final value in today’s dollars in cell K19 with the formula

=P63*Q63

Then designate this cell as an @RISK output cell.

Running the Simulation Set the number of iterations to 1000 and the number of simulations to 3 (one for each set of investment weights to be tested). Then run the simulation as usual.

Discussion of the Simulation Results Summary results appear in Figure 16.25. The first simulation, which invests the most heav- ily in stocks, is easily the winner. Its mean final cash, slightly more than $153,000 in today’s dollars, is much greater than the means for the other two sets of weights. The first simulation also has a much larger upside potential (its 95th percentile is close to $340,000), and even its downside is slightly better than the others: Its 5th percentile is the best, and its minimum is only slightly worse than the minimum for the other sets of weights.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

862 Chapter 16 Simulation Models

Figure 16.26 Histogram of Final Cash with 80% in Stocks

© C

e n g

a g

e L

e a rn

in g

Nevertheless, the histogram for simulation 1 (put 80% in stocks), shown in Figure 16.26, indicates a lot of variability—and skewness—in the distribution of final cash. As in Example 16.4, the concept of value at risk (VaR) is useful. Recall that VaR 5% is defined as the 5th percentile of a distribution and is often the value investors worry about. Perhaps Sally should rerun the simulation with different investment weights, with an eye on the weights that increase her VaR 5%. Right now it is about $39,400—not too good considering that she invests $40,000 total. She might not like the prospect of a 5% chance of ending up with no more than this. We also encourage you to try running this simulation with other investment weights, both for the 40-year horizon and (after modifying the spreadsheet model slightly) for shorter time horizons such as 10 or 15 years. Even though the stock strategy appears to be best for a long horizon, it is not necessarily guaranteed to dominate for a shorter time horizon. ■

Figure 16.25 Summary Results for Retirement Simulation

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-3 Financial Models 863

P R O B L E M S

Level A 8. Rerun the new car simulation from Example 16.4, but

now introduce uncertainty into the fixed development cost. Let it be triangularly distributed with parameters $600 million, $650million, and $850 million. (You can check that the mean of this distribution is $700 million, the same as the cost given in the example.) Comment on the differences between your output and those in the example. Would you say these differences are important for the company?

9. Rerun the new car simulation from Example 16.4, but now use the RISKSIMTABLE function appropriately to simulate discount rates of 5%, 7.5%, 10%, 12.5%, and 15%. Comment on how the outputs change as the discount rate decreases from the value used in the example, 10%.

10. In the cash balance model from Example 16.5, the timing is such that some receipts are delayed by one or two months, and the payments for materials and labor must be made a month in advance. Change the model so that all receipts are received immediately, and pay- ments made this month for materials and labor are 80% of sales this month (not next month). The period of interest is again January through June. Rerun the simulation, and comment on any differences between your outputs and those from the example.

11. In the cash balance model from Example 16.5, is the $250,000 minimum cash balance requirement really “costing” the company very much? Answer this by rerunning the simulation with minimum required cash balances of $50,000, $100,000, $150,000, and $200,000. Use the RISKSIMTABLE function to run all simulations at once. Comment on the outputs from these simulations. In particular, comment on whether the company appears to be better off with a lower minimum cash balance.

12. Run the retirement model from Example 16.6 with a damping factor of 1.0 (instead of 0.98), again using the same three sets of investment weights. Explain in words what it means, in terms of the simulation, to have a damping factor of 1. Then comment on the dif- ferences, if any, between your simulation results and those in the example.

13. The simulation output from Example 16.6 indicates that an investment heavy in stocks produces the best results. Would it be better to invest entirely in stocks? Answer this by rerunning the simulation. Is there any apparent downside to this strategy?

14. Modify the model from Example 16.6 so that you use only the years 1975 to 2007 of historical data. Run the simulation for the same three sets of investment

weights. Comment on whether your results differ in any important way from those in the example.

15. Referring to the retirement example in Example 16.6, rerun the model for a planning horizon of 10 years; 15 years; 25 years. For each, which set of investment weights maximizes the VaR 5% (the 5th percentile) of final cash in today’s dollars? Does it appear that a portfolio heavy in stocks is better for long horizons but not for shorter horizons?

Level B 16. Change the new car simulation from Example 16.4 as

follows. It is the same as before for years 1 through 5, including depreciation through year 5. However, the car might sell through year 10. Each year after year 5, after year 5, after the company examines sales. If fewer than 45,000 cars were sold that year, there is a 50% chance the car won’t be sold after that year. Modify the model and run the simulation. Keep track of two outputs: NPV (through year 10) and the number of years of sales.

17. Based on Kelly (1956). You currently have $100. Each week you can invest any amount of money you currently have in a risky investment. With probability 0.4, the amount you invest is tripled (e.g., if you invest $100, you increase your asset position by $300), and, with probability 0.6, the amount you invest is lost. Consider the following investment strategies:

■ Each week, invest 10% of your money.

■ Each week, invest 30% of your money.

■ Each week, invest 50% of your money.

Use @RISK to simulate 100 weeks of each strategy 1000 times. Which strategy appears to be best in terms of the maximum growth rate? (In general, if you can multiply your investment by M with probability M with probability M p and lose your investment with probability q = 1 − p, you should invest a fraction [p[p[ (M − 1) − q]/(M − 1) of your money each week. This strategy maximizes the expected growth rate of your fortune and is known as the Kelly criterion.) (Hint: If an initial wealth of I dollars grows to F dollars in 100 weeks, the weekly F dollars in 100 weeks, the weekly F growth rate, labeled r, satisfies F = (1 + r)100*I, so that r = (F/F/F I/I/ )I)I 1/100– 1.)

18. Amanda has 30 years to save for her retirement. At the beginning of each year, she puts $5000 into her retirement account. At any point in time, all of Amanda’s retirement funds are tied up in the stock market. Suppose the annual return on stocks follows a normal distribution with mean 12% and standard deviation 25%. What is the probability that at the end of 30 years, Amanda will have reached her goal

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

864 Chapter 16 Simulation Models

of having $1,000,000 for retirement? Assume that if Amanda reaches her goal before 30 years, she will stop investing. (Hint: Each year you should keep track of Amanda’s beginning cash position—for year 1, this is $5000—and Amanda’s ending cash position. Of course, Amanda’s ending cash position for a given year is a function of her beginning cash position and the return on stocks for that year. To estimate the probability that Amanda meets her goal, use an IF statement that returns 1 if she meets her goal and 0 otherwise.)

19. In the financial world, there are many types of com- plex instruments called derivatives that derive their value from the value of an underlying asset. Consider the following simple derivative. A stock’s current price is $80 per share. You purchase a derivative whose value to you becomes known a month from now. Specifically, let P be the price of the stock in a month. If P is between $75 and $85, the derivative is worth nothing to you. If P is less than $75, the derivative results in a loss of 100*(75 − P) dollars to you. (The factor of 100 is because many derivatives involve 100 shares.) If P is greater than $85, the derivative results in a gain of 100*(P − 85) dollars to you. Assume that the distribution of the change in the stock price from now to a month from now is normally distributed with mean $1 and standard deviation $8. Let E be the E be the E expected gain/loss from this derivative. It is a weighted average of all the possible losses and gains, weighted by their likelihoods. (Of course, any loss should be expressed as a negative number. For example, a loss of $1500 should be expressed as −$1500.) Unfortunately,

this is a difficult probability calculation, but E can E can E be estimated by an @RISK simulation. Perform this simulation with at least 1000 iterations. What is your best estimate of E?

20. Suppose you currently have a portfolio of three stocks, A, B, and C. You own 500 shares of A, 300 of B, and 1000 of C. The current share prices are $42.76, $81.33, and $58.22, respectively. You plan to hold this portfolio for at least a year. During the coming year, economists have predicted that the national economy will be awful, stable, or great with probabilities 0.2, 0.5, and 0.3, respectively. Given the state of the economy, the returns (one-year percentage changes) of the three stocks are independent and normally distributed. However, the means and standard deviations of these returns depend on the state of the economy, as indicated in the file P16_20.xlsx. a. Use @RISK to simulate the value of the portfolio

and the portfolio return in the next year. How likely is it that you will have a negative return? How likely is it that you will have a return of at least 25%?

b. Suppose you had a crystal ball where you could predict the state of the economy with certainty. The stock returns would still be uncertain, but you would know whether your means and standard deviations come from row 6, 7, or 8 of the file P16_20.xlsx. If you learn, with certainty, that the economy is going to be great in the next year, run great in the next year, run great the appropriate simulation to answer the same questions as in part a. Repeat this if you learn that the economy is going to be awful. How do these results compare with those in part a?

16-4 MARKETING MODELS There are plenty of opportunities for marketing departments to use simulation. They face uncertainty in the brand-switching behavior of customers, the entry of new brands into the market, customer preferences for different attributes of products, the effects of advertising on sales, and so on. We examine some interesting marketing applications of simulation in this section.

16-4a Models of Customer Loyalty

What is a loyal customer worth to a company? This is an extremely important question for companies. (It is an important part of customer relationship management, or CRM, cur- rently a hot topic in marketing.) Companies know that if customers become dissatis�ed with the company’s product, they are likely to switch and never return. Marketers refer to this customer loss as churn. The loss in pro�t from churn can be large, particularly because long-standing customers tend to be more pro�table in any given year than new customers. The following example uses a reasonable model of customer loyalty and simulation to estimate the worth of a customer to a company. It is based on the excellent discussion of customer loyalty in Reichheld (1996).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 865

E X A M P L E 16.7 THE LONG-TERM VALUE OF A CUSTOMER AT CCAMERICA

CCAmerica is a credit card company that does its best to gain customers and keep their business in a highly competitive industry. The first year a customer signs up for service typically results in a loss to the company because of various administrative expenses. However, after the first year, the profit from a customer is typically positive, and this profit tends to increase through the years. The company has estimated the mean profit from a typical customer to be as shown in column B of Figure 16.28 below. (See the file Customer Loyalty.xlsx.) For example, the company expects to lose $40 in the customer’s first year but to gain $87 in the fifth year—provided that the customer stays loyal that long. For modeling purposes, we assume that the actual profit from a customer in the customer’s actual profit from a customer in the customer’s actual nth year of service is normally distributed with mean shown in Figure 16.28 and standard deviation equal to 10% of the mean. At the end of each year, the customer leaves the com- pany, never to return, with probability 0.15, the churn rate. Alternatively, the customer stays with probability 0.85, the retention rate. The company wants to estimate the NPV of the net profit from any such customer who has just signed up for service at the beginning of year 1, at a discount rate of 15%, assuming that the cash flow occurs in the middle of the year.3 of year 1, at a discount rate of

3 of year 1, at a discount rate of

It also wants to see how sensitive this NPV is to the retention rate.

Objective To use simulation to find the NPV of a customer and to see how this varies To use simulation to find the NPV of a customer and to see how this varies T with the retention rate.

Where Do the Numbers Come From? The numbers in column B of Figure 16.28 are undoubtedly averages, based on the histori- cal records of many customers. To build in randomness for any particular customer, we particular customer, we particular need a probability distribution around the numbers in this figure. We arbitrarily chose a normal distribution centered on the historical average and a standard deviation of 10% of the average. These are educated guesses. Finally, the churn rate is a number very familiar to marketing people, and it can also be estimated from historical customer data.

Solution The variables for this model appear in Figure 16.27. (See the file Customer Loyalty Big Picture.xlsx.) The idea is to keep simulating profits (or a loss in the first year) for the customer until the customer churns. We simulate 30 years of potential profits, but this could be varied.

Figure 16.27 Big Picture for Customer Loyalty Simulation Model

3This assumption makes the NPV calculation slightly more complex, but it is probably more realistic than the usual assumption that cash �ows occur at the ends of the years.

NPV of Annual Profits

Discount ProfitDiscount Rate

Actual Profit for Year

Standard Devia�on of Profit (% of mean)

Quits A�er this Year?

Mean Profit from Customer

Reten�on Rate

Years Loyal ©

C e

n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

866 Chapter 16 Simulation Models

Developing the Simulation Model The simulation model appears in Figure 16.28. It can be developed with the following steps.

1. Inputs. Enter the inputs in the blue cells.

2. Retention rate. Although an 85% retention rate was given in the statement of the problem, it is useful to investigate retention rates from 75% to 95%, as shown in row 4. To run a separate simulation for each of these, enter the formula

=RISKSIMTABLE(D4:H4) in cell B4.

3. Timing of churn. In column C, use simulation to discover when the customer churns. This column will contain a sequence of No values, followed by a Yes, and

Customer Loyalty Model

Figure 16.28 Customer Loyalty Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

Customer loyalty model in the credit card industry

A

Inputs Reten�on rates to try

Reten�on rate

Discount rate

Stdev % of mean

Es�mated means Simula�on Outputs Batch

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

Discounted profit

–37.20

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

NPV

YearYearY s loyal

Means Simula on

1

2

3

4

5

Reten on rate

0.75

0.80

0.85

0.90

0.95

NPV

$100.57

$129.47

$184.68

$249.13

$361.55

YearYearY s loyal

4.06

4.91

6.73

9.54

15.62

B CB C D ED E F GF G H IH I J

0.75 0.80 0.85 0.90 0.950.75

0.15

10%

Mean Profit(if s ll here)

–40.00

66.00

72.00

79.00

87.00

92.00

96.00

99.00

103.00

106.00

111.00

116.00

120.00

124.00

130.00

137.00

142.00

148.00

155.00

161.00

161.00

161.00

161.00

161.00

161.00

161.00

161.00

161.00

161.00

161.00

Quits at end of year?

Yes

Actual profit

–39.89

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

0.00

–$37.20

1

400 300 200 100

0.70 0.75 0.80 0.85

Reten�on rate

Sensi�vity to Reten�on Rate

0.90 0.95 1.00 0

NPV YearYearY s loyal

© C

e n g

a g

e L

e a rn

in g

As usual, Excel’s RAND function can be used inside an IF statement to determine whether a given event occurs.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 867

then a sequence of blanks (or all No values if the customer never churns). To gener- ate these, enter the formulas

=IF(RAND()<1−B4,"Yes","No")

and

=IF(C11<>"No","",IF(RAND()<1−$B$4,"Yes","No"))

in cells C11 and C12, and copy the latter formula down column C. Study these formu- las carefully to see how the logic works. Note that they do not rely on @RISK func- tions. Excel’s RAND function can be used any time you want to simulate whether or not an event occurs.

4. Actual and discounted profits. Profits (or a loss in the first year) occur as long as there is not a blank in column C. Therefore, simulate the actual profits by entering the formula

=IF(C11<>"",RISKNORMAL(B11,$B$6*ABS(B11)),0)

in cell D11 and copying it down. (The absolute value function, ABS, is required in case any of the cash �ows are negative. A normal distribution cannot have a negative standard deviation.) Then discount these appropriately in column E by entering the formula

=D11/(1+$B$5)^(A11−0.5)

in cell E11 and copying it down. Note how the exponent of the denominator accounts for the cash �ow in the middle of the year.

5. Outputs. Keep track of two outputs, the total NPV and the number of years the customer stays with the company. Calculate the NPV in cell H10 by summing the discounted values in column E. (They have already been discounted, so the NPV function is not needed.) To find the number of years the customer is loyal, count the number of No values plus the number of Yes values, that is, all nonblanks. Calculate this in cell H11 with the formula

=COUNTIF(C11:C40,"No")+COUNTIF(C11:C40,"Yes")

Finally, designate both of cells H10 and H11 as @RISK output cells.

Running the Simulation Set the number of iterations to 1000 and the number of simulations to 5 (one for each potential retention rate). Then run the simulation as usual.

Discussion of the Simulation Results Summary results for all five retention rates and the histogram for an 85% retention rate appear in Figure 16.29. You can see that the mean NPV and the mean number of years loyal are quite sensitive to the retention rate.

To follow up on this observation, you can use the RISKMEAN function to capture the means in columns I and J of the model sheet and then create a line chart of them as a function of the retention rate. (See Figure 16.28.) This line chart shows the rather dramatic effect the retention rate can have on the value of a customer. For example, if it increases from the current 85% to 90%, the mean NPV increases by about 35%. If it increases from

Varying the retention rate can have a large impact on the value of a customer.

Careful discounting is required if cash flows occur in the middle of a year.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

868 Chapter 16 Simulation Models

Figure 16.29 Summary Results for Customer Loyalty Model

© C

e n g

a g

e L

e a rn

in g

85% to 95%, the mean NPV increases by about 96%. In the other direction, if the reten- tion rate decreases from 85% to 80%, the mean NPV decreases by about 30%. This is why credit card companies are so anxious to keep their customers. ■

The following example is a variation of the customer loyalty example. We now inves- tigate the effect of offering a customer an incentive to remain loyal.

E X A M P L E 16.8 THE VALUE OF A FREE MAINTENANCE AGREEMENT

Companies value loyal customers, and they sometimes go to great lengths to keep their customers loyal. This example investigates whether one such plan is worth its cost. We consider a nationwide company called Jamesons, which sells electronic appliances. Specifically, we will focus on sales of DVD players. To attract customers, the company is considering giving customers a free maintenance agreement with each purchase of a DVD player. The unit profit without free maintenance is currently $20. The company believes this will decrease to $16 with free maintenance. Their thinking is that about 4% of custom- ers will actually use the free maintenance, and for each such customer, the company will lose about $100. Hence the average decrease in profit per purchaser is about $4.

Prior to this year, 50,000 customers were loyal to Jamesons and 100,000 custom- ers were loyal to their competitors. (Loyalty is defined in terms of where the customer bought his or her last DVD player.) There are a number of uncertain quantities, and we assume they are all triangularly distributed. Their parameters (minimum, most likely, and maximum) are as follows. (1) The percentage of the 150,000 customers who purchase a DVD player in any given year has parameters 20%, 25%, and 40%. (2) The annual percentage change in unit profit has parameters 3%, 5%, and 6%. (3) In any year, the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 869

percentage of Jamesons’ loyal customers who remain loyal has parameters 56%, 60%, and 66% if there is no free maintenance, and they increase to 60%, 64%, and 70% with free maintenance. (4) Similarly, the percentage of the competitors’ loyal customers who switch to Jamesons has parameters 27%, 30%, and 34% if there is no free maintenance, and they increase to 32%, 35%, and 39% with free maintenance. These inputs are shown in the top section of Figure 16.31 below.

Jamesons is hoping that the decrease in unit profit from the free maintenance agree- ment will be more than offset by the higher loyalty percentages. Using a 15-year planning horizon, does the NPV of profits with a 10% discount rate confirm the company’s hopes?

Objective To use simulation to see whether it makes sense for Jamesons to give a free maintenance agreement to DVD player purchasers.

Where Do the Numbers Come From? In the previous example, we discussed the switching rates, which would be estimated from extensive customer data. The other data in the problem statement are straightforward to obtain.

Solution The variables for this model are shown in Figure 16.30. (See the file Free Maintenance Big Picture.xlsx.) The solution strategy is to compare two simulations, one without free maintenance and one with it. Because they are so similar, you can use RISKSIMTABLE to run both simulations. We make one assumption that is common in marketing but might not

NPV of Our Profits

Profit Contributed

Ini�al # Loyal to them

Ini�al # Loyal to us

Ini�al Unit Profit

Customers Loyal to them

Customers Loyal to us

% Change in Unit Profit

% Loyal to us who Purchase

% Loyal to them who Purchase

% who Stay Loyal to us

% who Switch Loyalty to us

Offer Free Maintenance?

Unit Profit

Purchases of Our Product

Discounted Rate

Figure 16.30 Big Picture for Free Maintenance Simulation Model

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

870 Chapter 16 Simulation Models

be intuitive. We assume that only purchasers in a given year have any chance of switch- ing loyalty in the next year. For example, if a customer is loyal to Jamesons and doesn’t purchase a DVD player in a given year, this customer is automatically loyal to Jamesons in the next year.

Developing the Simulation Model The completed simulation model appears in Figure 16.31. (See the first finished version of the file Free Maintenance.xlsx.) It can be developed with the following steps.

Free Maintenance Agreement Model

1. Inputs. Enter the given data in the blue cells.

2. Maintenance decision. The current “no free maintenance” policy is labeled simu- lation #1 and the proposed “free maintenance” policy is labeled simulation #2, so enter the formula

=RISKSIMTABLE(51,26) in cell B21.

3. Percentages who purchase. We assume that each year a random percentage of Jamesons’ loyal customers and a random percentage of the competitors’ loyal cus- tomers purchase a DVD player. Each of these is generated from the triangular distri- bution in rows 9–11, so enter the formula

=RISKTRIANG($B$9,$B$10,$B$11)

in cell B24 and copy it to the range B24:Q25.

4. Percentage who stay or become loyal. Each year a random percentage of the customers previously loyal to Jamesons remain loyal, and a random percentage of the competitors’ previously loyal customers switch loyalty to Jamesons. Also, the

Figure 16.31 Free Maintenance Simulation Model

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

Free maintenance agreement - is it worth it?

A

Common inputs Inputs that depend on policy

Loyal customers in previous year

To our brTo our brT and

To their brTo their brT and

% of poten�al customers who purchase in any year (triangular distribu�on)

Minimum

Most likely

Maximum

Annual % growth in profit contribu�on (triangular distribu�on)

Minimum

Most likely

Maximum

Discount rate

Simula�on

Index of simula�on

YearYearY

% loyal to us who purchase

% loyal to them who purchase

% who stay loyal to us

% who switch loyalty to us

Customers loyal to us

Customers loyal to them

Purchases of our product

% change in unit profit

Unit profit

Profit contribu�on

NPV

B CB C D ED E F GF G H IH I J KJ K L ML M N ON O P QP Q

Unit profit

% of our loyal customers who remain loyal (triangular distribu�on)

Minimum

Most likely

Maximum

% of their loyal customers who switch to us (triangular distribu�on)

Minimum

Most likely

Maximum

50000

100000

In this version, different random percentages are generated for each year. ear. ear

(See the formulas in the green cells below). Also, note how the index in cell

B21, along with VLOOKUPs and RISKSIMTABLE func�ons), permit ys and RISKSIMTABLE func�ons), permit ys and RISKSIMT ou to run

two simula�ons, one without free maintenance and one with it.

Not free

$20

56%

60%

66%

27%

30%

34%

Free

$16

60%

64%

70%

32%

35%

39%

20%

25%

40%

3%

5%

6%

10%

1

0

30.8%

35.6%

50000

100000

$3,307,582

1

29.1%

32.1%

60.0%

30.3%

54608

95392

15903

$20.00

$318,057

2

30.1%

35.7%

61.4%

29.4%

57490

92510

17286

4.78%

$20.96

$362,238

33

26.5%

28.5%

63.0%

30.0%

61022

88978

16169

3.52%

$21.69

$350,743

44

21.1%

34.6%

59.3%

29.3%

61875

88125

13087

4.64%

$22.70

$297,058

55

24.1%

23.7%

62.2%

33.1%

67024

82976

16125

5.19%

$23.88

$385,014

66

26.7%

27.9%

57.9%

31.0%

66336

83664

17727

4.12%

$24.86

$440,709

77

28.4%

30.5%

64.2%

32.5%

67572

82428

19199

3.91%

$25.83

$495,979

88

24.6%

24.6%

59.3%

31.0%

67544

82456

16619

5.73%

$27.31

$453,941

99

22.5%

24.6%

60.7%

31.9%

67491

82509

15194

4.95%

$28.67

$435,560

1010

27.9%

35.0%

59.1%

30.3%

67414

82586

18806

3.76%

$29.75

$559,393

11

28.6%

22.4%

58.9%

31.8%

68848

81152

19695

3.99%

$30.93

$609,220

12

21.7%

28.1%

59.9%

30.6%

66497

83503

14445

4.22%

$32.24

$465,722

13

28.8%

25.7%

63.2%

31.7%

68626

81374

19758

5.05%

$33.87

$669,169

14

32.6%

31.4%

60.1%

30.4%

67096

82904

21845

4.99%

$35.56

$776,754

15

23.6%

30.8%

59.2%

30.0%

65989

84011

15548

4.16%

$37.04

$575,837

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 871

distributions of these random percentages depend on the company’s maintenance policy. Therefore, enter the formula

=IF($B$21=1,RISKTRIANG($G$8,$G$9,$G$10),RISKTRIANG($H$8,$H$9,$H$10))

in cell C26, enter the formula

=IF($B$21=1,RISKTRIANG($G$13,$G$14,$G$15),RISKTRIANG($H$13,$H$14,$H$15))

in cell C27, and copy these across their rows.

5. Numbers of loyal customers. Create links to cells B5 and B6 in cells B28 and B29. Then, remembering that only purchasers in a given year can switch loyalty, calcu- late the number of customers loyal to Jamesons in year 1 with the formula

=B28*((1-B24)+B24*C26)+B29*B25*C27 in cell C28 and copy it across row 28. Similarly, calculate the number of customers loyal to the competitors in year 1 with the formula

=B29*((1-B25)+B25*(1-C27))+B28*B24*(1-C26) in cell C29 and copy it across row 29. These are basic bookkeeping formulas. Jamesons’ loyal customers are those who (1) were loyal and didn’t purchase, (2) were loyal, purchased, and stayed loyal, and (3) weren’t loyal, purchased, and switched loy- alty. Similar logic holds for the competitors’ loyal customers.

6. Purchasers at Jamesons. Calculate the number of purchasers at Jamesons in year 1 with the formula

=C24*C28 in cell C30 and copy it across row 30.

7. Monetary outcomes. These are straightforward. Start by entering the formula =IF($B$21=1,G5,H5)

for unit pro�t in year 1 in cell C32. Then enter the formulas

=RISKTRIANG($B$14,$B$15,$B$16) =C32*(1+D31) and

=C32*C30

in cells D31, D32, and C33, respectively, and copy them across their rows. Finally, calculate the NPV with the formula

=NPV(B18,C33:Q33)

in cell B35, and designate this as an @RISK output cell.

Running the Simulation Set up @RISK to run 1000 iterations and 2 simulations, one for each maintenance decision to be tested. Then run the simulation as usual.

Discussion of the Simulation Results The summary measures for the two simulations appear in Figure 16.32. Using the current inputs, the free maintenance initiative does not look good. Every measure, except possibly the standard deviation, is worse with the free maintenance agreement (bottom row) than without it (top row). Evidently, the increase in loyal customers does not compensate for the decrease not compensate for the decrease not in unit profit. If Jamesons is reasonably confident about the inputs for this model, it should scrap the free maintenance idea. However, it might want to perform some sensitivity analysis on the decrease in unit profit or the increase in loyalty percentages (or both) to see when the free maintenance agreement starts looking attractive. We tried two possibilities. First, if the decrease in unit profit is only $2, not $4, and everything else remains the same, the two mean

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

872 Chapter 16 Simulation Models

Figure 16.32 Summary Measures for Comparing Two Decisions

© C

e n g

a g

e L

e a rn

in g

NPVs are very close, so the free maintenance agreement might be worth trying. Second, if the decrease in unit profit remains at $4, but all of the input percentages in the ranges H8:H10 and H13:H15 increase by five percentage points, the mean NPV with the free maintenance agreement is still considerably lower than the mean NPV without it. Evidently, the company can’t take this big a hit in its profit margin unless it can convince a lot more customers to stay lot more customers to stay lot or become loyal.

There is an interesting modeling issue in this example. For each of the random quantities, we have generated a new random value each year. Would it be better to generate one random number from each triangular distribution and use it for each year? Would it make a difference in the results? The modified simulation appears in the second finished version of the Free Maintenance.xlsx file. The summary measures from this simulation appear in Figure 16.33. If we are interested in comparing the mean NPV with no free maintenance versus free main- tenance, we get about the same comparison in either model. The main difference between Figures 16.32 and 16.33 is the variability. Are you surprised that the models with more random numbers in Figure 16.32 have much smaller standard deviations than those in Figure 16.33? Evidently, there is an averaging effect. When different random numbers are used for each year, the highs and lows tend to cancel out, resulting in lower variability in NPV. ■

Figure 16.33 Summary Results for Modified Model

© C

e n g

a g

e L

e a rn

in g

16-4b Marketing and Sales Models

We conclude this marketing section with a model of marketing and selling condos. The main issue is the timing of sales, and we demonstrate how a deterministic model of this timing can provide very misleading results.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 873

© C

e n g

a g

e L

e a

rn in

g

E X A M P L E 16.9 MARKETING AND SELLING CONDOS

Blackstone Development Company has just finished building 120 high-end condos, each priced at $300,000. Blackstone has hired another company, Pletcher Marketing, to mar- ket and sell these condos. Pletcher will incur all of the marketing and maintenance costs, assumed to be $800 per unsold condo per month, and it will receive a 10% commission ($30,000) from Blackstone at the time of each condo sale. Because Blackstone wants these condos to be sold in a timely manner, it has offered Pletcher a $200,000 bonus at the end of the first year if at least half of the condos have been sold, and an extra $500,000 bonus at the end of the second year if all of the condos have been sold. Pletcher estimates that it can sell five condos per month on average, so that it should be able to collect the bonuses. However, Pletcher also realizes that there is uncertainty about the number of sales per month. How should this uncertainty be modeled, and will the resulting simulation model give different qualitative results than a deterministic model where exactly five condos are sold per month?

Objective To develop a simulation model that allows us to see how the uncertain timing affects the monetary outcomes for Pletcher, and to compare this simulation model to a deterministic model with no uncertainty about the timing of sales.

Where Do the Numbers Come From? The inputs are straightforward from Blackstone’s agreement with Pletcher. The only difficulty is determining an appropriate probability model for the timing of sales, which we discuss next.

Solution To make a fair comparison between a deterministic model with five sales per month and a simulation model with uncertainty in the timing of sales, we need a discrete distribution for monthly sales that has mean 5. One attractive possibility is to use the Poisson distribution discussed briefly in Chapter 5. It is discrete, and it has only one parameter, the mean. The Poisson distribution has one theoretical drawback in that it allows all nonnegative integers all nonnegative integers all to occur, but this has no practical effect. As shown in Figure 16.34, the Poisson distribution with mean 5 has virtually no probability of values larger than, say, 15.

Figure 16.34 Poisson Distribution with Mean 5

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

874 Chapter 16 Simulation Models

© C

e n g

a g

e L

e a rn

in g

Developing the Simulation Model The variables for the model appear in Figure 16.35. (See the file Selling Condos Big Picture.xlsx.) The deterministic model is straightforward and is not shown here. By sell- ing a sure five condos per month, Pletcher sells all condos by the end of year 2, receives both bonuses, and realizes an NPV (including bonuses) of $2,824,333. However, this is not very realistic. The steps for creating a more realistic simulation model follow. (See Figure 16.36, with several hidden columns, and the file Selling Condos.xlsx.) Because

Selling Condos Model

Figure 16.36 Condo Selling Simulation Model

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25

AOANAMAFAEADACABCBA

Condos to sell 120 Unit marketing, maintenance cost $800 Commission per condo sale $30,000 Bonus if at least half sold in year 1 $200,000 Extra bonus if all sold in 2 years $500,000 Discount rate (monthly) 0.8%

Mean demand per month 5

403938313029282721Month Demand 4 5 7 1 6

0 0 0 0 0Condos left to be sold 120 116 10 3 2 Condos sold this month 4 5 7 1 2 Maintenance cost $0$1,600$2,400$88,800$92,800 Commission from sales $60,000$30,000$210,000$150,000$120,000 Bonus at end of year 1 Bonus at end of year 2 Cash flow $60,000$28,400$207,600$27,200 $61,200

Months to sell out 29 Total bonus received NPV of cash flow

$0 $1,991,401

120 116 10 4 5

$27,200 $61,200

26

120 116 10 7 1

3 2 0 0 0 00 0 0 00 0 0 0

Marketing and selling condos

Simulation model Distribution of demand for condos each month (Poisson distributed)

Figure 16.35 Big Picture for Condo Selling Simulation Model

Bonuses Received

NPV of all Cash Flows

Months to Sell Out

Poten�al Bonuses

Condos Sold

Condos to Sell

Discount Rate

Condos Le� to be Sold

Commission from Sales

Unit Marke�ng, Maintenance Cost

Commission per Condo Sale

Maintenance Cost

Cash Flow

Mean Monthly Demand

Demand

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 875

of the uncertain timing of sales, we cannot say when all 120 condos will be sold. It could be before 24 months or well after 24 months. Therefore, we model it through 40 months. By experimenting, we found that all 120 condos will almost surely be sold in 40 months.

1. Inputs. Enter the inputs in the blue ranges.

2. Random demands. Generate the random demands for condos (the number of peo- ple who would like to buy) by entering the formula

=IF(B16>0,RISKPOISSON($B$12),"")

in cell B15 and copying across to month 40. The IF function checks whether there are still any condos available in that month. If there aren’t, a blank is recorded. Similar logic appears in many of the other formulas.

3. Number remaining and sold. In cell B16, enter a link to cell B3. In cell B17, find the number sold as the minimum of supply and demand with the formula

=IF(B16>0,MIN(B16,B15),"")

In cell C16, �nd the number remaining to be sold with the formula

=IF(B16>0,B16-B17,0)

Then copy the formulas in cells C16 and B17 across. Note that a 0, not a blank, is recorded in row 16 after all condos have been sold. This makes all the other IF func- tions work correctly.

4. Monetary values. Enter the formulas

=IF(B16>0,$B$4*(B16-B17),"")

=IF(B16>0,$B$5*B17,"")

and

=IF(B16>0,SUM(B19:B21)-B18,"") in cells B18, B19, and B22, and copy these across. For the bonuses, enter the formulas

=IF(SUM(B17:M17)>=B3/2,B6,0)

and

=IF(SUM(B17:Y17)=B3,B7,0) in cells M20 and Y21. These capture the all-or-nothing nature of the bonuses.

5. Outputs. Three interesting outputs are the number of months required to sell out, the total bonus earned, and the NPV of the cash flows, including bonuses. Calculate these in cells B24–B26 with the formulas

=COUNTIF(B16:AO16,">0")

=M20+Y21

and

=NPV(B8,B22:AO22)

Then designate them as @RISK output cells.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

876 Chapter 16 Simulation Models

Figure 16.37 Distribution of Months to Sell Out

Figure 16.38 Distribution of Total Bonus Received

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Running the Simulation Set @RISK to run 1000 iterations for a single simulation. Then run the simulation in the usual way.

Discussion of the Simulation Results Recall that the deterministic model sells out in 24 months, receives both bonuses, and achieves an NPV of about $2.82 million. As you might guess, the simulation model doesn’t do this well. The main problem is that there is a fairly good chance that one or both bonuses will not be received. Distributions of the three outputs appear in Figures 16.37 through 16.39. Figure 16.37 shows that although 24 months is (nearly) the most likely number of months to sell out, there was at least one scenario where it took only 18 months and another

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-4 Marketing Models 877

where it took 33 months. Figure 16.38 shows the four possibilities for bonuses: receive neither, receive one or the other, or receive both. Unfortunately for Pletcher, the �rst three possibilities are fairly likely; the probability of receiving both bonuses is only about 0.40. Finally, the shape of the NPV distribution in Figure 16.39, with three separate peaks, is in�uenced heavily by the bonuses or lack of them. On average, the NPV is only about $2.38 million, much less than estimated by the deterministic model. This is still one more example—a dramatic one—of the �aw of averages. ■

Figure 16.39 Distribution of NPV

© C

e n g

a g

e L

e a rn

in g

P R O B L E M S

Level A 21. Suppose that Coke and Pepsi are fighting for the

cola market. Each week each person in the market buys one case of Coke or Pepsi. If the person’s last purchase was Coke, there is a 0.90 probability that this person’s next purchase will be Coke; otherwise, it will be Pepsi. (You can assume that there are only two brands in the market.) Similarly, if the person’s last purchase was Pepsi, there is a 0.80 probabil- ity that this person’s next purchase will be Pepsi; otherwise, it will be Coke. Currently half of all people purchase Coke, and the other half purchase Pepsi. Simulate one year (52 weeks) of sales in the cola market and estimate each company’s average weekly market share and each company’s ending market share in week 52. Do this by assuming that the total market size is fixed at 100,000 customers. (Hint: Use the RISKBINOMIAL function. However, if your model requires more RISKBINOMIAL functions than the number allowed in the aca- demic version of @RISK, remember that you can instead use the BINOM.INV function (or the old CRITBINOM function) to generate binomially distributed random numbers. This takes the form =BINOM.INV(ntrtrt iaiai lslsl , psuccess,RAND()).)

22. Seas Beginning sells clothing by mail order. An important question is when to strike a customer from the company’s mailing list. At present, the company strikes a customer from its mailing list if a customer fails to order from six consecutive catalogs. The com- pany wants to know whether striking a customer from its list after a customer fails to order from four consec- utive catalogs results in a higher profit per customer. The following data are available:

■ If a customer placed an order the last time she received a catalog, then there is a 20% chance she will order from the next catalog.

■ If a customer last placed an order one catalog ago, there is a 16% chance she will order from the next catalog she receives.

■ If a customer last placed an order two catalogs ago, there is a 12% chance she will order from the next catalog she receives.

■ If a customer last placed an order three catalogs ago, there is an 8% chance she will order from the next catalog she receives.

■ If a customer last placed an order four catalogs ago, there is a 4% chance she will order from the next catalog she receives.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

878 Chapter 16 Simulation Models

■ If a customer last placed an order five catalogs ago, there is a 2% chance she will order from the next catalog she receives.

It costs $2 to send a catalog, and the average profit per order is $30. Assume a customer has just placed an order. To maximize expected profit per customer, would Seas Beginning make more money canceling such a customer after six nonorders or four nonorders?

23. Based on Babich (1992). Suppose that each week each of 300 families buys a gallon of orange juice from company A, B, or C. Let pA denote the probability that a gallon produced by company A is of unsatisfactory quality, and define pB and pC similarly for companies B and C. If the last gallon of juice purchased by a fam- ily is satisfactory, the next week they will purchase a gallon of juice from the same company. If the last gal- lon of juice purchased by a family is not satisfactory, the family will purchase a gallon from a competitor. Consider a week in which A families have purchased juice A, B families have purchased juice B, and C families have purchased juice C. Assume that families that switch brands during a period are allocated to the remaining brands in a manner that is proportional to the current market shares of the other brands. For example, if a customer switches from brand A, there is probability B/(B + C) that he will switch to brand B and probability C/C/C (B + C) that he will switch to brand C. Suppose that the market is currently divided equally: 10,000 families for each of the three brands. a. After a year, what will the market share for

each firm be? Assume pA = 0.10, pB = 0.15, and pC = 0.20. (Hint: You will need to use the RISKBINOMIAL function to see how many people switch from A and then use the RISKBINOMIAL function again to see how many switch from A to B and from A to C. However, if your model requires more RISKBINOMIAL functions than the number allowed in the academic version of @RISK, remember that you can instead use the BINOM.INV function (or the old CRITBINOM function) to generate binomially distributed random numbers. This takes the form =BINOM.INV(ntrtrt iaiai lslsl , psuccess,RAND()).)

b. Suppose a 1% increase in market share is worth $10,000 per week to company A. Company A believes that for a cost of $1 million per year it can cut the percentage of unsatisfactory juice cartons in half. Is this worthwhile? (Use the same values of pA, pB, and pC as in part a.)

Level B 24. The customer loyalty model in Example 16.7 assumes

that once a customer leaves (becomes disloyal), that customer never becomes loyal again. Assume instead that there are two probabilities that drive the model, the retention rate and the rejoin rate, with values 0.75

and 0.15, respectively. The simulation should follow a customer who starts as a loyal customer in year 1. From then on, at the end of any year when the cus- tomer was loyal, this customer remains loyal for the next year with probability equal to the retention rate. But at the end of any year the customer is disloyal, this customer becomes loyal the next year with prob- ability equal to the rejoin rate. During the customer’s nth loyal year with the company, the company’s mean profit from this customer is the nth value in the mean profit list in column B. Keep track of the same two outputs as in the example, and also keep track of the number of times the customer rejoins.

25. We are all aware of the fierce competition by mobile phone service companies to get our business. For example, AT&T is always trying to attract Verizon’s customers, and vice versa. Some even give away prizes to entice us to sign up for a guaranteed length of time. This example is based on one such offer. We assume that a mobile provider named Syncit is willing to give a customer a free laptop computer, at a cost of $300 to Syncit, if the customer signs up for a guaran- teed two years of service. During that time, the cost of service to the customer is a constant $60 per month, or $720 annually. After two years, we assume the cost of service increases by 2% annually. We assume that in any year after the guaranteed two years, the probabil- ity is 0.7 that the customer will stay with Syncit. This probability is the retention rate. We also assume that if a customer has switched to another mobile service, there is always a probability of 0.1 that the customer will (without any free laptop offer) willingly rejoin Syncit. The company wants to see whether this offer makes financial sense in terms of NPV, using a 10% discount rate. It also wants to see how the NPV varies with the retention rate. Simulate a 15-year time hori- zon, both with and without the free offer, to estimate the difference. (For the situation without the free offer, assume the customer has probability 0.5 of signing up with Syncit during year 1.)

26. Suppose that GLC earns a $2000 profit each time a per- son buys a car. We want to determine how the expected profit earned from a customer depends on the quality of GLC’s cars. We assume a typical customer will purchase 10 cars during her lifetime. She will purchase a car now (year 1) and then purchase a car every five years—during year 6, year 11, and so on. For simplic- ity, we assume that Hundo is GLC’s only competitor. We also assume that if the consumer is satisfied with the car she purchases, she will buy her next car from the same company, but if she is not satisfied, she will buy her next car from the other company. Hundo produces cars that satisfy 80% of its customers. Currently, GLC produces cars that also satisfy 80% of its customers. Consider a customer whose first car is a GLC car. If profits are discounted at 10% annually, use simulation

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-5 Simulating Games of Chance 879

to estimate the value of this customer to GLC. Also estimate the value of a customer to GLC if it can raise its customer satisfaction rating to 85%, to 90%, or to 95%. You can interpret the satisfaction value as the probability that a customer will not switch companies.

27. Mutron Company is thinking of marketing a new drug used to make pigs healthier. At the beginning of the current year, there are 1,000,000 pigs that could use the product. Each pig will use Mutron’s drug or a competitor’s drug once a year. The number of pigs is forecast to grow by an average of 5% per year. However, this growth rate is not a sure thing. Mutron assumes that each year’s growth rate is an independent draw from a normal distribution, with probability 0.95 that the growth rate will be between 3% and 7%. Assuming it enters the market, Mutron is not sure what its share of the market will be dur- ing year 1, so it models this with a triangular distri- bution. Its worst-case share is 20%, its most likely share is 40%, and its best-case share is 70%. In the absence of any new competitors entering this

market (in addition to itself), Mutron believes its market share will remain the same in succeeding years. However, there are three potential entrants (in addition to Mutron). At the beginning of each year, each entrant that has not already entered the market has a 40% chance of entering the market. The year after a competitor enters, Mutron’s market share will drop by 20% for each new competitor who entered. For example, if two competitors enter the market in year 1, Mutron’s market share in year 2 will be reduced by 40% from what it would have been with no entrants. Note that if all three entrants have entered, there will be no more entrants. Each unit of the drug sells for $2.20 and incurs a variable cost of $0.40. Profits are discounted by 10% annually. a. Assuming that Mutron enters the market, use

simulation to find its NPV for the next 10 years from the drug.

b. Again assuming that Mutron enters the market, it can be 95% certain that its actual NPV from the actual NPV from the actual drug is between what two values?

16-5 SIMULATING GAMES OF CHANCE We realize that this is a book about business applications. However, it is instructive (and fun) to see how simulation can be used to analyze games of chance, including sports con- tests. Indeed, many analysts refer to Monte Carlo simulation, and you can guess where that name comes from—the gambling casinos of Monte Carlo.

16-5a Simulating the Game of Craps

Most games of chance are great candidates for simulation because they are, by their very nature, driven by randomness. In this section, we examine one such game that is extremely popular in the gambling casinos: the game of craps. In its most basic form, craps is played as follows. A player rolls two dice and observes the sum of the two sides turned up. If this sum is 7 or 11, the player wins immediately. If the sum is 2, 3, or 12, the player loses immediately. Otherwise, if this sum is any other number (4, 5, 6, 8, 9, or 10), that num- ber becomes the player’s point. Then the dice are thrown repeatedly until the sum is the player’s point or 7. In case the player’s point occurs before a 7, the player wins. But if a 7 occurs before the point, the player loses. The following example uses simulation to deter- mine the properties of this game.

Joe Gamble loves to play craps at the casinos. He suspects that his chances of winning are less than fifty-fifty, but he wants to find the probability that he wins a single game of craps.

Objective To use simulation to find the probability of winning a single game of craps.

Where Do the Numbers Come From? There are no input numbers here, only the rules of the game.

E X A M P L E 16.10 ESTIMATING THE PROBABILITY OF WINNING AT CRAPS

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

880 Chapter 16 Simulation Models

Solution The simulation is of a single game. By running this simulation for many iterations, you can find the probability that Joe wins a single game of craps. If his intuition is correct (and surely it must be, or the casino could not stay in business), this probability is less than 0.5.

Developing the Simulation Model The simulation model is for a single game. (See Figure 16.40 and the file Craps.xlsx. No “big picture” is provided for this model.) There is a subtle problem here: The number of tosses of the dice necessary to determine the outcome of a single game is unknown. Theoretically, the game could continue forever, with the player waiting for his point or a 7. However, it is extremely unlikely that more than, say, 40 tosses are necessary in a single game. (This can be shown by a probability argument not presented here.) Therefore, you can simulate 40 tosses and use only those that are necessary to determine the outcome of a single game. The steps required are as follows.

1. Simulate tosses. Simulate the results of 40 tosses in the range B5:D44 by entering the formula

=RANDBETWEEN(1,6) in cells B5 and C5 and the formula

=SUM(B5:C5) in cell D5. Then copy these to the range B6:D44. (Recall that the RANDBETWEEN function generates a random integer between the two speci�ed values such that all values are equally likely, so it is perfect for tossing a die. You could also use @RISK’s RISKINTUNIFORM function, which works exactly like RANDBETWEEN.)

@RISK Function: RISKINTUNIFORM The @RISK function RISKINTUNIFORM in the form =RISRISRI KINKINKI TUNUNU ININ FOIFOI RM(N1,N2(N1,N2( ) works exactly like Excel’s RANDBETWEEN function.

2. First toss outcome. Determine the outcome of the first toss with the formulas =IF(OR(D5=7,D5=11),1,0) =IF(OR(D5=2,D5=3,D5=12),1,0)

Game of Craps

As in many spreadsheet simulation models, the concepts in this model are simple. The key is careful bookkeeping.

Figure 16.40 Simulation of Craps Game

1 2 3 4 5 6 7 8 9

10 11 12 13 14 42 43 44

A BA B C DC D E FE F G HG H I JI J Craps Simula�on

Simulated tosses Toss Die 1 Die 2 Sum Win on this toss? Lose on this toss? Con�nue? Summary results from simula�on

1 21 2 5 4 1 4 1 1 4 5 6 4 3 5

6 4 5 2 2 3 3 3 2 3 1 6 1

8 9 9 3 6 4 4 7 7 9 5 9 6

0 0 0 0 0 0 0 0

0 0 0 0 0 0 0 1

Yes Yes Yes Yes Yes Yes Yes No

Win? (1 if yes, 0 if no) 0) 0 2 Number of tosses 8s 8 3 4 Pr(winning) 0.490 5 Expected number of tosses 3.371 6 7 8 9

10 38 39 40

1 D 2 S

s 3

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-5 Simulating Games of Chance 881

and

=IF(AND(E5=0,F5=0),"Yes","No") in cells E5, F5, and G5. Note that the OR condition checks whether Joe wins right away (in which case a 1 is recorded in cell E5). Similarly, the OR condition in cell F5 checks whether he loses right away. In cell G5, the AND condition checks whether both cells E5 and F5 are 0, in which case the game continues. Otherwise, the game is over.

3. Outcomes of other tosses. Assuming the game continues beyond the first toss, Joe’s point is the value in cell D5. Then he is waiting for a toss to have the value in cell D5 or 7, whichever occurs first. To implement this logic, enter the formulas

=IF(OR(G5="No",G5=""),"",IF(D6=$D$5,1,0)) =IF(OR(G5="No",G5=""),"",IF(D6=7,1,0)) and

=IF(OR(G5="No",G5=""),"",IF(AND(E6=0,F6=0),"Yes","No")) in cells E6, F6, and G6, and copy these to the range E7:G44. The OR condition in each formula checks whether the game just ended on the previous toss or has been over for some time, in which case blanks are entered. Otherwise, the �rst two formulas check whether Joe wins or loses on this toss. If both of these return 0, the third formula returns Yes (and the game continues). Otherwise, it returns No (and the game has just ended).

4. Game outcomes. Keep track of two aspects of the game in @RISK output cells: whether Joe wins or loses and how many tosses are required. To find these, enter the formulas

=SUM(E5:E44) and

=COUNT(E5:E44) in cells J5 and J6, and designate each of these as an @RISK output cell. Note that both functions, SUM and COUNT, ignore blank cells.

5. Simulation summary. Although you can get summary measures in the various @RISK results windows after you run the simulation, it is useful to see some key summary measures right on the model sheet. To obtain these, enter the formula

=RISKMEAN(J5) in cell J8 and copy it to cell J9. As the labels indicate, the RISKMEAN in cell J8, being an average of 0’s and 1’s, is just the fraction of iterations where Joe wins. The average in cell J9 is the average number of tosses until the game’s outcome is determined.

Running the Simulation Set the number of iterations to 10,000 (partly for variety and partly to obtain a very accu- rate answer) and the number of simulations to 1. Then run the simulation as usual.

Discussion of the Simulation Results After running @RISK, the summary results in cells J8 and J9 of Figure 16.40 (among others) are available. Our main interest is in the average in cell J8. It represents the best estimate of the probability of winning, 0.490. (It can be shown with a probability argument that the exact probability of winning in craps is 0.493.) You can also see that the average number of tosses needed to determine the outcome of a game was about 3.4. (The maxi- mum number of tosses ever needed on these 10,000 iterations was 25.) ■

Recall that the mean (or average) of a sequence of 0’s and 1’s is the fraction of 1’s in the sequence. This can typically be interpreted as a probability.

Perhaps surprisingly, the probability of winning in craps is 0.493, only slightly less than 0.5.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

882 Chapter 16 Simulation Models

E X A M P L E 16.11 MARCH MADNESS

At the time this example was written, the most recent NCAA Basketball Tournament was the 2015 tournament, won by Duke University. Of course, on the Sunday evening when the 68-team field was announced, we did not know which team would win. All we knew were the pairings (which teams would play which other teams) and the team ratings, based on Jeff Sagarin’s nationally syndicated rating system. We now show how to simulate the tournament and keep a tally of the winners.

Objective To simulate the NCAA basketball tournament and keep a tally on the number To simulate the NCAA basketball tournament and keep a tally on the number T of times each team wins the tournament.

Where Do the Numbers Come From? As soon as you learn the pairings for the next NCAA tournament, you can perform a Web next NCAA tournament, you can perform a Web next search for “Sagarin ratings” to find the latest ratings.

Solution We need to make one probabilistic assumption. From that point, it is a matter of “play- ing out” the games and doing the required bookkeeping. To understand this probabilistic assumption, suppose team A plays team B and Sagarin’s ratings for these teams are, say, 85 and 78. Then Sagarin predicts that the actual point differential in the game (team A’s score minus team B’s score) will be the difference between the ratings, or 7.4

. Then Sagarin predicts that the actual point differential in the game (team A’s score 4

. Then Sagarin predicts that the actual point differential in the game (team A’s score We take this one

step further. We assume that the actual point differential is normally distributed with mean actual point differential is normally distributed with mean actual equal to Sagarin’s prediction, 7, and standard deviation 10. (Why 10? This is an estimate based on an extensive analysis of historical data. However, the spreadsheet is set up so that you can change the standard deviation to a different value if you prefer.) Then if the actual point differential is positive, team A wins. If it is negative, team B wins.

Developing the Simulation Model We provide only an outline of the simulation model. You can see the full details in the file March Madness 2015.xlsx. (This file includes the data for the 2015 tournament, but you can easily modify it for future tournaments.) The entire simulation is on a single Model sheet. Columns A through C list team indexes, team names, and Sagarin ratings. If two teams are paired in the first round, they are placed next to one another in the list. Also, all teams in a given region are listed together. (The regions are color-coded.) Columns E through K contain the simulation. (Extra calculations on upsets appear in columns L and M, but these are not an essential part of the simulation.) The first-round results are at the top, the second- round results are below these, and so on. Winners from one round are automatically carried

We model the point spread as normally distributed, with mean equal to the difference between the Sagarin ratings and standard deviation 10.

16-5b Simulating the NCAA Basketball Tournament

Each year the suspense reaches new levels as “March Madness” approaches, the time of the NCAA Basketball Tournament. Which of the 68 teams in the tournament will reach the “Sweet Sixteen,” which will go on to the prestigious “Final Four,” and which team will be crowned champion? The excitement at Indiana University is particularly high, given the strong basketball tradition here, so it has become a yearly tradition at IU (at least for the authors) to simulate the NCAA Tournament right after the brackets have been announced. We share that simulation in the following example.

4In general, there is also a home-court advantage, but we assume all games in the tournament are on “neutral” courts, so that there is no advantage to either team.

March Madness Model

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-5 Simulating Games of Chance 883

over to the next round with appropriate formulas. Selected portions of the model appear in Figure 16.41. This figure just shows one possible scenario, but one where Duke did indeed win.) We now describe the essential features of the model.

The Simulation Data report in @RISK lists the outputs from each iteration of the simulation, which allows us to tally the winners.

Figure 16.41 NCAA Basketball Simulation Model (Last Three Rounds Only)

135

136

137

138

139

140

141

142

143

144

145

146

147

148

149

150

151

152

153

154

155

156

157

158

Results of Round 4

E

Semifinals

Game

1

1

1

1

TeamsTeamsT

Duke

Gonzaga

Villanova

Virginia

North Carolina

Arizona

Kentucky

Butler

TeamsTeamsT

Duke

Virginia

Arizona

Kentucky

TeamsTeamsT

Duke

Kentucky

Duke

Game

1

2

Finals

Winner

Game

1

F HF HG IG IG IF HG IF HF HG IF H J KJ K L ML M

Predicted

1.2

–0.53

–4.63

13.48

Predicted

–0.47

–5.74

Predicted

–5.82

Simulated

11.14

–7.17

–14.70

7.48

Simulated

20.72

–7.26

Simulated

1.13

Index of winner

1

33

50

52

Index of winner

1

52

Index of winner

1

Winner

Duke

Virginia

Arizona

Kentucky

Number of upsets

P(no upsets)

Winner

Duke

Kentucky

Number of upsets

P(no upsets)

Winner

Duke

Upset?

0

0

0

0

0

0.17643

Upset?

1

0

1

0.371947

Upset?

1

P(Upset)

0.4522

0.4789

0.3217

0.0888

P(Upset)

0.4813

0.2830

P(Upset)

0.2803

Indexes

1

16

18

33

41

50

52

61

Indexes

1

33

50

52

Indexes

1

52

1 © C

e n g

a g

e L

e a rn

in g

1. Simulate rounds. Jumping ahead to the fourth-round simulation in Figure 16.41, the winners from the previous round 3 are captured, and then the games in round 4 are simulated. The key formulas are in columns H and I. For example, the formulas in cells H137 and I137 are

=VLOOKUP(F137,LTable,3)−VLOOKUP(F138,LTable,3)

and

=RiskNormal(H137,$I$1)

The �rst of these looks up the ratings of the two teams involved and subtracts to get the predicted point spread. The second formula simulates a point spread with the predicted point spread as its mean and the value in cell I1, 10, as its standard deviation. The rest of the formulas do the appropriate bookkeeping. You can view the details in the �le.

2. Outputs. As you can see when you examine the file, we created tallies in columns P to U for each team and designated all of them as @RISK output cells. The tallies include the team’s number of wins in the tournament, 0–1 values for whether they made it to the sweet 16, the final 8, the final 4, and the semi-finals, and a final 0–1 value for whether the team won the tournament. Then we used the RISKMEAN

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

884 Chapter 16 Simulation Models

P R O B L E M S

Level A 28. The game of Chuck-a-Luck is played as follows: You

pick a number between 1 and 6 and toss three dice. If your number does not appear, you lose $1. If your number appears x times, you win x times, you win x $x. On the average, use simulation to find the average amount of money you will win or lose on each play of the game.

29. A martingale betting strategy works as follows. You begin with a certain amount of money and repeatedly play a game in which you have a 40% chance of winning any bet. In the first game, you bet $1. From then on, every time you win a bet, you bet $1 the next time. Each time you lose, you double your previous bet. Currently you have $63. Assuming you have unlimited credit, so that you can bet more money than you have, use simulation to estimate the profit or loss you will have after playing the game 50 times.

30. You have $5 and your opponent has $10. You flip a fair coin and if heads comes up, your opponent pays you $1. If tails comes up, you pay your opponent $1. The game is finished when one player has all the money or after 100 tosses, whichever comes first. Use simulation to estimate the probability that you end up with all the money and the probability that neither of you goes broke in 100 tosses.

Level B 31. Assume a very good NBA team has a 70% chance of

winning in each game it plays. During an 82-game season what is the average length of the team’s longest winning streak? What is the probability that the team has a winning streak of at least 16 games? Use simulation to answer these questions, where each iteration of the simulation generates the outcomes of all 82 games.

32. You are going to play the Wheel of Misfortune Game against the house. The wheel has 10 equally likely numbers: 5, 10, 15, 20, 25, 30, 35, 40, 45, and 50. The goal is to get a total as close as possible to 50 points without exceeding 50. You go first and spin the wheel. Based on your first spin, you can decide whether you want to spin again. (You can spin no more than twice.) After you are done, it is the house’s turn. If your total is more than 50, the house doesn’t need a turn; it wins automatically. Otherwise, the house spins the wheel.

After its first spin, it can spin the wheel again if it wants. (The house can also spin no more than twice.) Then the winner is determined, where a tie goes to you. Use simulation to estimate your probability of winning the game if you and the house both use best strategies. What are the best strategies?

33. Consider the following card game. The player and dealer each receive a card from a 52-card deck. At the end of the game the player with the highest card wins; a tie goes to the dealer. (You can assume that Aces count 1, Jacks 11, Queens 12, and Kings 13.) After the player receives his card, he keeps the card if it is 7 or higher. If the player does not keep the card, the player and dealer swap cards. Then the dealer keeps his cur- rent card (which might be the player’s original card) if it is 9 or higher. If the dealer does not keep his card, he draws another card. Use simulation with at least 1000 iterations to estimate the probability that the player wins. (Hint: See the file P16_33.xlsx to see a clever way of simulating cards from a deck so that the same card is never dealt more than once.)

34. Based on Morrison and Wheat (1984). When his team is behind late in the game, a hockey coach usually waits until there is one minute left before pulling the goalie out of the game. Using simulation, it is possible to show that coaches should pull their goalies much sooner. Suppose that if both teams are at full strength, each team scores an average of 0.05 goal per minute. Also, suppose that if you pull your goalie you score an average of 0.08 goal per minute and your opponent scores an average of 0.12 goal per minute. Suppose you are one goal behind with five minutes left in the game. Consider the following two strategies:

■ Pull your goalie if you are behind at any point in the last five minutes of the game; put him back in if you tie the score.

■ Pull your goalie if you are behind at any point in the last minute of the game; put him back in if you tie the score.

Which strategy maximizes your probability of winning or tying the game? Simulate the game using 10-second increments of time. Use the RISKBINOMIAL function to determine whether a team scores a goal in a given 10-second segment. This is reasonable because the probability of scoring two or more goals in a 10-second period is near zero.

function in columns V to AA to find the means of these tallies. For example, after running 10,000 iterations, the mean of the last tally for Duke showed that they won the tournament on about 9% of the iterations. In contrast, the odds-on favorite enter- ing the tournament, Kentucky, won the tournament on about 43% of the iterations. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

35. You are playing tennis against a top tennis pro, and you have a 42% chance of winning each point. (You are good!) a. Use simulation to estimate the probability you will

win a particular game. Note that the first player to score at least four points and have at least two more points than his or her opponent wins the game.

b. Use simulation to determine your probability of winning a set. Assume that the first player to win

six games wins the set if he or she is at least two games ahead; otherwise, the first player to win seven games wins the set. (We substitute a single game for the usual tiebreaker.)

c. Use simulation to determine your probability of winning a match. Assume that the first player to win three sets wins the match.

16-6 CONCLUSION We claimed in the previous chapter that spreadsheet simulation, especially together with an add-in like @RISK, is a very powerful tool. After seeing the examples in this chapter, you should now appreciate how powerful and �exible simulation is. Unlike Solver optimization models, where you often make simplifying assumptions to achieve linearity, say, you can allow virtually anything in simulation models. All you need to do is relate output cells to input cells with appropriate formulas, where any of the input cells can contain probability distributions to re�ect uncertainty. The results of the simulation then show the distribution of any particular output. It is no wonder that companies such as GM, Eli Lilly, and many others are increasingly relying on simulation models to analyze their corporate operations.

Summary of Key Terms

Term Explanation Excel Page

Gamma distribution Right-skewed distribution of nonnegative values useful for many quantities such as the lifetime of an appliance

836

RISKGAMMA function

Implements the gamma distribution in @RISK =RISKGAMMA (alpha,beta)

838

Value at risk at the 5% level (VaR 5%)

Fifth percentile of distribution of some output, usually a monetary output; indicates nearly the worst possible outcome

850

Churn When customers stop buying a product or service and switch to a competitor’s offering

864

RANDBETWEEN function

Generates a random integer between two limits, where each is equally likely

=RANDBETWEEN (1,6), for example

880

P R O B L E M S

Conceptual Questions C.1. We have separated the examples in this chapter into

operations, finance, marketing, and sports categories. List at least one other problem in each of these cat- egories that could be attacked with simulation. For each, identify the random inputs, possible probability distributions for them, and any outputs of interest.

C.2. Suppose you are an HR (human resources) manager at a big university, and you sense that the university is becoming too top-heavy with full professors. That is,

there do not seem to be as many younger professors at the assistant and associate levels as there ought to be. How could you study this problem with a simulation model, using current and/or proposed promotions, hiring, firing, and retirement policies?

C.3. You are an avid basketball fan, and you would like to build a simulation model of an entire game so that you could compare two different strategies, such as man-to-man versus zone defense. Is this possible? What might make this simulation model difficult to build?

16-6 Conclusion 885 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

886 Chapter 16 Simulation Models

C.4. Suppose you are a financial analyst and your company runs many simulation models to estimate the profitability of its projects. If you had to choose just two measures of the distribution of any important output such as net profit to report, which two would you choose? Why? What information would be missing if you reported only these two measures? How could they be misleading?

C.5. Software development is an inherently risky and uncertain process. For example, there are many examples of software that couldn’t be “finished” by the scheduled release date—bugs still remained and features weren’t ready. (Many people believe this was the case with Office 2007.) How might you simulate the development of a software product? What random inputs would be required? Which outputs would be of interest? Which measures of the probability distribu- tions of these outputs would be most important?

C.6. Health care is continually in the news. Can (or should) simulation be used to help solve, or at least study, some of the difficult problems associated with health care? Provide at least two examples where simulation might be useful.

Level A 36. You now have $3000. You will toss a fair coin four

times. Before each toss you can bet any amount of your money (including none) on the outcome of the toss. If heads comes up, you win the amount you bet. If tails comes up, you lose the amount you bet. Your goal is to reach $6000. It turns out that you can maximize your chance of reaching $6000 by betting either the money you have on hand or $6000 minus the money you have on hand, whichever is smaller. Use simulation to estimate the probability that you will reach your goal with this betting strategy.

37. You now have $10,000, all of which is invested in a sports team. Each year there is a 60% chance that the value of the team will increase by 60% and a 40% chance that the value of the team will decrease by 60%. Estimate the mean and median value of your investment after 50 years. Explain the large difference between the estimated mean and median.

38. Suppose you have invested 25% of your portfolio in four different stocks. The mean and standard deviation of the annual return on each stock are shown in the file P16_38.xlsx. The correlations between the annual returns on the four stocks are also shown in this file. a. What is the probability that your portfolio’s annual

return will exceed 20%? b. What is the probability that your portfolio will lose

money during the year?

39. A ticket from Indianapolis to Orlando on Deleast Airlines sells for $150. The plane can hold 100 people.

It costs Deleast $8000 to fly an empty plane. Each person on the plane incurs variable costs of $30 (for food and fuel). If the flight is overbooked, anyone who cannot get a seat receives $300 in compensation. On average, 95% of all people who have a reservation show up for the flight. To maximize expected profit, how many reservations for the flight should Deleast book? (Hint: The function RISKBINOMIAL can be used to simulate the number who show up. It takes two arguments: the number of reservations booked and the probability that any ticketed person shows up.)

40. Based on Marcus (1990). The Balboa mutual fund has beaten the Standard and Poor’s 500 during 11 of the last 13 years. People use this as an argument that you can beat the market. Here is another way to look at it that shows that Balboa’s beating the market 11 out of 13 times is not unusual. Consider 50 mutual funds, each of which has a 50% chance of beating the market during a given year. Use simulation to estimate the probability that over a 13-year period the best of the 50 mutual funds will beat the market for at least 11 out of 13 years. This probability turns out to exceed 40%, which means that the best mutual fund beating the market 11 out of 13 years is not an unusual occurrence after all.

41. You have been asked to simulate the cash inflows to a toy company for the next year. Monthly sales are independent random variables. Mean sales for the months January through March and October through December are $80,000, and mean sales for the months April through September are $120,000. The standard deviation of each month’s sales is 20% of the month’s mean sales. Model the method used to collect monthly sales as follows:

■ During each month a certain fraction of new sales will be collected. All new sales not collected become one month overdue.

■ During each month a certain fraction of one-month overdue sales is collected. The remainder becomes two months overdue.

■ During each month a certain fraction of two-month overdue sales is collected. The remainder is written off as bad debt.

You are given the information in the file P16_41.xlsx from past months. Using this information, build a simulation model that generates the total cash inflow for each month. Develop a simple forecasting model and build the error of your forecasting model into the simulation. Assuming that there are $120,000 of one-month-old sales outstanding and $140,000 of two-month-old sales outstanding during January, you are 95% sure that total cash inflow for the year will be between what two values?

42. Consider a device that requires two batteries to function. If either of these batteries dies, the device

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-6 Conclusion 887

will not work. Currently there are two new batteries in the device, and there are three extra new batteries. Each battery, once it is placed in the device, lasts a random amount of time that is triangularly distributed with parameters 15, 18, and 25 (all expressed in hours). When any of the batteries in the device dies, it is immediately replaced by an extra if an extra is still available. Use @RISK to simulate the time the device can last with the batteries currently available.

43. Consider a drill press containing three drill bits. The current policy (called individual replacement) is to replace a drill bit when it fails. The firm is considering changing to a block replacement policy in which all block replacement policy in which all block replacement three drill bits are replaced whenever a single drill bit fails. Each time the drill press is shut down, the cost is $100. A drill bit costs $50, and the variable cost of replacing a drill bit is $10. Assume that the time to replace a drill bit is negligible. Also, assume that the time until failure for a drill bit follows an exponential distribution with a mean of 100 hours. This can be modeled in @RISK with the formula =RISKEXPON(100). Determine which replacement policy (block or individual replacement) should be implemented.

44. Appliances Unlimited (AU) sells refrigerators. Any refrigerator that fails before it is three years old is replaced for free. Of all refrigerators, 3% fail during their first year of operation; 5% of all one-year-old refrigerators fail during their second year of operation; and 7% of all two-year-old refrigerators fail during their third year of operation. a. Use simulation to estimate the fraction of all

refrigerators that will have to be replaced. b. It costs $500 to replace a refrigerator, and AU sells

10,000 refrigerators per year. If the warranty period were reduced to two years, how much per year in replacement costs would be saved?

45. The annual demand for Prizdol, a prescription drug manufactured and marketed by the NuFeel Company, is normally distributed with mean 50,000 and standard deviation 12,000. Assume that demand during each of the next 10 years is an independent random number from this distribution. NuFeel needs to determine how large a Prizdol plant to build to maximize its expected profit over the next 10 years. If the company builds a plant that can produce x units of Prizdol per year, it will x units of Prizdol per year, it will x cost $16 for each of these x units. NuFeel will produce x units. NuFeel will produce x only the amount demanded each year, and each unit of Prizdol produced will sell for $3.70. Each unit of Prizdol produced incurs a variable production cost of $0.20. It costs $0.40 per year to operate a unit of capacity. a. Among the capacity levels of 30,000, 35,000,

40,000, 45,000, 50,000, 55,000, and 60,000 units per year, which level maximizes expected profit? Use simulation to answer this question.

b. Using the capacity from your answer to part a, NuFeel can be 95% certain that actual profit for the 10-year period will be between what two values?

46. A company is trying to determine the proper capacity level for its new electric car. A unit of capacity provides the potential to produce one car per year. It costs $10,000 to build a unit of capacity and the cost is charged equally over the next five years. It also costs $400 per year to maintain a unit of capacity (whether or not it is used). Each car sells for $14,000 and incurs a variable production cost of $10,000. The annual demand for the electric car during each of the next five years is believed to be normally distributed with mean 50,000 and standard deviation 10,000. The demands during different years are assumed to be independent. Profits are discounted at a 10% annual interest rate. The company is working with a five-year planning horizon. Capacity levels of 30,000, 40,000, 50,000, 60,000, and 70,000 are under consideration. You can assume that the company never produces more than demand, so there is never any inventory to carry over from year to year. a. Assuming that the company is risk neutral, use

simulation to find the optimal capacity level. b. Using the answer to part a, there is a 5% chance

that the actual discounted profit will exceed what actual discounted profit will exceed what actual value, and there is a 5% chance that the actual discounted profit will be less than what value?

c. If the company is risk averse, how might the optimal capacity level change?

47. The DC Cisco office is trying to predict the revenue it will generate next week. Ten deals may close next week. The probability of each deal closing and data on the possible size of each deal (in millions of dollars) are listed in the file P16_47.xlsx. Use simulation to estimate total revenue. Based on the simulation, the company can be 95% certain that its total revenue will be between what two numbers?

Level B 48. A common decision is whether a company should

buy equipment and produce a product in house or outsource production to another company. If sales volume is high enough, then by producing in house, the savings on unit costs will cover the fixed cost of the equipment. Suppose a company must make such a decision for a four-year time horizon, given the following data. Use simulation to estimate the probability that producing in house is better than outsourcing.

■ If the company outsources production, it will have to purchase the product from the manufacturer for $18 per unit. This unit cost will remain constant for the next four years.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

888 Chapter 16 Simulation Models

■ The company will sell the product for $40 per unit. This price will remain constant for the next four years.

■ If the company produces the product in house, it must buy a $400,000 machine that is depreciated on a straight-line basis over four years, and its cost of production will be $7 per unit. This unit cost will remain constant for the next four years.

■ The demand in year 1 has a worst case of 10,000 units, a most likely case of 14,000 units, and a best case of 16,000 units.

■ The average annual growth in demand for years 2–4 has a worst case of 10%, a most likely case of 20%, and a best case of 26%. Whatever this annual growth is, it will be the same in each of the years.

■ The tax rate is 40%. ■ Cash flows are discounted at 12% per year.

49. Consider an oil company that bids for the rights to drill in offshore areas. The value of the right to drill in a given offshore area is highly uncertain, as are the bids of the competitors. This problem demonstrates the “winner’s curse.” The winner’s curse states that the optimal bidding strategy entails bidding a substantial amount below the company’s assumed value of the product for which it is bidding. The idea is that if the company does not bid under its assumed value, its uncertainty about the actual value of the product will often lead it to win bids for products on which it loses money (after paying its high bid). Suppose Royal Conch Oil (RCO) is trying to determine a profit-maximizing bid for the right to drill on an offshore oil site. The actual value of the right to drill is unknown, but it is equally likely to be any value between $10 million and $110 million. Seven competitors will bid against RCO. Each bidder’s (including RCO’s) estimate of the value of the drilling rights is equally likely to be any number between 50% and 150% of the actual value. Based on past history, RCO believes that each competitor is equally likely to bid between 40% and 60% of its value estimate. Given this information, what fraction (within 0.05) of RCO’s estimated value should it bid to maximize its expected profit? (Hint: You can use the RISKUNIFORM function to model the actual value of the field and the competitors’ bids.)

50. Suppose you begin year 1 with $5000. At the beginning of each year, you put half of your money under a mattress and invest the other half in Whitewater stock. During each year, there is a 50% chance that the Whitewater stock will double, and there is a 50% chance that you will lose half of your investment. To illustrate, if the stock doubles during the first year, you will have $3750 under the mattress and $3750 invested in Whitewater during year 2. You want to estimate your annual return over a 30-year period. If you end with F dollars, your annual return F dollars, your annual return F

is (F/F/F 5000)1/30 − 1. For example, if you end with $100,000, your annual return is 201/30 − 1 = 0.105, or 10.5%. Run 1000 replications of an appropriate simulation. Based on the results, you can be 95% certain that your annual return will be between which two values?

51. Mary Higgins is a freelance writer with enough spare time on her hands to play the stock market fairly seriously. Each morning she observes the change in stock price of a particular stock and decides whether to buy or sell, and if so, how many shares to buy or sell. Assume that on day 1, she has $100,000 cash to invest and that she spends part of this to buy her first 500 shares of the stock at the current price of $50 per share. From that point on, she follows a fairly simple “buy low, sell high” strategy. Specifically, if the price has increased three days in a row, she sells 25% of her shares of the stock. If the price has increased two days in a row (but not three), she sells 10% of her shares. In the other direction, if the price has decreased three days in a row, she buys up to 25% more shares, whereas if the price has decreased only two days in a row, she buys up to 10% more shares. The reason for the “up to” proviso is that she cannot buy more than she has cash to pay for. Assume a fairly simple model of stock price changes, as described in the file P16_51.xlsx. Each day the price can change by as much as $2 in either direc- tion, and the probabilities depend on the previous price change: decrease, increase, or no change. Build a simu- lation model of this strategy for a period of 75 trading days. (You can assume that the stock price on each of the previous two days was $49.) Choose interesting @RISK output cells, and then run @RISK for at least 1000 iterations and report your findings.

52. You are considering a 10-year investment project. At present, the expected cash flow each year is $10,000. Suppose, however, that each year’s cash flow is normally distributed with mean equal to last year’s last year’s last actual cash flow and standard deviation $1000. For example, suppose that the actual cash flow in year 1 is $12,000. Then year 2 cash flow is normal with mean $12,000 and standard deviation $1000. Also, at the end of year 1, your best guess is that each later year’s expected cash flow will be $12,000. a. Estimate the mean and standard deviation of the

NPV of this project. Assume that cash flows are discounted at a rate of 10% per year.

b. Now assume that the project has an abandonment option. At the end of each year you can abandon the project for the value given in the file P16_52.xlsx. For example, suppose that year 1 cash flow is $4000. Then at the end of year 1, you expect cash flow for each remaining year to be $4000. This has an NPV of less than $62,000, so you should abandon the project and collect

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-6 Conclusion 889

$62,000 at the end of year 1. Estimate the mean and standard deviation of the project with the abandonment option. How much would you pay for the abandonment option? (Hint: You can abandon a project at most once. So in year 5, for example, you abandon only if the sum of future expected NPVs is less than the year 5 abandonment value and the project has not yet been abandoned. Also, and the project has not yet been abandoned. Also, and once you abandon the project, the actual cash flows for future years are zero. So in this case the future cash flows after abandonment should be zero in your model.)

53. Play Things is developing a new Miley Cyrus doll. The company has made the following assumptions:

■ The doll will sell for a random number of years from 1 to 10. Each of these 10 possibilities is equally likely.

■ At the beginning of year 1, the potential market for the doll is one million. The potential market grows by an average of 5% per year. The company is 95% sure that the growth in the potential market during any year will be between 3% and 7%. It uses a normal distribution to model this.

■ The company believes its share of the potential market during year 1 will be at worst 20%, most likely 40%, and at best 50%. It uses a triangular distribution to model this.

■ The variable cost of producing a doll during year 1 has a triangular distribution with parameters $8, $10, and $12.

■ The current selling price is $20. ■ Each year, the variable cost of producing the doll

will increase by an amount that is triangularly distributed with parameters 4.5%, 5%, and 6.5%. You can assume that once this change is generated, it will be the same for each year. You can also assume that the company will change its selling price by the same percentage each year.

■ The fixed cost of developing the doll (which is incurred right away, at time 0) has a triangular distribution with parameters $4, $6, and $12 million.

■ Right now there is one competitor in the market. During each year that begins with four or fewer competitors, there is a 20% chance that a new competitor will enter the market.

■ Year t sales (for t sales (for t t > 1) are determined as follows. Suppose that at the end of year t − 1, n competitors are present (including Play Things). Then during year t, a fraction 0.9 – 0.1n of the company’s loyal customers (last year’s purchasers) will buy a doll from Play Things this year, and a fraction 0.2 – 0.04n of customers currently in the market who did not purchase a doll last year will purchase a doll from Play Things this year. Adding these two provides the mean sales for this year. Then the actual sales this year is normally distributed with this mean and standard deviation equal to 7.5% of the mean.

a. Use @RISK to estimate the expected NPV of this project.

b. Use the percentiles in @RISK’s output to find an interval such that you are 95% certain that the company’s actual NPV will be within this interval.actual NPV will be within this interval.actual

54. An automobile manufacturer is considering whether to introduce a new model called the Racer. The profitability of the Racer depends on the following factors:

■ The fixed cost of developing the Racer is triangularly distributed with parameters $3, $4, and $5, all in billions.

■ Year 1 sales are normally distributed with mean 200,000 and standard deviation 50,000. Year 2 sales are normally distributed with mean equal to actual year 1 sales and standard deviation 50,000. Year 3 sales are normally distributed with mean equal to actual year 2 sales and standard deviation 50,000.

■ The selling price in year 1 is $25,000. The year 2 selling price will be 1.05[year 1 price + $50 (% difffff 1)] where % diff1 is the number of percentage points by which actual year 1 sales differ from expected year 1 sales. The 1.05 factor accounts for inflation. For example, if the year 1 sales figure is 180,000, which is 10 percentage points below the expected year 1 sales, then the year 2 price will be 1.05[25,000 + 50(–10)] = $25,725. Similarly, the year 3 price will be 1.05[year 2 price + $50(% difffff 2f2f )] where % diff2 is the percentage by which actual year 2 sales differ from expected year 2 sales.

■ The variable cost in year 1 is triangularly distributed with parameters $10,000, $12,000, and $15,000, and it is assumed to increase by 5% each year.

Your goal is to estimate the NPV of the new car during its first three years. Assume that the company is able to produce exactly as many cars as it can sell. Also, assume that cash flows are discounted at 10%. Simulate 1000 trials to estimate the mean and standard deviation of the NPV for the first three years of sales. Also, determine an interval such that you are 95% certain that the NPV of the Racer during its first three years of operation will be within this interval.

55. It costs a pharmaceutical company $40,000 to produce a 1000-pound batch of a drug. The average yield from a batch is unknown but the best case is 90% yield (that is, 900 pounds of good drug will be produced), the most likely case is 85% yield, and the worst case is 70% yield. The annual demand for the drug is unknown, with the best case being 22,000 pounds, the most likely case 18,000 pounds, and the worst case 12,000 pounds. The drug sells for $60 per pound and leftover amounts of the drug can be sold for $8 per pound. To maximize annual expected profit, how many

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

890 Chapter 16 Simulation Models

batches of the drug should the company produce? You can assume that it will produce the batches only once, before demand for the drug is known.

56. A truck manufacturer produces the Off Road truck. The company wants to gain information about the discounted profits earned during the next three years. During a given year, the total number of trucks sold in the United States is 500,000 + 50,000G – 40,000I, where G is the number of percentage points increase in gross domestic product during the year and I is the I is the I number of percentage points increase in the consumer price index during the year. During the next three years, Value Line has made the predictions listed in the file P16_56.xlsx. In the past, 95% of Value Line’s G predictions have been accurate within 6%, and 95% of Value Line’s I predictions have been accurate within I predictions have been accurate within I 5%. You can assume that the actual G and I values are I values are I normally distributed each year.

At the beginning of each year, a number of competitors might enter the trucking business. The probability distribution of the number of competitors that will enter the trucking business is also given in the same file. Before competitors join the industry at the beginning of year 1, there are two competitors. During a year that begins with n competitors (after competitors have entered the business, but before any have left, and not counting Off Road), Off Road will have a market share given by 0.5(0.9)n. At the end of each year, there is a 20% chance that any competitor will leave the industry. The selling price of the truck and the production cost per truck are also given in the file. Simulate 1000 replications of the company’s profit for the next three years. Estimate the mean and standard deviation of the discounted three-year profits, using a discount rate of 10% and Excel’s NPV function. Do the same if the probability that any competitor leaves the industry during any year increases to 50%.

57. Suppose you buy an electronic device that you operate continuously. The device costs you $300 and carries a one-year warranty. The warranty states that if the device fails during its first year of use, you get a new device for no cost, and this new device carries exactly the same warranty. However, if it fails after the first year of use, the warranty is of no value. You plan to use this device for the next six years. Therefore, any time the device fails outside its warranty period, you will pay $300 for another device of the same kind. (We assume the price does not increase during the six-year period.) The time until failure for a device is gamma distributed with parameters α = 2 and β = 0.5. (This implies a mean of one year.) Use @RISK to simulate the six-year period. Include as outputs (1) your total cost, (2) the number of failures during the warranty period, and (3) the number of devices you own during the six-year period.

58. Work the previous problem for a case in which the one-year warranty requires you to pay for the new device even if failure occurs during the warranty period. Specifically, if the device fails at time t, measured relative to the time it went into use, you must pay $300t for a new device. For example, if the t for a new device. For example, if the t device goes into use at the beginning of April and fails nine months later, at the beginning of January, you must pay $225. The reasoning is that you got 9/12 of the warranty period for use, so you should pay that fraction of the total cost for the next device. As before, however, if the device fails outside the warranty period, you must pay the full $300 cost for a new device.

59. Based on Hoppensteadt and Peskin (1992). The following model (the Reed–Frost model) is often used to model the spread of an infectious disease. Suppose that at the beginning of period 1, the population consists of five diseased people (called infectives) and 95 healthy people (called susceptibles). During any period there is a 0.05 probability that a given infective person will encounter a particular susceptible. If an infective encounters a susceptible, there is a 0.5 probability that the susceptible will contract the disease. An infective lives for an average of 10 periods with the disease. To model this, assume that there is a 0.10 probability that an infective dies during any given period. Use @RISK to model the evolution of the population over 100 periods. Use your results to answer the following questions. [Hint: During any period there is probability 0.05(0.50) = 0.025 that an infective will infect a particular susceptible. Therefore, the probability that a particular susceptible is not infected during a period is (1 – 0.025)n, where n is the number of infectives present at the end of the previous period.]

a. What is the probability that the population will die out?

b. What is the probability that the disease will die out?

c. On the average, what percentage of the population is infected by the end of period 100?

d. Suppose that people use infection “protection” during encounters. The use of protection reduces the probability that a susceptible will contract the disease during a single encounter with an infective from 0.50 to 0.10. Now answer parts a through c under the assumption that everyone uses protection.

60. Chemcon has taken over the production of Nasacure from a rival drug company. Chemcon must build a plant to produce Nasacure by the beginning of 2010. Once the plant is built, the plant’s capacity cannot be changed. Each unit sold brings in $10 in revenue. The fixed cost (in dollars) of producing a plant that can produce x units per year of the drug is x units per year of the drug is x 5,000,000 + 10x0x0 . This cost is assumed to be incurred

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

16-6 Conclusion 891

at the end of 2010. In fact, you can assume that all cost and sales cash flows are incurred at the ends of the respective years. If a plant of capacity x is built, x is built, x the variable cost of producing a unit of Nasacure is 6 – 0.1(x − 1,000,000)/100,000. For example, a plant capacity of 1,100,000 units has a variable cost of $5.90. Each year a plant operating cost of $1 per unit of capacity is also incurred. Based on a forecasting sales model from the previous 10 years, Chemcon forecasts that demand in year t, Dt, is related to the demand in the previous year, Dt–t–t 1, by the equation Dt = 67,430 + 0.985Dt–t–t 1 + et, where et is normally t is normally t distributed with mean 0 and standard deviation 29,320. The demand in 2009 was 1,011,000 units. If demand for a year exceeds production capacity, all demand in excess of plant capacity is lost. If demand is less than capacity, the extra capacity is simply not used. Chemcon wants to determine a capacity level that maximizes expected discounted profits (using a discount rate of 10%) for the time period 2010 through 2019. Use simulation to help it do so.

61. Tinkan Company produces one-pound cans for the Canadian salmon industry. Each year the salmon spawn during a 24-hour period and must be canned immediately. Tinkan has the following agreement with the salmon industry. The company can deliver as many cans as it chooses. Then the salmon are caught. For each can by which Tinkan falls short of the salmon industry’s needs, the company pays the industry a $2 penalty. Cans cost Tinkan $1 to produce and are sold by Tinkan for $2 per can. If any cans are left over, they are returned to Tinkan and the company reimburses the industry $2 for each extra can. These extra cans are put in storage for next year. Each year a can is held in storage, a carrying cost equal to 20% of the can’s production cost is incurred. It is well known that the number of salmon harvested during a year is strongly related to the number of salmon harvested the previous year. In fact, using past data, Tinkan estimates that the harvest size in year t, HtHtH (measured in the number of cans required), is related to the harvest size in the previous year, HtHtH –t–t 1, by the equation HtHtH = HtHtH –t–t 1et, where et is normally distributed with mean 1.02 and standard deviation 0.10.

Tinkan plans to use the following production strategy. For some value of x, it produces enough cans at the beginning of year t to bring its inventory up to t to bring its inventory up to t x + ĤtHtH , where ĤtHtH is the predicted harvest size in year t. Then it delivers these cans to the salmon industry. For example, if it uses x = 100,000, the predicted harvest size is 500,000 cans, and 80,000 cans are already in inventory, then Tinkan produces and delivers 520,000 cans. Given that the harvest size for the previous year was 550,000 cans, use simulation to help Tinkan develop a production strategy that maximizes its

expected profit over the next 20 years. Assume that the company begins year 1 with an initial inventory of 300,000 cans.

62. You are unemployed, 21 years old, and searching for a job. Until you accept a job offer, the following situation occurs. At the beginning of each year, you receive a job offer. The annual salary associated with the job offer is equally likely to be any number between $20,000 and $100,000. You must immediately choose whether to accept the job offer. If you accept an offer with salary $x, you receive $x per year while you work (assume you retire at age 70), including the current year. Assume that cash flows are discounted so that a cash flow received one year from now has a present value of 0.9. You decide to accept the first job offer that exceeds w dollars. a. Use simulation to determine the value of w (within

$10,000) that maximizes the expected NPV of earnings you will receive the rest of your working life.

b. Repeat part a, but now assume that you get a 3% raise in salary every year after the first year you accept the job.

63. A popular restaurant in Indianapolis does a brisk business, filling virtually all of its seats from 6 p.m. until 9 p.m. Tuesday through Sunday. Its current annual revenue is $2.34 million. However, it does not currently accept credit cards, and it is thinking of doing so. If it does, the bank will charge 4% on all receipts during the first year. (To keep it simple, you can ignore taxes and tips and focus only on the receipts from food and liquor.) Depending on receipts in year 1, the bank might then reduce its fee in succeeding years, as indicated in the file P16_63.xlsx. (This would be a one-time reduction, at the end of year 1 only.) This file also contains parameters of the two uncertain quantities, credit card usage (percentage of customers who will pay with credit cards) and increased spending (percentage increase in spending by credit card users, presumably on liquor but maybe also on more expensive food). The restaurant wants to simulate a five-year horizon. Its base case is not to accept credit cards at all, in which case it expects to earn $2.34 million in revenue each year. It wants to use simulation to explore other options, where it will accept credit cards in year 1 and then continue them in years 2–5 if the bank fee is less than or equal to some cutoff value. For example, one possibility is to accept credit cards in year 1 and then discontinue them only if the bank fee is less than or equal to 3%. You should explore the cutoffs 2% to 4% in increments of 0.5%. Which policy provides with the largest mean increase in revenue over the five-year horizon, relative to never using credit cards?

64. The Ryder Cup is a three-day golf tournament played every other year with 12 of the best U.S. golfers

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Your nextYour nextY -door neighbor, Scott Jansen, has a 12-year-old daughter, and he intends to pay the tuition for her first year of college six years from now. The tuition for the first year will be $22,500. Scott has gone through his budget and finds that he can invest $3000 per year for the next six years. Scott has opened ear for the next six years. Scott has opened ear accounts at two mutual funds. The first fund follows an investment strategy designed to match the return of the S&P 500. The second fund invests in 3-month Treasury bills. Both funds have very low fees.

Scott has decided to follow a strategy in which he contributes a fixed fraction of the $3000 to each fund. An adviser from the first fund suggested that in each year he should invest 80% of the $3000 in the S&P 500 fund and the other 20% in the T-bill fund. The adviser explained that the S&P 500 has averaged much larger returns than the T-bill fund. Even though stock returns are risky investments in the short run, the risk should be fairly minimal over the longer six-year period. An adviser from the second fund recommended just the opposite: invest 20% in the S&P 500 fund and 80% in T-bills, because treasury bills are backed by the United States government. If you follow this allocation, he said, your average return will be lower, but at least you will have enough to reach your $22,500 target in six years.

Not knowing which adviser to believe, Scott has come to you for help.

Questions 1. The file C16_01.xlsx contains annual returns

of the S&P 500 and 3-month Treasury bills from 1960. Suppose that in each of the next 72 months 1960. Suppose that in each of the next 72 months 1960. (six years), it is equally likely that any of the his- torical returns will occur. Develop a spreadsheet model to simulate the two suggested investment strategies over the six-year period. Plot the value of each strategy over time for a single iteration of the simulation. What is the total value of each strategy after six years? Do either of the strate- gies reach the target?

2. Simulate 1000 iterations of the two strategies over the six-year period. Create a histogram of the final fund values. Based on your simulation results, which of the two strategies would you recommend? Why?

3. Suppose that Scott needs to have Suppose that Scott needs to have Suppose that Scott needs to ha $25,000 to pay for the first year’s tuition. Based on the same simulation results, which of the two strategies would you recommend now? Why?

4. What other real-world factors might be important to consider in designing the simulation and making a recommendation?

C A S E 16.1 COLLEGE FUND INVESTMENT

against 12 of the best European golfers. They play 16 team matches (each match has two U.S. golfers against two European golfers) on Friday and Saturday, and they play 12 singles matches (each match has a single U.S. golfer against a European golfer) on Sunday. Each match is either won or tied. A win yields 1 point for the winning team and 0 points for the losing team. A tie yields 0.5 point for each team. A team needs 14.5 points to win the Cup. If each team gets 14 points, the tournament is a tie, but the preceding winner gets to keep the Cup. In 1999, the U.S. was behind 10 points to 6 after the team matches. To win the Cup, the U.S. needed at least 8.5 points on Sunday, a very unlikely outcome, but they pulled off the miracle and won. Use simulation to estimate the probability of the U.S. scoring at least 8.5 points in the 12 singles matches, assuming all golfers in the tournament are essentially equal. Proceed as follows.

a. Use simulation to estimate the probability, call it h (for half), that a given match ends in a tie. To do this, you can assume that any of the 18 holes is tied with probability 0.475 and won with probability 0.525. (These are the historical fractions of holes that have been tied and won in singles matches in the past few Ryder Cups.) Note that each match is “match play,” so the only thing that counts on each hole is whether a golfer has fewer strokes than the other golfer—winning a hole by one stroke is equivalent to winning the hole by two or more strokes in match play. The player winning the most holes wins the match, unless they tie.

b. Run another simulation, using the estimated probability h as an input, to estimate the probability that the U.S. will score at least 8.5 points in the 12 singles matches.

892 Chapter 16 Simulation Models Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

An investor is considering the purchase of zero-coupon U.S. Treasury bonds. A 30-year zero-coupon bond yielding 8% can be purchased today for $9.94. At the end of 30 years, the owner of the bond will receive $100. The yield of the bond is related to its price by the following equation:

P = 100 (1 + y)y)y t

Here, P is the price of the bond, P is the price of the bond, P y is the yield of the y is the yield of the y bond, and t is the maturity of the bond measured in t is the maturity of the bond measured in t years. Evaluating this equation for t = 30 and y = 0.08 gives P = 9.94.

The investor is planning to purchase a bond today and sell it one year from now. The investor is interested in evaluating the return on the investment in the bond. Suppose, for example, that the yield of the bond one year from now is 8.5%. Then the price of the bond one year later will be $9.39 [=100/(1 + 0.085)29]. The time remaining to maturity is t = 29 because one year has passed. The return for the year is −5.54% [= (9.39 − 9.94)/9.94].

In addition to the 30-year-maturity zero-coupon bond, the investor is considering the purchase of zero-coupon bonds with maturities of 2, 5, 10, or

20 years. All of the bonds are currently yielding 8.0%. (Bond investors describe this as a flat yield curve.) The investor cannot predict the future yields of the bonds with certainty. However, the investor believes that the yield of each bond one year from now can be modeled by a normal distribution with mean 8% and standard deviation 1%.

Questions 1. Suppose that the yields of the five zero-coupon

bonds are all 8.5% one year from today. What are the returns of each bond over the period?

2. Using a simulation with 1000 iterations, estimate the expected return of each bond over the year. Estimate the standard deviations of the returns.

3. Comment on the following statement: Comment on the following statement: Comment on the f “The expected yield of the 30-year bond one year from today is 8%. At that yield, its price would be $10.73. The return for the year would be 8% [= (10.73 – 9.94)/9.94]. Therefore, the average return for the bond should be 8% as well. A simulation isn’t really necessary. Any difference between 8% and the answer in Question 2 must be due to simulation error.”

C A S E 16.2 BOND INVESTMENT STRATEGY

Case 16.2 Bond Investment Strategy 893 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Advanced Data Analysis CHAPTER 17 Data Mining

PA RT

6

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

897

HOTTEST NEW JOBS: STATISTICS AND MATMATMA HEMATICS/

Much of this book, as the title implies, is about data analysis. The term data analysis has long been synonymous with the term statistics, but in today’s world, with massive amounts of data available in business and many other fields such as health and science, data analysis goes beyond the more narrowly focused area of traditional statistics. But regardless of what it is called, data anal- ysis is currently a hot topic and promises to get even hotter in the future. The data analysis skills you learn here, and possibly in follow-up quantitative courses, might just land you a very interesting and lucrative job.

This is exactly the message in a recent New York Times article, “For TodaTodaT y’s Graduate, Just One Word: Statistics,” by Steve Lohr. (A similar arti-oday’s Graduate, Just One Word: Statistics,” by Steve Lohr. (A similar arti-oda cle, “Math Will Rock Your World,” by Stephen Baker, was the cover story for Business Week. Both articles are available online by searching for their titles.) The statistics article begins by chronicling a Harvard anthropology and archaeology graduate, Carrie Grimes, who began her career by mapping the locations of Mayan artifacts in places like Honduras. As she states, “People think of field archaeology as Indiana Jones, but much of what you really do is data analysis.” Since then, Grimes has leveraged her data analysis skills to get a job with Google, where she and many other people with a quantitative background are analyzing huge amounts of data to improve the company’s search engine. As the chief economist at Google, Hal Varian, states, “I keep saying that the sexy job in the next 10 years will be statisticians. And I’m not kidding.” The salaries for statisticians with doctoral degrees currently start at start at start $125,000, and they will probably continue to increase. (The math article indi- cates that mathematicians are also in great demand.)

Why is this trend occurring? The reason is the explosion of digital data—data from sensor signals, surveillance tapes, Web clicks, bar scans, sensor signals, surveillance tapes, Web clicks, bar scans, sensor signals,

Data Mining

C H A P T E R

17

K o n st

a n tin

C h a g

in /S

h u tt

e rs

to c k.

c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

898 Chapter 17 Data Mining

public records, financial transactions, and more. In years past, statisticians typically ana- lyzed relatively small data sets, such as opinion polls with about 1000 responses. Today’s Today’s T massive data sets require new statistical methods, new computer software, and most importantly for you, more young people trained in these methods and the correspond- ing software. Several particular areas mentioned in the articles include (1) improving Internet search and online advertising, (2) unraveling gene sequencing informa- tion for cancer research, (3) analyzing sensor and location data for optimal handling of food shipments, and (4) the recent Netflix contest for improving the company’s recommendation system.

The statistics article mentions three specific organizations in need of data analysts. The first is government, where there is an increasing need to sift through mounds of data as a first step toward dealing with long-term economic needs and key policy priori- ties. The second is IBM, which created a Business Analytics and Optimization Services group in April 2009. This group will use the more than 200 mathematicians, statisticians, and data analysts already employed by the company, but IBM intends to retrain or hire 4000 more analysts to meet its needs. The third is Google, which needs more data ana- lysts to improve its search engine. You may think that today’s search engines are unbeliev- ably efficient, but Google knows they can be improved. As Ms. Grimes states, “Even an improvement of a percent or two can be huge, when you do things over the millions and billions of times we do things at Google.”

Of course, these three organizations are not the only organizations that need to hire more skilled people to perform data analysis and other analytical procedures. It is a need faced by all large organizations. Various recent technologies, the most prominent by far all large organizations. Various recent technologies, the most prominent by far all being the Web, have given organizations the ability to gather massive amounts of data easily. Now they need people to make sense of it all and use it to their competitive advantage. ■

17-1 INTRODUCTION The types of data analysis discussed throughout this book are crucial to the success of most companies in today’s data-driven business world. However, the sheer volume of available data often de�es traditional methods of data analysis. Therefore, new methods— and accompanying software—have been developed under the name of data mining. Data mining attempts to discover patterns, trends, and relationships among data, especially non- obvious and unexpected patterns.1

attempts to discover patterns, trends, and relationships among data, 1

attempts to discover patterns, trends, and relationships among data, For example, an analysis might discover that people

who purchase skim milk also tend to purchase whole wheat bread, or that cars built on Mondays before 10 a.m. on production line #5 using parts from supplier ABC have signi�- cantly more defects than average. This new knowledge can then be used for more effective management of a business.

The place to start is with a data warehouse. Typically, a data warehouse is a huge database that is designed speci�cally to study patterns in data. A data warehouse is not the same as the databases companies use for their day-to-day operations. A data warehouse should (1) combine data from multiple sources to discover as many relationships as possible, (2) contain accurate and consistent data, (3) be structured to enable quick and accurate responses to a variety of queries, and (4) allow follow-up responses to speci�c relevant questions. In short, a data warehouse represents a type of database that is speci�- cally structured to enable data mining. Another term you might hear is data mart. A data mart is essentially a scaled-down data warehouse, or part of an overall data warehouse, that is structured speci�cally for one part of an organization, such as sales. Virtually all

1The topics in this chapter are evolving rapidly, as is the terminology. Data mining is sometimes used as a syno- nym for business analytics or data analytics, although these latter terms are broader and encompass most of the material in this book. Another term gaining popularity is big data. This term is used to indicate the huge data sets often analyzed in data mining.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-1 Introduction 899

large organizations, and many smaller ones, have developed data warehouses or data marts in the past decade or two to enable them to better understand their business—their custom- ers, their suppliers, and their processes.

Once a data warehouse is in place, analysts can begin to mine the data with a collection of methodologies and accompanying software. Some of the primary methodologies are classi�cation analysis, prediction, cluster analysis, market basket analysis, and forecasting. Each of these is a large topic in itself, but some brief explanations follow.

■ Classi�cation analysis attempts to �nd variables that are related to a categorical (often binary) variable. For example, credit card customers can be categorized as those who pay their balances in a reasonable amount of time and those who don’t. Classi�cation analysis would attempt to �nd explanatory variables that help predict which of these two categories a customer is in. Some variables, such as salary, are natural candidates for explanatory variables, but an analysis might uncover others that are less obvious.

■ Prediction is similar to classi�cation analysis, except that it tries to �nd variables that help explain a continuous variable, such as credit card balance, rather than a categorical variable. Regression, the topic of Chapters 10 and 11, is one of the most popular prediction tools, but there are others not covered in this book.

■ Cluster analysis tries to group observations into clusters so that observations within a cluster are alike, and observations in different clusters are not alike. For example, one cluster for an automobile dealer’s customers might be middle-aged men who are not married, earn over $150,000, and favor high-priced sports cars. Once natural clusters are found, a company can then tailor its marketing to the individual clusters.

■ Market basket analysis tries to �nd products that customers purchase together in the same “market basket.” In a supermarket setting, this knowledge can help a manager position or price various products in the store. In banking and other settings, it can help managers to cross-sell (sell a product to a customer already purchasing a related product) or up-sell (sell a more expensive product than a customer originally intended to purchase).

■ Forecasting is used to predict values of a time series variable by extrapolating Forecasting is used to predict values of a time series variable by extrapolating Forecasting patterns seen in historical data into the future. (This topic is covered in Chapter 12.) This is clearly an important problem in all areas of business, including the forecasting of future demand for products, forecasting future stock prices and commodity prices, and many others.

Not too long ago, data mining was considered a topic only for the experts. In fact, most people had never heard of data mining. Also, the required software was expensive and dif�cult to learn. Fortunately, this is changing. Many people in organizations, not just the quantitative experts, have access to large amounts of data, and they have to make sense of it right away, not a year from now. Therefore, they must have some understanding of tech- niques used in data mining, and they must have software to implement these techniques.

Data mining is a huge topic. A thorough discussion, which would �ll a large book or two, would cover the role of data mining in real business problems, data warehousing, the many data mining techniques that now exist, and the software packages that have been developed to implement these techniques. There is not nearly enough room to cover all of this here, so the goal of this chapter is more modest. We begin with a discussion of powerful tools for exploring and visualizing data. Not everyone considers these tools to be data mining tools—they are often considered preliminary steps to “real” data mining—but they are too important not to discuss here. Next, we discuss classi�cation, one of the most important types of problems tackled by data mining. Finally, the chapter concludes with a discussion of clustering.

It is not really possible, or at least not as interesting, to discuss data mining without using software for illustration. There is no attempt here to cover any data mining software

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

900 Chapter 17 Data Mining

package in detail. Instead, we highlight a few different packages for illustration. In some cases, you already have the software. For example, the NeuralTools add-in in the Palisade DecisionTools® cases, you already have the software. For example, the NeuralTools add-in in the Palisade

® cases, you already have the software. For example, the NeuralTools add-in in the Palisade

Suite, available with this book, can be used to estimate neural nets for classi�cation. In other cases, we illustrate popular software that can be downloaded for free from the Web. We also illustrate how some data mining methods can be implemented with Excel-only formulas. However, you should be aware that there are numerous other software packages that perform various data mining procedures, and many of them are quite expen- sive with a fairly steep learning curve. You might end up using one of these in your job, and you will then have to learn how it works.

17-2 DATA EXPLORATION AND VISUALIZATION Data mining is a relatively new �eld—or at least a new term—and not everyone agrees with its de�nition. To many people, data mining is a collection of advanced algorithms that can be used to �nd useful information and patterns in large data sets. Data mining does indeed include a number of advanced algorithms, but we broaden its de�nition in this chapter to include relatively simple methods for exploring and visualizing data. This section discusses some of the possibilities. They are basically extensions of methods discussed in Chapters 2 and 3, and the key ideas—tables, pivot tables, and charts—are not new. However, advances in software now enable you to analyze large data sets quickly and easily.

17-2a Introduction to Relational Databases

First, we present some general concepts about database structure. The Excel data sets we have discussed so far in this book are often called �at �les or, more simply, tables. They are also called single-table databases, where table is the database term for a rectangular range of data, with rows corresponding to records and columns corresponding to �elds.2

is the database term for a rectangular range 2

is the database term for a rectangular range Flat �les

are �ne for relatively simple database applications, but they are not powerful enough for more complex applications. These require a relational database, a set of related tables, where each table is a rectangular arrangement of �elds and records, and the tables are related explicitly.

As a simple example, suppose you would like to keep track of information on all of the books you own. Speci�cally, you would like to keep track of data on each book (title, author, copyright date, whether you have read it, when you bought it, and so on), as well as data on each author (name, birthdate, awards won, number of books written, and so on). Now suppose you store all of these data in a �at �le. Then if you own all of these data in a �at �le. Then if you own all 10 books by Danielle Steele, you must �ll in the identical personal information on Ms. Steele for each of the 10 records associated with her books. This is not only a waste of time, but it increases the chance of introducing errors as you enter the same information multiple times.

A better solution is to create a Books table and an Authors table. The Authors table will include a record for each author, with �elds for name, gender, date of birth, and so on. It will also contain a unique identi�er �eld, probably named AuthorID. For example, Danielle Steele might have AuthorID 1, John Grisham might have AuthorID 2, and so on. The values of AuthorID are not important, but they must be unique. The Books table will have a record for each book, with �elds like title, copyright date, genre, and so on. It will also contain an AuthorID �eld that lists the same AuthorID as in the Authors table for the author of this book. It can also contain a unique identi�er �eld, such as ISBN. (For the purpose of this discussion, we are assuming that each book has a single author. If multiple authors are allowed, the situation is slightly more complex.)

2Fortunately, Excel now uses the term table in exactly the same way as it has been used in database packages for years. Also, when talking about databases, it is more common to refer to observations (rows) as records and variables (columns) as �elds.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 901

The key to relating these two tables is the AuthorID �eld. In database software such as Access, there is a link between the AuthorID �elds in the two tables. This link allows you to �nd data from the two tables easily. For example, suppose you see in the Authors table that John Updike’s ID is 35. Then you can search through the Books table for all records with AuthorID 35. These correspond to the books you own by John Updike. Going the other way, if you see in the Books table that you own The World According to Garp by John Irving, who happens to have AuthorID 21, you can look up the (unique) record in the Authors table with AuthorID 21 to �nd personal information about John Irving.

The linked �elds are called keys. Speci�cally, the AuthorID �eld in the Authors table is called a primary key, and the AuthorID �eld in the Books table is called a for-

eign key. A primary key must contain unique val- ues, whereas a foreign key can contain duplicate values. For example, there is only one Danielle Steele, but she has written many books.

The theory and implementation of relational databases is both lengthy and complex. Indeed, many books have been written about the topic. However, this brief introduction suf�ces for our purposes. As you will see in examples, an Access database �le (recognizable by the .mdb extension, or the .accdb extension introduced in Access 2007) typically contains several related tables. They are related in the same basic way as the Books and Authors were related in the previous paragraphs— through links between primary and foreign keys.3 Authors were related in the previous paragraphs—

3 Authors were related in the previous paragraphs—

Primary keys, which are unique, and foreign keys, which are usually not unique, relate the tables in a relational database.

3You will soon see that the Excel Data Model can now play the role of a relational database, that is, a set of related tables, but stored entirely within Excel.

Spreadsheets versus Databases As is illustrated throughout this book, Excel is an excel- lent tool for analyzing data. However, Excel is not the best place to store complex data. In contrast, database packages such as Access, SQL Server, Oracle, and oth- ers have been developed explicitly to store data, and much of corporate data is stored in such database packages. These packages typically have some tools for analyzing data, but these tools are neither as well known nor as easy to use as Excel. Therefore, it is use- ful to know how to import data from a database into Excel for analysis.

F u n da m e n ta l I n s i g h t

17-2b Online Analytical Processing (OLAP)

We introduced pivot tables in Chapter 3 as an amazingly easy and powerful way to break data down by category in Excel® We introduced pivot tables in Chapter 3 as an amazingly easy and powerful way to break

® We introduced pivot tables in Chapter 3 as an amazingly easy and powerful way to break

. However, the pivot table methodology is not limited to Excel or even to Microsoft. This methodology is usually called online analytical processing, or OLAP. This name was initially used to distinguish this type of data analy- sis from online transactional processing, or OLTP. The latter has been used for years by transactional processing, or OLTP. The latter has been used for years by transactional companies to answer speci�c day-to-day questions: Why was there a shipment delay in this customer’s order? Why doesn’t the invoice amount for this customer’s order match the customer’s payment? Is this customer’s complaint about a defective product justi�ed? In fact, database systems have been developed to answer such “one-off” questions quickly. In contrast, OLAP is used to answer broader questions: Are sales of a particular product decreasing over time? Is a particular product selling equally well in different stores? Do customers who pay with our credit card tend to spend more?

When analysts began to realize that the typical OLTP databases are not well equipped to answer these broader types of questions, OLAP was born. This led to much research into the most appropriate database structure for answering OLAP questions. The consensus is that the best structure is a star schema. In a star schema, there is at least one Facts table with many rows and only a few columns. For example, in a supermarket database, a Facts table might have a row for each line item purchased, including the number of items of the product purchased, the total amount paid for the product, and possibly the discount. Each row of the Facts table would also list lookup values (or foreign keys, in database terminology) about

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

902 Chapter 17 Data Mining

the purchase: the date, the store, the product, the customer, any promotion in effect, and possibly others. Finally, the database would include a dimension table for each of these. For example, there would be a Products table. Each row of this table would contain multiple pieces of information about a particular product. Then if a customer purchases product 15, for example, information about product 15 could be looked up in the Products table.

One particular star schema, for the Foodmart Access database created by Microsoft for illustration, appears in Figure 17.1. (This database is available in the Foodmart.mdb �le if you want to view it in Access.) The Facts table in the middle contains only two “facts” about each line item purchased: Revenue and UnitsSold. (There are over 250,000 rows in the Facts table, but even this is extremely small in comparison to many corporate facts tables.) The other columns in the Facts table are foreign keys that let you look up informa- tion about the product, the date, the store, and the customer in the respective dimensions tables. You can see why the term “star schema” is used. The dimension tables surround the central Facts table like stars.

Figure 17.1 Star Schema for Foodmart Database

© C

e n g

a g

e L

e a rn

in g

Most data warehouses are built according to these basic ideas. By structuring cor- porate databases in this way, facts can easily be broken down by dimensions, and—you guessed it—the methodology for doing this is pivot tables. However, these pivot tables are not just the “standard” Excel pivot tables. You might think of them as pivot tables on ster- oids. The OLAP methodology and corresponding pivot tables have the following features that distinguish them from standard Excel pivot tables.

■ The OLAP methodology does not belong to Microsoft or any other software company. It has been developed by many analysts, and it has been implemented in a variety of software packages. Of course, Microsoft is included in this group. Its OLAP tools are located in the Analysis Services section of its SQL Server database software.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 903

Row Labels Drink $142,578.37

$41,137.07 $80,152.27 $17,754.68 $17,028.38 $26,227.46

$4,085.95 $22,141.51 $19,141.75 $21,289.03

$1,187,171.39 $314,635.84

$1,644,385.60

Alcoholic Beverages Beverages

Carbonated Beverages

1 2 3 4 5 6 7 8 9

10 11 12 13

14

A B

Drinks Hot Beverages

Pure Juice Beverages Dairy

Food Non-Consumable

Grand Total

Chocolate Coffee

Revenue –

+

+

+

+

+

+

+

+

+

A BFigure 17.2 Drilling Down a Hierarchy in the Foodmart Database

© C

e n g

a g

e L

e a rn

in g

■ In OLAP pivot tables, you aren’t allowed to drag any �eld to any area of the pivot table, as you can in Excel. Only facts are allowed in the Values area, and only dimensions are allowed in the Rows, Columns, and Filters areas. But this is not much of a limitation. The whole purpose of these pivot tables is to break down facts, such as Revenue, by dimensions such as Date and Product.

■ Some dimensions have natural hierarchies. For example, the Products dimen- sion in Figure 17.1 has the natural hierarchy ProductFamily, ProductDepartment, ProductCategory, and ProductSubcategory. Similarly, the Stores and Customers dimensions have geographical hierarchies, and the Date dimension always has hierarchies such as Year, Quarter, Month, and Day. OLAP software lets you specify such hierarchies. Then when you create a pivot table, you can drag a hierarchy to an area and “drill down” through it. For example, looking at Revenue totals, you can start at the ProductFamily level (Drink, Food, or Non-Consumable). Then you can drill down to the ProductDepartment level for any of these, such as Beverages, Dairy, and Alcoholic for the Drink family. Then you can drill down further to the ProductCategory level and so on. Figure 17.2 shows what a resulting pivot table might look like.

■ OLAP databases are typically huge, so it can take a while to get the results for a particular pivot table. For this reason, the data are often “preprocessed” in such a way that the results for any desired breakdown are already available and can be obtained immediately. Speci�cally, the data are preprocessed into �les that are referred to as OLAP cubes. (The analogy is to a Rubik’s cube, where each little sub-cube contains the result of a particular breakdown.) In Excel 2003, Microsoft let you build your own OLAP cubes, but this feature was removed in subsequent versions of Excel. Now you need Analysis Services in SQL Server (or some other company’s software) to build cubes. We don’t assume that you have access to such software, so we won’t pursue this approach here. Instead, we will discuss similar tools that are available in Excel in the next subsection.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

904 Chapter 17 Data Mining

17-2c Power Pivot and Self-Service BI Tools in Excel

This section is potentially one of the most important sections in the book because this is the area that Microsoft, and other companies, see as the future of data analysis, and we tend to agree.

It helps to have some background. Starting in Excel 2010, Microsoft introduced an optional add-in called PowerPivot. This add-in is not part of Excel 2010, but you can down- load it for free from a Microsoft website; just search for PowerPivot 2010. Once it is added in, it provides two main advantages, plus some others not discussed here, over regular Excel pivot tables. First, PowerPivot allows you to work with large data sets (over a million rows, say), without bringing your computer to a standstill. This is due to a data-compression scheme that lets you �t huge amounts of data into memory. Second, PowerPivot provides tools for relating separate tables of data, all within Excel. These tables could be from different sources, such as a combination of Access tables, Excel tables, text �les, and others. As long as these tables have appropriate columns for relating the tables, essentially primary and foreign keys, you can relate them with PowerPivot. The tools previously required to relate tables, including VLOOKUP functions, Microsoft Access, and/or Microsoft Query, are no longer necessary.

Next, in Excel 2013, Microsoft made PowerPivot (with a modi�ed user interface) part of Excel. More precisely, it introduced a Data Model for storing and relating large tables of data. Then PowerPivot can be used to manipulate this Data Model.4

for storing and relating large tables 4

for storing and relating large tables Excel 2013 also

includes another add-in called Power View, an easy-to-use add-in for producing reports based on a Data Model. Finally, Microsoft developed two other Excel add-ins for Excel 2013, Power Query and Power Map. As their names imply, Power Query is used to create queries for importing data into Excel, and Power Map is used to show data on geographical maps. These two add-ins are not part of Excel 2013, but you can download them for free from a Microsoft website.

These four add-ins, PowerPivot, Power View, Power Query, and Power Map, have become known as Excel’s Self-Service Business Intelligence (or Self-Service BI) tools. Actually, self-service BI is not exclusively a Microsoft term, but Microsoft has embraced it. The idea is that before self-service BI tools were available, employees usually had to request the reports they needed from their corporate IT departments. This could take days or weeks, and the reports were often out of date, or not quite what the employees needed, by the time they were received. Therefore, the purpose of self-service BI tools is to let employees generate their own reports, quickly and easily, with familiar tools such as Excel.

All of these self-service BI add-ins are built into Excel 2016.5 employees generate their own reports, quickly and easily, with familiar tools such as Excel.

5 employees generate their own reports, quickly and easily, with familiar tools such as Excel.

It seems safe to say that these Excel self-service BI tools will continue to evolve, getting easier to use and more powerful, as Excel evolves. It is most important at this point that you become aware of these tools and have some familiarity with what they can do. We illustrate some of the pos- sibilities next, using the tools and user interface from Excel 2016. (Unfortunately, even if you have the free add-ins for Excel 2010 or 2013, the user interface is somewhat different than in Excel 2016, and it would be too complex and confusing to provide instructions and screenshots for each of them. Therefore, we focus only on the latest, Excel 2016.)

To get started, you must load the add-ins. First, make sure the Developer tab is visible. (If it isn’t, right-click any ribbon, select Customize the Ribbon, and check the Developer item in the right pane of the resulting Customize dialog box.) Then from the Developer ribbon, click the COM Add-Ins button to see the list in Figure 17.3. You should check the three “Power” add-ins in this list. (If any of them aren’t in your list, then your version of Excel 2016 doesn’t include the add-ins.) Among other things, you should then see a Power Pivot tab with the associated ribbon shown in Figure 17.4. 4All versions of Excel 2013 include the Data Model. However, only owners of Of�ce Professional Plus or higher have the PowerPivot add-in. 5Again, not all versions of Of�ce include all of these tools; you evidently require Of�ce Professional Plus or higher. Also, Power Pivot is now (thankfully) spelled as two words, just like the other “power” add-ins.

Intro to Power BI

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 905

Figure 17.3 COM Add-Ins List (Excel 2016)

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Figure 17.4 Power Pivot Ribbon in Excel 2016

The rest of this subsections leads you through a typical example using Power Pivot. The data set for this example is stored in three separate, currently unrelated, �les. The bulk of the data are in the Access �le ContosoSales.accdb. Related data are in the Excel �le Stores.xlsx and the comma-delimited text �le Geography.csv. The ContosoSales database has �ve related tables, Dates, Sales, Products, ProductSubcategories, and ProductCategories. Each row in the Sales table is for a sale of some product on some date. The Access tables are related through primary and foreign keys as indicated in Figure 17.5.

Figure 17.5 Relationships Diagram for ContosoSales Database

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

906 Chapter 17 Data Mining

Similarly, the Stores and Geography �les each contain a single table of data that will eventually be related to the ContosoSales data. The Stores �le contains data about the stores where the products are sold, which will be related to the Sales table through StoreKey �elds. The Geography �le has information about the locations of the stores, which will eventually be related to the Stores data through GeographyKey �elds.

Here is an overview of the entire process. Once again, we remind you that these instruc- tions apply to a version of Excel 2016 that contains Power Pivot. Also, you might want to watch the accompanying Data Model and Power Pivot videos that lead you through most of these same steps.

1. Import the data from the three sources into an Excel Data Model, not into physical not into physical not Excel tables.

2. Create relationships between the tables in the Data Model.

3. Modify the Data Model to enable useful pivot tables.

4. Build one or more pivot tables from the Data Model.

Step 1: Import the Data into an Excel Data Model

1. Open a new workbook and save it as Power Pivot Tutorial.xlsx. 2. Click the Manage button on the Power Pivot ribbon. This opens a Power Pivot win-

dow, which is basically a backstage view for managing your (currently empty) Data Model. Note that the Excel window remains open so that you can go back and forth between the Power Pivot and Excel windows.

3. From the Home ribbon of the Power Pivot window, select From Access under the From Database dropdown list, locate the ContosoSales.accdb file, and click Next. Accept the option to select from a list of tables and click Next. Select all five tables and click Finish. The data are loaded into five spreadsheet-like tabs in the Power Pivot window, where you can view the data. Because of the relationships in the Access file, the five tables in the Data Model are automatically related. You can see the relation- ships by clicking the Diagram View button on the Home ribbon of the Power Pivot window. This is your Data Model, at least so far. See Figures 17.6 and 17.7.

4. From the Home ribbon of the Power Pivot window, select Excel File from the From Other Sources list and go through the obvious steps to import the single Stores table from the Stores.xlsx file. (Remember to check that the first row should be used as column head- ers.) Now the Stores table is part of the Data Model, although it isn’t yet related to the other tables.

5. Repeat the previous step to import the Geography table from the Geography.csv comma-delimited text file. (This time, choose Text File from the From Other Sources list.) This adds one more table to the Data Model, again not related to other tables.

Step 2: Create Relationships between the Data Sources One of the great features of the Excel Data Model is that you can relate “relatable” tables (those with appropriate key �elds) inside Excel, without the need for complex VLOOKUPs or other software such as Access. In the current example, you can do this directly within the Power Pivot window. There are at least two ways to do this, as discussed next.

1. Relate the Stores table to the Sales table through the StoreKey fields. To do this, select Create Relationship from the Design ribbon in the Power Pivot window, fill out the resulting dialog box as shown in Figure 17.8, and click OK. (The “many” side of the relationship should be on the left, and the “one” side should be on the right.)

2. Relate the Geography table to the Stores table through the GeographyKey fields. To do this, you could again go through the Create Relationships dialog box, but an

Data Model, Power Pivot

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 907

Figure 17.6 Power Pivot Data View Window

© C

e n g

a g

e L

e a rn

in g

Figure 17.7 Power Pivot Diagram View Window

© C

e n g

a g

e L

e a rn

in g

easier way is to drag from GeographyKey field in the Stores table (the “many” side) to the GeographyKey field in the Geography table (the “one” side) in Diagram View.

Now all seven tables are related, as shown in Figure 17.9.

Step 3: Modify the Data Model The data you see in the Power Pivot window, that is, the data in the Data Model, can’t be manipulated like in regular Excel worksheets, but there are two useful things you can do: (1) create measures and (2) create calculated columns. Both of these require Power Pivot’s

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

908 Chapter 17 Data Mining

Figure 17.8 Create Relationship Dialog Box

Figure 17.9 Diagram View of Completed Relationships

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 909

DAX language (short for Data Analysis Expressions). This language is very powerful and can become quite complex, so only a taste of it is presented here. In any case, the whole purpose of measures, calculated �elds, and other modi�cations of the Data Model are for their eventual use in pivot tables (or in Power View reports).

1. A measure is any summarization of fields that could be placed in the Values area of a pivot table. For this example, create a measure called Total Net Revenue. To do so, return to the Power Pivot ribbon in the Excel window, select New Measure from the Excel window, select New Measure from the Excel Measures dropdown list, and fill out the resulting dialog box as shown in Figure 17.10. If you then click OK and return to Data View in the Power Pivot window, you will see the Total Net Revenue measure below the data in the Sales tab.

2. A calculated column is like a new column added to an Excel table. Here, two cal- culated columns will be added to the Products table so that the ProductCategories and ProductSubcategories tables can be hidden, resulting in a less cluttered view for the user. To do this, return to the Products table in Data View, click the first blank column, type the following formula in the formula bar, and press Enter. (You’ll get help as you type.) Then right-click this column, select Rename Column, and rename it Product Category. The DAX function RELATED brings a field from a related table into the current table.

=RELATED(ProductCategories[ProductCategoryName])

Then do this a second time with the following formula, and rename this column Product Subcategory. Then the Products table should appear as in Figure 17.11.

=RELATED(ProductSubcategories[ProductSubcategoryName])

3. As indicated in step 2, you can hide fields, or even entire tables, from users if you As indicated in step 2, you can hide fields, or even entire tables, from users if you As indicated in step 2, you can hide f think these fields or tables would never be used in a pivot table. This provides a less cluttered look when the user eventually creates pivot tables from the Data Model. To do this, right-click a column or a table tab and select Hide from Client Tools.

Figure 17.10 Total Net Revenue Measure

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

910 Chapter 17 Data Mining

Try this with the ProductCategories and ProductSubcategories table tabs or with any other fields not useful for pivot tables. For example, primary and foreign key fields are good candidates for hiding. They are necessary for relating tables, but they aren’t likely to be used in pivot tables.

Step 4: Build One or More Pivot Tables from the Data Model This is the easy step. From the Home ribbon in the Power Pivot window, select the �rst item, PivotTable, from the PivotTable dropdown list. (You can experiment with the other items.) Now you can drag any of the (non-hidden) �elds from any of the (non-hidden) tables to a pivot table in the usual way. In particular, you will see the Total Net Revenue measure in the Sales table, a candidate for the Values area, and the two calculated columns in the Products table, candidates for the Rows and Columns areas or for �ltering.

Two example pivot tables appear in Figure 17.12 and 17.13. Assuming you have followed along to this point, you should try to reproduce them.

There are two things to note here. If you return to the Power Pivot window and make any changes, such as hiding more �elds or creating more calculated columns, the changes will be re�ected automatically when you return to the pivot table. Second, suppose you forget to relate tables, such as Stores and Geography. Then depending on the items you drag to the pivot table, you might get a warning about missing relationships. In this case, you can create the required relationships as described earlier to make the pivot table calculate correctly.

Arguably, Power Pivot is the most useful member of the “Power” add-ins for Excel 2016. However, you might also want to experiment with Power View for creating quick, insightful reports, and Power Map for creating insightful 3D maps. You can view the accom- panying Power View and Power Map videos to get started. You’ll �nd that it is quite easy.

Figure 17.11 Products Table with Calculated Columns

© C

e n g

a g

e L

e a rn

in g

Power View, Power Map

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-2 Data Exploration and Visualization 911

Figure 17.12 First Example Pivot Table

© C

e n g

a g

e L

e a rn

in g

Figure 17.13 Second Example Pivot Table

© C

e n g

a g

e L

e a rn

in g

17-2d Visualization Software

You can gain a lot of insight by using charts to view your data in imaginative ways. This trend toward powerful charting software for data visualization is the wave of the future and will certainly continue. Excel’s built-in tools, including the new Power View and Power Map add-ins, can be used for visualization. In addition, many other companies are devel- oping visualization software. To get a glimpse of what is currently possible, you can watch the accompanying video about a free software package, Tableau Public, developed by Tableau Software. Perhaps you will �nd other visualization software packages, free or otherwise, that rival Tableau or Power View. Alternatively, you might see blogs with data visualizations from ordinary users. In any case, the purpose of all visualization software is to portray data graphically so that otherwise hidden trends or patterns can emerge clearly.

Using Tableau Public

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

912 Chapter 17 Data Mining

17-3 CLASSIFICATION METHODS This section discusses one of the most important problems studied in data mining: classi- �cation. This is similar to the problem attacked by regression analysis—using explanatory variables to predict a dependent variable—but now the dependent variable is categorical. It usually has two categories, such as Yes and No, but it can have more than two categories, such as Republican, Democrat, and Independent. This problem has been analyzed with very different types of algorithms, some regression-like and others very different from regression, and this section discusses four of the most popular classi�cation methods. Each of the methods has the same objective: to use data from the explanatory variables to clas- sify each record (person, company, or whatever) into one of the known categories.

Before proceeding, it is important to discuss the role of data partitioning in classi�cation and in data mining in general. Data mining is usually used to explore very large data sets, with many thousands or even millions of records. Therefore, it is very possible, and also very useful, to partition the data set into two or even three distinct subsets before the algorithms are applied. Each subset has a speci�ed percentage of all records, and these subsets are typically chosen randomly. The �rst subset, usually with about 70% to 80% of the records, is called the training data set. The second subset, called the testing data set, usually contains the rest

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

P R O B L E M S

Level A Problems 1–3 require Excel 2016 (or 2013). It is possible to do them in Excel 2010, assuming the Power Pivot add-in has been installed and loaded, but there is more work involved.

1. The Access database file Foodmart.mdb mentioned earlier has the tables and relationships shown in Figure 17.1. Import the tables into an Excel Data Model. Then create a pivot table that shows, for each product family, the percentage of the total revenue from stores in each of the three countries (Canada, Mexico, and USA). For example, you should find that 26.20% of revenue for the Food family came from stores in Mexico.

2. Proceed as in the previous problem, but now create a pivot table that shows, for stores in each country, the percentage of units sold in each of the three product families (Drink, Food, and Non-Consumable). For example, you should find that 70.83% of all units sold in Canada were in the Food family.

3. Proceed as in Problem 1, but now create a pivot table that has two fields from the Products table, ProductFamily and ProductDepartment, in the Rows area and two fields from the Stores table, Country and Region, in the Columns area. Use this to find the percentage of revenue from any product family or any product department that comes from any country or any region of any country. That is, a single pivot table should answer all such questions. For example, you should find that 17.48% of all revenue from the Seafood department comes from the Central region of Mexico.

Level B 4. The file Adventure Works.cub contains sales data

on biking and related products. It was created in Microsoft SQL Server software and stored as an offline cube. There are two dimension hierarchies, Product Model Categories and Product Model Lines, that categorize the products in slightly different ways. Create a pivot table that shows Internet Sales Amount for all products in the Mountain line in the Rows area, broken down by all product model categories in the Columns area. Then do whatever is necessary to find the percentage of all Internet Sales Amount in the Mountain line due to Tires and Tubes Accessories. (Hint: To do this, you’ll have to use Microsoft Query, part of Microsoft Office and discussed in detail in online Chapter 18. The required steps are listed below.) a. Select From Microsoft Query from the From Other

Sources dropdown list in the Get External Data group on the Data ribbon.

b. Click the OLAP Cubes tab, then <New Data Source>, then OK.

c. Give the source a name such as Ad Works Cube, select the latest OLAP provider, and click Connect.

d. Click the Cube file option and browse for the Adventure Works.cub file.

e. Click Finish, then OK, and then OK to back out to an Import Data dialog.

f. Select PivotTable Report and a location such as cell A1 on a worksheet, and you’ll be all set to go.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 913

of the data. Each of these data sets should have known values of the dependent variable. Then the algorithm is trained with the data in the training data set. This results in a model that can be used for classi�cation. The next step is to test this model on the testing data set. It is very possible that the model will work quite well on the training data set because this is, after all, the data set that was used to create the model. The real question is whether the model is �ex- ible enough to make accurate classi�cations in the testing data set.

Most data mining software packages have utilities for partitioning the data. (In the following subsections, you will see that the logistic regression procedure in StatTools does not yet have partitioning utilities, but the Palisade NeuralTools add-in for neural networks does have them.) The various software packages might use slightly different terms for the subsets, but the overall purpose is always the same, as just described. They might also let you specify a third subset, often called a prediction data set, where the values of the dependent variable are prediction data set, where the values of the dependent variable are prediction unknown. Then you can use the model to classify these unknown values. Of course, you won’t know whether the classi�cations are accurate until you learn the actual values of the dependent variable in the prediction data set.

17-3a Logistic Regression

Logistic regression is a popular method for classifying individuals, given the values of a set of explanatory variables. It estimates the probability that an individual is in a particular category. As its name implies, logistic regression is somewhat similar to the usual regression analysis, but its approach is quite different. It uses a nonlinear function of the explanatory variables for nonlinear function of the explanatory variables for nonlinear classi�cation.

Logistic regression is essentially regression with a binary (0–1) dependent variable. For the two-category problem (the only version of logistic regression discussed here), the binary variable indicates whether an observation is in category 0 or category 1. One approach to the classi�cation problem, an approach that is sometimes actually used, is to run the usual mul- tiple regression on the data, using the binary variable as the dependent variable. However, this approach has two serious drawbacks. First, it violates the regression assumption that the error terms should be normally distributed. Second, the predicted values of the dependent variable can be between 0 and 1, less than 0, or greater than 1. If you want a predicted value to estimate a probability, then values less than 0 or greater than 1 make no sense.

Therefore, logistic regression takes a slightly different approach. Let X1 through XkXkX be the potential explanatory variables, and create the linear function b0 + b1X1 + ⋯ + bkXkXk kXkX . Unfortunately, there is no guarantee that this linear function will be between 0 and 1, and hence that it will qualify as a probability. But the nonlinear function

1/11 + e− (b0 + b1X1 + ⋯ + bkXkXk kXkX )2 is always between 0 and 1. In fact, the function f(f(f x) = 1/(1 + e− x) is an “S-shaped logistic” curve, as shown in Figure 17.14. For large negative values of x, the function approaches 0, and for large positive values of x, it approaches 1.

The logistic regression model uses this function to estimate the probability that any obser- vation is in category 1. Speci�cally, if p is the probability of being in category 1, the model

p = 1/(1 + e−(b0 + b1X1 + ⋯ + bkXkXk kXkX ))

is estimated. This equation can be manipulated algebraically to obtain an equivalent form:

ln a p 1 − p

b = b0 + b1X1 + ⋯ + bkXkXk kXkX

This equation says that the natural logarithm of p/(1 − p) is a linear function of the explanlinear function of the explanlinear - atory variables. The ratio p/(1 − p) is called the odds ratio.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

914 Chapter 17 Data Mining

The odds ratio is a term frequently used in everyday language. Suppose, for example, that the probability p of a company going bankrupt is 0.25. Then the odds that the company will go bankrupt are p/(1 − p) = 0.25/0.75 = 1/3, or “1 to 3.” Odds ratios are probably most common in sports. If you read that the odds against Duke winning the NCAA basket- ball championship are 4 to 1, this means that the probability of Duke winning the champi- onship is 1/5. Or if you read that the odds against Purdue winning the championship are 99 to 1, then the probability that Purdue will win is only 1/100.

The logarithm of the odds ratio, the quantity on the left side of the above equation, is called the logit (or log odds). Therefore, the logistic regression model states that the logit is a linear function of the explanatory variables. Although this is probably a bit mysterious and there is no easy way to justify it intuitively, logistic regression has produced useful results in many applications.

The numerical algorithm used to estimate the regression coef�cients is complex, but the important goal for our purposes is to interpret the regression coef�cients correctly. First, if a coef�cient b is positive, then if its X increases, the log odds increases, so the probability of being in category 1 increases. The opposite is true for a negative b. So just by looking at the signs of the coef�cients, you can see which explanatory variables are positively correlated with being in category 1 (the positive b’s) and which are positively correlated with being in group 0 (the negative b’s).

You can also look at the magnitudes of the b’s to try to see which of the X’s are “most important” in explaining category membership. Unfortunately, you run into the same prob- lem as in regular regression. Some X’s are typically of completely different magnitudes than others, which makes comparisons of the b’s dif�cult. For example, if one X is income, with X is income, with X values in the thousands, and another X is number of children, with values like X is number of children, with values like X 0, 1, and 2, the coef�cient of income will probably be much smaller than the coef�cient of children, even though these two variables can be equally important in explaining category membership. We won’t say more about the interpretation of the regression coef�cients here, but you can �nd comments about them in the �nished version of lasagna triers �le discussed next.

In many situations, especially in data mining, the primary objective of logistic regression is to “score” members, given their X values. The score for any member is the estimated value X values. The score for any member is the estimated value X of p, found by plugging into the logistic regression equation to get the logit and then solving algebraically to get p. (This is typically done automatically by the software package.) Those members who score highest are the most likely to be in category 1; those who score lowest are most likely to be in category 0. For example, if category 1 represents the responders to some direct mail campaign, a company might mail brochures to the top 10% of all scorers.

These scores can also be used to classify members. Here, a cutoff probability is required. All members who score below the cutoff are classi�ed as category 0, and the rest

�7.0 0

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9

1

7.0�5.0 5.0�3.0 3.0�1.0 1.0 x

Logis c func on: 1/(1+exp(�x))Figure 17.14 S-shaped Logistic Curve

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 915

E X A M P L E 17.1 CLASSIFYING LASAGNA TRIERS WITH LOGISTIC REGRESSION

The The T Lasagna Triers Logistic Regression.xlsx file contains the same data set from Chapter 3 Lasagna Triers Logistic Regression.xlsx file contains the same data set from Chapter 3 Lasagna Triers Logistic Regression.xlsxon 856 people who have either tried or not tried a company’s new frozen lasagna product. The categorical dependent variable, Have Tried, and several of the potential explanatory vari- ables contain text, as shown in Figure 17.15. Some logistic regression software packages allow such text variables and implicitly create dummies for them, but StatTools requires all numeric variables. Therefore, the StatTools Dummy utility was used to create dummy variables for all text variables. (You could also do this with IF formulas.) Using the numeric variables, including dummies, how well is logistic regression able to classify the triers and nontriers?

Objective To use logistic regression to classify users as triers or nontriers, and to inter- pret the resulting output.

Solution A StatTools data set already exists (in the unfinished version of the file). It was used to cre- ate the dummy variables. To run the logistic regression, you select Logistic Regression from the StatTools Regression and Classification dropdown list. Then you fill out the usual StatTools dialog box as shown in Figure 17.16. At the top, you see two options: “with no Count Variable” or “with Count Variable.” The former is appropriate here. (The latter is used only when there is a count of the 1’s for each joint category, such as males who live alone.) The dependent variable is the dummy variable Have Tried Yes, and the explanatory variables are the original numeric variables (Age, Weight, Income, Car Value, CC Debt, and Mall Trips) and the dummy variables (Pay Type Salaried, Gender Male, Live Alone Yes, Dwell Type Condo, and Dwell Type Home). As in regular regression, one dummy variable for each categorical variable should be omitted.

The logistic regression output is much like regular regression output. There is a summary section and a list of coefficients, shown in Figure 17.17. The summary section is analogous to the ANOVA table in a regression output. The Improvement value indicates how much bet- ter the logistic regression classification is than a classification with no explanatory variables at all. The corresponding p-value indicates that this improvement is statistically significant at any of the usual significance levels, exactly like a small p-value in an ANOVA table.

The coefficient section is also analogous to regular regression output. The Wald value is like the t-value, and each corresponding p-value indicates whether that variable could be excluded from the equation. In this case, Income, Car Value, CC Debt, Gender Male,

1

2 12 1

3

4

5

6

7

8

9

A BA B C DC D E FE F G HG H I JI J K LK L M

Person

2

3

4

5

6

7

8

48

Age

33

51

56

28

51

44

29

175

Weight

202

188

244

218

173

182

189

65500

Income

29100

32200

19000

81400

73000

66400

46200

No

Have Tried

Yes

No

No

Yes

No

Yes

Yes

East

Nbhd

East

East

West

West

East

West

West

7

Mall Trips

4

1

3

3

2

6

5

Home

Dwell Type

Condo

Condo

Home

Apt

Condo

Condo

Condo

No

Live Alone

No

No

No

No

No

Yes

No

Male

Gender

Female

Male

Female

Male

Female

Female

Male

3510

CC Debt

740

910

1620

600

950

3500

2860

2190

Car Value

2110

5140

700

26620

24520

10130

10250

Hourly

Pay Type

Hourly

Salaried

Hourly

Salaried

Salaried

Salaried

Salaried

Figure 17.15 Lasagna Data Set with Text Variables

© C

e n g

a g

e L

e a rn

in g

are classi�ed as category 1. This cutoff value is often 0.5, but any value can be used. This issue is discussed in more detail later in this section.

Fortunately, StatTools has a logistic regression procedure, as illustrated in the following example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

916 Chapter 17 Data Mining

8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28

HGFD ED ECBA Logis�c Regression for Have Tried Yes

Summary Measures

Regression Coefficients

Constant

Coefficient

–2.540587689

–0.069688555

0.007033414

4.76283E-06

–2.66917E-05

7.78774E-05

0.687005598

1.332747327

0.255542473

1.322630127

–0.080928114

0.176721835

–2.79278055

–6.447602252

1.82703581

1.260222403

–1.307318278

0.852024709

11.49524745

6.032913283

1.334116706

4.659013441

–0.294190764

0.710114914

–4.323596336

–0.090873108

–0.000511863

–2.64471E-06

–6.67092E-05

–0.000101272

0.569867539

0.899758382

–0.119884388

0.766212962

–0.620099029

–0.311051044

–0.757579042

–0.048504003

0.014578691

1.21704E-05

1.33259E-05

0.000257027

0.804143656

1.765736273

0.630969333

1.879047292

0.458242801

0.664494713

0.078820065

0.932684254

1.007058206

1.000004763

0.999973309

1.00007788

1.987754476

3.791445433

1.291161851

3.75328001

0.922259987

1.193299112

0.0052

<0.0001

0.0677

0.2076

0.1911

0.3942

<0.0001

<0.0001

0.1822

<0.0001

0.7686

0.4776

0.909698289

0.010808445

0.003849631

3.77935E-06

2.04171E-05

9.14027E-05

0.059764316

0.220912727

0.191544317

0.283886309

0.275087202

0.248863714

Standard Error

Lower Limit

Upper Limit

Exp(Coef) Wald Value

p-Value

Age

Weight

Income

Car Value

CC Debt

Mall Trips

Pay Type Salaried

Gender Male

Live Alone Yes

Dwell Type Condo

Dwell Type Home

Null Deviance 1165.604813

687.9428839

477.6619292

<0.0001

Model Deviance

Improvement

p-Value

This is the output from using all explanatory variables. You can run the logis�c regression again, dele�ng variables with high p-values, but the basic results don’t change substan�ally.

Figure 17.17 Summary and Coefficients in StatTools Logistic Regression Output

© C

e n g

a g

e L

e a

rn in

g

and the two Dwell Type dummies could possibly be excluded. (You can check that if these variables are indeed excluded and the logistic regression is run again, very little changes.) The signs of the remaining coefficients indicate whether the probability of being a trier increases or decreases when these variables increase. For example, this probability decreases as Age increases (a minus sign), and it increases as Weight increases (a plus sign). Again, however, you have to use caution when interpreting the magnitudes of the coefficients. For example, the coefficient of Weight is small because Weight has values in the hundreds, and the coefficient of Live Alone Yes is much larger because this variable is either 0 or 1.

Figure 17.16 StatTools Logistic Regression Dialog Box

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 917

30 A B C D

31 32 33 34 35 36 37 38 39

Summary Classifica�on

Classifica�on MatrixClassifica�on MatrixClassifica�on Matri

1

1

422 81

73 280

0

85.25%

82.01% 57.83% 57.34%

77.56%

Percent

Percent

Correct

0

Correct Base Improvement

C DA BFigure 17.18 Classification Summary

© C

e n g

a g

e L

e a rn

in g

Figure 17.19 Scores for the First Few People

Probability

M

41

42

43 75.28% 1

0

0

0

1

0

1

0

0

1

35.15%

7.65%

9.18%

60.22% 0 07.69%

44

45

46

47

N O

Analysis Class

Original Class

48

N O

© C

e n g

a g

e L

e a rn

in g

The Exp(Coef) column is more interpretable. For example, as explained in the finished version of the file and in StatTools cell comments, if Live Alone Yes increases from 0 to 1— that is, a person who doesn’t live alone is compared to a person who does live alone—the odds of being a trier increase by a factor of about 3.75. In other words, the people who live alone are much more likely to try the product. The other values in this column can be interpreted in a similar way, and you should be on the lookout for values well above 1 or well below 1.

Below the coefficient output, you see the classification summary shown in Figure 17.18. To create these results, the explanatory values in each row are plugged into the logistic regression equation, which results in an estimate of the probability that the per- son is a trier. If this probability is greater than 0.5, the person is classified as a trier; if it is less than 0.5, the person is classified as a nontrier. The results show the number of correct and incorrect classifications. For example, 422 of the 495 triers, or 85.25%, are classified correctly as triers. The bottom summary indicates that 82.01% of all classifications are correct. However, how good is this really? It turns out that 57.83% of all observations are triers, so a naïve classification rule that classifies everyone as a trier would get 57.83% cor- rect. The last number, 57.34%, represents the improvement of logistic regression over this naïve rule. Specifically, logistic regression is 57.34% of the way from the naïve 57.83% to a perfect 100%.

The last part of the logistic regression output, a small part of which is shown in Figure 17.19, lists all of the original data and the scores discussed earlier. For example, the first person’s score is 75.28%. This is the probability estimated from the logistic regression equation that this person is a trier. Because it is greater than 0.5, this person is classified as a trier. However, this is one of the relatively few misclassifications. The first person is actually a nontrier. In the same way, explanatory values for new people, those whose trier status is unknown, could be fed into the logistic regression equation to score them. Then

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

918 Chapter 17 Data Mining

17-3b Neural Networks

A neural network (or simply, neural net) methodology attempts to mimic the complex behavior of the human brain. It sends inputs (the values of explanatory variables) through a complex nonlinear network to produce one or more outputs (the values of the dependent variable). Methods for doing this have been studied by researchers in arti�cial intelligence and other �elds for decades, and there are now many software packages that implement versions of neural net algorithms. Some people seem to believe that data mining is syn- onymous with neural nets. Although this is de�nitely not true—data mining employs many algorithms that bear no resemblance to neural nets—the neural net methodology is cer- tainly one of the most popular methodologies in data mining. It can be used to predict a categorical dependent variable, as in this section on classi�cation, and it can also be used to predict a numeric dependent variable, as in multiple regression.

The biggest advantage of neural nets is that they often provide more accurate predictions than any other methodology, especially when relationships are highly nonlinear. They also have a downside. Unlike methodologies like multiple regression and logistic regression, neural nets do not provide easily interpretable equations where you can see the contribu- tions of the individual explanatory variables. For this reason, they are often called a “black box” methodology. If you want good predictions, neural nets often provide an attractive method, but you shouldn’t expect to understand exactly how the predictions are made.

A brief explanation of how neural nets work helps to clarify this black box behav- ior. Each neural net has an associated network diagram, something like the one shown in Figure 17.20. This �gure assumes two inputs and one output. The network also includes a “hidden layer” in the middle with two hidden nodes. Scaled values of the inputs enter the network at the left, they are weighted by the W values and summed, and these sums are sent to the hidden nodes. At the hidden nodes, the sums are “squished” by an S-shaped logistic- type function. These squished values are then weighted and summed, and the sum is sent to the output node, where it is squished again and rescaled. Although the details of this pro- cess are best left to software, small illustrative examples are available in the �le Neural Net Explanation.xlsm. (The �le is an .xlsm �le because the logistic function is implemented

Figure 17.20 Neural Net with Two Inputs and Two Hidden Nodes

Input 1

Input 2

Hidden 1

Hidden 2

W11

W10 Output

There could be a few addi�onal “bias” arrows, essen�ally like the constant term in regression.

W20

W12

W21

W22

© C

e n g

a g

e L

e a rn

in g

perhaps some incentives could be sent to the top scorers to increase their chances of trying the product. The point is that logistic regression is then being used as a tool to identify the people most likely to be the triers. ■

Before leaving this subsection, you have probably noticed that StatTools includes another classification procedure called discriminant analysis. This is a classical technique developed decades ago that is still in use. It is somewhat similar to logistic regression and has the same basic goals. However, it is not as prominent in data mining discussions as logistic regression. Therefore, discriminant analysis is not discussed here.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 919

with a macro, so make sure you enable macros.) There is one sheet for a one-input neural net and another for a two-input neural net. You can see how everything works by studying the cell formulas. However, the main insight provided by this �le is that you can see how different sets of weights lead to very different nonlinear behaviors.

A neural net can have any number of hidden layers and hidden nodes, and the choices for these are far from obvious. Many software packages make these choices for you, based on rules of thumb discovered by researchers. Once the structure of the network is chosen, the neural net is “trained” by sending many sets of inputs—including the same inputs mul- tiple times—through the network and comparing the outputs from the net with the known output values. Based on many such comparisons, the weights are repeatedly adjusted. This process continues until the weights stabilize or some other stopping criterion is reached. Depending on the size of the data set, this iterative process can take some time.

As research continues, the algorithms implemented with neural net software continue to change. The ideas remain basically the same, but the way these ideas are implemented, and even the results, can vary from one implementation to another.

StatTools does not implement neural nets, but another add-in in the Palisade suite, NeuralTools, does. The following continuation of the lasagna triers example illustrates its use.

E X A M P L E 17.2 CLASSIFYING LASAGNA TRIERS WITH NEURAL NETS

Logistic regression provided reasonably accurate classifications for the lasagna triers data set. Can a neural net, as implemented in Palisade’s NeuralTools add-in, provide comparable results?

Objective To learn how the NeuralTools add-in works, and to compare its results to To learn how the NeuralTools add-in works, and to compare its results to T those from logistic regression.

Solution The data for this version of the example are in the file Lasagna Triers NeuralTools.xlsx. There are two differences from the file used for logistic regression. First, no dummy vari- ables are necessary. The NeuralTools add-in is capable of dealing directly with text vari- ables. Second, there is a Prediction Data sheet with a second data set of size 250 to be used for prediction. Its values of the dependent Have Tried variable are unknown.

You launch NeuralTools just like StatTools, @RISK, or any of the other Palisade add- ins. This produces a NeuralTools tab and ribbon, as shown in Figure 17.21. As you can see, NeuralTools uses a Data Set Manager, just like StatTools. The only difference is that when you specify the data set, you must indicate the role of each variable in the neural net. The possible roles are Independent Numeric, Independent Categorical, Dependent Numeric, Dependent Categorical, Tag, and Unused. Except for Tag, which isn’t used here, these have the obvious meanings. So the first step is to create two data sets, one for each sheet, with Have Tried as Dependent Categorical, Person as Unused, and the other variables as Independent Numeric or Independent Categorical as appropriate. (NeuralTools usually guesses the roles correctly.) We call these data sets Train/Test Data and Prediction Data, respectively.

Figure 17.21 NeuralTools Ribbon

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

920 Chapter 17 Data Mining

Figure 17.22 Train Tab of Training Dialog Box

© C

e n g

a g

e L

e a rn

in g

The Net Configuration tab shown in Figure 17.23 lets you select one of three options for the training algorithm. The PN/GRN (probabilistic neural net) algorithm is relatively new. It is fairly quick and it usually gives good results, so it is a good option to try, as is done here.6 new. It is fairly quick and it usually gives good results, so it is a good option to try, as is

6 new. It is fairly quick and it usually gives good results, so it is a good option to try, as is

The MLF option (multi-layer feedforward) algorithm is more traditional, but it is considerably slower. The Best Net Search tries both PN/GRN and various versions of MLF to see which is best, but it is quite slow.

The Runtime tab (not shown here) specifies stopping conditions for the algorithm. You can accept the defaults, and you can always stop the training prematurely if it doesn’t seem to be making any improvement.

Once you click Next on any of the tabs, you will see a summary (not shown here) of the model setup. Then you can click its Train button to start the algorithm. You will see a

6The abbreviation PN/GRN is a bit confusing. For classi�cation problems, the algorithm is called probabilistic neural net (PNN). However, if the dependent variable is continuous, the same basic algorithm is called generalized regression neural net, which explains the GRN abbreviation.

To train the data in the Train/Test Data set, you activate the Data sheet and click Train on the NeuralTools ribbon to get a Training dialog box with three tabs. The Train tab shown in Figure 17.22 provides three basic options. The first option allows you to parti- tion the data set into training and testing subsets. The default shown here is to set aside a random 20% of cases for testing. The second option is for predicting cases with missing values of the dependent variable. This is not relevant here because there are no such cases in the Data sheet. Besides, prediction will be performed later on the Prediction Data set. The third option is to calculate variable impacts. This is useful when you have a large number of potential explanatory variables. It lets you screen out the ones that seem to be least useful. You can check this option if you like. However, its output doesn’t tell you, at least not directly, how the different explanatory variables affect the dependent variable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 921

progress monitor, and eventually you will see results on a new sheet, the most important of which are shown in Figure 17.24. (As in other Palisade add-ins, the results are stored by default in a new workbook. You can change this behavior from the Application Settings dialog box, available from the Utilities dropdown list.)

Figure 17.23 Net Configuration Tab of Training Dialog Box

© C

e n g

a g

e L

e a rn

in g

33

B

Classifica�on Matrix

(for training cases)

Classifica�on Matrix

(for tes�ng cases)

No No

260 26

30 369

10.3448% 6.5823%

Yes Bad(%)

No 54 16

17 84

23.9437% 16.0000%

Yes Bad(%)

Yes

No

Yes

C D E

34

35

36

37

38

39

40

41

42

43

D EFigure 17.24 Selected Training Results

© C

e n g

a g

e L

e a rn

in g

The top part shows classification results for the 80%, or 685, cases used for training. About 10% of the No values (row 36) were classified incorrectly, and about 6.5% of the Yes values (row 37) were classified incorrectly. The bottom part shows similar results for the 20%, or 171, cases used for testing. The incorrect percentages, about 24% and 16%, are not as good as for the training set, but this is not unusual. Also, these results are slightly better than those from logistic regression, where about 18% of the classifications were incorrect. (Remember, however, that the data set wasn’t partitioned into training and testing subsets for logistic regression.) Note that these results are from an 80–20 random split of the original data. The results you get from a different random split will different random split will different probably be different.

Now that the model has been trained, it can be used to predict the unknown values of the dependent variable in the Prediction Data set. To do so, you activate the Prediction

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

922 Chapter 17 Data Mining

Data sheet, click Predict on the NeuralTools ribbon, and then fill out the resulting dialog box as shown in Figure 17.25. If there are multiple trained nets, you can browse for the one you want to use in the Net to Use box. The Enable Live Prediction option provides real-time predictions: If values of the explanatory variables change for any cases in the prediction set, the predictions will update automatically.

After you click Next, you will see a Prediction Preview dialog box, and you can click its Predict button. At this point, NeuralTools runs each of the cases in the Prediction Data sheet through the trained net and displays the results next to the prediction data. A few of these are shown in Figure 17.26. However, be careful about interpreting the Prediction% column. Unlike the StatTools logistic regression output, each percentage shown here is the probabil- ity that the prediction is correct, not the probability that the person is a trier. For example, the first person is classified as a nontrier, and there is 89.89% confidence that this classifica- tion is correct. Equivalently, the probability is only 10.11% that this person is a trier.

Figure 17.25 Prediction Dialog Box

© C

e n g

a g

e L

e a rn

in g

Figure 17.26 Prediction Results

1

2

3

4

5

6

7

8

9

10

11

M

Have Tried

No

Yes

Yes

Yes

Yes

Yes

No

No

Yes

No 89.89%

84.00%

64.31%

65.33%

92.13%

99.47%

54.20%

74.65%

99.47%

predict

Tag UsedTag UsedT Predic�on

Predic�on Report: “Net Trained on

Predic�on%

predict

predict

predict

predict

predict

predict

predict

predict

Yes

Yes

Yes

Yes

Yes

No

No

Yes

N O P QP QN O

© C

e n g

a g

e L

e a rn

in g

As indicated earlier, these results are live. For example, if you change the Live Alone and Mall Trips data for the first person to Yes and 8, you will see that the prediction changes to Yes, with very high confidence. This feature lets you experiment with explanatory data values to see their effect on the predictions. This doesn’t explain exactly how the neural net “black box” is working, but it helps. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 923

17-3c Naïve Bayes

The method discussed in this section is a simple and very different classi�cation method from logistic regression and neural nets. It has the advantage of being fairly simple to implement in Excel, with no add-ins necessary. The idea is to �nd the conditional prob- abilities of given sets of explanatory X values, given that the dependent variable is 0, or given that it is 1. That is, we see how likely these X values are for the 0 category and how X values are for the 0 category and how X likely they are for the 1 category. These probabilities, which we’ll label P(X | 0) and P(X | 1), are calculated from the observed training data for all observed sets of X values. Then for a new observation, we look up these probabilities for its explanatory X values. If its P(X | 0) is larger than its P(X | 1), we classify it as a 0. Otherwise, we classify it as a 1.

This is basically an application of Bayes’ rule from Chapter 6, where the classi�ca- tion of a new observation is based on the posterior probability of 0 or 1, given its X values. This explains the word Bayes in the name of the method. But why naïve? This is due to the way the probabilities P(X | 0) and P(X | 1) are calculated from the training data. In any application, X is a set of explanatory values, such as male, lives alone, lives in a condo, and lives in the South neighborhood. So P(X | 0) is the joint probability of these characteristics, given that the person is in the 0 category, and P(X | 1) is similar for the 1 category. Normally, joint probabilities are dif�cult to estimate, but if we can assume probabilistic independence across characteristics, then a joint probability becomes much easier—it is the product of the individual characteristics. For example, the P(X | 0) just mentioned becomes the product of P(male | 0), P(lives alone | 0), P(lives in a condo | 0), and P(lives in the South neighbor- hood | 0). Each of these is easy to estimate. For example, to estimate P(male | 0), we simply �nd the proportion of people in the 0 category who are male.

It is naïve to assume independence across characteristics, and this assumption is not justi�ed in most applications. Surprisingly, however, it often doesn’t matter. The classi�ca- tions from the naïve Bayes method are often quite good and comparable to more sophisti- cated methods, despite the naïve independence assumption. In the following example, we illustrate how the naïve Bayes method can be applied to the lasagna trier data.

E X A M P L E 17.3 CLASSIFYING LASAGNA TRIERS WITH NAÏVE BAYES

We have already seen how two complex algorithms, logistic regression and neural nets, provide reasonably accurate classifications for the lasagna trier data set. Does the naïve Bayes method provide comparable results?

Objective To see how the naïve Bayes method can be implemented with Excel-only for- mulas and to compare its results to those from logistic regression and neural nets.

Solution The data for this version of the example are in the file Lasagna Triers Naïve Bayes.xlsx. To calculate the probabilities P(X | 0) and P(X | 1) described above, the naïve Bayes method requires that all explanatory variables are categorical, with only a few possible values. In this data set, some of the explanatory variables such as Gender and Nbhd are already categorical, but others such as Age and Weight are numeric and essentially continuous. We rearranged the columns so that all numeric variables are all contiguous (which made for easier copying), and we binned them into four categories, based on their quartiles. For example, the binned Age variable will be 1, 2, 3, or 4, depending on which quartile its Age value falls into. A sample of the resulting binned training data set appears in Figure 17.27. Actually, the training data set consists of only 700 of the 856 observations. We use the other 156 observations for testing, and the testing data set is binned similarly.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

924 Chapter 17 Data Mining

For each set of X values, we need to calculate P(X(X( | 0) and P(X(X( | 1). Given the naïve inde- pendence assumption, each of these is a product of probabilities, and this product is usually very small. Therefore, it is customary to find the natural logs of the individual probabilities and use the fact that the log of a product is the sum of the logs. Figure 17.28 shows some of the calculations for the 0 category, where Have Tried is No. (Columns AJ-AU to the right contain similar calculations for the 1 category, where Have Tried is Yes.) For example, the first person’s binned age from Figure 17.27 is 4. Cell W4 then finds the log of the propor- tion of all people in the 0 category with binned age 4, using COUNTIFS and COUNTIF functions. Fortunately, the formula in cell W4 is copyable to the entire range W4:AG703, and a similar formula in cell AJ4 (replacing “No” with “Yes”) is copyable to the range AJ4:AU703. Then the values in column AH (and column AU) are sums of these logs, mean- ing that they are the logs of the products of the individual probabilities. More simply, they are the logs of the estimated probabilities P(X(X( | 0) and P(X(X( | 1) required for classification.

1

2

3

4

5

6

7

8

9

10

11

12

13

Person Age

4

2

4

4

1

4

3

1

1

1

1

2

3

4

5

6

7

8

9

10

A B

Weight

2

3

2

4

4

1

2

2

3

3

C

Income

4

2

2

1

4

4

4

3

4

1

Car Value

2

2

3

1

4

4

4

4

4

1

D E

CC Debt

4

2

2

3

2

2

4

4

4

3

F

Mall Trips

4

3

1

2

2

1

3

3

4

4

G

Gender

Male

Female

Male

Female

Male

Female

Female

Male

Male

Female

H

Live Alone

No

No

No

No

No

No

Yes

No

No

Yes

I

Dwell TypeDwell TypeDwell T

Home

Condo

Condo

Home

Apt

Condo

Condo

Condo

Condo

Apt

J

Pay Typey Typey T

Hourly

Hourly

Salaried

Hourly

Salaried

Salaried

Salaried

Salaried

Salaried

Salaried

K

Nbhd

East

East

East

West

West

East

West

West

West

East

Have Tried

No

Yes

No

No

Yes

No

Yes

Yes

Yes

Yes

L ML M

Figure 17.27 Binned Training Data

1

2

3

4

5

6

7

8

9

10

11

Age

–0.96425

–0.96425

–1.96277

–0.96425

–1.30599

–1.96277

35664

–1.31842

–1.48094

–1.48094

–1.39638

–1.31842

–1.31842

–1.39638

–1.39638

–1.15715

–1.6061

–1.6061

–1.6061

–1.43776

–1.331

–1.49575

–1.15715

–1.62291

–1.62291

–1.62291

–1.62291

–1.26963

–1.26963

–1.6061

–1.26963

–1.26963

–1.98687

–1.98687

–1.10532

–0.91295

–1.48094

–1.48094

–0.91295

–1.10532

–1.10532

–0.67656

–0.71001

–0.67656

–0.71001

–0.67656

–0.67656

–0.71001

–0.09832

–0.09832

–0.09832

–0.09832

–0.09832

–2.36824

–0.09832

W

Weight

X

Income Car Value

Y Z

CC Debt

AA

Mall Trips

AB

Gender

AC

Live Alone

AD

Dwell TypeDwell TypeDwell T

–0.7588

–1.20063

–1.20063

–0.7588

–1.46634

–1.20063

–1.20063

–1.20063

AE

Pay Typey Typey T

–0.50749

–0.50749

–0.92132

–0.50749

–0.92132

–0.92132

–0.92132

–0.92132

AF

Nbhd

–0.63154

–0.63154

–0.63154

–1.54156

–1.54156

–0.63154

–1.54156

–1.54156

Total Prob

–13.1283

–11.1468

–10.9192

–11.4292

–14.1608

–11.3006

–15.6539

–13.9059

AG AH

35664 =LN(COUNTIFS(B$4:B$703,B4,$M$4:$M$703,“No”)/COUNTIF($M$4:$M$703,“No”))

LN(number)

Log of condi�onal probabili�es when Have Tried is No (training data only)

Figure 17.28 Estimated Log Probabilities for Training Data

Now we can use these probabilities for classification, either for the training data or the testing data. Some of the results for the training data appear in Figure 17.29. Each prediction in column N is based on a comparison of the total in column AH and the total in column AU, that is, P(X | 0) versus P(X | 1) for that row. (Actually, it is a comparison of their

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 925

1

2

3

4

5

6

7

8

9

10

11

12

13

Have Tried

No

Yes

No

No

Yes

No

Yes

Yes

Yes

Yes

M N

Predicted Yes

No

Total

O

Classifica�on matrix

Actual

Yes

320

81

401

Yes

20.2%

No

49

250

299

No

16.4%

Total

369

331

700

Total

18.6%

Percentages of bad predic�ons

P Q R S T U V

Age

–0.96425

–1.57331

–0.96425

–0.96425

–1.96277

–0.96425

–1.30599

–1.96277

–1.96277

–1.96277

Log of condi�onal probabili�es

W

Weight

–1.31842

–1.35664

–1.31842

–1.48094

–1.48094

–1.39638

–1.31842

–1.31842

–1.35664

–1.35664

Income

–1.6061

–1.39638

–1.39638

–1.15715

–1.6061

–1.6061

–1.6061

–1.43776

–1.6061

–1.15715

X YX Y

Predic�on

Yes

No

No

No

=lF(AH8>AU8,“No”,““No”,““No” Yes”)Yes”)Y

N N N N IF(logical_test, [value_if_true], [value_if_false])

Yes

Yes

Yes

Yes

Correct?

No

No

Yes

Yes

Yes

Yes

Yes

Yes

Figure 17.29 Prediction Results for Training Data

logs, but this is equivalent to a comparison of the probabilities.) If P(X | 0) is larger, we pre- dict No, and if P(X | 1) is larger, we predict Yes. Finally, we check whether the prediction is correct in column O—that is, whether column N matches column M)—and we tally the results in columns Q-U.

The calculations for the testing data set, shown in Figure 17.30, are entirely analogous except for one important difference. The log probabilities in columns W:AH and AJ:AU are based on the training data, not the testing data. Essentially, the training data set is the “model” for this method, so predictions for the testing data (or new data) should be based on this model.

1

2

3

4

5

6

7

8

9

10

11

12

13

Have Tried

No

No

No

No

No

Yes

Yes

No

Yes

Yes

M N

Predicted Yes

No

Total

O

Classifica�on matrix

Actual

Yes

73

21

94

Yes

22.3%

No

6

56

62

No

9.7%

Total

79

77

156

Total

17.3%

Percentages of bad predic�ons

P Q R S T U V

Age

–1.30599

–0.96425

–1.96277

–0.96425

–0.96425

–1.96277

–0.96425

–1.30599

–1.57331

–1.96277

Log of condi�onal probabili�es

W

Weight

–1.39638

–1.35664

–1.35664

–1.48094

–1.39638

–1.48094

–1.48094

–1.48094

–1.39638

–1.31842

Income

–1.43776

–1.6061

–1.39638

–1.6061

–1.43776

–1.39638

–1.6061

–1.15715

–1.39638

–1.6061

X YX Y

Predic�on

No

No

No

No

No

Yes

Yes

No

Yes

Yes

Correct?

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Yes

Figure 17.30 Prediction Results for Testing Data

In any case, classification accuracy for the training data set in Figure 17.29 is similar to the classification accuracy for the testing data in Figure 17.30, and neither is very differ- ent from the logistic regression results in Figure 17.18 or the neural nets results in Figure 17.24.7 ent from the logistic regression results in Figure 17.18 or the neural nets results in Figure

7 ent from the logistic regression results in Figure 17.18 or the neural nets results in Figure

In short, despite its simplicity, the naïve Bayes method is a worthy competitor to these much more complex classification methods. ■

7As usual, the results can depend on the training/testing split. You can see how sensitive the results are to this split in the �le Lasagna Triers Naïve Bayes Sensitivity.xlsm (which contains a macro you will need to enable).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

926 Chapter 17 Data Mining

We have based the classification on the logarithm of the conditional probabilities. This avoids very tiny probability estimates. However, this can also cause a problem. Suppose, for example, that some attribute value is never observed for the Yes category. Then the estimated probability of this attribute value, given Yes, is 0, and the log of 0 is undefined. This will show up as one or more errors in a log probability column. The easiest fix in this case is to not take logs. For example, there will be no LN functions as shown in Figure 17.28, and the total probability in column AH will be the product of the probabilities to its left, not the sum.

Before leaving this section, we mention that the naïve Bayes method can be used, in almost the same way illustrated here, for text mining. For example, imagine you have one set of tweets from Republican candidates and another set from Democrat candidates. Then you want to classify a new set of tweets as coming from Republicans or Democrats. In this case, the procedure is based on “bags of words.” You parse each tweet into its individual words (ignoring common words like “the” and “and”), and these words become the X val- ues for any tweet. For example, one word might be “overspending.” Then the naïve Bayes method would find the log proportion of all Republican tweets that include “overspend- ing” (analogous to cell W4 in Figure 17.28) and the similar log proportion for Democrats. Finally, these log proportions of words would be used to classify new tweets exactly as in Figure 17.30. Admittedly, naïve Bayes is not the only classification method used for text mining, but it is simple and often surprisingly accurate.

17-3d Classification Trees

The �rst two classi�cation methods discussed, logistic regression and neural networks, use complex nonlinear functions to capture the relationship between explanatory variables and a categorical dependent variables. The method discussed in this subsection, classi�cation trees (sometimes called decision trees, not to be confused with the very different decision trees in Chapter 6), is also capable of discovering nonlinear relationships, but it is much more intuitive. This method, which has many variations, has existed for decades, and it has been implemented in a variety of software packages. Unfortunately, it is not available in any of the software that accompanies this book, but the essential features of the method are explained here.

Referring to the lasagna data again, imagine that you have all 856 observations in a single box. If you choose one case randomly, there is considerable uncertainty about the Have Tried status of this person because the box is divided about 57% Yes to 43% No. The basic idea of classi�cation trees is to split the box into two or more boxes so that each box is more “pure” than the original box, meaning that each box is more nearly Yes than No, or vice versa. There are many possible splits. For example, one possible split is on Mall Trips: those with fewer than 4 and those with 4 or more. You can check (with a pivot table, say) that the �rst box is divided 25.8% Yes to 74.2% No and the second box is divided 76.4% Yes to 23.6% No. Each of these boxes (or subsets, if you prefer) is purer than the original box, so this is a promising split.

Each of these boxes can now be split on another variable (or even the same variable) to make them even purer, and this splitting can continue. Eventually, the boxes are either suf-make them even purer, and this splitting can continue. Eventually, the boxes are either suf-make them even purer, and this splitting can continue. Eventually, the boxes are either suf �ciently pure or they contain very few cases, in which case further splitting is not useful. This sounds simple enough, but the trick is to �nd the best splits and a good criterion for stopping. The details are implemented in different ways in different software packages.8 This sounds simple enough, but the trick is to �nd the best splits and a good criterion for

8 This sounds simple enough, but the trick is to �nd the best splits and a good criterion for

8We thought of including a version with Excel-only formulas, but the method does not lend itself well to Excel implementation. The simplicity of the method is obscured by the bulky Excel formulas. If you are interested, you can check one of our attempts in the �le Lasagna Triers Excel-Only Tree Method.xlsm, which contains a macro you will have to enable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 927

The attractive aspect of this method is that the �nal result is a set of simple rules for classi�cation. As an example, the �nal tree might look like the one in Figure 17.31. (This is taken from SSAS software.) Each box has a bar that shows the purity of the corresponding box, where blue corresponds to Yes values and red corresponds to No values. (These colors show up in the software.) The �rst split, actually a three-way split, is on Mall Values: fewer than 4, 4 or 5, and at least 6. Each of these is then split in a different way. For example, when Mall Trips is fewer than 4, the split is on Nbhd West versus Nbhd not West. The splits you see here are the only ones made. They achieve suf�cient purity, so the algorithm stops splitting after these.

Predictions are then made by majority rule. As an example, suppose a person has made 3 mall trips and lives in the East. This person belongs in the second box down on the right, which has a large majority of No values. Therefore, this person is classi�ed as a No. In contrast, a person with 10 mall trips belongs in one of the two bottom boxes on the right. This person is classi�ed as a Yes because both of these boxes have a large majority of Yes values. In fact, the last split on Age is not really necessary.

Figure 17.31 Possible Classification Tree

Have Tried

Mall Trips < 4

Mall Trips > = 4 and < 6

Mall Trips > = 6

Nbhd = ‘West’

Nbhd not = ‘West’

Nbhd not = ‘East’

Nbhd = ‘East’

Age > = 42

Age < 42

_

_ _

_

All

© C

e n g

a g

e L

e a rn

in g

This classi�cation tree leads directly to the following rules.

■ If the person makes fewer than 4 mall trips:

● If the person lives in the West, classify as a trier.

● If the person doesn’t live in the West, classify as a nontrier.

■ If the person makes 4 or 5 mall trips:

● If the person doesn’t live in the East, classify as a trier.

● If the person lives in the East, classify as a nontrier.

■ If the person makes at least 6 mall trips, classify as a trier.

The ability of classi�cation trees to provide such simple rules, plus fairly accurate classi�- cations, has made this a very popular classi�cation technique.

17-3e Measures of Classification Accuracy

Classi�cation algorithms often provide probabilities of classi�cations, as well the clas- si�cations themselves. For example, a method might indicate that the probability of an observation being in the 1 category is 0.875. To use this probability to make a prediction, a cutoff value is required. If 0.5 is used as the cutoff, any observation with probability greater

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

928 Chapter 17 Data Mining

than or equal to 0.5 is classi�ed as a 1, and any with probability less than 0.5 is classi�ed as a 0. However, 0.5 is not necessarily the best cutoff value, and the tradeoffs for different cutoff values are discussed here.

Suppose a classi�cation algorithm applied to a testing data set gives the results shown in Figure 17.32. (The speci�c algorithm is not important here, but if you are interested, the last two sheets of the �le Lasagna Triers Excel-Only Tree Method.xlsm illustrates the typical calculations.) For example, the �rst observation is actually a No, and the algorithm estimates that its probability of being a Yes is 0.264. Of course, you would expect No val- ues to get low probabilities and Yes values to get high probabilities.

5

6

7

8

9

10

11

12

13

14

15

Have Tried

No

No

No

No

No

Yes

Yes

No

Yes

Yes

M N

Prob(Yes)ob(Yes)ob(Y

0.264

0.472

0.296

0.452

0.324

0.748

0.608

0.064

0.660

0.768

Figure 17.32 Prediction Probabilities from a Classification Algorithm

Then a table of percentages can be calculated for various values of the cutoff value. Such a table appears in Figure 17.33. The columns shown here are typical, but you could calculate others. The terms Precision, Speci�city, and Sensitivity are commonly used. They are de�ned as follows and are calculated as simple ratios from the data in Figure 17.32.

■ Precision: Of all testing rows predicted to be Yes—that is, P(Yes) is greater than or equal to the cutoff—the percentage where the dependent variable is Yes.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

Cutoff for

classifica�on

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

0.50

0.55

0.60

0.65

0.70

0.75

0.80

0.85

0.90

0.95

A

Precision

0.603

0.618

0.644

0.664

0.697

0.722

0.783

0.830

0.884

0.937

0.973

0.971

0.966

0.957

0.941

1.000

1.000

1.000

1.000

B True Nega�ve Rate

(Specificity)

0.000

0.065

0.161

0.242

0.355

0.435

0.597

0.710

0.823

0.919

0.968

0.968

0.968

0.968

0.968

1.000

1.000

1.000

1.000

True Posi�ve Rate

(Sensi�vity)

1.000

1.000

1.000

0.989

0.979

0.968

0.957

0.936

0.894

0.787

0.755

0.702

0.596

0.479

0.340

0.255

0.170

0.096

0.021

C

False Posi�ve Rate

1.000

0.935

0.839

0.758

0.645

0.565

0.403

0.290

0.177

0.081

0.032

0.032

0.032

0.032

0.032

0.000

0.000

0.000

0.000

D ED EFigure 17.33 Accuracy Measures for Various Cutoff Values

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 929

Another concept that often accompanies discussions of classi�cation is lift. Imagine that you have a large population where 5% of the people, if they received one of your sales brochures, would actually purchase something from you. You have enough money to mail 10,000 sales brochures, and you naturally want to mail these to the people most likely to respond by making a purchase. If you randomly choose 10,000 people, you can expect to reach 500 purchasers (5% of 10,000) by luck alone. But if you use one of the classi�cation techniques discussed here to score the people on their probability of purchasing, and you then mail brochures to the top 10,000 scorers, you ought to reach more—hopefully many more—than 500 purchasers. Lift is de�ned (loosely) as the increase in the number of pur- chasers you reach over the random mailing. (There is a very precise de�nition of lift, but the intuitive meaning given here will suf�ce.) Presumably, better classi�cation methods provide a higher lift.

Many software packages illustrate lift with a lift chart. This chart for the lasagna data is shown in Figure 17.35. You can think of the horizontal axis as the percentage of the population you mail to, and the vertical axis as the percentage of the triers you reach. In this data set, the 5% from the previous paragraph is replaced by about 57%, the

1.000 0.900 0.800 0.700 0.600 0.500 0.400 0.300 0.200

0.000 0.200 0.400 0.600 0.800 1.000

0.100 0.000

Tr u

e Po

si �

ve R

at e

False Posi�ve Rate

ROC Curve Figure 17.34 ROC Curve

9ROC stands for Receiver Operating Characteristic, a military term from World War II that has stuck.

■ Speci�city (also called the true negative rate): Of all testing rows where the depend- ent variable is No, the percentage that are correctly classi�ed—that is, P(Yes) is less than the cutoff.

■ False positive rate (one minus the speci�city): Of all testing rows where the depend- ent variable is No, the percentage that are incorrectly classi�ed—that is, P(Yes) is greater than or equal to the cutoff.

■ Sensitivity (also called the true positive rate): Of all testing rows where the dependent variable is Yes, the percentage that are correctly classi�ed—that is, P(Yes) is greater than or equal to the cutoff.

Finally, it is common to graph the last two columns, the true positive rate versus the false positive rate, in a so-called ROC curve. This curve appears in Figure 17.34. It is actually a scatterplot of the last two columns, with the dots connected.9

. This curve appears in Figure 17.34. It is actually 9

. This curve appears in Figure 17.34. It is actually Clearly, we want a cutoff

where the false positive rate is low and the true positive rate (sensitivity) is high, so we want a point high and to the left on the curve. The circled points, corresponding to cutoff values around 0.5 to 0.6, seem to be the best. The important point is that the ROC curve provides a basis for choosing a good cutoff value. (The choice could also be based on the costs of misclassi�cations, but this is not discussed here.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

930 Chapter 17 Data Mining

percentage of triers total. The bottom line in the chart corresponds to the random mail- ing. If you mail to a random x% of the customers, you will reach about x% of the triers just by luck. At the other extreme, the top line is the perfect choice—it is when you have the perfect foresight to mail only to the triers, at least until there are no triers left (the �at part past 57%). The curve in between is from the classi�cation method. As an example, if you mail to the top 31% of scorers, you will reach about 50% of the triers, not just 31% as in the random mailing. (From 31%, read up and to the left to get the 50%.) This is a reasonably good lift. Obviously, you want the middle curve to be as close as possible to the upper (perfect) line.

17-3f Classification with Rare Events

Classi�cation methods are often used on data sets with rare events. As an example, suppose a company has data on millions of customers and is trying to classify them as either defaulting on credit card payments (Yes) or not (No). There is probably a very small percentage of Yes values in the data, maybe even less than 1%. In this case, unless special techniques are used, it is very likely that any classi�cation algorithm in any software package will classify everyone as No. The algorithm can then claim that over 99% of its classi�cations are correct. Of course, this sounds good, but the predic- tions are worthless.

Fortunately, all is not lost. Most packages, including NeuralTools, accompany predic- tions of new observations with probabilities that the predictions are correct. So even if all of these probabilities are above 50%, you can still sort on the probability column to see the predictions that are least likely to be correct. Then if you are forced to choose some observations who, say, will default on credit card payments, you can choose the ones with the lowest probabilities of being classi�ed as No.

In addition, some software packages allow you to oversample. In this case, you work with a training data set that contains all of the Yes values (or at least most of them) and a all of the Yes values (or at least most of them) and a all small percentage of the No values. The resulting data set is more nearly 50–50 Yes and No, which gives the algorithm a better chance of “learning” what distinguishes No observations from Yes observations. Also, if the original data set is huge, this oversampled subset is still plenty large enough for analysis.

100%

90%

80%

70%

60%

50%

Po p

u la

� o

n C

o rr

ec t

%

Overall Popula�on %

40%

30%

20%

10%

0% 0% 8% 16% 23% 31% 39% 47% 55% 63% 70% 78% 86% 94%

No Model Ideal Model Classify Have Tried DT

Figure 17.35 Lift (Accuracy) Chart for Lasagna Data

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-3 Classification Methods 931

P R O B L E M S

Level A 5. The file P17_05.xlsx contains data on 100 consumers

who drink beer. Some of them prefer light beer, and others prefer regular beer. A major beer producer believes that the following variables might be useful in discriminating between these two groups: gender, marital status, annual income level, and age. a. Use logistic regression to classify the consumers

on the basis of these explanatory variables. How successful is it? Which variables appear to be most important in the classification?

b. Consider a new customer: Male, Married, Income $42,000, Age 47. Use the logistic regression equation to estimate the probability that this customer prefers Regular. How would you classify this person?

6. Using the same beer preference data in the file P17_05.xlsx, discretize the Income and Age variables according to their quartiles. Then use the naïve Bayes procedure to classify the 100 customers as having Regular or Light preference. Based on these results, consider a new customer: Male, Married, Income $42,000, Age 47. How would you classify this cus- tomer?

7. Admissions directors of graduate business programs constantly review the criteria they use to make admission decisions. Suppose that the director of a particular top-20 MBA program is trying to understand how she and her staff discriminate between those who are admitted to their program and those who are rejected. To do this, she collects data on each of the following variables for 100 randomly selected individuals who applied in the past academic year: whether the applicant graduated in the top 10% of his or her undergraduate class, whether the admissions office interviewed the applicant in person or over the telephone, the applicant’s overall GMAT score (where the highest possible score is 800), and the applicant’s undergraduate grade-point average (standardized on a four-point scale). These data are provided in the file P17_07.xlsx. How useful is logistic regression in discriminating between those who are admitted to this MBA program and those who are not on the basis of these variables?

8. Using the same admissions data in the file P17_07.xlsx, discretize the GMAT Score and Undergraduate GPA variables according to their quar- tiles. Then use the naïve Bayes procedure to classify the 100 applicants as Yes or No for admittance. (Remember that classifications can be based on the probabilities themselves, not necessarily their logs.)

Based on these results, consider a new customer: in top 10% of undergraduate class, did not interview with admissions officer, GMAT 580, GPA 3.29. How would you classify this applicant?

9. A company that sells through a catalog and online through the Web has collected data on 10,000 potential customers. The data are in the file P17_09.xlsx. They include RFM (recency, frequency, and monetary) variables, which are popular in marketing research, as well as yes/no data on whether the person has received various advertising, and yes/no data on whether the person has made a catalog purchase or an online purchase in the latest time period.

a. Use pivot tables to explore how or whether the Catalog Purchase variable in column I is influenced by the variables in columns B–H.

b. Repeat part a for the Online Purchase variable in column J.

10. Continuing the previous problem, the same data have been split into two sets in the file P17_10.xlsx. The first 9500 observations are in the Training Data sheet, and the last 500 observations are in the Prediction Data sheet. In this latter sheet, the values in the Catalog Purchase and Online Purchase columns have been deleted. The purpose of this problem is to use NeuralTools to train a neural net with the data on the first sheet and then use this neural net to predict values on the second sheet. Proceed as follows. a. Designate a NeuralTools data set for each sheet. The

Customer and Catalog Purchase columns should be marked Unused, and the Online Purchase column should be marked Category Dependent. (The Catalog Purchase column is ignored in this problem.)

b. Use the NeuralTools Train option to train a neural net on the first data set, using the PNN algorithm. You can accept the option to set aside 20% of the 9500 observations for testing. Then interpret the outputs. In particular, can you tell how the neural net making its predictions?

c. Use the NeuralTools Predict option to predict Online Purchase for the observations in the Prediction Data sheet. What can you say about the resulting predictions? If you were forced to choose some people as most likely to make an online purchase, which people would you choose?

11. The file P17_11.xlsx contains data on 74 companies that have either gone bankrupt or haven’t. The data set also contains data on five frequently quoted account- ing ratios.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

932 Chapter 17 Data Mining

a. Create a pivot table that shows the average of each ratio, broken down by the Yes/No values in column G. Comment on which ratios seem to have an effect on whether a company goes bankrupt.

b. Use logistic regression to classify companies as bankrupt or not, using all five of the accounting ratios. Does this do a good job of classifying? Are any of the ratios insignificant?

c. Experiment with logistic regressions that use only two of the accounting ratios. Which pair classifies about as well as in part b, but with both ratios significant? Could the high p-values in part b be due to multicollinearity?

12. Using the same data as in the previous problem, use NeuralTools, with the PNN algorithm, to perform the classification. Even though there are only the classification. Even though there are only the classif 74 companies, you can still use 20% of them for testing. Then at the end of the run, respond Yes to the sensitivity analysis. This lets you see how sensitive the percentage of bad predictions in the test data is to size or composition of the test data set. Comment on the results.

13. A classification algorithm was used to predict Yes/No A classification algorithm was used to predict Yes/No A classif values for a given training data set, and then the results were applied to 100 observations in a testing data set. The actual Yes/No values and the estimated probabili- ties of Yes for these 100 observations are listed in the file P17_13.xlsx. Calculate the same accuracy meas- ures as in Figure 17.33 and create the corresponding ROC curve. Comment on how you would use it for future classifications.

Level B 14. The file The file The f P17_14.xlsx contains customer data on

acceptance of products with various attributes. This is explained more fully in the file. There are three potential Yes/No dependent variables, Accept1, Accept2, and Accept3. To keep the outputs straight, it is a good idea to store the results from the following three parts in separate files. a. Use NeuralTools to classify the Accept1 dependent Use NeuralTools to classify the Accept1 dependent Use NeuralT

variable, ignoring Accept2 and Accept3. Try the PNN algorithm and then the MLF algorithm. Comparing their outputs, do they classify equally well? (Keep in mind that MLF takes a lot more lot more lot computing time, but you can stop it prematurely if it doesn’t seem to be making progress.)

b. Repeat part a, using Accept2 as the dependent variable and ignoring Accept1 and Accept3. You can skip the MLF algorithm for this part. However, respond Yes to run a sensitivity analysis at the end of the run. This lets you see how sensitive the percentage of bad predictions in the test data is to size or composition of the test data set. Comment on the results.

c. Repeat part b, using Accept3 as the dependent variable and ignoring Accept1 and Accept2.

15. The file The file The f P17_15.xlsx contains data on 178 wines. They are categorized into three types, labeled A, B, and C. The rest of the variables are numeric properties of the wines. Use NeuralTools to classify these wines. Use the PNN algorithm, and check the Variable Impact Analysis option in the Train dialog box. This ranks the variables on their impact, which provides some information on which variables might not be needed for the neural net. Then run the algorithm a second time, using only the top five variables in terms of their impact percentages. (In the Data Set Manager, mark the others Unused.) Comment on the results. Is the prediction accuracy much different without the deleted variables?

16. Continuing the previous problem, the file P17_16. xlsx contains the same wine data. Using a Microsoft Data Mining add-in (not discussed here), a decision tree classification was performed (with 0% of the cases held out for testing). You can see the resulting tree in the Tree sheet. Write out the corresponding decision rules implied by this tree. Then use a nested IF formula to make the classifications in column O of the Data sheet, and find the percentage of incorrect classifica- tions. Would you say the decision tree is very accurate?

17. Neural nets (and NeuralTools) can also be used when Neural nets (and NeuralTools) can also be used when Neural nets (and NeuralT the dependent variable is continuous, not categorical. In this case, the method is an alternative to multiple regression. The file P17_17.xlsx contains fairly old Boston housing data that appears frequently in data mining discussions. The original purpose was to use regression to see how the median value of a house (MEDVAL) depends on air quality, as measured by the variable NOX, after controlling for a number of other variables. The results of this regression appear in the Original Analysis sheet. As you can see on this sheet, the resulting RMSE (root mean squared error) is about 4 (in thousands of dollars). See if you can get better results with NeuralTools. Unlike the regression analysis, you don’t need to create any nonlinear transformations—NeuralTools does this internally. transformations—NeuralTools does this internally. transformations—NeuralT Use the GRN algorithm, make sure the Perform Linear Regression option in the Net Configuration tab is unchecked, and don’t use any test cases. That is, use all of the cases for training. Discuss your results.

18. Continuing problem 10, there is another method that has been suggested when the dependent variable has only a small percentage of one category, in this case Y (yes). This is oversampling. To do this, you train the neural net on a subset that is more equally divided between Y and N values. This allows the net to “learn” better about the Y cases because it sees a much higher percentage of them. NeuralTools lets you do this fairly percentage of them. NeuralTools lets you do this fairly percentage of them. NeuralT

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-4 Clustering 933

17-4 CLUSTERING In data mining terminology, the classi�cation methods in the previous section are called supervised data mining techniques. This term indicates that there is a dependent vari- able the method is trying to predict. In contrast, the clustering methods discussed in this section are called unsupervised data mining techniques. Unsupervised methods have no dependent variable. Instead, they search for patterns and structure among all of the vari- ables. Clustering is probably the most common unsupervised method, and it is the only one discussed here. However, another popular unsupervised method you might encounter is market basket analysis (also called association analysis), where patterns of customer purchases are examined to see which items customers tend to purchase together, in the same “market basket.” This analysis can be the basis for product shelving arrangements, for example.

Clustering, known in marketing circles as segmentation, tries to group entities (customers, companies, cities, or whatever) into similar clusters, based on the values of their variables. This method bears some relationship to classi�cation, but the fundamental difference is that in clustering, there are no �xed groups like the triers and nontriers in clas- si�cation. Instead, the purpose of clustering is to discover the number of groups and their discover the number of groups and their discover characteristics, based entirely on the data.

Clustering methods have existed for decades, and a wide variety of clustering methods have been developed and implemented in software packages. The key to all of these is the development of a dissimilarity measure. Speci�cally, to compare two rows in a data set, you need a numeric measure of how dissimilar they are. Many such measures are used. For exam- ple, if two customers have the same gender, they might get a dissimilarity score of 0, whereas two customers of opposite genders might get a dissimilarity score of 1. Or if the incomes of two customers are compared, they might get a dissimilarity score equal to the squared difference between their incomes. The dissimilarity scores for different variables are then combined in some way, such as normalizing and then summing, to get a single dissimilarity score for the two rows as a whole.

Once a dissimilarity measure is developed, a clustering algorithm attempts to �nd clusters of rows so that rows within a cluster are similar and rows in different clusters are dissimilar. Again, there are many ways to do this, and many variations appear in different software packages. For example, the package might let you specify the number of clusters ahead of time, or it might discover this number automatically.

In any case, once an algorithm has discovered, say, four clusters, your job is to under- stand (and possibly name) these clusters. You do this by exploring the distributions of variables in different clusters. For example, you might �nd that one cluster is composed mostly of older women who live alone and have modest incomes, whereas another cluster is composed mostly of wealthy married men.

easily by creating a Tag variable, as explained in the file P17_18.xlsx. Then when you define the data set, you mark this variable as Tag. In general, each Tag value can be Train, Test, or Predict, depending on how you want that case to be treated. a. Run the PNN algorithm on the data in this file,

using Online Purchase as the dependent variable, ignoring the Catalog Purchase variable, and using the given Tag variable. You will see in the Train dialog box how the Tag variable is recognized.

b. In the resulting output, you should see that the percentage of bad predictions for the training data is larger than the percentage of bad predictions for larger than the percentage of bad predictions for larger the testing data. However, using the classification matrices in the output, argue why this is actually misleading—that is, why the predictions are really better in the training data.better in the training data.better

c. Are there any Y predictions for the prediction data (the last 500 rows)? What percentage?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

934 Chapter 17 Data Mining

One of the most popular clustering algorithms is called K-Means, where K refers to the number of clusters. In this method, a “cluster center” is determined for each of the K clusters. Then using some measure of dissimilarity, or distance, each observation in the data set is assigned to the cluster it is closest to. The goal is to determine cluster centers such that observations in a given cluster are similar to one another, and observations in different clusters are dissimilar to one another. As you will see, this becomes an optimiza- tion model for choosing the best cluster centers. You �rst choose a value of K and run the algorithm. Then you can experiment with different values of K.

Fortunately, the K-Means algorithm (at least one version of it) is fairly easy to imple- ment with Excel-only formulas. This is illustrated in the following example.

EXAMPLE 17.4 CLUSTERING CUSTOMERS FOR SHOES

The file Shoe Sales Clusters.xlsx contains data on 3000 transactions made by 250 cus-tomers. (See Figure 17.36.) Each transaction is for a dollar amount spent on one of five categories of shoes: athletic, dress, work, casual, or sandal. The goal is to find clusters of customers who have similar buying behavior. How can this be done in Excel?

1

2

3

4

5

6

7

2998

2999

3000

3001

Transac�on

1

2

3

4

5

6

2997

2998

2999

3000

CustID

210

7

220

93

66

232

53

136

173

141

A TypeTypeT

Sandal

Work

Dress

Athle�c

Athle�c

Dress

Athle�c

Casual

Work

Work

Spent

29

74

134

150

168

125

67

27

85

276

B CB C DFigure 17.36 Shoe Transaction Data Set

Objective To see how cluster analysis can be implemented in Excel to find clusters of customers with similar shoe-buying behavior.

Solution We want to cluster customers, not transactions, so we start by transforming the data set in Figure 17.36, where each row is a transaction, to a data set where each row is a customer. This can be done easily with pivot tables, as shown in Figure 17.37. We have done this two ways, and either can be the basis for a cluster analysis. Both of these pivot tables have 250 rows, one for each customer. The pivot table on the left shows counts of transactions, broken down by shoe type. The pivot table on the right shows sums of amount spent, again broken down by shoe type. The finished version of the file shows two cluster analyses, one based on each of these pivot tables. We will focus only on the counts here, but both cluster analyses lead to very similar results.

The counts in the first pivot table are then copied to another sheet, shown in Figure 17.38. Each row corresponds to a customer, and each column from B to F repre- sents an “attribute” for the cluster analysis. Typically, the attribute columns can be of very different magnitudes (although this isn’t really the case here), so it is useful to standard- ize them in some way. For illustration, we have expressed each as a percentage of the

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-4 Clustering 935

maximum value in its column. These percentages appear in columns G to K. This isn’t the only way to standardize, but it has the attractive property that each standardized value is between 0 and 1.

Now comes the K-Means procedure, shown in Figure 17.39. We have somewhat arbi- trarily chosen K=4, so that four clusters will be used. (We ask you in the problems to rerun the analysis with other values of K.) We need four cluster centers, listed in columns T to X. Each cluster center is simply a set of attribute values, and because of the way we stand- ardized, each of these attribute values should be between 0 and 1. Any values can be used initially; Solver will eventually be used to find the “best” cluster centers.

3

4

5

6

7

8

9

10

11

12

13

14

1

2

3

4

5

6

7

8

9

10

1

2

3

4

5

6

7

8

9

10

Count of Transac�on TypeTypeT

CustID Athle�cAthle�cA Casual

A B CA B

10

0

0

9

9

3

1

0

1

1

2

7

1

5

2

2

1

3

2

5

Dress

D

2

1

9

0

0

8

1

1

3

1

Sandal

E

1

3

0

0

1

6

1

4

1

0

Work

F

1

1

0

0

2

0

8

2

7

10

Grand Totaland Totaland T

G H

16

12

10

14

14

19

12

10

14

17

K L M N ON O

Sum of Spent TypeTypeT

CustID

I J

Athle�cAthle�cA Casual

1257

0

0

1862

1221

664

61

0

348

124

77

499

42

381

157

153

74

221

279

244

Dress

719

190

1768

0

0

1612

117

214

600

322

Sandal

42

160

0

0

84

320

82

260

70

0

Work

184

170

0

0

142

0

914

361

651

1051

Grand Totaland Totaland T

2279

1019

1810

2243

1604

2749

1248

1056

1948

1741

K L

Figure 17.37 Pivot Tables for Customers

1

2

3

4

5

6

7

8

9

10

11

12

13

CustID

1

2

3

4

5

6

7

8

9

10

Athle�c

10

0

0

9

9

3

1

0

1

1

Casual

2

7

1

5

2

2

1

3

2

5

Dress

2

1

9

0

0

8

1

1

3

1

Sandal

1

3

0

0

1

6

1

4

1

0

Work

1

1

0

0

2

0

8

2

7

10

Athle�c%

0.833333

0

0

0.75

0.75

0.25

0.083333

0

0.083333

0.083333

Casual%

0.2

0.7

0.1

0.5

0.2

0.2

0.1

0.3

0.2

0.5

Dress%

0.142857

0.071429

0.642857

0

0

0.571429

0.071429

0.071429

0.214286

0.071429

Sandal%

0.125

0.375

0

0

0.125

0.75

0.125

0.5

0.125

0

Work%

0.076923

0.076923

0

0

0.153846

0

0.615385

0.153846

0.538462

0.769231

A B C D E F G H I J KB C

% of max in columnCounts

Figure 17.38 Customer Counts and Standardized Counts

1

2

3

4

5

6

7

8

9

10

1

0.83124

0.594565

0.365238

0.882321

0.823199

0.571518

0.689405

2

0.905869

0.62393

0.783538

0.881141

0.798835

1.000115

0.277164

3

0.231257

0.83213

0.881122

0.289896

0.1855

0.934662

0.81076

4

0.946315

0.249242

0.884916

0.892381

0.888152

0.645384

0.82009

Min Dist

0.231257

0.249242

0.365238

0.289896

0.1855

0.571518

0.277164

Cluster

3

4

1

3

3

1

2

1

2

3

4

Athle�c

0.057971

0.034539

0.634545

0.052704

Casual

0.239528

0.327508

0.25512

0.528175

Dress

0.415672

0.067711

0.057822

0.097712

Sandal

0.238348

0.072579

0.074008

0.544528

Work

0.046336

0.474255

0.043852

0.05719

L M N O P Q R S T U W XVM N

Cluster centers (decision variable cells)

ClusterlD

Total distance 68.61493

Distances to cluster centers

Figure 17.39 K-Means Procedure

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

936 Chapter 17 Data Mining

For any given cluster centers, we find the “distance” from each customer’s standardized attributes to each cluster center. Various distance measures are used in cluster analysis, but here we will use the popular Euclidean (straight-line) distance measure: the square root of the sum of squared differences. There are several ways to implement this in Excel, but we have used a combination of the SUMXMY2 (sum of squared X minus Y values) and the OFFSET function. The formula in cell L4, which can be copied down and across, is

=SQRT(SUMXMY2($G4:$K4,OFFSET($T$2,L$3,0,1,5)))

The range G4:K4 contains the standardized attributes for this particular customer, and the OFFSET function uses the indexes in row 3 to return the attributes for the appropriate clus- ter center. Then each customer is assigned to the cluster with the minimum distance. The formulas in cells P4 and Q4 are

=MIN(L4:O4)

and

=MATCH(P4,L4:O4,0)

The total distance over all customers in cell T8, the sum of the values in column P, is then the objective to be minimized. The Solver setup appears in Figure 17.40. The deci- sion variable cells are the cluster centers, and they are constrained to be between 0 and 1. Note that we have used the Evolutionary method instead of the GRG Nonlinear method. This is a highly nonlinear (and nonsmooth) problem, and the Evolutionary method is more reliable.

Figure 17.40 Solver Dialog Box for Finding Optimal Cluster Centers

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-4 Clustering 937

1

2

3

4

5

6

7

8

9

10

11

Transac�on

1

2

3

4

5

6

7

8

9

10

CustID

210

7

220

93

66

232

132

82

72

99

Count Cluster

1

2

1

1

3

1

2

4

2

2

A TypeTypeT

Sandal

Work

Dress

Athle�c

Athle�c

Dress

Work

Casual

Work

Casual

Spent

29

74

134

150

168

125

72

102

66

74

B CB C D ED EFigure 17.41 Transaction Data with Cluster IDs

Figure 17.42 Pivot Table and Pivot Chart of Transaction Counts

1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16 17

A B D HB DCB DCB DB D E F G I J KI J

Count of Transac�on Typensac�on Typensac�on T Count Cluster

58 31

365 33

487

190 228 125 289 832

465 70 41 86

662

165 41 32

237 475

1 2 3 4

49 427

29 39

544

927 797 592 684

3000Grand Total

Athle�c Casual Dress Sandal Work Grand Total

The meanings of the four clusters are pre y obvious from these pivot charts. People in cluster 1 tend to buy mostly dress shoes, people in cluster 2 tend to buy mostly work shoes, people in cluster 3 tend to buy mostly athle�c shoes, and people in cluster 4 tend to buy mostly sandals and casual shoes.

100% 90% 80% 70% 60% 50% 40% 30% 20% 10%

0%

Count Cluster

1

Type

2 3 4

Work

Sandal

Dress

Casual

Athle�c

The last step is to make sense of the clusters. To do this, it is useful to return to the transaction data, but with cluster IDs attached. This is shown in Figure 17.41. (Each cluster ID in column E is based on a lookup of the CustID in the table in Figures 17.38 and 17.39.) Then a pivot table of transaction counts and an associated pivot chart can be created, as shown in Figure 17.42. Each value in the pivot table represents the number of transactions for a given shoe type made by customers in a given cluster.

It is particularly useful to use a pivot chart of the stacked column type, where each piece of each column represents that cluster’s percentage of all transactions made by that cluster. As described in the text box, the “meaning” of the clusters is quite apparent. The shoe company could assign other customers (that is, other than these 250) to the given clusters, based on their past buying behavior. Then it could devise specific promotions for each cluster and target market to customers based on their cluster membership. ■

A difficult issue in cluster analysis is finding the distance between two rows of attributes. We solved this fairly easily in the example because all attributes contain positive numeric values. We standardized these to values between 0 and 1 and then used the Euclidean distance measure. But what if some attributes were text, such as Male/Female or Democrat/Republican/ Independent? How do we measure the “distance” between a Democrat male earning $60,000 and a Republican female earning $80,000? Let’s just say that various distance measures have been proposed. You are asked to explore some possibilities in one of the problems.

As with classi�cation trees in the previous section, there is unfortunately no software accompanying this book that implements clustering. However, a variety of clustering algo- rithms are available in data mining software, including Microsoft’s SSAS software.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

938 Chapter 17 Data Mining

17-5 CONCLUSION Data mining is a huge topic, and its importance is becoming increasingly important in business and other areas. Admittedly, data analysis has played an important role for many years, but large data sets are now more common than ever before, and better algorithms, better software, and better technology in general are now available to mine large data sets. The discussion in this chapter provides only a glimpse of the variety of problems data mining can attack and the types of methods it can employ. Indeed, an increasing num- ber of books on data mining, some highly technical and others much less technical, are

P R O B L E M S

Level A 19. The file P17_19.xlsx contains various data on

325 metropolitan cities in the United States. Cell comments in row 1 explain some of the variables. A Microsoft Data Mining add-in (not discussed here) was used to cluster these cities, with the results shown in the file. There are four clusters, cluster member- ship is listed in column V of the Data sheet, and the composition of clusters is in the Categories Report sheet. Study this report carefully, and then write a short report about the clusters. Does the clustering make sense? Can you provide descriptive, meaningful names for the clusters?

20. Continuing problem 15, the file P17_20.xlsx contains the same wine data. Instead of trying to use a clas- sification algorithm to classify wines into the three known types (A, B, and C), it is interesting to see if a clustering algorithm can discover these known discover these known discover categories. The file contains the results of two runs of a Microsoft Data Mining Detect Categories algorithm (not discussed here). Of course, neither uses the Type variable in column A. The first run didn’t specify the number of categories, and the add-in found 7, with category membership in column O of the Data sheet. The second run specified the number of categories as 3, with category membership in column P of the Data sheet. Analyze the results closely. Do either (or both) of the runs seem to discover the known A, B, and C types?

Level B 21. Using the data in the file P17_21.xlsx, the same data

as in Problem 19, use the method in Example 17.4 to find four clusters of cities. Note that there are two text variables, Crime_Trend and Unemployment_Threat. You can ignore them for this problem. Write a short report about the clusters you find. Does the clustering make sense? Can you provide descriptive, meaningful names for the clusters?

22. Using the data in the file P17_15.xlsx, the same data as in Problem 20, use the method in Example 17.4 to find three clusters of wine types. (Of course, don’t use the Type variable when creating clusters.) Write a short report about the clusters you find. Does the clus- tering agree with the Type variable?

23. This problem lets you see how dissimilarity, the key to clustering, might be calculated and then used for prediction. The file P17_23.xlsx contains data for 10 people. The value of Amount Spent for person 10 is unknown, and the ultimate purpose is to use the data for the first 9 people to predict Amount Spent for person 10. To do so, a common “nearest neighbor” approach is used. You find the three most similar people to person 10 and then use the average of their Amount Spent values as a prediction for person 10. (In the data mining literature, this approach is called k-means, with k = 3.) Proceed as follows. a. For each of the five attributes, Gender to Marital

Status, fill in the corresponding yellow boxes as indicated. Each box shows how dissimilar each person is to each other person, based on a single attribute only. The box for Gender has been filled in to get you started.

b. These yellow values can be combined in at least three ways, as indicated by the cell comments above the orange boxes. Fill in these orange boxes.

c. Find the dissimilarity between each person and person 10 in three ways in the blue box at the top, following the cell comment in cell I2.

d. Use Excel’s RANK function in the green box to rank the dissimilarities in the blue box.

e. Find three predictions of Amount Spent for person 10, each an average of Amount Spent for the three most similar people to person 10. There will be three predictions because each set of rankings in the green box can lead to a different set of three nearest neighbors.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

17-5 Conclusion 939

being written.10 Finally, it is important to realize that data mining is only part, although a very important part, of “business analytics.” For example, business analytics often uses the insights from data mining to optimize a system. The optimization aspect is not usually included in the realm of data mining, but data mining as a �rst step often enables an intel- ligent optimization.

Term Explanation Excel Page

Data mining Variety of methods used to discover patterns in data sets, usually large data sets

898

Data warehouse Specially constructed database that can be used for data mining

898

Data mart Scaled-down data warehouse for a particular business function or department

898

Flat file A single-table database 900

Relational database A database where the tables are stored in related tables, linked by primary and foreign keys

900

Online analytical processing (OLAP)

Methodology for developing fast, flexible pivot table reports

901

Star schema Database where a Facts table is surrounded by Dimensions tables

901

OLAP cube Special type of file where aggregates are preprocessed to produce quick pivot table analyses

903

SQL Server Microsoft’s server-based database package  903

Analysis Services in SQL Server

Part of SQL Server that performs data mining analysis

903

Data Model Technology introduced in Excel 2013 for compactly storing and relating data from various sources, all within Excel

Can be viewed in Power Pivot window (in Excel 2016)

904

Power Pivot Add-in introduced for Excel 2010, now incorporated into Excel 2016, for building pivot tables from an Excel Data Model

Power Pivot tab in Excel 2016 and Power Pivot window

904

Power View Add-in introduced for Excel 2013, now included in Excel 2016, for creating quick reports

Ribbon must be customized (in Excel 2016) to include Power View button

904

Power Map Add-in for creating 3D maps 3D Map on Insert ribbon (in Excel 2016)

904

Tableau Public Non-Microsoft product for creating interesting data visualizations; Public version is free

911

Classification methods

Methods for predicting a dependent categorical variable from given explanatory variables

912

Data partitioning Dividing large data set into training and testing subsets so that algorithms trained on one set can be tested on the other

Available in NeuralTools, not in StatTools

912

Logistic regression Classification method where the logit is estimated as a linear function of the explanatory variables

StatTools Regression & Classification group

913

10To appreciate how big this topic is becoming, just watch TV commercials by IBM and other companies. You might also want to read two recent books: In the Plex, by Levy and Ganser, Simon & Schuster, 2011; and Big Data, by Mayer-Schonberger and Cukier, Eamon Dolan/Houghton Mif�in Harcourt, 2013. The former, mostly about the many ways data mining is used at Google, is mind-blowing.

Summary of Key Terms

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

940 Chapter 17 Data Mining

Term Explanation Excel Page

Odds ratio Ratio of p to 1−p to 1−p to 1− , where p is the probability of a given category

913

Logit Logarithm of the odds ratio 914

Neural network (or neural net)

Complex nonlinear method for classification or prediction, attempts to mimic the human brain

918

NeuralTools Add-in in the Palisade DecisionTools suite, used for implementing neural nets

NeuralTools tab 919

Classification Trees (or Decision Trees)

Classification method that splits sets of cases so that subsets become purer in terms of composition of categories

926

Lift Data mining term, the ability to determine the most likely responders to a mail campaign, for example

929

Supervised versus unsupervised data mining methods

Supervised methods try to predict a dependent variable; unsupervised methods don’t have a dependent variable

933

Clustering (or segmentation)

Unsupervised method, tries to attach cases to categories (clusters), with high similarity within categories and high dissimilarity across categories

933

Market basket analysis (or association analysis)

Where patterns of customer purchases are examined to see which items customers tend to purchase together, in the same “market basket.”

933

P R O B L E M S

Conceptual Questions

C.1. Explain what a star schema is all about. How does it help to provide useful information in pivot tables?

C.2. Suppose a hospital wants to create a database with the star schema structure. What dimensions and facts might it store?

C.3. How does the OLAP methodology allow you to “drill down” in a pivot table?

C.4. What is the advantage of creating an OLAP cube file, especially for extremely large databases?

C.5. Explain briefly what a Data Model in Excel (2013 and later) represents. Also, explain briefly what you can now do in Excel with the new PowerPivot tool that you couldn’t do in previous versions of Excel.

C.6. How does the general classification problem dis- cussed in Section 17-3 differ from the general prob- lem analyzed with regression, and why does standard regression not work for the classification problem?

C.7. What is the main purpose of logistic regression, and how does it differ from the type of regression, discussed in Chapters 10 and 11?

C.8. Suppose that a term in a logistic regression equation is 0.687*MallTrips, as in Figure 17.17. Explain, exactly what this means.

C.9. Suppose you are trying to classify a variable where 96% of its observations equal 0 and only 4% equal 1. You run a logistic reg-ression, and the classification table shows that 97% of the classifications are correct. Why might this large percentage still not be cause for celebration?

C.10. What are the strengths and drawbacks of neural nets versus classification trees?

C.11. Clustering algorithms always start with a dissimilar- ity measure. Why it is not always obvious how to develop such a measure?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Level A 24. The lasagna data discussed in the chapter is repeated

in the file in the file in the f 17_24.xlsx. Instead of trying to classify a dependent variable, Have Tried, this file shows the result of clustering. Specifically, a Microsoft Data Mining Detect Categories algorithm (not discussed here) was used, arbitrarily specifying the number of categories as 3. Also, the Have Tried variable was treated just like all of the other variables. Using the results in the Categories_Report sheet, what can you say about the composition of the categories the algo- rithm found? How might you “name” these categories?

25. (Requires Power Pivot) The file P17_25.xlsx contains salaries of all Major League Baseball players in 2015 in one sheet and geographical information about the teams in another sheet. Use PowerPivot and Power View to create a map with bubbles indicating the size of total salary, either by city or by state. The directions for doing this are a bit different from the example in the text because this data set resides in Excel. a. Select any cell in the Salary data and click Add to Select any cell in the Salary data and click Add to Select an

Data Model on the PowerPivot ribbon. (Make sure you check that your table has headers.) This does two things. It designates the data set as an Excel table, and it adds this table to the PowerPivot window.

b. From the Excel window, select any cell in the Geography data, and again click Add to Data Model on the PowerPivot ribbon. Now you should have two tabs in the PowerPivot window.

c. Although it is not absolutely necessary, it is useful to rename the Excel tables as Salaries and Teams, respectively, and to do the same to the tabs in the PowerPivot window.

d. In the PowerPivot window, click Diagram View on the Home ribbon. Then drag from Team in the Salaries table to Team in the Teams table to create a relationship.

e. Go back to Excel, activate the Geography sheet, and click Power View from the Insert ribbon. In the Power View Fields pane on the right, click ALL to see a list of all fields in both tables. In the Salaries table, check Salary, and in the Teams table, check either State or City. Uncheck any other fields that might be checked. Then click Map from the ribbon. You will probably have to move the fields around to get the desired map. The Salary field should be in the Size box, and the City (or State) field should be in the Locations box.

f. To fine tune the map, click MAP in the Filters pane To fine tune the map, click MAP in the Filters pane T to expand it. Then drag Team to this area. This lets you filter out teams, such as either of the New York or Los Angeles teams. Next, drag Pitcher to the Color box to see a pie chart for each bubble.

Level B 26. The file The file The f P17_26.xlsx contains Gender, Age,

Education, and Success (Yes/No) data of 1000 people. The purpose is to see how a classification tree method can use the first three variables to classify Success. You start with 564 Yes values and 436 No values. This is quite diverse (close to 50–50), and as explained in the file, it has a diversity index of 0.9836, the high- est being 1. The question you are asked to explore is which splits you should make to reduce this diversity index—that is, to make the subsets purer. Directions are given in the file. (Note that the method suggested is only one variation of splitting and measuring diver- sity in classification trees. When a Microsoft Data Mining add-in (not discussed here) is used on this data set, it finds an extremely simple rule: Classify as Yes if Education is UG or G, and classify as No if Education is HS. This is slightly different from what your method will find.)

CASE 17.1 HOUSTON AREA SURVEY

The Kinder Institute at Rice University in Houston has surveyed people in the Houston area for several decades on a multitude of issues. An explanation of the research, along with a “codebook” for the survey questions through the years, is available in the file Houston Area Survey Codebook (1982-2014).pdf. A subset of the data odebook (1982-2014).pdf. A subset of the data odebook (1982-2014).pdf from the most recent survey in 2014 is available in the file C17_01.xlsx. This file contains data on

about 1750 responders on over 80 variables (survey questions).

An explanation of the variables is included in the Variables sheet. These variables have been color-coded according to several broad topics and categories within these topics. This sheet lists the survey questions and the possible responses. Most of the questions have only a few possible responses, such as Male/Female or Better off/About the same/

Case 17.1 Houston Area Survey 941 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Worse off, but a few have numeric responses with many possible values.

In the full data set from 2014, there were many more variables, but about a third of them were deleted to produce the Excel file for this case. Many of the deleted variables had a large number of missing values, which made them unsuitable for our purposes. However, a few of the remaining variables also have some missing values. In addition, most of the remaining variables have several RF/DK values. These correspond to “Refused to answer” or “Didn’t know” responses. The last two columns of the Variables sheet indicate the number of RF/DK and Blank cells for each variable.

The last sheet in the file contains a simple pivot table for your convenience. It lets you see the counts of possible responses for any of the questions. In this way, you can quickly get some insights into the data.

In terms of real-world surveys of this type, this Excel file is not at all large. It has “only” about

1750 rows and about 80 columns. Still, this data set is large enough to raise the questions, “What data mining questions should I ask” or “Where do I begin?” We won’t provide answers to these questions. The only guidelines we will provide are the following:

1. Use pivot tables (or PowerPivot) to find inter-ivot) to find inter-ivot) to find inter esting breakdowns of the data.

2. Choose a dependent variable with only two pos- sible values and a set of explanatory variables (which doesn’t need to be all of the potential variables). Then use one or more classification methods to “explain” the dependent variable.

3. Use a subset (of your choosing) to run a cluster analysis on the data. You can choose the number of clusters. Once you have created the clusters, try to explain what each one is all about.

942 Chapter 17 Data Mining Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

CHAPTER 18 Importing Data into Excel

CHAPTER 19 Analysis of Variance and Experimental Design

CHAPTER 20 Statistical Process Control

APPENDIX A Statistical Reporting

PA RT

7 Bonus Online Material

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-3

STOCK MARKET FUNCTIONS ADD-IN

Over the past decade or two, it has become increasingly common to read an article that references a data set and then wonder, “How can I get my hands on that data set so that I can analyze it in Excel®?” The short answer is that it all depends on the data set. The tools discussed in this chapter sometimes work exactly as described to easily import interesting data into Excel for analysis. In some cases, however, it helps if someone else has created tools to take care of the details. Such tools are becoming more common, and one is described here.

A Web search for “import financial data into Excel” uncovers a Financial Alchemist site (http://financial-alchemist.blogspot.com/2007/08/ using-excel-to-import-financial-data.html) authored by Turley Muller, a Turley Muller, a T financial analyst. In turn, he references an Excel Stock Market Function Add-in, developed by Randy Harmelink and available at http://finance .groups.yahoo.com/group/smf_addin/. From this site, you can download the add-in. (It appears that you now have to join a group to do so.) The download is a zip file, and as the instructions indicate, you should extract the zip files to the C:\Program Files\SMF Add-In folder (which you need to create). Then you can go to the Add-Ins list in Excel and browse for the file RCH_Stock_Market_Functions.xla in the SMF Add-In folder to load the add-in.

From that point, you can explore. Harmelink has created a number of templates and examples (in his Files group) that are already set up to import data. For example, one of his more recent files, RCHGetWebData-Template-BarChart-Quotes-Extract.xls, automatically imports stock price data (monthly, weekly, daily, or even hourly) for any selected ticker symbol. Alternatively, you can visit Muller’s site (http://finance.groups.yahoo.com/group/stock_analysis_group/files/), where he has created financial models that take advantage of Harmelink’s add-in.

Importing Data into Excel

C H A P T E R

18

E d

h a r/

S h u tt

e rs

to c k.

c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Chapter 18 Importing Data into Excel

Finally, you can learn and then use Harmelink’s customized Excel functions to import exactly the data you need. (One tip: If you open an example file and it has a lot of errors, click the Edit Links button on Excel’s Data ribbon. Then make sure the link is pointing to the file RCH_Stock_Market_Functions.xla.)

If you are a financial analyst and you want to take advantage of this material, keep in mind that some learning is required. Although Harmelink provides the documentation to learn his system, his add-in is not completely intuitive or straight- forward. But this is a small price to pay. You certainly realize that the financial data you need is out there on the Web somewhere. Now you have a tool that enables you to import the required data into Excel, where you can analyze it in any way you like. ■

18-1 INTRODUCTION We introduced several numerical and graphical methods for analyzing data statistically in Chapters 2 and 3, and we examined many more statistical methods in later chapters. However, any statistical analysis, whether in Excel® in Chapters 2 and 3, and we examined many more statistical methods in later chapters.

® in Chapters 2 and 3, and we examined many more statistical methods in later chapters.

or any other software package, pre- sumes that you have the appropriate data. This is a big presumption. Indeed, the majority of the time spent in many real-world data analysis projects is devoted to �nding the data and getting it into a format suitable for analysis. Unfortunately, this aspect of data analysis is given very little, if any, attention in most statistics textbooks. We believe it is extremely important, so we devote this chapter to methods for �nding data and importing it into Excel, the software package we are using for data analysis.

Our basic assumption throughout most of this chapter is that the appropriate data exists somewhere. In particular, we do not cover methods for collecting data from scratch, such as using opinion polls, for example. This is a large topic in itself and is better left to a specialized textbook in sampling and survey methods. We assume that the data already exists, either in an Excel �le, in a text �le, in a database �le (such as a Microsoft Access �le), or on the Web. In the �rst case, where the data set already resides in an Excel �le, you might need to rearrange the data in some way to get it in the form of a rectangular data set, as discussed in Chapters 2 and 3. You already have basic tools for doing this, such as cutting and pasting, but we will illustrate some interesting possibilities for rearranging data in this chapter.

If the data set is not already in Excel, one common possibility is that it is stored in a text �le. This is essentially any �le that can be opened and read by humans in a text edi- tor such as Notepad. Text �les, also called ASCII �les,1

. This is essentially any �le that can be opened and read by humans in a text edi 1

. This is essentially any �le that can be opened and read by humans in a text edi are common because they don’t

require any proprietary software, such as SPSS or SAS, to make them readable. In fact, they are often called “plain vanilla” �les because they represent a lowest common denomi- nator—anyone with a text editor can read them. We will show how they can be imported fairly easily into Excel by using Excel’s handy text import wizard.

Another possibility is that the data is stored in a relational database. Indeed, most com- panies store at least some of their data in this format. Common database packages include Microsoft Access, SQL Server, and Oracle. These packages were developed to perform certain tasks very well, including data storage, querying, and report writing. However, they are not nearly as good as Excel at statistical data analysis—that is, number crunching. Therefore, we show how to import data from a typical database package into Excel. The

1ASCII (American Standard Code for Information Interchange) is a standard character-encoding scheme based on alphabetical, numerical, and other characters.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-2 Rearranging Excel Data 18-5

key here is to form a query. The query speci�es exactly which data you want to import. Various software tools have been developed to create queries for importing data into Excel. An old one that is still available and part of Microsoft Of�ce is Microsoft Query. A much newer one, part of the self-service BI group of Excel tools discussed in Chapter 17, is Power Query. It provides a better user interface and is capable of querying more types of data sources than previous tools.

Next, we brie�y examine the possibility of importing data directly from the Web into Excel. Given that the amount of data on the Web is already enormous and is constantly growing, the ability to import it into Excel is extremely valuable. As with importing data from a database �le, you can import data from the Web by creating a query and then running it in Excel. Unfortunately, different websites store data in many different ways, so a method that imports data into Excel from one site might not work for another site. Nevertheless, you will see that the current possibilities are powerful and relatively straightforward.

Finally, you cannot always assume that the data you obtain, from the Web or else- where, is clean. There can be (and often are) many instances of wrong values—which can occur for all sorts of reasons—and unless you �x these at the beginning, the resulting sta- tistical analysis can be seriously �awed. Therefore, we conclude this chapter by discussing a few techniques for cleansing data.

18-2 REARRANGING EXCEL DATA The tools we discussed in Chapters 2 and 3 were always applied to a data set in Excel, data set in Excel, data set a rectangular array of data with observations in rows, variables in columns, and variable names in the top row. Sometimes you have to use your Excel skills to get the data in this format, even if the data already resides in Excel. In this section we illustrate two possibili- ties, based on data we imported from the Web. As you will see from these two examples, there is no single way to do it. Sometimes simple cutting and pasting works, and sometimes advanced Excel functions are required. In all cases, it is best to map out a plan and then decide how to implement it.

E X A M P L E 18.1 BASEBALL DATA FOR DIFFERENT TEAMS

We have already analyzed baseball salaries in Chapters 2 and 3. The files used in those chapters were already in nice data set form inside Excel. However, they didn’t start this way. We found the data on the USA Today website, and the site allowed us to import the data into Excel via a Web query (as we discuss later in the chapter).2

website, and the site allowed us to import 2

website, and the site allowed us to import However, a sepa-

rate Web query was required for each of the 30 teams. The results for a typical team appear as in Figure 18.1, with only a few of the Arizona players listed. (See the file Baseball Salaries Original.xlsx. It contains salaries for 2009.) As this figure indicates, each team’s data starts with the team name, then a row of headings, and then the data. The data for Atlanta is right below the data for Arizona, the data for Baltimore is right below the data for Atlanta, and so on. If you want four long columns with all of the data, and these colall of the data, and these colall - umns are to have headings Player, Team, Salary, and Position, how can you rearrange the data to achieve this?

2The USA website has changed since we ran this query, but we will continue to use the same data as in the previ- ous edition of the book for this example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-6 Chapter 18 Importing Data into Excel

Repetitive tasks like this one are best handled by macros, but if you don’t know how to write macros, you need to develop an efficient plan for performing the task manually.

E X A M P L E 18.2 CPI MONTHLY DATA

The file CPI.xlsx contains monthly data on the Consumer Price Index (CPI) from 1913 to 2009. We imported this data from the website www.bls.gov/cpi/#tables, again using a Web query. A few rows appear in Figure 18.2. This format is common on websites, where there is a row for each year and a column for each month. For some data analysis purposes, this format might be fine, but what if you want a long data set with just two variables, Month-Year (like Jan-1913) and CPI? How can the data be rearranged to this format?

Objective To rearrange the monthly data into two long columns, one with month-year and one with the CPI.

Solution This example comes under the category of “If you do some planning and know some good functions, you can save yourself a lot of work.” The solution appears in Figure 18.3. The lot of work.” The solution appears in Figure 18.3. The lot

This is the type of example that can make you a hero at your job. With some planning and knowledge of useful Excel functions, you can save hours or even days of work. And the formula-based approach is the best way to avoid errors.

Objective To rearrange the data from the baseball Web queries into a single data set.

Solution First, we admit that this isn’t really data analysis; it is Excel manipulation. But it is certainly valuable for you to know some Excel methods for rearranging data. This is a very common task, especially in the business world. We also mention that this is a repetitive task—the repetitive task—the repetitive task same thing must be done for all 30 teams—and repetitive tasks are handled best with mac- ros. However, because we do not presume that you can write macros at this stage, we will manipulate the data with Excel tools only.

The key is to devise a strategy. Ours is quite simple, using the following steps:

1. Insert a blank column before column B, and enter the label Team in cell B2.

2. Cut (Ctrl+x) the Arizona Diamondbacks team name from cell A1 and paste it (Ctrl+v) next to the first Arizona player in cell B3. Then copy it down for the other Arizona players.

3. Repeat step 2 for each of the other teams.

4. Delete unnecessary rows of labels for the other teams.

Try it out and see how quickly you can manipulate the data. Better yet, see if you can find a strategy that is even quicker. ■

The following example is typical for time series data found on the Web.

Arizona Diamondbacks Player Salary Posi�on

Pitcher

Pitcher Shortstop Pitcher Pitcher Pitcher Pitcher

Ou�ielder First Baseman

Buckner, Billy $403,000

$800,000 $8,750,000 $1,500,000 $6,250,000

$500,000 $401,000

$7,500,000

$11,666,666Byrnes, Eric Clark, Tony Davis, Doug Drew, Stephen Garland, Jon Gordon, Tom Gu�errez, Juan C. Haren, Danny

1 A BA B C

2 3 4 5 6 7 8 9

11 10

Figure 18.1 Imported Data for Arizona

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-2 Rearranging Excel Data 18-7

desired results are in columns D and E, but the values in columns A–C help to get these results. The following steps are used.

1. Referring to Figure 18.2, create the range name Data (for all the CPI values, not the headings in row 1 or column A). This makes the formula in step 7 easier to read.

2. Add a new worksheet for the rearranged data in Figure 18.2, create the column headings in row 1, enter 1 in cells A2 and B2, and enter 1913 in cell C2.

3. To generate the recurring pattern of 1 to 12 in column B, enter the formula =IF(B2<12,B2+1,1) in cell B3. Copy this down as far as necessary.

4. To generate the pattern in column A (12 1’s, 12 2’s, 12 3’s, and so on), enter the formula =IF(B3=1,A2+1,A2) in cell A3, and copy it down.

5. To generate the years in column C, enter the formula =IF(B3=1,C2+1,C2) in cell C3 and copy it down.

6. To generate the month-year values in column D, enter the formula =DATE(C2,B2,1) in cell D2 and copy it down. This creates dates in column D, which can then be for- matted in a custom format such as mmm-yyyy.

7. To generate the CPI values in column E, enter the formula =INDEX(Data,A2,B2) in cell E2 and copy it down.

8. If you want only the data in columns D and E, copy these two columns and paste them over themselves as values. Then they are no longer dependent on columns A–C, so columns A–C can be deleted.

1 2 3 4 5 6 7 8

A B C DC D E FE F G H I J K LK L M Year 1913 1914 1915 1916 1917 1918 1919

Jan 9.8

10.0 10.1 10.4 11.7 14.0 16.5

Feb 9.8 9.9

10.0 10.4 12.0 14.1 16.2

Mar 9.8 9.9 9.9

10.5 12.0 14.0 16.4

Apr 9.8 9.8

10.0 10.6 12.6 14.2 16.7

May 9.7 9.9

10.1 10.7 12.8 14.5 16.9

Jun 9.8 9.9

10.1 10.8 13.0 14.7 16.9

Jul 9.9

10.0 10.1 10.8 12.8 15.1 17.4

Aug 9.9

10.2 10.1 10.9 13.0 15.4 17.7

Sep 10.0 10.2 10.1 11.1 13.3 15.7 17.8

Oct 10.0 10.1 10.2 11.3 13.5 16.0 18.1

Nov 10.1 10.2 10.3 11.5 13.5 16.3 18.5

Dec 10.0 10.1 10.3 11.6 13.7 16.5 18.9

A B G H I J

Figure 18.2 CPI Data

© C

e n g

a g

e L

e a rn

in g

Row index 1 1 1 1 1 1 1 1 1 1 1 1 2 2

1 1913 1913 1913 1913 1913 1913 1913 1913 1913 1913 1913 1913 1914 1914

9.8 9.8 9.8 9.8 9.7 9.8 9.9 9.9 10 10

10.1 10 10 9.9

Jan-1913 Feb-1913 Mar-1913 Apr-1913 May-1913 Jun-1913 Jul-1913

Aug-1913 Sep-1913 Oct-1913 Nov-1913 Dec-1913 Jan-1914 Feb-1914

2 3 4 5 6 7 8 9

10 11 12 1 2

Column index Year Month-Year CPI1 A BA B C DC D E

2 3 4 5 6 7 8 9

11 12 13 14 15

10

Figure 18.3 Rearranged CPI Data

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-8 Chapter 18 Importing Data into Excel

The Excel data that you obtain can be arranged in all sorts of ways, and you might need strategies and tools we have not discussed here. However, the point of these two examples is that if you spend some time devising a plan before you dive in, you can save yourself a lot of work. The bottom line is that clever strategies can sometimes save your company days of mind-numbing work—and make you a hero.

The INDEX function is a really useful function for finding a particular value in a rectangular range.

Study these steps carefully and try to understand the strategy. You should also look up the INDEX and DATE functions, either in online help or in the Excel tutorial available with the book. Basically, the INDEX function allows you to find a particular value from a rectangular range. The DATE function allows you to specify a date from a year, month, and day. They can be real lifesavers for working with tables and dates. ■

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P18_01.xlsx contains the counts of unique

visitors to popular websites from April 2008 to April 2009. There are actually two sheets, one for news sites and one for sports sites. For each sheet, rearrange the data or do whatever it takes to create the two charts shown in the file.

2. The file P18_02.xlsx contains yearly data on nine of the Big Ten universities. There are two pieces of data for each university for each year: the count of full professors, and the total amount paid to these professors. Rearrange the data or do whatever it takes to create the chart shown in the file of average salary per full professor.

3. The file P18_03.xlsx is the result of importing a text (.txt) file into Excel. The first column should be Year, and this should be followed by four columns for each state: the number and the percentage of females without health insurance and similar data for males. Starting in row 202, you can see that the numbers were imported correctly. However, the variable names that should all be in row 1 were imported badly. Do what- ever it takes to get the correct labels in row 1, with the corresponding numbers below them in rows 2–6. You can shorten the labels to Virginia Male Pct, for example. Then create a time series chart that contains a few time series variables of your choice.

4. The file P18_04.xlsx contains monthly data since 1931 on the number of cooling degree-days (CDD, an index of the amount of energy to cool a home or business) in each of the United States and several combined regions. (The codes for the locations appear on the Locations sheet.) Some of the data is missing, as indicated by -9999 in various cells. Rearrange the

data so that there are three long columns: Location (spelled out, such as Virginia or South Atlantic), Month (such as Jan-1941), and CDD. Replace all -9999 values with blanks. Then show how a pivot table can be used to create a time series graph for any selected location.

Level B 5. In analogy with the previous problem, the file

P18_05.xlsx contains monthly data since 1931 on the number of heating degree days (HDD, an index of the amount of energy to heat a home or business) in each of the United States and several combined regions. (The codes for the locations appear on the Locations sheet.) However, each row really contains the end of the previous year and the beginning of the current year. For example, row 2 contains values (all missing) for Jul–Dec of 1930 and the values (non-missing) for Jan–Jun of 1931. As in the previ- ous problem, rearrange the data so that there are three long columns: Location (spelled out, such as Virginia or South Atlantic), Month (such as Jan- 1941), and HDD. Replace all -9999 values with blanks, and make sure you get the correct data with the correct months. Then show how a pivot table can be used to create a time series graph for any selected location.

6. The file P18_06.xlsx contains monthly data from 1920 to 2004 on average temperatures in the 48 contiguous states and several regions of the U.S. (The codes for locations are listed on the Locations sheet.) Rearrange the data so that there is a Month column (with values such as Jun-1945) and a column for each state or region (spelled out, such as Virginia or Southeast). Each state or region column should contain its monthly temperatures. Then create a time series graph for a few states or regions.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-3 Importing Text Data 18-9

18-3 IMPORTING TEXT DATA Most software packages, statistical and otherwise, store documents in a proprietary binary format that is readable only by that package. For example, prior to the 2007 version, Excel stored its �les in .xls format.3 format that is readable only by that package. For example, prior to the 2007 version, Excel

3 format that is readable only by that package. For example, prior to the 2007 version, Excel

If you try to open an .xls �le in a text editor such as Notepad, all you will see is gibberish. Because such �les are not readable from one package to the next, it is often useful to store them in a more universal format, namely, as text �les. Most software packages allow you to save a �le as a text �le, usually with a .txt extension. Other common extensions for text �les are .dat, .csv (comma delimited), and .prn (created when you “print” to a �le).

Because of their universal nature, you will often receive data in text �les, and then you will often want to import the data into Excel for analysis. This section discusses some of the issues involved. First, a text �le can be �xed width or delimited. (Delimited means sepa- rated.) For either, a line of data in a text �le contains a single observation—a list of variable values. With �xed width, each variable’s value starts and stops at �xed positions (columns) in the line. For example, columns 1–5 might contain the �rst variable’s value, columns 6–8 might contain the second variable’s value, and so on. Therefore, each line of data has the same length, and the columns line up when you view the data in a text editor. In contrast, with delimited data, there is a delimiter character, usually a tab, comma, semicolon, or space, that separates the values in a line. In this case, the lines are typically of different lengths and do not line up nicely. For example, if there is a Name variable, the names John Lee and Tom Schlussenberger will create two lines of different lengths.

Fixed-width �les were originally associated with the old IBM punched cards, which could be read much more easily if the reading program knew which column each variable started in. Even though punched cards are thankfully long gone, �xed-width �les are still quite common and found on many websites. Fortunately, Excel can import either �xed- width or delimited formats with its text import wizard, as the following examples illustrate.

A text file is basically any file that can be read by humans when it is opened in a text editor such as Notepad.

The columns of fixed- width format files line up when you open them in Notepad. The columns of delimited files tend to have ragged edges.

E X A M P L E 18.3 TEMPERATURE DATA

We found state, regional, and national (srn) annual data (1895–2005) on temperature, precipitation, and drought at the website http://rda.ucar.edu/datasets/ds885.1/data/. Three text files were available for download: srn_temp.txt (temperature), srn_pcp.txt (precipitation), and srn_pdsi.txt (drought). A small portion of the temperature data, as shown in Notepad, appears in Figure 18.4. There are no headings, just numbers. Fortunately, the website also has a data dictionary file, srn_data.txt, that provides information about these fixed-width data files. Figure 18.5 shows part of this data dictionary. It indicates what the variables are and how they are stored in columns. How can the temperature data be imported into Excel?

Objective To import the fixed-width text file data into Excel by using Excel’s text import wizard.

Solution The key is to open a file in the usual way within Excel, but to look for files of the type “Text Files (*.prn; *.txt; *.csv).” When you select the srn_tmp.txt file, you see the first step of the text import wizard in Figure 18.6. It allows you to select either Delimited or Fixed width. In this case, select Fixed width. It also allows you to start the import at a row

Always look for a data dictionary on websites. Without it, you might get a text file full of numbers without knowing what the numbers represent.

3Excel �les in version 2007 and later versions are stored in XML format (hence the �nal x in .xlsx). These are special forms of text �les that can be read in an XML editor.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-10 Chapter 18 Importing Data into Excel

Figure 18.4 Temperature Data

© C

e n g

a g

e L

e a rn

in g

Figure 18.5 Data Dictionary for Temperature Data

© C

e n g

a g

e L

e a rn

in g

Figure 18.6 Step 1 of Text Import Wizard

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-3 Importing Text Data 18-11

If the data are in delimited format, you �rst have to be told (or �gure out) what the delimiter character is. If the values are clearly separated by a space or a comma, the choice is obvious. If you see varying gaps between the values in a given row, the tab character is proba- bly the delimiter. Note that the delimiter character is sometimes part of a value. For example, part of a value. For example, part suppose the delimiter is a space and a Name variable has a value such as John Brown.

other than row 1 (because the first few rows often contain descriptive text), but row 1 for this example starts directly with data.

The second step of the wizard, shown in Figure 18.7, allows you to separate (or parse) the columns as listed in the data dictionary. Excel guesses where the breaks should be, but you can override these guesses. Specifically, we clicked on the third, fourth, and fifth posi- tions on the ruler to create the three arrows to the left.

The last step of the wizard, not shown here, allows you to fine-tune the import, column by column, but we usually bypass this step and simply click Finish. The data are imported beautifully into Excel, as shown in Figure 18.8. All you have to do is create column head- ings in row 1, using the data dictionary as a guide. However, the file is still a .txt file, so the last step is to “Save As” to save it as an .xlsx (or .xls) file. ■

To parse a line of data means to separate it into its individual pieces.

A text qualifier, usually a double quote, is necessary if data values include the delimiter character.

Figure 18.7 Step 2 of Text Import Wizard for Fixed-Width Data

© C

e n g

a g

e L

e a rn

in g

1 2 3 4 5 6 7 8 9

State 1 1 1 1 1 1 1 1

Division Element Year 0 0 0 0 0 0 0 0

2 2 2 2 2 2 2 2

1895 1896 1897 1898 1899 1900 1901 1902

43.7 44.1 42.6 49.4 44.4

44 46.1 43.2

37.6 47.9 51.2 45.9 39.9 44.1 43.1 40.6

54.5 52.5 60.2

59 55.2 52.6

53 54.8

63.1 67.9

62 58.1 61.6 63.5 57.4 61.6

69.8 75.7 68.6 73.4 75.8 71.2

70 75.3

78.1 77

80.9 80.3 79.7 76.3 78.4 80.8

79.9 80.8

81 79.8 80.2 79.7 82.1 82.6

79.9 82

78.7 78.6 81.1 81.5 78.5

82

77.9 75.5 75.3 75.1 72.5 77.6

72 73

60.6 63.5 66.9 61.1

66 68.7 62.5 63.3

53.4 57.5 54.3 49.9 55.5 54.9 48.7 57.6

45.6 46.2 47.8 44.1 44.9 46.8 41.7 45.3

A B C D E F G H I J K L M N O P FebJan Mar Apr May Jun Jul Aug Sep Oct Nov Dec

A B C D E F G H I J y J

K L l A

M N O P

Figure 18.8 Imported Data with Column Headings

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-12 Chapter 18 Importing Data into Excel

In this case, there is typically a text quali�er character, usually a double quote, that surrounds any value that contains the delimiter. So instead of seeing John Brown in the text �le, you will see “John Brown” in quotes. This simply indicates that the name John Brown is a single value, not two values. Of course, the person who creates the text �le is the one who must include these text quali�ers—if they are indeed necessary.

E X A M P L E 18.4 MOBILE SUBSCRIBERS

The website http://stats.oecd.org/index.aspx contains a wide assortment of economic data. (OECD stands for Organisation for Economic Co-operation and Development.) Under the Information and Communication Technology group, we found annual data by country for the number of mobile subscribers during 2002–2009.4 Under the Information and Communication Technology group, we found annual data by

4 Under the Information and Communication Technology group, we found annual data by

We downloaded the data into a file named Mobile Subscriptions.txt. A portion of the file in Notepad appears in Figure 18.9. This time there are column headings in row 1, but the ragged lines indicate that this file must be delimited, not fixed width. How can the data be imported into Excel?

Objective To see how delimited text data can be imported into Excel with the import text wizard.

Solution Again, the key is to open a file of the type “Text Files (*.prn; *.txt; *.csv)”. This time you should check the Delimited option in step 1 of the wizard (see Figure 18.6). Then the step 2 dialog box appears as in Figure 18.10. Excel guesses, correctly in this case, that the file is tab-delimited, so all you need to do is click Finish. Note the Text qualifier option in this dialog box. It isn’t relevant here (no tabs are in the middle of any data values), but the option always appears, and you can change the character if necessary.

Some of the imported data appear in Figure 18.11. Note that the Flags column con- tains no data, so it can be deleted. Column A can also be deleted because it includes a

4Actually, the data on this site can be imported directly into Excel. However, we took the circuitous route of downloading into a text �le for illustration in this example.

Figure 18.9 Text File Data on Mobile Subscribers

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-3 Importing Text Data 18-13

constant value, Mobile subscribers. Next, you might want to reformat the numbers in col- umn D, say, to Numeric with 0 decimals. Finally, as in the previous example, you should “Save As” to save the file in .xlsx (or .xls) format. ■

Before leaving this section, here are a few comments about importing text data.

■ If a text �le is comma-delimited and is saved as a .csv �le, you can open it directly into Excel, without the import text wizard. Excel automatically parses the values between the commas into separate columns.

■ Sometimes you will �nd a table of data on the Web where there is no option to save it in some type of format, text or otherwise. One method that sometimes works is to highlight the data in your browser, press Ctrl+c to copy, put your cursor in Excel, and press Ctrl+v to paste. It might work as you hoped, but it might not. It is very possible that everything will be pasted into a single column. If this happens to you, highlight the data in this column and click the Text to Columns button on Excel’s Data ribbon. The purpose of this button is to parse delimited data in a single column into several columns. It often works perfectly, but be aware of the caution that follows.

Excel’s Text to Columns tool is handy for parsing a single column into multiple columns. But check the results carefully to make sure that they are correctly lined up.

Figure 18.10 Step 2 of Text Import Wizard for Delimited Data

© C

e n g

a g

e L

e a rn

in g

Figure 18.11 Imported Excel Data

FlagsValueYearCountrySeries

Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Mobile subscribers Australia

Australia Australia Australia Austria Austria Austria Austria Belgium

2002 2003 2004 2005 2002 2003 2004 2005 2002

1.27E+07 1.43E+07 1.65E+07 1.84E+07 6.74E+06 7.09E+06 7.99E+06 8.37E+06 8.10E+06

1 A BA B C DC D E

2 3 4 5 6 7 8 9

10 © C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-14 Chapter 18 Importing Data into Excel

■ Whenever you parse text data into Excel columns, there is always the chance that the data won’t line up properly—that is, data will get into the wrong columns. So make sure you look closely at the parsed data before blindly proceeding. For example, if the data are supposed to �ll columns A–L but you see some dangling values in column M, something didn’t get parsed correctly and you need to �x it.

P R O B L E M S

Level A 7. The file P18_07.txt lists monthly values of the con-

sumer price index (CPI). Import this data into Excel, excluding the rows before the actual data. (Many text files have information in the first few lines that doesn’t import nicely.) Then rearrange the data as was done in the previous section so that there are only two columns: Month (such as Jun-1954) and CPI. You can delete the columns to the right of the December column. Save the results as an Excel (.xlsx) file.

8. The file P18_08.txt lists daily values of an air quality index for Los Angeles. The first value in each row is a date such as 20070322. This means March 22, 2007. Import this data into Excel and save it as an .xlsx file. Use the date functions DATE, YEAR, MONTH, and DAY to transform the text values such as 20070322 into dates, and then format these as mm/dd/yyyy.

9. The files P18_09 AL.txt and P18_09 NL.txt contain lists of all American League and National League baseball batters who had at least 250 at-bats during the 1990 season. The heading at the top of each text file describes the variables. Import these text files into Excel, and then arrange the data into a single sheet in a single file with five variables: League (AL or NL), Last Name, First Name, At-Bats, and Handedness. Finally, create a pivot table to find the percentages of batters for either league or for both leagues combined who are right-handed hitters, left-handed hitters, or switch-hitters. Save the results as an Excel (.xlsx) file. (This data came from a research project on batting streaks performed by one of the authors in the 1990s.)

10. Continuing the previous problem, the files P18_10 1987.txt through P18_10 1990.txt contain data on Barry Bonds’s at-bats during each of the four seasons 1987–1990. The file P18_10 Variables.txt lists the variables in each file. Import each year’s data into Excel. Then bring all of the data into a single Excel (.xlsx) file with four sheets, one for each year. Enter variable names in the top row of each sheet (you can use the ones suggested in the P18_10 Variables.txt file), and replace all missing values with blanks. (They are currently denoted by periods.) Finally, for any year of your choice, create a pivot table that allows you to see how Bonds’s batting success varied by possible

explanatory variables. For example, did he have more success in home games than away games?

11. The files P18_11 Temp.txt, P18_11 Precip.txt, and P18_11 Drought.txt contain monthly data on tem- perature, precipitation, and drought for various states and regions in the U.S. The file P18_11 Description. txt describes the data. In particular, it indicates that each of the data files is fixed width, and it indicates the fixed width, and it indicates the fixed precise file format (which data are in which columns). Import each of the data files into Excel. Then combine the three worksheets into a single Excel (.xlsx) file, with one sheet for temperature, one for precipitation, and one for drought.

12. The file P18_12.txt contains yearly data for the number of licensed drivers (those under 18, those over 85, and total) by gender and state. Import this data into Excel and save it as an Excel (.xlsx) file. Use appropriate text functions (unless you want to do it manually) to shorten the variable names to something like Arizona Females Young, Arizona Females Old, and Arizona Females All. Explain briefly what the presence of consecutive commas in the text files indicates. How are these imported into Excel?

Level B 13. The file P18_13.txt contains yearly salary data for

full professors at several Big Ten universities. For each university, there is data on the average salary for full professors, the number of full professors, and the total paid to all full professors. Import this data into Excel. The variable names in row 1 will be quite long, so do whatever it takes to shorten them to something like Indiana Average Salary, Indiana Full Professors, and Indiana Total Paid. Save the results as an Excel (.xlsx) file.

14. Text data can sometimes be quite intimidating. As an example, the file P18_14.txt has data on all organiza- tions convicted in federal courts in 2007. If you open it in Notepad, it won’t make a bit of sense. Fortunately, there is a “codebook” in the file P18_14.pdf. (It is common for government and other organizations to publish such codebooks.) Explain in some detail how you could import this data into Excel. Optionally, try could import this data into Excel. Optionally, try could importing it.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-15

18-4 IMPORTING DATA INTO EXCEL Excel has long had a number of tools for importing data from a variety of sources, includ- ing relational databases, text �les, Web pages, and others. Excel 2016 includes the tools that have been available in several previous versions of Excel, referred to here as the “old” tools, and it includes a newer and better set of tools, generally referred to as Power Query. Both sets of tools are discussed here. They are all on the Data ribbon in the Get External Data and the Get & Transform groups, shown in Figure 18.12. The Get External Data group (which might be compressed to a single Get External Data dropdown, depending on the window size on your screen) includes the old tools, and the Get & Transform group contains the Power Query tools. You won’t see the latter unless you have Excel 2016. (Actually, Power Query is available as a free add-in for Excel 2013, but it isn’t packaged with Excel 2013, and it has a different user interface.)

5This isn’t quite true. Since Excel 2007, you could always import data from a query saved in Access, and this query could combine data from multiple tables.

Figure 18.12 Tools for Importing Data on the Data Ribbon

Your �rst question is probably why there are now two sets of tools, not just one. We can’t presume to know exactly what Microsoft’s strategy is, but it seems apparent that the old tools needed an overhaul, so Microsoft developed a brand new set of better tools, that is, Power Query. However, many users have been reliant on the old tools for so long that it would have been disastrous to eliminate them entirely. Therefore, at least for now, you get your choice, the old or the new. We wouldn’t be surprised to see the old tools eliminated eventually, but it’s impossible to say when this might happen. In any case, the new Power Query tools really are better, so if you have a choice, you should use them. The accompany- ing video on Power Query brie�y discusses the advantages of the new tools.

Queries When you go through the steps indicated here in Microsoft Query, you are asking for selected data to be imported into Excel. You do this with a query. In general, a query specifies (1) which tables you are getting your data from, (2) which

fields from these tables you want to import, and (3) which criteria (or filters) you want to impose. The criteria determine which rows from the tables will be imported. In short, a query specifies the subset of the entire database that is of interest to you.

F u n da m e n ta l I n s i g h t

18-4a Importing from Access with Old Tools

A common source for imported data is an Access �le containing one or more related tables. Then an easy way to import Access data is with the From Access button on the left in Figure 18.12. This button has been on the Data ribbon since Excel 2007, but until Excel 2013, it could import only a single table from an Access database, giving it limited usefulness.5

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-16 Chapter 18 Importing Data into Excel

Starting in Excel 2013, however, this button allows you to import multiple tables and their relationships. You are then given the choice of importing the data into one or more tables or as the basis for a pivot table. If you import multiple Access tables and then choose the table option, you will get a separate Excel table, on a separate worksheet, for each of the Access tables. The pivot table option is often the recommended option. It allows you to build a pivot table from �elds in all of the related tables. We won’t pursue these options here. They are very quick and easy, and their only drawback relative to other approaches is that you can’t get subsets of the Access tables, such as all customer orders for January 2016; you get the entire tables.

Another approach, still using “old” tools, is to use Microsoft Query. This is discussed later in this section. It does allow you to �lter the data so that you get exactly the rows and columns you need.

18-4b Importing from Access with Power Query 6

This subsection introduces the new Power Query tools as a third way to import Access data. Although the discussion is in terms of Access data, most of it carries over to other potential data sources. This consistency is a strength of Power Query.

To get started, you select the Access option from the New Query dropdown, shown in Figure 18.13. This leads to a set of steps that is fairly consistent for most data sources cho- sen through the New Query dropdown list. You �rst indicate where the source is located, in this case in a folder on your hard drive. Then you see a Navigator window, shown in Figure 18.14, where you can select the tables for your query. Finally, you can click the Edit button to see the Query Editor window shown in Figure 18.15.

Power Query

6This subsection requires Excel 2016.

Figure 18.13 New Query Dropdown List

This Query Editor is a primary reason for converting from the old tools to Power Query. It lets you “shape” the data in a number of ways. That is, it lets you select exactly the rows and columns you want to import. This includes using the Transform and Add Column tabs to transform existing columns or add new calculated columns. This has always been possible with older tools, particularly Microsoft Query, but the new Query Editor user interface is much friendlier.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-17

Figure 18.14 Navigator Window for Selecting Access Tables

Figure 18.15 Query Editor Window

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-18 Chapter 18 Importing Data into Excel

Once you are �nished in the Query Editor, you can select one of the Load To options from the Close & Load dropdown to import the data. These options are shown in Figure 18.16. For example, with the options currently selected, each of the selected tables is imported into a table on a separate worksheet in the Excel �le. Alternatively, you could select the Only Create Connection option and check the Add this data to the Data Model option to add the tables to the current Data Model. In this case, you wouldn’t see the data in Excel worksheets, but you could view them in the Power Pivot window, as explained in the previous chapter. Also, with this option, the tables wouldn’t yet be related, as they are in Access, but you could easily relate them inside the Power Pivot window.

7Microsoft Query is probably the best known of the “old” tools. If you plan to use only new Power Query tools, you can omit this section.

Another key advantage to using the new Power Query tools is that the Workbook Queries pane opens, as shown in Figure 18.17. This lists all of the queries developed for this workbook. (In this case, where �ve tables were imported at once, Power Query treats them as �ve separate queries.) You can then double-click any of these to go back to the Query Editor, where you can rerun or modify the query. This is a great time-saving feature if you need to run similar queries on a regular basis. Note that the Show Queries button on the Data ribbon toggles this Workbook Queries pane from visible to hidden or vice versa.

18.4c Using Microsoft Query 7

The software in this section, Microsoft Query, has been part of Microsoft Of�ce for years. It is fairly old technology, but it still works �ne.

Microsoft Query allows you to import all or part of the data from many database pack- ages into Excel—with very little work. You probably do not know you own this software.

Figure 18.16 Load To Options

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-19

Figure 18.17 Workbook Queries Pane

8In Of�ce 2003 and earlier, Access �les had an .mdb extension. In Of�ce 2007, the extension changed to .accdb. Old .mdb �les can be converted to the new .accdb format, but Access 2007 or later can read .mdb �les. Because we see no advantage to converting .mdb �les to .accdb �les, we have not done so.

For example, if you click the Windows Start button and then choose Programs, you will not �nd Microsoft Query in the list. However, it comes with Of�ce, and you can use it. (The only question is whether you installed it when you installed Of�ce. To check, open a blank spreadsheet in Excel and select From Microsoft Query from the From Other Sources dropdown menu in the Get External Data group on the Data ribbon. If this doesn’t work, then Microsoft Query is not installed. You will have to go through the Of�ce Setup program to install it.)

Once Microsoft Query is installed, importing data from Access (or any other supported database package) is essentially a three-step process:

1. Define the source, so that Excel knows what type of database the data is in and where the data is located.

2. Use Microsoft Query to define a query.

3. Return the data to Excel.

We illustrate these three steps in the following example.

E X A M P L E 18.5 FINE SHIRT COMPANY’S RELATIONAL DATA

Fine Shirt Company creates and sells shirts to its customers. These customers are retail-ers who sell the shirts to consumers. The company has created an Access database file Shirt Orders.mdb that has information on sales to its customers during the period of 2012 through 2016.8 There are three related tables in this database: Customers, Orders, and Products. These tables are related as shown in Figure 18.18.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-20 Chapter 18 Importing Data into Excel

Figure 18.19 Choose Data Source Dialog Box

© C

e n g

a g

e L

e a rn

in g

Figure 18.18 Relationships Diagram

© C

e n g

a g

e L

e a rn

in g

9This procedure can be done in the same way, with virtually no changes, with databases from other packages, such as SQL Server and Oracle. This is fortunate; you need to learn only one basic method for all relational databases.

Objective To illustrate how Microsoft Query can be used to import the results of queries on the Shirt Orders database into Excel.

Solution Before going into the details, it is important to realize that the entire procedure is done within Excel and Microsoft Query, not Access. All you need is an Access database file, in not Access. All you need is an Access database file, in not this case Shirt Orders.mdb.9

The first step of the procedure is to tell Excel what type of data you have and where it is located. In its terminology, you must define a data source. To do so, open a blank spreadsheet in Excel and select From Microsoft Query from the From Other Sources drop- down menu in the Get External Data group on the Data ribbon. This takes you to the Choose Data Source dialog box shown in Figure 18.19. Note that the list you see might not be the same as the one shown here. Each time you tell Excel about a new data source, it is added to the list shown. To add a new data source, select the top <New Data Source> item and click OK.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-21

Figure 18.20 Create New Data Source Dialog Box

© C

e n g

a g

e L

e a

rn in

g

Figure 18.21 Dialog Box for Selecting Database File

© C

e n g

a g

e L

e a rn

in g

10If the bottom checkbox is checked, the Query Wizard will be launched when you click OK. You can try this if you like, but we prefer the method described here.

This takes you to the Create New Data Source dialog box. It should eventually be filled in as shown in Figure 18.20. Then click Connect to bring up the ODBC dialog box in Figure 18.21. Click Select in this dialog box and browse for the Shirt Orders.mdb file.

Click OK a couple of times to see the completed Create New Data Source dialog box, and click OK once more to get back to the Choose Data Source dialog box, with your data source, Shirt Orders, now on the list, as shown in Figure 18.22.

At this point, you should be looking at the Choose Data Source dialog box shown in Figure 18.22—with Shirt Orders on the list. Make sure the Shirt Orders item is selected

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-22 Chapter 18 Importing Data into Excel

Figure 18.22 Choose Data Source Dialog Box with the New Data Source

© C

e n g

a g

e L

e a rn

in g

Figure 18.23 Add Tables Dialog Box

© C

e n g

a g

e L

e a rn

in g

and the bottom checkbox is unchecked, and click OK.10 This brings up the Add Tables dialog box shown in Figure 18.23, in front of the Microsoft Query window shown in Figure 18.24. This begins the second step of the overall procedure, where you define the query. Essentially, you need to specify which tables are relevant for the query, which fields you want to return to Excel, and which records meet the criteria you spell out.

Only the following simple query is illustrated here: Find all of the records from the Orders table where the order date is during the years 2015 or 2016, the product number is 3 or 5, and the number of units ordered is at least 100, and return to Excel all fields in the Orders table for these records. Proceed as follows.

1. If the Add Tables dialog box is still visible, select the Orders table, click Add, and then click Close. (If the Add Tables dialog box is not visible, select the Add Tables menu item from the Table menu to make it visible.) The labels from the table appear in the top pane of the window shown in Figure 18.25.

2. Double-click any of the fields in this table that you want to be returned by the query. If you double-click the top item (the asterisk), all fields will be returned. For this query, double-click the asterisk, and you should see a sampling of the data that will be returned in the bottom pane of the window.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-23

Figure 18.24 Microsoft Query Window

© C

e n g

a g

e L

e a rn

in g

Figure 18.25 Query Window before Entering Criteria

© C

e n g

a g

e L

e a rn

in g

3. Click the Show/Hide Criteria button on the Microsoft Query toolbar (the button with the glasses and the funnel). This opens a middle pane in the window, where you can enter criteria.

4. Enter the criteria for the query. Any conditions in a given row are “and” conditions, and those in different rows are treated as “or” conditions. You can either type the conditions directly into the middle pane—if you know the correct syntax—or you can select the Add Criteria menu item from the Criteria menu. This latter option brings up the dialog box shown in Figure 18.26. After some experimenting, you will see how to enter conditions in this dialog box. Then, when you click the Add button, the condition appears in the middle pane of the window. By examining the syntax of the conditions that are entered, you can quickly learn how to type in your own conditions directly. The final conditions for the query appear in Figure 18.27. (Note how dates are enclosed in # signs, and how the keywords Between and In are used.)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-24 Chapter 18 Importing Data into Excel

Figure 18.26 Add Criteria Dialog Box

© C

e n g

a g

e L

e a rn

in g

If you scroll down the records in the bottom pane of the window, you will see that this query returns 69 of the 2245 records in the Orders table. The final step in the overall three-step process is to get these data back into Excel. To do this, select the Return Data to Microsoft Excel menu item from the File menu. This takes you back to Excel and brings up the dialog box in Figure 18.28, where you can specify the type of report you want and where you want the results. For now, choose the Table option, so that the Access data are imported into an Excel table—the same type of table discussed in Chapter 2. When you click OK, the results appear in a few seconds, and you can now analyze them statistically using any tools we have discussed. However, it is important to realize that these data are still linked to the query. This means that you can refresh the data in Excel if the Access data change. To do so, make sure your cursor is inside the Excel table, and click the Refresh button on the Table Tools Design ribbon (or the Refresh All button on the Data ribbon).

It is also possible to get back to Microsoft Query so that you can edit your query. Again, make sure a cell inside the Excel table is selected, and click the Connections button on the Data ribbon. This brings up the Workbook Connections dialog box in

Figure 18.27 Criteria for Query

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-25

Figure 18.29. Click Properties, then select the Definition tab, and finally click the Edit Query button. (Note that if you have performed multiple imports into the same Excel workbook, you will see several connections in the top pane of Figure 18.29. You can find the relevant connection by highlighting any of the connections and then clicking the bot- tom pane.)

One more possibility is to save the query itself. To do so, select Save from the File menu in the Microsoft Query window and type a descriptive file name such as Shirt Orders Query 1. The extension .dqy (for database query) is added by default. This allows you to run this query at any time from within Excel by clicking the Existing Connections button on the Data ribbon.

We reiterate that once the results of the query data are returned to Excel, you can then begin the statistical analysis of the data—creating summary measures, scatterplots, pivot tables, and so on. However, if your ultimate goal is to create a pivot table based on the data- base data, you can do this directly by choosing the appropriate options in Figure 18.28. ■

Figure 18.28 Import Data Dialog Box

© C

e n g

a g

e L

e a rn

in g

Figure 18.29 Workbook Connections Dialog Box

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-26 Chapter 18 Importing Data into Excel

18.4d SQL Statements and M

Queries represent a large part of the power behind relational databases. Regardless of the particular database package—Access, SQL Server, Oracle, or any of the others—the types of queries you create are all basically the same. You typically select one or more tables, select several �elds from these tables, and impose certain conditions. To standardize queries across packages, SQL (structured query language; pronounced “S-Q-L” or “sequel”) was devel- oped several decades ago. (It is often called the “language of databases.”) Sitting behind each query you develop in a user interface such as Microsoft Query is an SQL statement. Although these statements are beyond the scope of this book, you might like to take a look at them. This is easy to do. Once you have created a query, click the SQL button in the Query toolbar.

As an example, if you form the query shown in Figure 18.27 and click the SQL but- ton, you see the SQL statement in Figure 18.30. At �rst, this is probably intimidating. However, if you break it down into its parts, it is fairly straightforward. SQL has a number of keywords that are usually capitalized. This statement includes the keywords SELECT, FROM, WHERE, and AND. The SELECT clause of the statement speci�es the �elds to return (where, in the case of multiple tables, the table name and a period precede the �eld name). The FROM clause speci�es the tables to base the query on. Finally, the WHERE clause spells out the criteria, separated by AND. If you want to learn more about SQL, the best way is to create a query through the interface and then look at the corresponding SQL statement. Once you get used to SQL statements, you can edit a query by editing its SQL equivalent. If you get really pro�cient, you can even create a query from scratch by typing the appropriate SQL statement directly. (If you are interested, there are numerous books available for learning SQL.)

Figure 18.30 SQL Statement

© C

e n g

a g

e L

e a rn

in g

Interestingly, Microsoft has developed a new language called M for queries made with Power Query. However, this is for advanced users and is not discussed here. (Why the name “M”? We have no idea.)

18-4e Web Queries 11

As you have almost certainly discovered, the Web is a great source for data. Recognizing this, Microsoft developed Web queries several years ago, and we have described how to perform them in previous editions of the book. The problem is that they often don’t work as expected. You �nd a Web page with a table of data you’d like to import, you use the From

11 The new Web query tool discussed here requires Excel 2016.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-4 Importing Data into Excel 18-27

Web button in the Get External Data group on the Data ribbon, you identify the table(s) you want to import, and you either get errors or you get nothing. Sometimes you get what you want, but you often don’t.

This is a primary example of the “old” tools versus the newer Power Query tools. In short, the old Web query tool often doesn’t work in cases where the new Power Query Web query tool works beautifully. So if you like to import data from the Web and you have often been frustrated by the old tools not working, you will be very pleasantly surprised by Web queries in Power Query. There is no guarantee that they will work with all websites, but they appear to work a lot more often.

Here is a typical example. The website http://www.usatoday.com/sports/mlb/salaries/ contains salaries of Major League Baseball players. Its data are in a nicely formatted table, exactly the form you’d expect to be importable into Excel. The old Web query tool from the Get External Data group doesn’t identify the table, so no import is possible. However, the new Web query tool from Power Query works perfectly. Better yet, it is completely straightforward. You select From Web from the From Other Sources list in the New Query dropdown, enter the URL, and select the Table(s) of interest. You even get a preview, as shown in Figure 18.31. Then you can click Edit to open the Query Editor, which allows you to import exactly the rows and columns of interest.

Figure 18.31 Preview of Web Data to Be Imported

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-28 Chapter 18 Importing Data into Excel

18.5 CLEANSING DATA When you study statistics in a course, the data sets you analyze have usually been care- fully prepared by the textbook author or your instructor. For that reason, they are usually in good shape—they contain exactly the data you need, there are no missing data, and there are no “bad” entries (caused by typographical errors, for example). Unfortunately, you cannot count on real-world data sets to be so perfect. This is especially the case when you obtain data from external sources such as the Web. There can be all sorts of problems with the data, and it is your responsibility to correct these problems before you do any serious analysis. This initial step, called cleansing data, can be tedious, but it can prevent totally misleading results later on.

In this section we examine one data set that has a number of errors, all of which could very possibly occur in real data sets. We discuss methods for �nding the problems and for correcting them. However, you should be aware of two things. First, the errors in this example are only a few of those that could occur. Cleansing data requires care- ful detective work to uncover all possible errors that might be present. Second, once an error is found, it is not always clear how to correct it. A case in point is missing data.

P R O B L E M S

Level A 15. Starting with the file Shirt Orders.mdb from

Example 18.5, find all of the records from the Orders table where the order was placed in 2015 or 2016, the product number is 1 or 10, the customer is not 7, and the number of units ordered is at least 75. Return all fields in the Orders table for each of these records to Excel.

16. Starting with the file Shirt Orders.mdb from Example 18.5, find all of the records from the Orders table that correspond to orders for between 50 and 100 items (inclusive) made by the customer Rags to Riches for the product Short-sleeve Polo. Return the dates, units ordered, and discounts for each of these orders to Excel.

17. Starting with the file Shirt Orders.mdb from Example 18.5, find all of the records from the Orders table that correspond to orders for more than 75 items made by the customer Threads for products designed to be worn by women. Return the dates, units ordered, and product description for each of these orders to Excel.

18. Fine Shirt Company would like to know how many units of its products designed for each gender subset (i.e., men, women, and both genders) were sold to each customer during each quarter of the past five years (i.e., from the first quarter of 2012 through the fourth quarter of 2016). Starting with the file Shirt Orders.mdb from Example 18.5, perform an

appropriate query and bring the results back to Excel as a pivot table to answer the company’s question.

19. Fine Shirt Company would like to know how many units of each of its products were sold to each customer during each year of the period 2012–2016. Starting with the file Shirt Orders.mdb from Example 18.5, perform an appropriate query and bring the results back to Excel as a pivot table to answer the company’s question.

20. Import the salary data for the Baltimore Ravens NFL team from the website http://www.sportscity.com/nfl/ salaries/baltimore-ravens-salaries/. Can you import data from other NFL teams from similar websites?

21. The website http://www.aflcio.org/Corporate-Watch/ Paywatch-2014/100-Highest-Paid-CEOs lists the com- pensations of the 100 highest paid CEOs, as of 2014. Import these data into Excel.

22. Websites such as http://finance.yahoo.com/q/is?s=KO provide income statements for companies. The infor- mation after the question mark identifies the company, in this case Coca Cola with stock symbol KO. Import data from such a site into Excel, where you can choose the company.

23. Websites such as http://finance.yahoo.com/q/hp?s= AA&a=00&b=29&c=2001&d=00&e=29&f=2010& g=m contain historical stock price data. The informa- tion after the question mark indicates the company, in this case Alcoa with stock symbol AA, and the time period. Import data from such a site into Excel, where you can choose the company and the time period.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18.5 Cleansing Data 18-29

Cleansing Data Textbook data tends to be clean (no missing or bad Textbook data tends to be clean (no missing or bad T data), but this is not the case with data in the real world. Unfortunately, cleansing data is difficult and time- consuming, but it must be done to avoid the “garbage in, garbage out” effect. Fortunately, there are a number of tools, both in Excel and in database software, for cleans- ing data. Although data cleansing is still time-consuming detective work, the tools make the job easier.

F u n da m e n ta l I n s i g h t

Objective To find and fix errors in this company’s data set.

Solution We purposely constructed this data set to have a number of problems, all of which you might encounter in real data sets. We begin with the Social Security Number (SSN). Presumably, all 1500 customers are distinct people, so all 1500 SSNs should be different. How can you tell if they are? One simple way is as follows.

E X A M P L E 18.6 CUSTOMER DATA WITH ERRORS

The file Data Cleansing.xlsx has data on 1500 customers of a particular company. A portion of these data appears in Figure 18.32, where many of the rows have been hid- den. How much of this data set is usable? How much needs to be cleansed?

1 2 3 4 5 6 7 8 9

11 12

1498 1499

1501 1500

10

Customer 1 2 3 4 5 6 7 8

10 11

1497 1498

1500 1499

9

70 67 25 51 50 39 55 24

33 34 68 44

64 32

31

0 1 1 1 0 0 1 1

0 0 0 1

0 0

0

4 0 8 2 2 1 3 0

2 3 5 4

1 6

2

2080 0

3990 920

1000 550

1400 0

1080 1390 2540 2160

530 2910

910

62900 23300 48700

137600 101400 139700

50900 50500

88300 120300 121100

64000

121400 91000

151400

East West East West East East

South South

West North South North

South South

North

418-18-5649 065-63-3311 059-58-9566 443-13-8685 638-89-7231 202-94-6453

943-85-8301 047-07-5332 638-19-2849 670-57-4549

366-03-5021 166-84-2698

266-29-0308

SSN Birthdate Age Region Cred Card User Income Purchases Amount Spent 539-84-9599 444-05-4079

08/17/73 08/02/47 10/03/48 03/24/60 12/02/43 11/08/74

07/05/65 11/13/64 07/31/30 07/21/54

09/23/34 10/30/66

09/28/67

10/26/44 01/01/32

A BA B C DC D E FE F G HG H I

Figure 18.32 Data Set with Bad Data

© C

e n g

a g

e L

e a rn

in g

For example, some respondents to a questionnaire, when asked for their annual income, might leave this box blank. How should you treat these ques- tionnaires when you perform the eventual data analysis? Should you delete them entirely, should you replace their blank incomes with the average income of all who responded to this question, or should you use a more complex rule to estimate the missing incomes? All three of these options have been suggested by statisticians, and all of them have their pros and cons. Perhaps the safest method is to delete any questionnaires with missing data, so that you don’t have to guess at the missing val-

ues, but this could mean throwing away a lot of potentially useful data. The point is that some subjectivity and common sense must be used when cleansing data sets.

Again, cleansing data typically involves careful detective work and some common sense. The bad news is that it is tedious yet often necessary. The good news is that you can use the powerful Excel tools we have discussed to search for suspicious data values and then �x them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-30 Chapter 18 Importing Data into Excel

1. Sort on the SSN column.

2. Once the SSNs are sorted, enter the formula =If(B3=B2,1,0) in cell J3 and copy this formula down column J. This formula checks whether two adjacent SSNs are equal.

3. Enter the formula =SUM(J3:J501) in cell J2 to see if there are any duplicate SSNs (see Figure 18.33). As you can see, there are two pairs of duplicate SSNs.

Figure 18.34 Dialog Box for Locating Duplicates

© C

e n g

a g

e L

e a rn

in g

Figure 18.33 Checking for Duplicate SSNs

1 2 3 4 5 6 7

681 685 62

787 328 870

63 35 44 23 22 41

0 0 1 0 1 0

1 4 4 3 4 2

2 0 0 0 0 0

530 1750 2020 1330 1940 1010

159700 149300

44000 153000

49800 138900

North North West North West South

001-05-3748 001-43-2336 001-80-6937 002-23-4874 004-10-8303 004-39-9621

A B C D E F G H I JA B C D E F G H I J Customer SSN Birthdate Age Region Cred Card User Income Purchases Amount Spent Duplicates

03/24/36 08/21/63 12/27/54 01/31/76 10/19/76 10/13/57 ©

C e n g

a g

e L

e a rn

in g

12In case you are interested in some of Excel’s date functions, we left the formula for age in cell D2. (We replaced this formula by its values in the rest of column D; otherwise, Excel takes quite a while to recalculate it 1500 times.) This formula uses Excel’s TODAY, YEAR, MONTH, and DAY functions. Check online help to learn more about these functions.

4. To find the duplicates, select the range from cell J3 down and select Find from the Find & Select dropdown menu on the Home ribbon, with the resulting dialog box filled in as shown in Figure 18.34. In particular, make sure the bottom box has Values selected.

5. Click the Find Next button twice to find the offenders. Customers 369 and 618 each have SSN 283-42-4994, and customers 159 and 464 each have SSN 680-00-1375.

At this point, the company should check the SSNs of these four customers, which are hopefully available from another source, and enter them correctly here. (You can then delete column J and sort on column A to bring the data set back to its original form.)

The Birthdate and Age columns present two interesting problems. When the birth- dates were entered, they were entered in exactly the form shown (10/26/44, for example). Then the age was calculated by a somewhat complex formula, just as you would calculate your own age.12 Then the age was calculated by a somewhat complex formula, just as you would calculate

12 Then the age was calculated by a somewhat complex formula, just as you would calculate

Are there any problems? First, sort on Birthdate. You will see that the first 18 customers all have birthdate 05/17/27—quite a coincidence! (see Figure 18.35).

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18.5 Cleansing Data 18-31

As you may know, Excel’s dates are stored internally as integers (the number of days since January 1, 1900), which you can see by formatting dates as numbers. So highlight these 18 birthdates and format them with the Number option (and zero decimals) to see which number they correspond to. It turns out to be 9999, the code often used for a missing value. Therefore, it is likely that these 18 customers were not born on 05/17/27 after all. Their birthdates were probably missing and simply entered as 9999, which were then formatted as dates. If birthdate is important for further analysis, these 18 customers should probably be deleted from the data set or their birthdates should be changed to blanks (if the true values cannot be found).

It gets even more interesting if you sort on the Age variable. You will see that the first 12 customers after sorting have negative ages (see Figure 18.36). You have just run into a Y2K (year 2000) problem. These 12 customers were all born before 1930. Excel guesses that any two-digit year from 00 to 29 corresponds to the 21st century, whereas those from 30 to 99 correspond to the 20th century.13

corresponds to the 21st century, whereas those from 13

corresponds to the 21st century, whereas those from This guess was obviously a bad one for these 12

customers, and you should change their birthdates to the 20th century. An easy way to do this is to highlight these 12 birthdates, select Replace from the Find & Select dropdown list, fill out the resulting dialog box as shown in Figure 18.37, and click the Replace All button. This replaces any year that begins with 202, as in 2028, with a year that begins with 192.

Figure 18.35 Suspicious Duplicate Birthdates

1 2 3 4 5 6 7 8 9

11 12 13 14 15

17 16

10

Customer 64

429 463 466 486 494 607 645 661 730 754 782 813

1045 1068 1131 1179 1329 174

71 71 71 71 71 71 71 71

71 71 71 71 71

71 71

71

0 0 0 0 0 0 1 0

1 0 0 1 0

1 0

0

1 4 2 4 2 1 3 5 5 1 4 0 2 4 3 3 4 5 2

490 2100

930 1900 1040

480 1540 2480 2450

510 1980

0 1020 1850 1400 1520 1940 2710

960

50500 120300

62300 155400 116500 103700

75900 155300 147900

38200 77300 51600 47500 82400

138500 67800 44800 83900 29900

East South East East West East

South North

West North West East

South

North North

West

SSN Birthdate Age Region Cred Card User Income Purchases Amount Spent 205-84-3572 279-23-7773 619-94-0553 365-18-7407 364-94-9180 085-32-5438 626-04-1182 086-39-4715 212-01-7062 142-06-2339 891-12-9133 183-25-0406 338-58-7652 715-28-2884 110-67-7322 602-63-2343 183-40-5102 678-19-0332 240-78-9827

05/17/27 05/17/27 05/17/27 05/17/27 05/17/27 05/17/27

05/17/27 05/17/27 05/17/27 05/17/27 05/17/27

05/17/27 05/17/27

18 19 20

71 71 69

0 0 0

East West East

05/17/27 05/17/27 01/09/30

05/17/27

05/17/27 05/17/27

A BA B C DC D E FE F G HG H I

© C

e n g

a g

e L

e a rn

in g

Figure 18.36 Negative Ages: A Y2K Problem

1 2 3 4 5 6 7 8 9

11 12 13

10

Customer 148 324 426 440

1195 1310 589 824

229 1089 1037

922

–31 –30 –30 –30 –30 –30 –29 –29

–28 –28 –27

–29

0 0 0 1 0 0 1 1

0 0 1

1

8 2 2 1 4 2 2 2

1 5 3

6

3960 1000 1100

470 1960

980 1030 1070

450 2580 1510

3000

63800 142500

68400 113600

40600 91800 59300

9999

26700 90000

128300

35400

South North North West West West West North

East South East

East

968-16-0774 618-84-1169 806-70-0226 380-84-2860 776-44-8345 376-25-7809

964-27-4755 808-29-7482 594-47-1955

329-51-3208

SSN Birthdate Age Region Cred Card User Income Purchases Amount Spent 237-88-3817 133-99-5496

09/29/28 10/19/28 10/14/28 10/17/28 04/16/27 11/02/27

01/29/27 02/28/27 08/10/25

03/21/28

08/11/29 05/13/28

A BA B C DC D E FE F G HG H I

© C

e n g

a g

e L

e a rn

in g

13To make matters even worse, a different rule was used in earlier versions of MS Of�ce. There is no guarantee that Microsoft will continue to use this same rule in future editions of Of�ce. However, if you enter four-digit years from now on, as you should, it won’t make any difference.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-32 Chapter 18 Importing Data into Excel

(Always be careful with the Replace All option. For example, if you enter /20 and /19 in the “Find what:” and “Replace with:” boxes, you will not only replace the years, but the 20th day of any month will also be replaced by the 19th day.) If you copy the formula for Age that was originally in cell D2 to all of column D, the ages should recalculate automatically as positive numbers.

The Region variable presents a problem that can be very hard to detect—because you usually are not looking for it. There are four regions: North, South, East, and West. If you sort on Region and scroll down, you will find a few East values, a few North values, a few South values, and a few West values, and then the East values start again. Why aren’t the East values all together? If you look closely, you will see that a few of the labels in these cells—those at the top after sorting—begin with a space. The person who entered them inadvertently entered a space before the name. Does this matter? It certainly can. Suppose you create a pivot table, for example, with Region in the row area. You will get eight row categories, not four. (An example appears in Figure 18.38.) Therefore, you should delete the extra spaces. The most straightforward way is to use Replace from the Find & Select dropdown menu in the obvious way. (Excel also has a handy TRIM function that removes any leading or trailing spaces from a label.)

Figure 18.37 Dialog Box for Correcting the Y2K Problem

© C

e n g

a g

e L

e a rn

in g

Figure 18.38 Pivot Table with Too Many Categories

Region Sum of Amount Spent East North South West East North South West Grand Total

48550 36530 67289 35140

555909 514135 563585 520294

2341432

3 A B

4 5 6 7 8 9

10 11 12 ©

C e n g

a g

e L

e a rn

in g

A slightly different problem occurs in the Cred Card User column, where 1 corresponds to credit card users and 0 corresponds to nonusers. A typical use of these numbers might be to find the proportion of credit card users, which you can find by entering the formula =AVERAGE(F2:F1501) in some blank cell. This should give the proportion of should give the proportion of should 1s, but instead it gives an error (#DIV/0!). What is wrong? A clue is that the numbers in column F

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18.5 Cleansing Data 18-33

are left-justified, whereas numbers in Excel are usually right-justified. Here is what might have happened. Data on credit card users and nonusers might initially have been entered as the labels Yes and No. Then to convert them to 1 and 0, someone might have entered the formula IF(F4="Yes","1","0"). The double quotes around 1 and 0 cause them to be interpreted as text, not numbers, and no arithmetic can be done on them. (In addition, text is typically left-justified, the telltale sign seen here.) Fortunately, Excel has a VALUE function that converts text entries that look like numbers to numbers. So you should form a new column that uses this VALUE function on the entries in column F to convert them to numbers. (Specifically, you can create these VALUE formulas in a new column, then do a Copy and Paste Special as Values to replace the formulas by their values, and finally cut and paste these values over the original text in column F.)

Next consider the Income column. If you sort on it, you will see that most incomes are from $20,000 to $160,000. However, there are a few at the top that are much smaller, and there are a few 9999s (see Figure 18.39). By this time, you can guess that the 9999s correspond to missing values, so unless these true values can be found, these customers should probably be deleted if Income is crucial to the analysis (or their incomes should be changed to blanks). The small numbers at the top take some educated guesswork. Because they range from 22 to 151, a reasonable guess (and hopefully one that can be confirmed) is that the person who entered these incomes thought of them as “thousands” and simply omit- ted the trailing three zeroes. If this is indeed correct, you can fix them by multiplying each by 1000. (There is an easy way to do this. Enter the multiple 1000 in some blank cell, and press Ctrl+c to copy it. Next, highlight the range G2:G12, click the Paste dropdown menu, select Paste Special, and check the Multiply option. This trick has become one of our favorites.)

Finally, consider the Purchases (number of separate purchases by a customer) and Amount Spent (total spent on all purchases) columns. First, sort on Purchases. You will see the familiar 9999s at the bottom. In fact, each 9999 for Purchases has a corresponding 9999 for Amount Spent. This makes sense. If the number of purchases is unknown, the total amount spent is probably also unknown. You can effectively delete these 9999 rows by inserting a blank row right above them. Excel then automatically senses the boundary of the data. Essentially, a blank row or column imposes a separation from the “active” data (see Figure 18.40).

Now we examine the remaining data for these two variables. Presumably, there is a relationship between these variables, where the amount spent increases with the number of purchases. You can check this with a scatterplot of the (nonmissing) data, which is shown in Figure 18.41. There is a clear upward trend for most of the points, but there are some suspicious outliers at the bottom of the plot. Again, you might take an educated guess. Perhaps the average spent per purchase, rather than the total amount spent, was entered

Figure 18.39 Suspicious Incomes

1 2 3 4 5 6 7 8 9

11 12 13 14 15

17 16

10

Customer 439 593

1343 925

1144 460 407 833 233 51

816 824 518 570 605 796

28 38 56 66 64 27 39 38 67 65 37

�29 24 28 40 45

0 0 1 0 0 0 1 0 0 0 1 1 1 1 1 0

8 5 5 6

9999 3 4 4 6 2 2 2 2 3 0 3

4160 2460 2600 2980 9999 1500 2000 1970 2950 1010

900 1070

940 1520

0 1570

22 25 43 55 71 81 88

104 138 149 151

9999 9999 9999 9999 9999

West East West North North East East West

West North North West South

North North

South

SSN Birthdate Age Region Cred Card UserCred Card User Income Purchases Amount Spent 390-77-9781 744-30-0499 435-02-2521 820-65-4438 211-02-9333 756-41-9393 241-86-3823 908-76-1846 924-59-1581 669-39-4544 884-27-5089 376-25-7809 378-83-7998 758-72-4033 600-05-9780 918-32-8454

06/03/70 05/04/60 08/24/42 11/12/32 08/13/34 05/14/71 07/03/59 09/17/60 05/12/31 10/05/33 03/05/62 11/02/27 11/02/7411/02/74 11/07/7011/07/70 07/10/5807/10/58 03/22/5403/22/5403/22/54

A BA B C DC D E FE F G HG H I

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-34 Chapter 18 Importing Data into Excel

for a few of the customers. This would explain the abnormally small values. (It would also explain why these outliers are all at about the same height in the plot.) If you can locate these outliers in the data set, you can multiply each by the corresponding number of purchases (if your educated guess is correct). How do you locate them in the data set? First, sort on Amount Spent, then sort on Purchases. This will arrange the amounts spent in increasing order for each value of Purchases. Then, using the scatterplot as a guide, scroll through each value of Purchases (starting with 2) and locate the abnormally low values of Amount Spent (which are all together). For example, Figure 18.42 indicates the suspicious values of Amount Spent when three purchases were made. This procedure is a bit tedious, but it is better than working with invalid data. ■

Figure 18.40 Separating Rows with Missing Data from the Rest

1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 1502

1427

1144 287

1298 375 250 14

1106 1121 153 980

1061 858 432

1438 1125 469 443 317

182-48-9138

211-02-9333 133-53-5943 552-06-0509 867-63-6238 586-87-0627 614-59-6703 102-74-2447 637-23-3846 048-55-8930 967-97-4228 377-29-0406 819-34-4450 572-79-9529 452-69-6883 394-20-9464 797-55-3419 087-21-2053 865-85-3875

05/18/40

08/13/34 09/22/35 10/12/37 09/17/71 06/24/52 08/01/72 03/14/30 06/14/54 09/05/34 07/04/63 10/08/5110/08/51 05/26/5905/26/59 01/21/6701/21/67 01/16/7401/16/74 10/20/7510/20/7510/20/75 09/16/6109/16/61 07/02/5207/02/52 12/19/3112/19/3112/19/31

58

64 63 61 27 46 26 69 44 64 35 47 39 32 25 23 37 46 67

East

North North North West East

South West South West South West South West South North North West South

0

0 1 0 0 1 1 0 0 1 1 1 1 1 0 1 1 0 0

105000

71 20000 23700 29900 53300 54400 59300 64000 64400 76800 93000

101300 104500 116400 129400 132800 141200 149900

9

9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999

4450

9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999 9999

A BA B C DC D E FE F G HG H I

© C

e n g

a g

e L

e a rn

in g

Figure 18.41 Scatterplot with Suspicious Outliers

5000

4500

4000

3500

3000

A m

o u

n t

Sp en

t

2500

2000

1500

1000

500

0 0 2 4 6

Purchases

Amount Spent vs Purchases

8 10

© C

e n g

a g

e L

e a rn

in g

Figure 18.42 Suspicious Values of Amount Spent

642 643 644 645 646 647 648 649 650 651 652

777 259 121 109

1469 1331 1313 501 936 921 294

820-27-6346 731-52-6832 345-16-5545 280-07-3023 719-98-9028 745-63-6259 041-74-0192 156-39-5201 261-74-3204 601-98-9218 728-06-3395

07/04/36 02/05/51 07/08/59 08/04/43 03/15/69 07/22/58 12/04/59 08/15/38 10/01/37 05/06/38 07/12/6607/12/66

62 48 39 55 30 40 39 60 61 60 32

West East West West North South East East West South West

0 1 1 0 1 0 0 0 0 1 0

155000 41700

112700 24300 91300 63700 25900

111000 65000

131000 159800

2 3 3 3 3 3 3 3 3 3 3

A BA B C DC D E FE F G HG H I 1180

450 450 460 470 480 510 540 590

1260 1300 ©

C e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18.6 Conclusion 18-35

P R O B L E M S

Level A 24. The file P18_24.xlsx contains a data set that represents

30 responses from a questionnaire concerning the president’s environmental policies. Each observation lists the person’s age, gender, state of residence, number of children, annual salary, and opinion of the president’s environmental policies. Check for bad or suspicious values and change them appropriately.

25. The file P18_25.xlsx contains the following data on movie stars: the name of each star, the star’s gender, domestic gross (average domestic gross of the star’s last few movies), foreign gross (average foreign gross of the star’s last few movies), and income (current amount the star asks for a movie). Check for bad or suspicious values (including names) and change them appropriately.

26. The file P18_26.xlsx contains data on a bank’s employees. Check for bad or suspicious values and change them appropriately.

27. The file P18_27.xlsx contains data on 500 randomly selected households. Check for bad or suspicious values and change them appropriately.

Level B 28. The file P18_28.xlsx contains data imported

into Excel from Microsoft’s famous Northwind database. There are worksheets for the company’s

customers, products, product categories, and transactions. Each transaction is for a product purchased by a customer, but if a customer purchases multiple products at the same time, there are several corresponding rows in the Transactions table, one for each product purchased. The ID columns allow you to look up names of customers, products, and product categories. However, some of the IDs in the Transactions sheet have purposely been corrupted. There can be three reasons. First, an ID in the Transactions sheet might not correspond to any customer, product, or product category. Second, because each order is by a single customer, a given OrderID should correspond to only one CustomerID. Third, a given product ID should always correspond to the same product category ID. Besides the corrupted IDs, there is one other potential type of error, concerning dates. Shipping dates can be blank (for orders that haven’t yet shipped), but they shouldn’t be before the corresponding order dates. Find all corrupted IDs and shipping dates in the Transactions sheet. Highlight all bad data in yellow. You don’t need to change them (because in most cases there is no way of knowing the correct values).

18.6 CONCLUSION This chapter has covered some very powerful tools for importing data into Excel. As with many other features of Excel, the tools we have discussed are fairly easy to use—once you know that they exist. We believe that once you know that something can be done and have a general idea of how to do it, you can �gure out the details. Indeed, as the software changes, you will be forced to learn the details on your own through experimenting and consulting online help. Therefore, as you look back on this chapter, focus more on what can be done, not the details. It is possible to import data into Excel from text �les. It is possible to create queries in Microsoft Query so that data from database packages can be imported into Excel. It is even possible to import Web data into Excel by various methods. Once you realize these possibilities, you will be able to accomplish tasks that many Excel users have never even tried.

Again, cleansing data typically involves careful detective work and some common sense. The bad news is that it is tedious yet often necessary. The good news is that you can use the powerful Excel tools we have discussed to search for suspicious data values and then �x them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-36 Chapter 18 Importing Data into Excel

Summary of Key Terms

Term Explanation Excel Page

Text file (or ASCII file)

Data file that can be read by any text editor, such as Notepad

18-4

Query Instruction to a database to return a subset of the data that satisfies specified conditions

18-5

Fixed-width file Text file where each variable starts in a specified column

18-9

Delimited file Text file where values are separated by a delimiter character (usually a tab, comma, semicolon, or space)

18-9

Power Query A new set of tools for querying a wide variety of data sources

The Get & Transform group in the Data ribbon in Excel 2016

18-16

Microsoft Query Software packaged with Office to import database data into Excel

From Microsoft Query, under From Other Sources on the Data ribbon

18-18

SQL Structured query language, a concise language used to specify database queries

18-26

Web query A method for importing tables from selected Web pages into Excel

From Web on the Data ribbon 18-26

Cleansing data Process of removing errors from a data set 18-28

P R O B L E M S

Conceptual Questions C.1. Consider a data set with monthly data on some

variable. The data are arranged so that there is a column for each month, Jan to Dec, and a row for each year. Is it possible to create a single time series chart on month–year values when the data are arranged this way? If not, what format is required?

C.2. Why is data stored so often in “plain vanilla” text files? After all, a text editor like Notepad has virtually no tools for analysis.

C.3. Suppose you have data such as in the Shirt Orders database. How could this data be stored in an Excel file? Would anything be lost? In general, what is the advantage of storing such data in a database package such as Access rather than in Excel?

C.4. Continuing the previous question, if there is an advantage of storing this type of data in Access, why should you bother importing it into Excel?

C.5. What is the advantage of using SQL for queries? (Although you might not know SQL at this point, virtually all database analysts know it and use it often.)

C.6. If you find data of interest on a website, discuss the If you find data of interest on a website, discuss the If you f options for importing it into Excel for analysis. Why isn’t there a single method that always works? Do you think there ever will be such a method?

C.7. Suppose that you are given a data set in Excel, but because of the source, you suspect that it has some bad data. What tools would you typically use, and how would you use them, to find the bad data? Even if you find the bad data, why might you not be able to change the values appropriately?

L ev el A 29. The file The file The f P18_29.txt contains yearly data on the P18_29.txt contains yearly data on the P18_29.txt

projected population growth rate for several countries. Import this data into Excel, change the labels in the first row so that only the country name remains, and create a time series chart for your choice of countries. Due to missing data, delete all years before 1991. Make sure the data are in chronological order, starting with the ear- liest date (1991). Save the results in an Excel (.xlsx) file.liest date (1991). Save the results in an Excel (.xlsx) file.liest date (1991). Sa

30. Sometimes the data you find on the Web is embedded Sometimes the data you find on the Web is embedded Sometimes the data you f in a Word document. For example, the file P18_30.docx

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18.6 Conclusion 18-37

contains an air traffic report from June 2009, including a number of tables. Table 3 of the report lists data about on-time arrivals by airport and time of day. Can you import this data into Excel?

31. The Organisation for Economic Co-operation and Development (OECD) website http://stats.oecd. org/index.aspx has a wealth of economic data. For example, under Monthly Economic Indicators, find International Trade Indicators. Choose the data for Germany and import it into Excel. If you like, experiment with some of the many options at this site for filtering the data. The tools are pretty amazing.

Problems 32–35 (and 42 in the Level B section) are based on the file School Schedule.mdb. Open this file in Access, click on Database Tools and select Relationships to see the relationships diagram. Essentially, students at a university take sections of courses. The sections are in various buildings, and the courses are in various departments. The Student_ Schedules table is for the many-to-many relationship between students and sections: one student can take multiple sections, and a given section contains multiple students.

32. Create an appropriate query that returns the course code, course name, course description, category, and department of all courses in the database, and then return the data to Excel as a table.

33. Create an appropriate query that returns a list of all students in all sections. Specifically, it should return the student’s first and last name, the course name, the section number, and the student’s grade in the section. Return the data to Excel as a table. Then, inside the table, create a new column that is a con- catenation of first name and last name, and create a pivot table that allows you to find the average grade for each student.

34. Create an appropriate query and return the results to Excel as a pivot table. The pivot table should allow you to choose a building name (from the Filters area or a slicer) and see the number of sections that meet in each room of that building.

35. Create an appropriate query and return the results to Excel as a pivot table. The pivot table should allow you to choose a department name (from the Filters area or a slicer) and see the number of courses given by that department in each category. (Note that some categories aren’t given by some departments.)

Problems 36–38 (and 43–44 in the Level B sec- tion) are based on the file Northwind.mdb. Open this file in Access, click Database Tools, and select Relationships to see the relationships diagram. Orders at Northwind are taken by employees from customers for products supplied by suppliers, and the

orders are shipped by shippers. The Order Details table is required because one order can be for several products.

36. Create an appropriate query that lists the company names of all of Northwind’s customers and their countries. Return the results to Excel as a table. Then build a pivot table from this table that allows you to count customers by country.

37. Create an appropriate query that lists the first and last names of each employee and the person, if any, that employee reports to. (Hints: This is a case where the Employees table includes a primary key, EmployeeID, and a foreign key, Reports to, to itself. Bring back both in your query and then use a VLOOKUP in the results to find the first and last name of the employee’s supervisor, if any.)

38. Create an appropriate query that returns the follow- ing information for all products that have not been discontinued: product name, product category name, unit price, units in stock, and units on order. The query should filter out all discontinued products before they are returned to Excel. Return the results as an Excel table. Then create another table right next to it with a similar query, but this time ask only for the prod- uct name and category of all discontinued products. discontinued products. discontinued (Note that the Discontinued field is 1 for discontinued products, 0 for others.)

Problems 39–40 (and 45–46 in the Level B section) are based on the file Classical CDs.mdb. Open this file in Access, click on Database Tools and select Relationships to see the relationships diagram. This is the attempt by one of the authors to capture his rather large classical music collection in a database. Each record in the CDs table corresponds to one CD “album.” (Usually it’s a single CD, but some come in sets.) The large CDs_Works table contains a record for each work on each CD. There are links to the musicians playing the work, which could include an orchestra, a chamber group, a choral group, a conductor, and/or one or more artists (such as pianists). The Works table has a record for every work (piece of music) in the collection, with a link to the composer. If you open one of the tables with foreign keys in Access, such as the Artists table with a foreign key to the Instruments table, you will see the names of the instruments. This is a lookup trick that is possible in Access. Even though you might see Piano, only the foreign key (6 for Piano) is stored in the Artists table. The implication is that if you want a list of artists and their instruments, as in the next problem, you will need both the Artists and Instruments tables in the query.

39. Create an appropriate query to find the names of all artists and the instruments they play. Return the data

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

18-38 Chapter 18 Importing Data into Excel

into an Excel table. Then create a pivot table from this table and use it to find a list of all pianists.

40. Create an appropriate query to find the titles of all works in the collection and the corresponding com- poser names. Return the data as a pivot table. Then use the pivot table to find all of the works by Beethoven, Ludwig van. (The database stores names like this one in a single field. It doesn’t separate names into first name and last name fields.)

Level B 41. The file P18_41.txt contains yearly data on the num-

ber and percentage of people without health insurance by state. Try importing this data into Excel. What goes wrong with the first row, which should be a single row of variable names? Can you fix this by modifying the text file and then importing into Excel? Or is it easier to fix it in Excel? Do it the way you think is easier. Then shorten the variable names in Excel to something like Ohio Uninsured and Ohio Uninsured Pct. Save the results as an Excel (.xlsx) file.

42. (Based on the School Schedule database) Create an appropriate query that enables you to determine, for each student, how many classes the student has each day of the week. Note that the Class_Sections table has flags for each day of the week to indicate the days each section meets. You can ignore the Saturday flag because no classes meet on Saturday.

43. (Based on the Northwind database) Create an appropriate query and return it as a pivot table. This pivot table should allow you to see the number of orders shipped by each shipper during each month. For example, you should find that the shipped date was July 1997 for 13 orders shipped by Speedy Express. (Note: Microsoft Query recognizes primary key–foreign key relationships if the primary key and if the primary key and if foreign key have the same name. However, it doesn’t recognize the relationship in this case because the pri- mary key is ShipperID and the foreign key is ShipVia. Therefore, you must drag a link between these two in the top pane of the Microsoft Query screen.)

44. (Based on the Northwind database(Based on the Northwind database( ) Create an appropriate query that allows you to see the total revenue broken down by any of product name, product category, month-year of order date, or customer. Here revenue is defined as UnitPrice*Quantity*(1-Discount), where these fields all come from the Order Details table. You can do this in either of two ways. First, you can return all of the data as a table, then use an Excel formula to calculate revenue for each row, and finally use a pivot

table to get the desired results. Second, you can create a calculated field Revenue in Microsoft Query and return the results as a pivot table. (The latter is actually preferable because a pivot table takes up less room in Excel. Imagine if there were millions of rows in the Order Details table. They wouldn’t fit in Excel if you tried to bring them in as a table, but this isn’t a problem with a pivot table.)

45. (Based on the Classical CDs database) Create an appropriate query to find all of the works conducted by Bernstein, Leonard. (Use a filter for the conductor.) Return the data as a table to Excel. The table should include the name of the work, the orchestra, the title/ description of the CD, and the CD’s label. (There is no need to return the name of the conductor. If you filter correctly, it will always be Bernstein, Leonard.)

46. (Based on the Classical CDs database(Based on the Classical CDs database( ) Create a query to find the following fields: Artist from Artists, Composer from Composers, Conductor from Conductors, Orchestra from Orchestras, and Title from Works. Return this to Excel as a pivot table. Then use the pivot table to find a list of all works by Chopin, Frederic. The collection has hundreds of works by Chopin. Why are you seeing only a few of these in the pivot table? What could you do differently to see all of them?

47. The file Foodmart.mdb contains many transactions at a supermarket chain. Open this file in Access, click on Database Tools and select Relationships to see the relationships diagram. This type of relationship diagram is called a “star schema.” The Facts table includes a record for each line item purchased by any customer at any store on any date. The other tables are called “dimensions” that facts can be broken down by. This type of database is set up perfectly for pivot tables, where you can break down facts (Revenue or UnitsSold) by dimensions. In Microsoft Query, develop a query that uses all of the tables. It should have the following fields: Revenue and ItemsSold from Facts; all fields except DateID from Dates; all fields except ProductID from Products; City, Region, StateProvince, Country, MaritalStatus, and Gender from Customers; and City, Region, StateProvince, and Country from Stores. Note that City, Region, StateProvince, and Country have the same names in the Customers and Stores tables, which can be confusing. Therefore, for each of these, use the Add Column menu item from the Records menu to select these fields and give them names like Customer City and Store City. Return the data to a pivot table in Excel. Then create an interest- ing pivot table, where you break down Revenue or ItemsSold by any of the various dimensions.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 18.1 EDUTOYS, INC.

EduToys, Inc., sells a wide variety of educational toy products to its customers through its website. Jeannie Dobson, director of information services at EduToys, recently developed a relational database to store critical information that the management team needs to more effectively serve EduToys’ customers. The database, which is provided in the file C18_01. mdb, consists of five related tables: Company, Customer, Inventory, Orders, and Toys.

The Company table consists of the following information on each of the 159 companies that manufacture and supply products to EduToys: identification number, name, and telephone number. The Customer table maintains the following data on each of the 307 customers who purchased at least one item from EduToys’s online store during the first 10 months of operation ( January–October 1998): identification number, last name, first name, age, gender, street address, city, state, zip code, and telephone number. The Inventory table consists of the following information on each of the 201 products that EduToys purchases from its various suppliers: identification number, name, quantity in current inventory, quantity on order, and expected delivery date of order. The Orders table records the following information for each of the customer transactions that took place during the first 10 months of 1998: transaction identification number, date, customer identification number, customer credit card number, product identification number, and quantity purchased. Finally, the Toys table maintains the following data on each of the products sold by EduToys: product identification number, company (i.e., supplier) identification number, product name, type of product, appropriate age group for product, unit price, and detailed product description.

As part of your internship with EduToys, you have been asked by your supervisor to prepare a report that responds to the following questions. Your supervisor encourages you to make extensive use of the database in completing this assignment. Also, she wants you to retain copies of all Excel spreadsheets that you prepare to generate the needed information.

Questions 1. How do EduToys’s past customers break down Toys’s past customers break down T

by age and gender?

2. Which of EduToys’s past customers have Toys’s past customers have T spent amounts that fall in the top 20% of all transactions (as measured in dollars)? Report the first name, last name, street address, city, state, and zip code for each of these customers.

3. Which products have generated sales revenues (in dollars) that fall in the top 25% of all such revenue contributions? Report the current inven- tory level, quantity on order, and supplier of each of these best-selling products.

4. How do the given 1998 sales (in dollars) break down by product type and product age group?

5. What proportion of all given transactions were conducted through the use of each type of credit card (including American Express, Discover, MasterCard, and Visa)?

6. What changes or additions would you recommend making to the present database? Provide the reasoning behind each of your recommendations.

Case 18.1 EduToys, Inc. 18-39 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-1

USING CONTROLLED EXPERIMENTS IN BUSINESS

Can statistical principles and careful experimentation lead to improved products and lower costs? They certainly can, argues Rita Koselka in the article “The New Mantra: MVT” in Forbes magazine [Roselka (1996)]. Most products are a result of several controllable inputs. The question is, Which combination of input settings results in the best quality and lowest cost? This is where experimentation enters the picture. For years, companies experimented (if they experimented at all) by changing the level of one input at a time. This one-at-a-time method of experimentation is not only costly and time- consuming, but it often fails to identify the best combination of input settings. As we will discuss in Section 19-5, the input factors often interact, so that the best setting of one factor might depend on the settings of other factors, and one-at-a-time testing will probably not discover this fact. A better alternative is to test multiple factors simultaneously. This is called multiple variable testing, or MVT, and it is quickly becoming regarded as one of the most important statistical techniques for product improvement. If you have never heard of MVT, you probably will. It is a natural outgrowth of the quality control movement that has been so pervasive in the past two decades. As the article states, “It [MVT] doesn’t just tell you how to raise the quality of your output. It tells you how to do that cost-effectively.”

The potential improvements with MVT can occur in traditional manufacturing and service industries. The following are several examples discussed in the article.

■ Several years ago a subsidiary of Raychem Corp. called Elo TouchSystems was losing $3 million annually making touch-sensitive computer screens for products like automatic teller machines. The problem was a bubbling between the screen and the coating, and it resulted in a disastrous

Analysis of Variance and Experimental Design

C H A P T E R

19

To m

S te

w a rt

/C o rb

is /G

lo w

I m

a g

e s,

I n c .

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 Chapter 19 Analysis of Variance and Experimental Design

25% reject rate. Raychem had spent 18 months on quality improvement efforts, but they hadn’t worked. Then the company hired statistical consultants who experimented with MVT. Their solution, which would never have surfaced with one-at-a-time testing, was to change three things at the same time: the type of polyester, the coversheet shaping process, and the adhesive. Within months, the reject rate had decreased to less than 1%, many fewer quality inspectors were required, and the company was breaking even. After the changes, it began making $15 million on $50 million in sales.

■ For years, Boise Cascade had been experimenting, with limited success, with small variations in its pulping process at a Louisiana paper mill. After using MVT with eight variables, it came to the counterintuitive conclusion that the mill could maintain its paper quality while switching to a cheaper grade of wood. The result was paper of at least as high a quality level and a savings of $3 million per year.

■ Saint Luke’s Hospital in Kansas City was concerned about the misuse of warfarin, an anti-bloodclotting drug that can be fatal if used improperly. In 1992 the hospital worked with statistical consultants to experiment with ways to keep patients from misusing the drug. They tested seven variables to better educate patients and provide emergency access to nurses. They found that having a standardized instruction sheet and having the pharmacist discuss the drug with patients yielded a 68% improvement in patient understanding of how to use the drug appropriately.

■ A shoe company selling sneakers in over 100 stores was considering a proposal to increase sales with a costly, high-tech display. Before doing so, it hired statistical consultants, who persuaded the company to experiment with a whole range of possible changes: in sales techniques, advertising, separation of shoes by color, and various discounts, as well as the displays. The �ndings were surprising. Although the new display had the potential to increase sales, its impact would not be nearly as great as a simple combination of using the old display case and arranging the shoes by color. Using this suggestion, the company did not spend money on new displays, and it was still able to increase sales by 33%.

MVT is not a new scientific method. Statisticians have studied and applied experimental designs for years, particularly in the physical sciences. However, it is relatively new to business. For the most part, the well-known strategic consultants and the big accounting firms have been strangers to MVT. Fortunately, this is changing. For example, experimental design is now being taught formally at Motorola University in Illinois. As Roselka concludes, “The design of experiments involves some cleverness. It may cost a lot of money to shut down a production line and rearrange it; it may take precious months for a billing department or a mail-order operation to see whether a novel way of doing things will pay off. MVT is the science of gleaning the most amount of information from the least amount of costly testing.” ■

19-1 INTRODUCTION One of the most frequent applications of statistics is the comparison of several populations on some characteristic. We discussed the simplest version of this comparison problem in Chapters 8 and 9 when we discussed the two-sample procedure for analyzing the difference between two population means. A natural extension is to more than two population means, which is the topic of this chapter. The resulting procedure is commonly called analysis of variance, or ANOVA.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-1 Introduction 19-3

There are two typical situations where ANOVA is used. The �rst is when there are several distinct populations. For example, consider recent graduates with BS degrees in one of three disciplines: Business, Engineering, and Computer Science. We might sample ran- domly from each of these populations to discover whether there are any signi�cant differ- ences among them with respect to mean starting salary. A second situation where ANOVA is used is in randomized experiments. In this case a single population is treated in one of several ways. For example, a pharmaceutical company might select a group of people who suffer from allergies and randomly assign each person to a different type of allergy medi- cine currently being developed. Then the question is whether any of the treatments differ from one another with respect to the mean amount of symptom relief.

These two examples illustrate two basic situations where ANOVA is used. The com- parison of recent graduates is called an observational study. In this case we analyze the data that are already available to us, that is, the starting salaries of recent graduates from the three disciplines. Unfortunately we don’t �rst get to choose which students should major in which disciplines. It might be nice to do so because it would help to rule out other pos- sible causes besides discipline, such as unequal academic abilities, that might affect start- ing salaries. But we don’t get to make these choices. The students themselves choose their disciplines, and all we can do is analyze the resulting data on starting salaries.

In an observational study, we analyze data already available to us. The disadvantage is that it is dif�cult or impossible to rule out factors over which we have no control for the effects we observe.

In contrast, the allergy example illustrates a designed experiment. The researchers in this example are interested in whether different allergy medicines cause different amounts of symptom relief. Therefore, they will select the subjects for the experiment so that the subjects receiving one allergy medicine are as much alike, in every characteristic that might matter—age, medical history, gender mix, and so on—as the subjects receiving any other allergy medicine. In this way, if there are any differences across groups with respect to symptom relief, the researchers will be able to attribute the differences to the types of medicine, not some extraneous factor.

In a designed experiment, we control for various factors such as age, gender, or socioeconomic status so that we can learn more precisely what is responsible for the effects we observe.

It should be clear from this discussion that designed experiments are generally prefer- able to observational studies. In a carefully designed experiment, where we can “control for” extraneous factors such as age or gender that are not of direct interest, we can be fairly sure that any differences across groups with respect to some measurement variable are due to the variables that we purposely manipulate. This ability to infer causal relationships is never possible with observational studies. For example, if recent Business graduates are found to make more, on average, than Computer Science graduates, we can never be sure whether this is a result of being a Business graduate rather than a Computer Science gradu- ate or whether, say, it is due to the fact that the Business graduates in our study have more work experience than the Computer Science graduates. We didn’t control for work experi- ence, so we cannot rule out the possibility that it might have had an effect.

ANOVA has been used in many disciplines. In fact, it began in agricultural studies, where researchers wanted to learn, for example, which types of wheat produce the great- est yield per acre. Because the results from such an experiment can take many months to obtain, the agricultural researchers had to design their experiments very carefully, so that

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-4 Chapter 19 Analysis of Variance and Experimental Design

they could obtain the most information from the resulting data. This idea of obtaining the most useful information from a limited amount of data continues to be crucial in ANOVA studies and has spawned a whole area of scienti�c research called experimental design. The essential goal of experimental design is to decide which observations to make, given a limited budget (in time and/or money), to maximize the chances of seeing differences across groups that actually exist. For example, the allergy researchers want to design their experiment so that if there really are differences across medicine types, the analysis will have a good chance of detecting them.

Experimental design is the science (and art) of setting up an experiment so that the most information can be obtained for the time and money involved.

We will concentrate on the most common and basic experimental designs in this chapter, leaving more complex designs to specialized books. However, because our audi- ence is mostly business students, it is important to note that the use of designed experi- ments in business situations is probably less prevalent than in, say, medicine or agriculture. Business managers do not always have the luxury of being able to design a controlled experiment for obtaining data. Instead, they often have to rely on whatever data are avail- able, that is, observational data. Nevertheless, as the introductory vignette to this chapter attests, there are many potentially pro�table uses of experimental design in the business world, and many companies are beginning to use designed experiments for competitive advantage.

Before proceeding, there is some general terminology we should introduce. In all of our examples, there is a variable of primary interest that we wish to measure. It is called the dependent variable (or sometimes the response or criterion variable) and is the variable we measure to detect differences among groups. The groups themselves are deter- mined by one or more factors (sometimes called independent or explanatory variables), each varied at several treatment levels (often shortened to levels). The number of factors determines the type of ANOVA. If there is a single factor, the procedure is called one-way ANOVA; if there are two factors, it is called two-way ANOVA; if there are three factors, it is called three-way ANOVA; and so on. The only types we will discuss in this book are the two most common types, one-way and two-way ANOVA. It is best to think of a factor as a categorical variable, with the possible categories being its levels. Finally, the “entities” measured at each treatment level (or combination of levels) are called experimental units. Some examples will help to clarify this terminology.

In one-way ANOVA, a single dependent variable is measured at various levels of a single factor. Each experimental unit is assigned to one of these levels. In two-way ANOVA, a single dependent variable is measured at various combinations of the levels of two factors. Each experimental unit is assigned to one of these combinations of levels.

Consider the observational study on graduates of Business, Engineering, and Computer Science. The dependent variable is starting salary, the experimental units are the individual graduates, and the single factor is the student’s major discipline. This factor has three levels: Business, Engineering, and Computer Science, and each student is “assigned” to one of these levels. If we also wanted to see how gender affects starting salary, we could introduce a second factor, gender, at the two levels “male” and “female.” Then each student would be “assigned” to one of the combinations of levels, such as a female in Business.

For the study on allergy medicines, the dependent variable is the amount of relief from allergy symptoms, the experimental units are the individual patients, and the single factor

It is no coincidence that some of this terminology is the same as that used in regression analysis. We will see why later in this chapter, when we investigate the relationship between ANOVA and regression.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-5

is medicine type. Its levels are the various types of medicines used in the experiment. Each patient in the experiment receives exactly one of these types of medicine. We could also introduce a second factor here. For example, if we purposely wanted to see whether age has an effect on the dependent variable (or on which medicine type is most effective), we could introduce a second factor, age, with levels such as 5 to 20, 20 to 35, 35 to 50, and 50 or older. Then each patient would be at some combination of the two factors, such as a person 20 to 35 years old receiving the second type of medicine.

Although the experimental units in both of these two examples are people, this is not always the case. Suppose a company wants to see whether �ve different shelf layouts for its product lead to different levels of sales. The company could choose a sample of 50 super- markets that sell its product, try the �rst layout in 10 of them, the second layout in another 10, and so on. Then the dependent variable is sales level, the single factor is shelf layout, varied at �ve levels, and the experimental units are the 50 supermarkets. Note that in this example, each of the experimental units, that is, each supermarket, is chosen (probably in some random way) to “receive” one of the �ve treatments and each treatment is applied to a separate subset of 10 supermarkets. When there are an equal number of experimental units assigned to each treatment level (or combination of levels, for a two-factor or multi-factor design), this is called a balanced design. Balanced designs are somewhat easier to analyze, and we prefer them whenever possible. In fact, the only two-factor design we will discuss in this book is a balanced design.

In a balanced design, an equal number of experimental units is assigned to each combination of treatment levels.

19-2 ONE-WAY ANOVA We begin our discussion with the simplest design to analyze, the one-factor design. As discussed in the introduction, there are basically two situations. First, the data could be observational data, in which case the levels of the single factor might best be considered as “subpopulations” of an overall population—graduates of Business, Engineering, and Computer Science, for example. Second, the data could be generated from a designed experiment, where a single population of experimental units, allergy patients, say, is treated by different types of allergy medicine. Fortunately, the data analysis is basically the same in either case. We normally ask two questions. First, are there any signi�cant differences in the mean of the dependent variable across the different groups? If the answer to this question is “yes,” then we typically ask the second question: Which of the groups differs signi�cantly from which others, again with respect to the mean of the dependent variable?

19-2a The Equal-Means Test

We set up the �rst question as a hypothesis test. Let J be the number of levels of the single factor, and let μjμjμ be the mean of the dependent variable for level j. (As usual, this Greek letter is used as a “population” mean, the mean of the dependent variable if all experimenall experimenall - tal units received treatment level j.) The null hypothesis is that there are no differences in population means across treatment levels:

H0H0H : μ1 = μ2 = . . . = μJ The alternative is then the opposite, namely, that at least one pair of μ’s are not equal. If we can reject this null hypothesis at some typical level of signi�cance (usually the 5% or 10% level), then we hunt further to see which means are different from which others. To do this, we typically calculate con�dence intervals for differences between pairs of means and see which of these con�dence intervals do not include zero. For example, if the con�dence not include zero. For example, if the con�dence not

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 Chapter 19 Analysis of Variance and Experimental Design

interval for the difference μ2 − μ4 extends from 5.35 to 9.31, we would conclude that μ2 and μ4 are not equal (and that not equal (and that not μ2 is in fact larger than μ4).

This is the general plan. Now we will see how to put it into action. First, we ask an obvious question: If ANOVA is basically a test of differences between means, why is it called analysis of variance and not analysis of means? The answer to this question is the key to the procedure. Consider the box plot in Figure 19.1. It corresponds to observa- tions from four treatment levels with slightly different means and fairly large variances. (The large variances are indicated by the relatively wide boxes and long lines extending from them.) From these box plots, would you conclude that the population means differ across the four treatment levels? Would your answer change if the data were instead as in Figure 19.2?1 across the four treatment levels? Would your answer change if the data were instead as in

1 across the four treatment levels? Would your answer change if the data were instead as in

We expect that it would.

1Note that we keep the horizontal scale the same in both charts for a fair comparison.

0 20 40 60 80

Level = 1

Level = 2

Level = 3

Level = 4

100 120

Box-Whisker Plot of Comparison of Y/Low Varia�on Data

*

*

*

*

*

Figure 19.2 Samples with Small Within Variation

0 20 40 60 80

Level = 1

Level = 2

Level = 3

Level = 4

100 120

Box-Whisker Plot of Comparison of Y/High Varia�on Data

*

*

*

*

Figure 19.1 Samples with Large Within Variation

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-7

The sample means in these two �gures are virtually the same, but the variation within each treatment level in Figure 19.1 is quite large relative to the variation between the sample means. In contrast, there is very little variation within each treatment level in Figure 19.2. In the �rst case, the large “within” variation makes it dif�cult to infer whether there are really any differences across population means, whereas the small “within” variation in the second case makes it clearer that differences across population means probably exist.

This is the essence of the ANOVA procedure. We compare variation within the indi- vidual treatment levels to variation between the sample means. Only if the between varia- tion is large relative to the within variation can we conclude with any assurance that there are differences across population means—and reject the equal-means hypothesis.

The test itself is based on two assumptions: (1) The population variances are all equal to some common variance σ2, and (2) the populations are normally distributed. These are analogous to the assumptions we made for the two-sample procedures in Chapters 8 and 9. Although these assumptions are never satis�ed exactly in any real application, you should keep them in mind and check for gross violations whenever possible. Fortunately, the test we present is fairly robust to violations of these assumptions, particularly when the sample sizes are large and roughly the same.

To run the test, let YjYjY , s 2 jsjs , and njnjn be the sample mean, sample variance, and sample size

from treatment level j. Also, let n and Y be the sample mean, sample variance, and sample size

be the combined number of observations and the sample mean of all n observations. (Y is called the grand mean.) Then a measure of the between variance is MSB (mean square between), given in Equation (19.1). Note that MSB is large if the individual sample means differ substantially from the grand mean Y

(mean square between), given in Equation (19.1). Note that , and this

occurs only if they differ substantially from one another.

A robust test is one in which the conclusions are approximately valid even when the assumptions behind it are violated to some extent.

Measure of Between Variation

MSMSM BSBS = oJj = 1 njnjn (YjYjY − Y )

2

J − 1 (19.1)

Measure of Within Variation

MSMSM W = oJj = 1 (njnjn − 1)s

2 jsjs

n − J (19.2)

A measure of the within variance is MSW (mean square within), given in Equation (19.2). MSW (mean square within), given in Equation (19.2). MSW This value is really just a weighted average of the individual sample variances, where the sample variance s2jsjs receives weight (njnjn − 1)/(n − J)J)J . In fact, MSW is the average of the MSW is the average of the MSW sample variances if the sample sizes, the njnjn ’s, are equal. In this sense, MSW is a pooled MSW is a pooled MSW estimate of the (assumed) common variance σ2, just as in the two-sample procedures from Chapters 8 and 9. Therefore, MSW is large if the individual sample variances are large. For MSW is large if the individual sample variances are large. For MSW example, MSW is much larger in Figure 19.1 than in Figure 19.2. However, MSW is much larger in Figure 19.1 than in Figure 19.2. However, MSW MSB is about the same in both �gures.

The numerators of Equations (19.1) and (19.2) are called sums of squares (often labeled SSB and SSW), and the denominators are called SSW), and the denominators are called SSW degrees of freedom (often labeled dfB and dfW). As you will see, they are always reported in ANOVA output. Finally, the ratio dfW). As you will see, they are always reported in ANOVA output. Finally, the ratio dfW of the mean squares is the test statistic we use, the F-ratio in Equation (19.3). Under the null hypothesis of equal population means, this test statistic has an F distribution with dfB and dfW degrees of freedom. If the null hypothesis is dfW degrees of freedom. If the null hypothesis is dfW not true, then you would expect not true, then you would expect not MSB to be large relative to MSW, as in Figure 19.2. Therefore, the MSW, as in Figure 19.2. Therefore, the MSW p-value for the test is found by �nding the probability to the right of the right of the right F-ratio in the F distribution with dfB and dfW degrees of freedom.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-8 Chapter 19 Analysis of Variance and Experimental Design

The elements of this test are usually presented in an ANOVA table, as you will see shortly. The “bottom line” in this table is the p-value for the F-ratio. If the p-value is suf--value is suf--value is suf �ciently small, you can conclude that the population means are not all equal. Otherwise, you cannot reject the equal-means hypothesis.

19-2b Confidence Intervals for Differences between Means

If you cannot reject the equal-means hypothesis, then there is little incentive to examine differences between individual pairs of means. However, if you can reject the equal-means hypothesis, then it is customary to form con�dence intervals for the differences between pairs of population means. This can lead to quite a few con�dence intervals. For example, if there are J = 5 treatment levels, then there are 10 pairs of differences (the number of ways 2 means can be chosen from a total of 5 means). The con�dence interval for any difference μi − μjμjμ is of the form shown in Expression (19.4).

Confidence Interval for Difference Between Means

YiYiY − YjYjY ± multiplier × "M"M" SMSM W(1/ni + 1/njnjn )" (19.4)

E X A M P L E 19.1 THE EFFECT OF SHELF HEIGHT ON CEREAL SALES

Does it matter which shelf a popular brand is placed on? It certainly might, because we tend to purchase items that are easiest to see. To test this, suppose that Midway is a large chain of supermarket stores with many stores in many locations. Midway selects 125 of these stores for an experiment. Specifically, it selects these particular 125 stores to be as alike as possible, so that store size, amount of customer traffic, types of customers, and other characteristics are as similar across stores as possible. Each store stocks cereal in a similar location in the store on five-shelf displays. In the experiment, 25 randomly selected stores place a particular popular brand of cereal—we’ll call it Brand X—on the lowest shelf for a month. Another randomly selected 25 stores place Brand X on the next- to-lowest shelf, another 25 place it on the middle shelf, another 25 place it on the next- to-highest shelf, and the final 25 place it on the highest shelf. Then the number of boxes of Brand X sold is recorded at each of the stores for the last two weeks of the experi- ment. (The first two weeks allow customers to get used to the shelving arrangement.) The resulting data are in the file Cereal Sales.xlsx, as shown in Figure 19.3 (with some rows hidden). Does shelf height appear to make a difference in sales?

F-ratio for ANOVA Test

F-ratio = MSMSM BSBS MSMSM W

(19.3)

As we will discuss in Section 19-4, there are several possibilities for the appropriate multiplier in this expression. Regardless of the multiplier, however, you are always looking for con�dence intervals that do not include not include not 0. If the con�dence interval for μi − μjμjμ is all positive, for example, then you can conclude with high con�dence that these two means are not equal and that μi is indeed larger than larger than larger μjμjμ . However, if the con�dence interval for μi − μjμjμ includes 0, that is, if it extends from a negative number to a positive number, you cannot conclude that these two means are different.

We have presented the formulas for one-way ANOVA because they lend some insight into the procedure. However, the StatTools One-Way ANOVA procedure takes care of all the calculations, as we illustrate in the following example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-9

Figure 19.3 Data for Cereal Experiment

1

2

3

4

5

23

24

25

26

Lowest Next-to-lowest Middle Next-to-highest Highest A BA B C DC D E

340

376

378

371

389

417

250

347

428

219

431

345

329

374

444

281

378

425

284

349

346

456

471

484

448

564

395

546

358

427

325

428

461

202 374 381 41 411 449

375

399

Objective To use one-way ANOVA to see whether shelf height makes any difference in mean sales of Brand X, and if so, to discover which shelf heights outperform the others.

Solution First, the sample sizes are equal—this is a balanced design. This is not absolutely neces- sary in an experiment of this type, but because Midway is able to specify which stores use which shelving heights, it makes sense to use a balanced design. Second, this is a designed experiment, not an observational study. Midway deliberately chose the 125 stores in the experiment to be alike in as many ways as possible. This helps to ensure that any differ- ences in sales across the five groups can be attributed to differences in shelf heights and not to other extraneous factors. Of course, it is virtually impossible to control for all other all other all factors in an experiment such as this—the 125 stores are certainly not identical in all of all of all their characteristics—but Midway has tried its best to keep them similar. Also, it has ran- domly assigned the stores to treatment levels (shelf heights), rather than arbitrarily assign- ing them. By using a random assignment, Midway avoids any possible bias it might have unconsciously introduced with a nonrandom assignment.

To analyze the data, select One-Way ANOVA from the StatTools Statistical Inference group, and fill in the resulting dialog box as shown in Figure 19.4. In particular, click the Format button and make sure the Unstacked option is checked (because there is a separate sale column for each of the shelf heights), and select all five variables for analysis. (The Stacked option would be appropriate if there were two columns of length 125 each, one with the shelf height and the other with sales.) Finally, make sure only the Tukey option for confidence intervals is checked. (We will discuss these confidence interval options in Section 19-4.)

Figure 19.4 StatTools Dialog Box for Confidence Intervals

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-10 Chapter 19 Analysis of Variance and Experimental Design

The one-way ANOVA output is shown in Figure 19.5. The summary statistics at the top indicate that the next-to-highest shelf height has the largest average sales, 426.3, almost 100 boxes larger than the lowest shelf height, which has the smallest average sales. This information is confirmed by the side-by-side box plots in Figure 19.6. (Although these box plots are not created as part of the ANOVA output, they are always a useful addition.) The sample standard deviations vary from about 61 to 85 over the five treatment levels. Although these tend to indicate unequal variances, the equal-variance assumption is almost never satisfied exactly in any study, and this much discrepancy in the standard deviations is nothing to worry about—it certainly does not invalidate the analysis.

It appears from the summary statistics and the box plots that mean sales differ for dif-It appears from the summary statistics and the box plots that mean sales differ for dif-It appears from the summary statistics and the box plots that mean sales differ for dif ferent shelf heights, but are the differences significant? The test of equal means answers

Figure 19.5 One-Way ANOVA Output

A 7 One-Way ANOOne-Way ANOOne-W VA for Selected UnsVA for Selected UnsV tacked Vcked Vck ariableed Variableed V s

8 ANOVA SummarVA SummarV yA SummaryA Summar

9 Total Sample Size 125

10 Grand Mean 381.44

11 Pooled Std Dev 75.63

12 Pooled Varianceooled Varianceooled V 5719.19

13 Number of Samples 5

14 Confidence Level 95.00%

15

16 Lowest Next-to-lowest Middle Next-to-highest Highest 17 Unstacked Data Unstacked Data Unstacked Data Unstacked Data Unstacked DataANOVA Sample StVA Sample StV ats

18 Sample Size 25 25 25 25 25

19 Sample Mean 334.92 378.68 383.44 426.28 383.88

20 Sample Std Dev 61.04 84.08 75.63 85.05 69.62

21 Sample VarianceSample VarianceSample V 3726.24 7069.56 5719.17 7234.21 4846.78

22 Pooling Weight 0.2000 0.2000 0.2000 0.2000 0.2000

23

24 Sum of Degrees of Mean 25 Squares Squares

F-Ra�oF-Ra�oF p-Value-Value-V FreedomOne Way ANOOne Way ANOOne W VA TVA TV ableA TableA T

26 Between Varia�onBetween Varia�onBetween V 104807.68 26201.92 4.58 0.00184

27 Within Varia�onWithin Varia�onWithin V 686303.12 120 5719.19

28 Total Varia�ontal Varia�ontal V 791110.80 124

29

30 Difference Tukey 31 Confidence Interval TesConfidence Interval TesConfidence Interval T ts of Means Lower Upper

32 Lowest-Next-to-lowest –43.76

33 Lowest-Middle

Next-to-lowest-Middle –4.76

–48.52

34 Lowest-Next-to-highest

Lowest-Highest –48.96

–91.36

35

36

37 Next-to-lowest-Next-to-highest

Next-to-lowest-Highest –5.20

–47.60

38

39 Middle-Next-to-highest –42.84

40 Middle-Highest –0.44

41 Next-to-highest-Highest 42.40

–103.0190249

–64.01902487

–107.7790249

–108.2190249

–150.6190249

–64.45902487

–106.8590249

–102.0990249

–59.69902487

–16.85902487

15.49902487

54.49902487

10.73902487

10.29902487

–32.10097513

54.05902487

11.65902487

16.41902487

58.81902487

101.6590249

B C D E FB C D E

The effect of unequal variances is mitigated by having equal, or nearly equal, sample sizes for the treatment levels. This is another reason for using a balanced design.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-11

this question. It appears in rows 26−28 of the output. The values in this ANOVA table are based on Equations (19.1)–(19.3). (The only part we didn’t discuss is the Total variation in row 28. It is based on the total variation of all observations around the grand mean in cell B10 and is used mainly as a check of the calculations. Note that SSB and SSW in cells B26 SSW in cells B26 SSW and B27 add up to the total sum of squares in cell B28. Similarly, the degrees of freedom add up in column C.) The F-ratio in cell E26 is 4.58, the ratio of the mean squares in cells D26 and D27. Its corresponding p-value is 0.0018, nearly zero. This leaves practically no doubt that the five population means are not all equal. Shelf height evidently does make a not all equal. Shelf height evidently does make a not significant difference in sales.

The 95% confidence intervals for ANOVA in rows 32–41 indicate which shelf heights differ significantly from which others. Any difference whose confidence interval does not include 0 is boldfaced. In this example, there is only one such difference, the one between the next-to-highest height and the lowest height. Not surprisingly, these are the treatment levels with the largest and smallest average sales. None of the other differences are sig- nificant. For example, even though the difference between the next-to-highest and next- to-lowest heights is 47.6, the corresponding confidence interval extends from a negative number to a positive number. Therefore, we cannot declare this difference to be statistically significant.

The main conclusion from this example is that shelf height definitely appears to make a difference in mean sales, at least for the population of stores similar to the ones in the study. Customers tend to purchase fewer boxes of cereal when they are placed on the bottom shelf, and they tend to purchase more when they are placed on the next-to-highest shelf—presum- ably right around eye level. ■

Figure 19.6 Side-by-Side Box Plots of Sales

Box-Whisker Plot Comparison

Highest/Unstacked Data

*

*

*

*

*

Next-to-highest/ Unstacked Data

Middle/Unstacked Data

Next-to-lowest/ Unstacked Data

Lowest/Unstacked Data

0 100 200 300 400 500 600

19-2c Using a Logarithmic Transformation

Recall that the inferences based on the ANOVA procedure rely on two assumptions: equal variances across treatment levels and normally distributed data. Although these assump- tions are never met exactly in any real study, you should check whether they are at least approximately valid. Often a look at side-by-side box plots, as in Figure 19.6, can indicate whether there are serious violations of these assumptions. For example, the box plots in this �gure are reasonably symmetric and indicate reasonably similar variances, so that the ANOVA results should be valid. If the assumptions are seriously violated, however, you should not blindly report the ANOVA results. In some cases, a transformation of the data will help, as illustrated in the following example.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-12 Chapter 19 Analysis of Variance and Experimental Design

E X A M P L E 19.2 PAYMENTS FOR ORDERS AT REBCO

Rebco is a manufacturing company that supplies parts to many other manufacturing companies, its customers. Rebco is concerned about the time it takes these customers to pay for their orders. The file Rebco Payments.xlsx contains data (a subset of which is  shown in Figure 19.7) on the most recent payment from 91 of its customers. The customers are categorized as small, medium, and large. For each customer we see the number of days it took the customer to pay and the amount of the payment. Are there any differences in the mean time to pay across the three customer sizes? What about differ- ences across the mean payment amounts?

Objective To see how a logarithm transformation can be used to ensure the validity of the ANOVA assumptions, and to see how the resulting output should be interpreted.

Solution Unlike Example 19.1, this is a one-factor observational study, where the single factor is customer size at three levels: small, medium, and large. The experimental units are the bills for the orders, and there are two dependent variables, days until payment and payment amount, that will be examined. Focusing first on the days until payment, you can see from the side-by-side box plots in Figure 19.8 that whatever differences there are appear to be slight. Perhaps the large customers pay, on average, a bit more promptly, but it is difficult to see from the plots whether the apparent differences are significant. Therefore, we turn

Figure 19.7 Data for Rebco Example

1 2 3 4 5 6 7

91 90 9192

A BA B C DC D E Customer

1 Large 2 Small 3 Small 4 Small 5 Large 6 Small

23 15

12 21 20 21 14 29

1045 671

1352 7.209340257 5.613128106 5.587248658 5.433722004

7.53369371 5.505331536 6.951772164 6.508769137

274 267 229

1870 246

Medium Large

Customer Size De Days Amount Log(Amount)

© C

e n g

a g

e L

e a rn

in g

Figure 19.8 Box Plots for Days Until Payment

Box-Whisker Plot of Comparison of Days/Payment Data

Customer Size = Small

Customer Size = Medium

Customer Size = Large

0 5 10 15 20 25 30 35 © C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-13

Figure 19.9 ANOVA Results for Days Until Payment

The analysis of the amounts these customers pay is quite different. This is immedi- ately evident from the side-by-side box plots in Figure 19.10. Actually, two things are

Figure 19.10 Box Plots for Payment Amounts

to the numerical results. The summary results and the ANOVA table in Figure 19.9 show that the differences between the sample means are not even close to being statistically significant. The p-value for the test is only 0.318. Rebco cannot reject the null hypothesis that customers of all sizes take, on average, the same number of days to pay.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

One-Way ANOOne-Way ANOOne-W VA for Days by Customer Size ANOVA Summary Summary Summar

Total Sample Size

7 A BA B C DC D E FE F

8

9

10

11 12

13 14 15

16 17

18

19

20 21

22 23

24

25

26 27 28

91 19.571

5.769

33.285 3

95.00%

Days (Large) Payment Data

Days (Medium) Payment Data

Days (Small) Payment Data

Grand Mean

Pooled Std Dev Pooled Varianceooled Varianceooled V

Number of Samples

Confidence Level

ANOVA Sample Stats

Sample Size Sample Mean

Sample Std Dev Sample VarianceSample VarianceSample V

Pooling Weight

20 18.100

4.887 23.884

0.2159

39 20.487

5.707 32.572

0.4318

32 19.375

6.318 39.919

0.3523

OneWay ANOOneWay ANOOneW VA Table Table T

Between Varia onBetween Varia onBetween V 77.242

2929.044 3006.286

2

88 90

38.621

33.285

1.160 0.3181

Within Varia onWithin Varia onWithin V

Days (Large)-Days (Medium) Days (Large)-Days (Small) Days (Medium)-Days (Small)

Total Varia ontal Varia ontal V

Confidence Interval Testsstsst

Sum of Squares

Degrees of Freedom

Mean Squares

F-Ra F-Ra F o p-Value-Value-V

Difference of Means

–2.387

–1.275

1.112

Tukey Lower

–6.17092558

–5.1965248

–2.169265764

Upper

1.396566606

2.6465248

4.393624738

29

30

31

32 33 34

Box-Whisker Plot of Comparison of Amount/Payment Data

Customer Size = Small

Customer Size = Medium

0 200 400 600 800 1000 1200 1400 1600 1800 2000

Customer Size = Large

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-14 Chapter 19 Analysis of Variance and Experimental Design

clear. First, there is little doubt that small customers tend to have lower bills than medium- size customers, who in turn tend to have lower bills than large customers. Second, how- ever, you can see that the equal-variance assumption is grossly violated. There is very little variation in payment amounts from small customers and a large amount of varia- tion from large customers. This situation should be remedied before running any formal ANOVA.

One common method for equalizing variances is to take logarithms of the dependent variable and then use the transformed variable as the new dependent variable. This log transformation tends to spread apart small values and compress together large values— exactly what is needed in this example. The box plots for the logarithms of payment amounts appear in Figure 19.11. The log transformation retains the ordering, so that logs of small amounts are still less than logs of large amounts, but the variances are now much closer to being equal. The resulting ANOVA on the log variable appears in Figure 19.12. The p-value in the ANOVA table is again the key for checking whether we can reject the equal-means hypothesis. The fact that it is virtually 0 indicates that the means of the log variables are not equal.not equal.not

What does this say about the original variables? The bottom part of the output in Figure 19.12 answers this question, although you have to be very careful when interpret- ing the results. First, when we ran the StatTools One-Way ANOVA procedure on the log variable, we requested the confidence intervals in rows 32–34.2 ing the results. First, when we ran the StatTools One-Way ANOVA procedure on the log

2 ing the results. First, when we ran the StatTools One-Way ANOVA procedure on the log

However, each of these is a confidence interval for the difference between means of the log-transformed varialog-transformed varialog-transformed - bles. Because they are in log units, these numbers have little practical meaning. The trick is to take their antilogarithms (with the EXP function), as shown in rows 37–39, and then interpret the antilogs correctly. It can be shown that the correct interpretation is that each antilog is a ratio of medians for the respective treatment levels. (If the populations are reasonably symmetric, the antilogs can also be interpreted as approximate ratios of means.) For example, our best guess is that the median amount paid by large customers is 2.253 times as large as the median amount paid by medium-sized customers, and we are 95% confident that this ratio is between 1.877 and 2.705. Because the populations are

2Again, we will discuss the type of con�dence interval method shown here in Section 19-4.

Figure 19.11 Box Plots of Log- Transformed Amounts

Box-Whisker Plot of Comparison of Log(Amount)/Payment Data

Customer Size = Small

Customer Size = Medium

Customer Size = Large

0 1 2 3 4 5 6 7 8 © C

e n g

a g

e L

e a rn

in g

The graph in Figure 19.10 indicates definite violations of the ANOVA equal-variance assumption.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-2 One-Way ANOVA 19-15

Figure 19.12 ANOVA Results for Log-Transformed Amounts

One-Way ANOOne-Way ANOOne-W VA for Log(Amount) by Customer Size

ANOVA Summary Summary Summar

Total Sample Size

7

A B C D E F

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

91

6.0961

0.2787

0.0777

3

95.00%

Log(Amount) (LargeLog(Amount) (LargeLog(Amount) (Lar )

Payment Data

Log(Amount) (Small)

Payment Data

Grand Mean

Pooled Std Dev

Pooled Varianceooled Varianceooled V

Number of Samples

Confidence Level

ANOVA Sample Stats

Sample Size

Sample Mean

Sample Std Dev

Sample VarianceSample VarianceSample V

Pooling Weight

20

7.0474

0.3030

0.0918

0.2159

32

5.3323

0.2525

0.0637

0.3523

OneWay ANOOneWay ANOOneW VA Table Table T

Between Varia­onBetween Varia­onBetween V 37.5191

6.8346

44.3538

0.8123 0.995099974

1.904488762

1.061244697

1.7151

0.9027

18.7596

0.0777

241.5401 <0.0001

Within Varia­onWithin Varia­onWithin V

Total Varia­ontal Varia­ontal V

Sum of

Squares

Mean

Squares

Difference

of Means

Log(Amount) (Medium)

Payment Data

39

6.2350

0.2863

0.0820

0.4318

2

88

90

0.629549626

1.525627517

0.744221983

Degrees of

Freedom

Lower

Tukey

Upper

F-Ra­F-Ra­F o p-Value-Value-V

Confidence Interval Testsstsst

Log(Amount) (Large)-Log(Amount)(Medium)

Log(Amount) (Large)-Log(Amount)(Small)

Log(Amount) (Medium)-Log(Amount)(Small)

E FC DA B

The “ratio of medians” interpretation discussed in this example is the correct interpre- tation in any comparison problem where a log transformation is used (probably to equalize variances) on the dependent variable. It applies not only to ANOVA studies such as Rebco’s but to the two-sample t procedures discussed in Chapters 8 and 9.

reasonably symmetric (see the box plots in Figure 19.10), this same statement applies, at least approximately, to the means.

The bottom line for Rebco is that its large customers have bills that are typically over twice as large as those for medium-sized customers, which in turn are typically over twice as large as those for small customers. Even though all customers currently tend to take about the same number of days to pay, there is a greater incentive to get the large custom- ers to pay early—more money is at stake. ■

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-16 Chapter 19 Analysis of Variance and Experimental Design

P R O B L E M S

Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. An automobile manufacturer employs sales

representatives who make calls on dealers. The manufacturer wishes to compare the effectiveness of four different call-frequency plans for the sales representatives. Thirty-two representatives are chosen at random from the sales force and randomly assigned to the four call plans (eight per plan). The representatives follow their plans for 6 months, and their sales for the 6-month study period are recorded. These data are listed in the file P19_01.xlsx. a. Do the sample data support the hypothesis that at

least one of the call plans helps produce a higher average level of sales? Perform an appropriate statistical test and report a p-value.

b. If the sample data indicate the existence of mean sales differences across the call plans, which plans produce significantly different average sales levels at the 95% level?

2. Consider a large chain of supermarkets that sell their own brand of potato chips in addition to many other name brands. Management would like to know whether the type of display used for the store brand has any effect on sales. There are four types of displays being considered, so management decides to choose 24 similar stores to serve as experimental units. A random six of these are instructed to use display type 1, another random six are instructed to use display type 2, a third random six are instructed to use display type 3, and the final six stores are instructed to use display type 4. For a period of one month, each store keeps track of the fraction of total potato chips sales that are of the store brand. The data for the 24 stores are listed in the file P19_02.xlsx. Note that one of the stores using display 3 is blank. This store did not follow instructions properly, so its observation is disregarded. a. Why do you think each store keeps track of the

fraction of total potato chips sales that are of the store brand? Why do they not simply record the total amount of sales of the store brand potato chips?

b. Do the data suggest different mean proportions of store brand sales at the 10% significance level? If so, construct 90% confidence intervals for the differences between all pairs of mean proportions to identify which of the display types are associated with higher fractions of sales.

3. National Airlines recently introduced a daily (i.e., early morning) nonstop flight between Houston and Chicago. The vice president of marketing for National Airlines

decided to perform a statistical test to see whether National’s average passenger load on this new flight was different from that of each of its two major competitors (which we will call competitor 1 and competitor 2). Ten early-morning flights were selected at random from each of the three airlines and the percent of unfilled seats on each flight was recorded. unfilled seats on each flight was recorded. unfilled These data are listed in the file P19_03.xlsx. a. Is there evidence that National’s average passenger

load on the new flight is different from that of its two competitors? Report a p-value and interpret the results of the statistical test.

b. Select an appropriate significance level and construct confidence intervals for all pairs of differences between means. Which of these differences, if any, are statistically significant at the selected significance level?

4. A hotel manager would like to know whether customers who pay by different methods have different-sized bills. She divides all customers into four categories: those who pay by check or cash, those who pay with a VISA or MasterCard, those who pay with an American Express card, and those who use some other type of credit card. She then collects data on daily bills, which are listed in the file P19_04.xlsx. Note that these bills contain the room charge, plus any other charges to the customer’s account. a. Test whether the different categories of customers

have different-sized bills at the 10% significance level.

b. Based on 90% confidence intervals for all pairs of differences between means, which of these differences, if any, are significantly nonzero at the 10% significance level?

5. A company sells identical soap in four different packages at the same price. The sales of each package type for 12 months are listed in the file P19_05.xlsx. Is there any indication of differences in the mean sales of this brand of soap across the various package types? Perform an appropriate statistical test and report a p-value.

Level B 6. Do graduates of undergraduate business programs with

different majors tend to earn disparate average starting salaries? Consider the data listed in the file P19_06 .xlsx. a. Is there any reason to doubt the equal-variance

assumption made in the one-way ANOVA model in this particular case? Support your response to this question.

b. Assuming that the variances of the four underlying populations are indeed equal, can you reject at the 10% significance level that the mean starting salary

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-3 Using Regression to Perform ANOVA 19-17

is the same for each of the given business majors? Explain why or why not.

c. Based on 90% confidence intervals for all pairs of differences between means, which of these differences, if any, are statistically significant at the 10% significance level?

7. A company that employs a large number of salespeople is interested in determining which of the following subsets of the sales staff sells, on average, the most: (1) those whose compensation consists of a fixed salary, (2) those whose compensation is based strictly on commission, and (3) those whose compensation is based on a smaller fixed portion and a reduced and a reduced and commission rate. Sales data (in dollars) from the previous quarter are collected for randomly selected

salespeople who are compensated according to one of the three aforementioned schemes. The data are listed in the file P19_07.xlsx. a. Is there any reason to doubt the equal-variance

assumption made in the one-way ANOVA model in this particular case? Support your response to this question.

b. Can you reject at the 5% significance level that the mean sales are the same for each of the three groups of salespeople? Explain why or why not.

c. Based on 95% confidence intervals for all pairs of differences between means, which of these differences, if any, are statistically significant at the 5% significance level?

19-3 USING REGRESSION TO PERFORM ANOVA The method we discussed in the previous section for performing ANOVA—calculating sums of squares by rather complex formulas and showing the results in an ANOVA table— is the traditional way of implementing ANOVA. Indeed, it is the method implemented in most statistical software packages, and it can be extended to many experimental designs besides one-way ANOVA. However, it is worth knowing that most of the same ANOVA results can be obtained by multiple regression analysis, as we brie�y discuss in this section. The advantage of using regression is that many people understand regression better than the formulas used in traditional ANOVA. The disadvantage is that some of the traditional ANOVA output, such as the con�dence intervals for mean differences, can be obtained with regression only with some dif�culty—they are not standard parts of the regression output. Therefore, regression is not a perfect substitute for traditional ANOVA, but it can supplement the analysis.

To perform ANOVA with regression, we run a regression with the same dependent variable as in ANOVA and use dummy variables for the treatment levels as the only explan- atory variables. For example, if there is a single factor with 5 treatment levels, we create 4 dummy variables, one for each of the treatment levels except a designated “reference” level, and we run the regression with these 4 dummies as the only explanatory variables. In the resulting regression output, the ANOVA table will be exactly the same as the ANOVA table we obtain from traditional ANOVA, and the coef�cients of the dummy variables will be estimates of the mean differences between the corresponding treatment levels and the reference level.

For example, if there are 5 treatment levels and level 5 is designated as the reference level, then the regression coef�cients will estimate the mean differences μ1 − μ5, μ2 − μ5, μ3 − μ5, and μ4 − μ5. Therefore, the reported con�dence intervals for these coef�cients are really con�dence intervals for these mean differences. However, we do not automatically obtain con�dence intervals for other mean differences such as μ2 − μ3. Also, the con�- dence intervals we obtain are not of the “Tukey” type we obtained with ANOVA. (They are of the “no correction” type we will discuss in the next section.) On the plus side, however, the regression output provides an R2 value, the percentage of the variation of the dependent variable explained by the various treatment levels of the single factor. This R2 value is not part of the traditional ANOVA output.

To see how this works, we revisit Midway’s cereal experiment from Example 19.1.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-18 Chapter 19 Analysis of Variance and Experimental Design

E X A M P L E 19.1 THE EFFECT OF SHELF HEIGHT ON CEREAL SALES (CONTINUED)

Recall that the Midway supermarket chain ran a study on 125 stores to see whether shelf height, set at five different levels, has any effect on sales of a popular brand of cereal. (See the file Cereal Sales.xlsx.) Does Midway get the same results as before if it analyzes the data with regression?

Objective To see how Midway can analyze its data with regression, using only dummy variables for the treatment levels.

Solution Before you can run a regression, you must first reorganize the data. Recall that the original data in the file are in unstacked form—one sales column for each shelf height. For regres- sion, the data must be in stacked form. This is easy to accomplish with StatTools. First, select Stack from the Data Utilities group in StatTools. In the resulting dialog box (not shown), check all five variables, and specify Shelf Height as the Category Name and Sales as the Value Name. This creates a new worksheet with two long variables called Shelf Height and Sales. The results for a few of the stores appear in Figure 19.13.

1 2

3

4

5

122

123

124

125 Highest

A BA B

Shelf Height Lowest 340

Lowest 376

Lowest 378

Lowest 371

330

Highest

Highest

449

Highest 461

375

126 Highest 399

Sales Figure 19.13 Stacked Variables

We now run a multiple regression with the Sales variable as the dependent variable and Shelf Height as the explanatory variable. Remember from Chapter 10 that StatTools allows you to select a text variable as an explanatory variable, and it then creates the required dummy variables internally. In this case, Next-to-lowest (last in alphabetical order) is the reference category. The regression output is shown in Figure 19.14.

The first thing to notice is that the ANOVA table from the regression output is identi- cal to the ANOVA table from traditional ANOVA. (See Figure 19.5.) This will always be cal to the ANOVA table from traditional ANOVA. (See Figure 19.5.) This will always be cal the case. You can infer, because of the extremely low p-value in this table, that the popula- tion regression coefficients are not all 0. However, because these regression coefficients are really mean differences between the various levels and the reference level, you can infer that these mean differences are not all 0. Specifically, at least one of the heights differs from the reference next-to-lowest height. The estimates of the mean differences, given in the range B20:B23, are the observed average differences in sales between upper heights and the lowest height. Also, the constant in cell B19 is the observed average sales for the reference next-to- lowest height.

If you compare the confidence intervals in the range F20:G23 of the regression output to the corresponding confidence intervals for the ANOVA output in Figure 19.5, you will see that they are somewhat different. For example, the confidence interval in row 23 from

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-3 Using Regression to Perform ANOVA 19-19

Mul�ple Regression for Sales SummarySummarySummar

ANOVA TVA TV ableA TableA T

Regression Tableegression Tableegression T Coefficient

Constant 378.68 15.12506882

21.39007745

21.39007745

21.39007745

21.39007745

25.0365803 <0.0001

0.8243

0.0279

348.7334164

–37.15086471

–86.11086471

–37.59086471

5.249135289

408.6265836

47.55086471

–1.409135289

47.11086471

89.95086471

0.8083

0.0430

0.243103374

–2.045808394

0.222533089

2.225330886

5.2

–43.76

4.76

47.6

Shelf Height (Highest)

Shelf Height (Lowest)

Shelf Height (Middle)

Shelf Height (Next-to-highest)

Standard Error

t-Value-Value-V p-Value-Value-V Lower Confidence Interval 95%

Upper

Mul ple R

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

A B C D E F G

Degrees of Freedom

Explained 4 104807.68 26201.92 4.581401874 0.0018 5719.192667686303.12120Unexplained

Sum of Squares

Mean of Squares

F p-Value-Value-V

0.3640 0.1325 0.1036 75.62534408 0

R-Square Adjusted R-Square

Std. Err. ofd. Err. ofd. Err Estimate

Rows Ignored

A B C D E F

Figure 19.14 Regression Output for Cereal Example

P R O B L E M S

Level A 8. For the National Airlines data in Problem 3 (see the

file P19_03.xlsx), perform a regression analysis using dummy variables for the airlines. Comment on the meaning of the regression output. How does it compare with the ANOVA output from Problem 3? Does it give you any extra insights?

9. For the soap data in Problem 5 (see the file P19_05.xlsx), perform a regression analysis using dummy variables for the different packages. Comment on the meaning of the regression output. How does it compare with the ANOVA output from Problem 8? Does it give you any extra insights?

Level B 10. In Problem 6, the salary data for graduates of the

undergraduate business programs (see the file P19_06. xlsx) represent an unbalanced design—there are more students from some majors than others. Run a regression on starting salaries, using dummies for majors as the explanatory variables. Do you get the same results as with the ANOVA output from Problem 6? Specifically, consider the constant term and the regression coefficients in the output. Is the constant equal to the average starting salary for the reference major? (You can designate any of the majors as the reference major.) Are the regression coefficients equal to average differences between the various majors and the reference major?

Figure 19.14 extends from 5.25 to 89.95, indicating that the mean for next-to-highest is sig- nificantly larger than the mean for next-to-lowest. This is a slightly different conclusion than indicated by the ANOVA confidence intervals in Figure 19.5. The reason for this apparent discrepancy is the subject of the next section. It is basically because the Tukey intervals quoted in the ANOVA output are more “conservative” (wider) and typically lead to fewer significant differences.

One final comment about the regression output regards its R2 value. We see that dif- value. We see that dif- value. We see that dif ferences in the shelf height account for 13.25% of the variation in sales. This means that although shelf height has some effect on sales, there is a lot of “random” variation in sales across stores that cannot be accounted for by shelf height. ■

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-20 Chapter 19 Analysis of Variance and Experimental Design

19-4 THE MULTIPLE COMPARISON PROBLEM In many statistical analyses, including ANOVA studies, we want to make statements about multiple unknown parameters. For example, in the cereal study (Example 19.1), we wanted to create con�dence intervals for differences between each pair of means—10 con�dence intervals in all.3 to create con�dence intervals for differences between each pair of means—

3 to create con�dence intervals for differences between each pair of means—

Any time we make such a statement, there is a chance that we will be wrong; that is, there is a chance that the true population value will not be inside the con�- dence interval. If we create a 95% con�dence interval, say, then the error probability is 0.05. In fact, as we explained in Chapter 8, the endpoints of the con�dence interval are chosen so that the error probability will be 1 minus the con�dence level chosen. What do we mean by “error probability,” however, when we make several statements based on the same data? This is the issue addressed in this section.

We can use simulation to get an idea of the problem. In the �le Multiple Comparison .xlsx, we simulate a data set very much like those encountered in one-way ANOVA. (See the range A10:H70 of Figure 19.15. Note that a lot of rows have been hidden.) The data in this range correspond to data from a one-factor design with 8 treatment levels and 60 obser- vations per level—480 observations all together. However, we entered the same formula, =NORM.INV(RAND(),0,1), in each cell. This means that each treatment level is generat- ing normal data with mean 0 and standard deviation 1. Therefore, we know that the equal- means hypothesis of ANOVA is true—all population means are equal to 0. Nevertheless, we calculate 95% con�dence intervals for each of the 28 possible differences between means in rows 84–111, using the two-sample procedure described in Chapter 8. If a con- �dence interval does not include not include not 0, we indicate it as a signi�cant difference by putting “Yes” in column D. Then if at least one of these 28 con�dence intervals is signi�cant, we record “Yes” in cell D113. Finally, we replicate this procedure 500 times in columns J and K, each time recording the value in cell D113, and we report the percentage of replications with “Yes” in cell K5. As you can see, the reported percentage (in cell K5) is close to 50%.

What does this prove? Recall that all of the population means equal 0. This is how we simulated the random numbers in the �rst place. Therefore, if any one of the 28 con�dence intervals in rows 84–111 turns out to be signi�cant and we report it as such, we are making an error. That is, we are reporting that these two population means are not equal, when in fact they both equal 0. Because none of the 28 con�dence intervals in rows 84–111 should be signi�cant, we will have a perfect record only if we report “No” in cell D113. Of course, a perfect record cannot always be obtained, but by using a 95% con�dence level, you might expect a perfect record in 95% of the replications. Unfortunately, the simulation shows that we are not even close to this. We get a perfect record only about half of the time! In statisti- cal terms, if we run each con�dence interval at the 95% level, the overall con�dence level overall con�dence level overall (of having all 28 statements correct) is much less than 95%. (Worse yet, we are never really sure how much less.) This is called the multiple comparison problem. It says that if we make a lot of statements, each at a given con�dence level such as 95%, then the chance of making at least one wrong statement is much greater than 5%.

The question is how to get the overall con�dence level equal to the desired value, such as 95%. Or in the simulation in Figure 19.15, how can we get the error rate in cell K5 to be approximately 5%? The answer is that we need to correct the individual con�dence intercorrect the individual con�dence intercorrect - vals, so that we do not calculate them exactly as described in Chapter 8. Several corrections not calculate them exactly as described in Chapter 8. Several corrections not have been proposed by statisticians, and StatTools includes three of the most popular cor- rection methods in its one-way ANOVA procedure: the Bonferroni, Tukey, and Scheffé methods. (They can be chosen from the dialog box shown in Figure 19.16.) Although the

3Note that if a con�dence interval for a difference such as μ1 − μ2 is reported, the con�dence interval for its oppo- site, μ2 − μ1, is not reported. This is because the latter is simply the negative of the former.not reported. This is because the latter is simply the negative of the former.not

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-4 The Multiple Comparison Problem 19-21

Simula�on of mul�ple comparison problem

Percent of replica�ons with any significant differy significant differy significant diff ences

Data table for whether anData table for whether anData table f y differences are significantSimulation of data and confidence intervals

Sample8 –1.38261 –0.33695

0.67425 0.142446 0.840802

–0.46184

–0.04096

Sample7 –0.75971 0.637854 1.083935 0.482804 0.028709

0.728025

0.12165

Sample6 0.983571 0.396659 0.571373 –0.16077 1.997633

0.232316

0.158603

0.9707620.8979671.06218

Sample5 –0.57045 2.309349 0.300742 –0.06452 –0.92909

–0.07783

0.023595

0.818163

Sample4 0.978887152 1.039012856 –0.02990212 0.757778728 –1.01662996

–1.00944356

–0.09419457

0.913152569

Sample3 0.7533667

0.59737356 0.43801209 –0.4507764 –0.2320311

0.6977043

–0.0541804

0.97389301

Sample2 1.81343727 –0.0254418 0.74692562 –0.2595726 0.00504709

–0.5515881

–0.1780704

Sample1 0.217689683

–0.176004652 –0.358308438 –1.238068644

1.067266927

–2.719100304

–0.037980741

0.980308296 1.01357647

0.95636008 0.17460666 2.00171748

Upper limit Significant?

Any Significant?

No

No No

No No No

No

0.48960289

0.36571288 0.40572704

0.38646654 0.54907127 0.51211795

Lower limit

–0.2094235

–0.3333135 –0.2932994

–0.3125599 –0.1499552 –0.1869085

Means

Stdevs

Pooled stdev StErr of diffStErr of diffStErr of dif t-multiple

95% confidence intervals for diffeor diffeor dif rences between means DiffeDiffeDif rence

1 minus 2

1 minus 3 1 minus 4

6 minus 7 6 minus 8 7 minus 8

Simula�on of mul�ple comparison problem

Simulation of data and confidence intervals

(from data table below)

Replication Any Significant?

In this simulation, samples from several normal populations, all with the same mean and standard deviation, will be simulated, and the usual 95% confidence interval is constructed for each mean diffediffedif rence. Then a data table is used to check the percentage of replications that have at leastge of replications that have at leastge of replications that have at leas one confidence interval that does not include 0. It is much larger than 5%.

A

1

2 3 4

5 6 7 8

B CB CB CB C D ED E F GF G H IH I J KJ K L ML M N

1 2 3

58

59 60 61 62 63 64 65

66 67 68 69 70 71 72 73

74 75 98 99

100

No

No Yes

Yes Yes

Yes Yes

Yes

Yes Yes

Yes

Yes

Yes

Yes Yes

Yes

Yes Yes

No No

No

No

No

No

No

No

No

No

No

No No

48.2%

101

102 103 104

498

499 500

9 10 11 12

13 14

69 70 71

72 73 74

75

76 77 78 79 80

81 82 83

84

85 86

109 110 111 112

113 114 115 509 510 511

No

Figure 19.15 Simulation to Illustrate the Multiple Comparison Problem

Figure 19.16 One-Way ANOVA Dialog Box with Confidence Intervals Options

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-22 Chapter 19 Analysis of Variance and Experimental Design

details of these methods are beyond the scope of this book, they are all methods for coping with the multiple comparison problem. They differ only in the multiplier they use in the typical con�dence interval formula for a difference between means:

YiYiY − YjYjY ± multiplier × "M"M" SMSM W(1/ni + 1/njnjn )" Recall that the multiplier used for the usual “no-correction” method from Chapter 8 is

a t-value that, for a 95% con�dence level, is approximately equal to 2. The correction meth- ods all use multiples that are larger than this. The idea is that by using a larger multiplier, larger than this. The idea is that by using a larger multiplier, larger we get a wider con�dence interval. This decreases the chance that the con�dence interval will fail to include the true mean difference, which in turn decreases the chance that at least one of several such con�dence intervals will fail to include its true mean difference. The larger the multiplier is, the more conservative the con�dence intervals will be (where “con- servative” means wider intervals). Scheffé’s and Bonferroni’s methods tend to be the most conservative, whereas Tukey’s method strikes a balance between being too conservative and not conservative enough. It is the method favored by many researchers when the focus is on many con�dence intervals for mean differences, as in Example 19.1.

To follow the simulation one step further, the multiplier used in the individual con�- dence intervals in rows 84–111 of Figure 19.15 is approximately equal to 2, as shown in cell B80. Using appropriate formulas (not presented here), it can be shown that the multi- pliers for the Tukey, Bonferroni, and Scheffé methods are 3.04, 3.27, and 3.77, respectively. Furthermore, if the Tukey multiplier is used in the simulation, the percentage in cell K5 becomes approximately 5%, exactly what we want.

To see how these correction methods might affect results, we report all four types of con�dence intervals for the cereal data of Example 19.1 in Figure 19.17, with the results rear- ranged slightly to �t better on the printed page. (We reported only the Tukey intervals earlier.) You should note the following. First, the con�dence intervals get wider as we move from no correction (from Chapter 8) to Tukey to Bonferroni to Scheffé. Second, all three correction methods report exactly the same signi�cant differences. Speci�cally, they all report that the only signi�cant difference is between the next-to-highest and lowest shelf heights. The three correction methods do not agree exactly in all data sets, but they usually produce similar results. In contrast, the no-correction method �nds 7 of the 10 differences to be signi�cant, a very different result. This is typical. Because this method does not correct for the number of con�dence intervals being reported, it tends to �nd too many signi�cant differences.

Confidence Interval TesConfidence Interval TesConfidence Interval T ts Difference of Means

–43.76 –86.11086471 –1.409135289 –104.9327306 17.41273061 –103.0190249 15.49902487 –110.6837587 23.16375867

18.40375867

–24.43624133

17.96375867

62.16375867

19.32375867

61.72375867

24.08375867

66.48375867

109.3237587

–115.4437587

–158.2837587

–115.8837587

–71.68375867

–114.5237587

–72.12375867

–109.7637587

–67.36375867

–24.52375867

10.73902487

–32.10097513

10.29902487

54.49902487

11.65902487

54.05902487

16.41902487

58.81902487

101.6590249

–107.7790249

–150.6190249

–108.2190249

–64.01902487

–106.8590249

–64.45902487

–102.0990249

–59.69902487

–16.85902487

12.65273061

–30.18726939

12.21273061

56.41273061

13.57273061

55.97273061

18.33273061

60.73273061

103.5727306

–109.6927306

–152.5327306

–110.1327306

–65.93273061

–108.7727306

–66.37273061

–104.0127306

–61.61273061

–18.77273061

–6.169135289

–49.00913529

–6.609135289

37.59086471

–5.249135289

37.15086471

–0.489135289

41.91086471

84.75086471

Lower Upper No Correc�on

Lower Upper Lower Upper Lower Upper Bonferroni Tukey Scheffe

–90.87086471

–133.7108647

–91.31086471

–47.11086471

–89.95086471

–47.55086471

–85.19086471

–42.79086471

0.049135289

–48.52

–91.36

–48.96

–4.76

–47.60

–5.20

–42.84

–0.44

42.40

Lowest-Next-to-lowest

Lowest-Next-to-highest

Lowest-Highest

Next-to-lowest-Middle

Next-to-lowest-Next-to-highest

Next-to-lowest-Highest

Middle-Next-to-highest

Middle-Highest

Next-to-highest-Highest

Lowest-Middle

30

A B C D E F G IHG IH J

31

32

33

34

35

36

37

38

39

40

41

A B C D E F G I

Figure 19.17 Confidence Intervals from Different Methods

At this point, it is natural to ask why there are so many methods. The reason has to do with the purpose of the study. A researcher who initiates a study might have a particular interest in a few speci�c differences. For example, the analyst in Example 19.1 might be particularly interested in the differences between the lowest height and each of the other

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-4 The Multiple Comparison Problem 19-23

four heights. The whole study is intended to study these speci�c differences. In this case, the differences of interest are called planned comparisons. On the other hand, the analyst might initiate the study just to see what differences there are. This analyst will examine all pair- wise differences to see which are signi�cant. Here we talk about unplanned comparisons because the analyst does not specify which differences to focus on before collecting the data.

In the case of planned comparisons, if there are only a few differences of interest, it is usually acceptable to report con�dence intervals for these differences using the no-correction method. If there are more than a few planned comparisons (even statisticians do not always agree on the interpretation of “a few”), then it is better to report Bonferroni intervals. In the case of unplanned comparisons, the Tukey method is usually the pre- ferred method. It keeps the overall con�dence level close to the desired level (such as 95%) without making the intervals overly wide. More important, it keeps the entire study from becoming a “�shing expedition,” where a few differences become signi�cant just by the luck of the draw (as occurred in the simulation in Figure 19.15).

The Scheffé method can be used for planned or unplanned comparisons. It tends to produce the widest intervals because it is intended not only for differences between means, such as μ2 − μ4, but also for more general contrasts, where a contrast is the difference between weighted averages of means. For example, if the analyst in Example 19.1 is inter- ested in how the lowest height compares to the average of the other four heights, then the difference μ1 − (μ2 + μ3 + μ4 + μ5)/4 would be of interest. Although the analysis of gen- eral contrasts such as this is deferred until the next section, we note that Scheffé’s method was developed speci�cally to deal with them. If we are interested only in simple differ- ences like μ2 − μ4, then Tukey’s method should be used instead.

P R O B L E M S

Level A 11. Consider again the one-way ANOVA hypothesis

test described in Problem 1. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 95%. Summarize your results. Recall that the relevant data are listed in the file P19_01.xlsx.

12. Consider again the one-way ANOVA hypothesis test described in Problem 2. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 90%. How do these results compare to the uncorrected 90% confidence intervals? Recall that the relevant data are listed in the file P19_02.xlsx.

13. Consider again the one-way ANOVA hypothesis test described in Problem 3. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 99%. Compare the widths of the confidence intervals generated with each of these methods with those of uncorrected 99% confidence intervals. Explain your findings. Recall that the relevant data are listed in the file P19_03.xlsx.

14. Consider again the one-way ANOVA hypothesis test described in Problem 4. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 90%. Summarize your results. Recall that the relevant data are listed in the file P19_04.xlsx.

15. Consider again the one-way ANOVA hypothesis test described in Problem 5. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 99%. How do these results compare to the uncorrected 99% confidence intervals? Recall that the relevant data are given in the file P19_05.xlsx.

Level B 16. Consider again the one-way ANOVA hypothesis test

described in Problem 6. Suppose that we are interested in comparing the mean starting salary of accounting students with that of each of the other three majors (i.e., marketing, finance, and management). Recall that the relevant data are listed in the file P19_06.xlsx. a. Which method for generating confidence intervals

for mean differences is most appropriate in this situation? Explain your choice.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-24 Chapter 19 Analysis of Variance and Experimental Design

19-5 TWO-WAY ANOVA The examples discussed so far in this chapter have been single-factor designs. There is a single factor, such as shelf height in Example 19.1 or customer size in Example 19.2, that we observe at several levels. The question then is whether the mean of a dependent variable is equal across all levels. In this section we allow two factors, each at several levels. As you will see, some of the ideas from one-way ANOVA carry over to two-way ANOVA. However, there are differences in the data setup, the analysis itself, and, perhaps most important, the types of questions we ask. Because an abstract discussion of two-way ANOVA can be dif�cult to follow, we immediately introduce Example 19.3.

b. Apply the method identified in part a to estimate the mean differences of interest. Briefly interpret your findings.

17. Consider again the one-way ANOVA hypothesis test described in Problem 7. Suppose that we are interested in comparing the mean sales achieved by salespeople with varying compensation schemes. In other words, we are interested in making all possible comparisons at

this point. Recall that the relevant data are listed in the file P19_07.xlsx. a. Which method for generating confidence intervals

for mean differences is most appropriate in this situation? Explain your choice.

b. Apply the method identified in part a to estimate the mean differences of interest. Briefly interpret your findings.

E X A M P L E 19.3 DRIVING DISTANCES FOR GOLF BALL BRANDS

If you are a golfer, or even if you have ever seen golf ball commercials on television, you know that a number of golf ball manufacturers claim to have the “longest ball,” that is, the ball that goes the farthest on drives. This example illustrates how these claims might be tested. We assume that there are five major brands, labeled A through E. A consumer testing service runs an experiment where 60 balls of each brand are driven under three tem- perature conditions. The first 20 are driven in cool weather (about 40 degrees), the next 20 are driven in mild weather (about 65 degrees), and the last 20 are driven in warm weather (about 90 degrees). The goal is to see whether some brands differ significantly, on average, from other brands and what effect temperature has on mean differences between brands. For example, it is possible that brand A is the longest ball in warm weather but some other brand is longest in cool temperatures.

Objective To use two-way ANOVA to analyze the effects of golf ball brands and tem- perature on driving distances.

Solution This example represents a controlled experiment. The consumer testing service decides exactly how to run the experiment, namely, by assigning 20 randomly chosen balls of each brand to each of three temperature levels. In our general terminology, the experimental units are the individual golf balls and the dependent variable is the length (in yards) of each drive. There are two factors: brand and temperature. The brand factor has five treatment levels, A through E, and temperature has three levels, cool, mild, and warm. The design is balanced because the same number of balls, 20, is used at each of the 5 × 3 = 15 treatment level combinations. In fact, balanced designs are the only two-way designs we discuss in this book. (The analysis of unbalanced designs is more complex and is best left to a more advanced book.) There is one further piece of terminology. We call this a full factorial two-way design because we test golf balls at each of the 15 possible treat- ment level combinations. For example, if we decided not to test any brand A balls at a

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-5 Two-Way ANOVA 19-25

temperature of 65 degrees, then the resulting experiment would be called an incomplete design. We will discuss incomplete designs briefly in the next section—and why they are sometimes used—but full factorial designs are preferred whenever possible.

In a full factorial design, experimental units are assigned to each treatment level combination. In an incomplete design, experimental units are assigned to some of the treatment level combinations but not to all of them.

How should the consumer testing service actually carry out the experiment? One pos- sibility is to have 15 golfers, each of approximately the same skill level, hit 20 balls each. Golfer 1 could hit 20 brand A balls in cool weather, golfer 2 could hit 20 brand B balls in cool weather, and so on. You can probably see the downside of this design. Brand A might come out the longest ball just because the golfers assigned to brand A have good days. Therefore, if the consumer testing company decides to use human golfers, it should spread them evenly among brands and weather conditions. For example, it could employ 10 golf- ers to hit two balls of each brand in each of the weather conditions. Even here, however, the use of different golfers introduces an unwanted source of variation: the different abili- ties of the golfers (or how well they happen to be driving that day). Is the solution, then, to use a single golfer for all 300 balls? This has its own downside—namely, that the golfer might get tired in the process of hitting this many balls. Even if he hits the brands in ran- dom order, the fatigue factor could play a role in the results.

These are the types of things designers of experiments must consider. They must attempt to eliminate as many unwanted sources of variation as possible, so that any dif-attempt to eliminate as many unwanted sources of variation as possible, so that any dif-attempt to eliminate as many unwanted sources of variation as possible, so that any dif ferences across the factor levels of interest can be attributed to these factors and not to extraneous factors. In this example, we suspect that the best option for the consumer test- ing service is to employ a “mechanical” golf ball driving machine to hit all 300 balls. This should reduce the inevitable random variation that would occur by using human golfers. Still, there will be some random variation. Even a mechanical device, hitting the same brand under the same weather conditions, will not hit every drive exactly the same length.

Once the details of the experiment have been decided and the golf balls have been hit, we will have 300 observations (yardages) at various conditions. The usual way to enter the data in Excel®—and the only way the StatTools Two-Way ANOVA procedure will accept it—is in the stacked form shown in Figure 19.18. (See the file Golf Ball.xlsx.) There must be two categorical variables that represent the levels of the two factors (Brand and Temperature) and a measurement variable that represents the dependent variable (Yards). Although many rows are hidden in this figure, there are actually 300 rows of data, 20 for

A

Brand TemperTemperT ature

Cool

Cool

Cool

Cool

Cool

Cool

Cool

Cool

Cool

Cool

214.3

Yards

208.0

208.8

216.7

212.1

219.2

220.6

229.1

204.0

215.3

A

A

A

A

A

A

A

A

A

A

1

2

3

4

5

6

7

8

9

10

11

B CB CFigure 19.18 Data for Golf Ball Example

Data for StatTool’s Two- Way ANOVA procedure cannot be in unstacked form. Also, a balanced design must be used.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-26 Chapter 19 Analysis of Variance and Experimental Design

each of the 15 combinations of Brand and Temperature. Again, this is a balanced design, balanced design, balanced which is what StatTools expects for its two-way ANOVA procedure. (StatTools will issue an error message if it finds an unbalanced design, that is, unequal numbers of observations at the various treatment level combinations.)

Given this data set, what can you learn from it? In fact, which questions should you ask? Here it helps to look at a table of sample means, such as in Figure 19.19. (This table is part of the output from the StatTools Two-Way ANOVA procedure. Alternatively, it can be obtained easily with an Excel pivot table, as we did here.4 part of the output from the StatTools Two-Way ANOVA procedure. Alternatively, it can be

4 part of the output from the StatTools Two-Way ANOVA procedure. Alternatively, it can be

) Prompted by this table, here are some questions you might ask.

■ Looking at column E, do any brands average signi�cantly more yards than any others (where these averages are averages over all temperatures)?

■ Looking at row 10, do average yardages differ signi�cantly across temperatures (where these averages are across all brands)?

■ Looking at the columns in the range B5:D9, do differences among averages of brands depend on temperature? For example, does one brand dominate in cool weather and another in warm weather?

■ Looking at the rows in the range B5:D9, do differences among averages of tempera- tures depend on brand? For example, are some brands very sensitive to changes in temperature, while others are not?

A 3 4 5 6 7 8 9

10

B CB CB CB C D ED ED ED E

B C D E Grand Total 222.1

224.8 215.0 228.0 224.1 218.8 236.5

245.1 242.7 237.6 255.7 243.5

258.4 258.3 263.0 256.1 270.9 261.4

237.9 242.5 244.6 236.2 250.5 242.3

A

Average of Yards Brand

TemperTemperT ature Cool Mild Warm Grand Total

Figure 19.19 Table of Sample Means in Golf Ball Example

4Note that the default label Excel uses in cells A10 and E4 is Grand Total—and you cannot change them. However, they are really “grand averages.”

It is useful to characterize the type of information these questions are seeking. Question 1 is asking about the main effect of the brand factor. If you ignore the tempera- ture (by averaging over the various levels of it), do some brands tend to go farther than some others? This is obviously a key question for the study. Question 2 is also asking about a main effect, the main effect of the temperature factor. If you ignore the brand (by aver- aging over all brands), do balls tend to go farther in some temperatures than others? The answer to this question is obvious to golfers. They all know that balls compress better, and hence go farther, in warm temperatures than in cool temperatures. Therefore, this is not a key question for the study, although you would certainly expect the study to confirm what experience indicates.

Main effects indicate whether there are different means for treatment levels of one factor when averaged over the levels of the other factor.

Questions 3 and 4 are asking about interactions between the two factors. These inter- actions are often the most interesting results of a two-way study. Essentially, interactions (if there are any) provide information that could not be guessed by knowing the main

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-5 Two-Way ANOVA 19-27

Interactions indicate patterns of differences in means that could not be guessed from the main effects alone. They exist when the effect of one factor on the dependent variable depends on the level of the other factor.

effects alone. In this example, interactions are patterns of the averages in the range B5:D9 that could not be guessed by looking only at the “main effect” averages in column E and row 10. Specifically, the order of brands in column E, from largest to smallest average yardages, is E, C, B, A, D. If there were no interactions at all, this ordering would hold at each temperature. For these data, it is close. At the cool temperature, the ordering is C, E, B, A, D; for mild, it is E, B, C, D, A; for warm, it is E, C, A, B, D. Actually, having no interactions implies even more than the preservation of these rankings. It implies that the difference between any two brands’ averages is the same at any of the three temperature levels. For example, the differences between brands E and D at the three temperatures are 224.8 − 215.0 = 9.8, 255.7 − 237.6 = 18.1, and 270.9 − 256.1 = 14.8. If there were no interactions at all, these three differences would be equal.

The concept of interaction is much easier to understand by looking at graphs. The graphs in Figures 19.20 and 19.21, which are both outputs from the StatTools Two-Way ANOVA procedure, represent two ways of looking at the pattern of averages for differ- ent combinations of brand and temperature—that is, the averages in the range B5:D9 of Figure 19.19. The first graph shows a line for each brand, where each point on the line corresponds to a different temperature. The second graph shows the same information with the roles of brand and temperature reversed. Neither graph is “better” than the other; they simply show the same data from different perspectives. The key to either is whether the lines are parallel. If they are, then there are no interactions—the effect of one factor on average yardage is the same regardless of the level of the other factor. The more nonparal- lel they are, however, the stronger the interactions are. The lines in either of these graphs are not exactly parallel, but they are nearly so. This implies that there is very little interac- tion between brand and temperature in these data.

280.00

270.00

260.00

250.00

240.00

230.00

220.00

210.00

200.00 Cool Mild

Interac�on Plot: Brand by Tempeand by Tempeand by T rature

Warm

A

B

C

D

E

Figure 19.20 One View of Interactions in Golf Ball Example

Remember that the interactions become stronger as the lines in either of these graphs become more nonparallel.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-28 Chapter 19 Analysis of Variance and Experimental Design

In general, interactions can be of several types. We show two contrasting types in Figures 19.22 and 19.23. (For simplification, these focus on two brands only. They are based on different data from those used in the different data from those used in the different Golf Ball.xlsx file.) In Figure 19.22, brand A dominates at all temperatures. However, there is an interaction because the difference between brands increases as temperature increases. In this situation the interaction effect is interesting, but the main effect of brand—brand A is better when averaged over all temperatures—is also interesting. The situation is quite different in Figure 19.23, where there is a “crossover.” Brand A is somewhat better at cool temperatures, but brand B is better at mild and warm temperatures. In this case the interaction is the most interesting finding, and the main effect of brand is much less interesting. In simple terms, if you are a golfer, you would buy brand A in cool temperatures and brand B otherwise, and you wouldn’t care very much which brand is better when averaged over all temperatures.all temperatures.all

Interac�on Plot: Temperature by Brand 280.00

270.00

260.00

250.00

240.00

230.00

220.00

210.00

200.00 A B C D E

Cool Mild Warm

Figure 19.21 Another View of Interactions in Golf Ball Example

300

275

250

225

200 Cool Mild Warm

A B

Figure 19.22 One Possible Pattern of Interactions

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-5 Two-Way ANOVA 19-29

For these reasons, you check first for interactions in a two-way design. If there are first for interactions in a two-way design. If there are first significant interactions, then the main effects might not be as interesting. However, if there are no significant interactions, then main effects generally become more important.

Summing up what we have seen so far, main effects are differences in averages across the levels on one factor, where these averages are averages over all levels of the other facall levels of the other facall - tor. In a table of sample means, such as in Figure 19.19, you can check for main effects by looking at the averages in the “Grand Total” column and row. In contrast, the interactions are patterns of averages in the main body of the table and are best shown graphically, as in Figures 19.20 and 19.21. They indicate whether the effect of one factor depends on the level of the other factor.

The next question is whether the main effects and interactions you see in a table of sample means are statistically significant. As in one-way ANOVA, this is answered by an ANOVA table. However, instead of having just two sources of variation, within and between, as in one-way ANOVA, there are now four sources of variation: one for the main effect of each factor, one for interactions, and one for variation within treatment level com- binations. For the golf ball data, two-way ANOVA separates the total variation across all 300 observations into four sources. First, there is variation due to different brands produc- ing different average yardages. Second, there is variation due to different average yard- ages at different temperatures. Third, there is variation due to the interactions apparent in the interaction graphs. Finally, there is the same type of “within” variation as in one-way ANOVA. This is the variation that occurs because yardages for the 20 balls of the same brand hit at the same temperature are not all identical. (This within variation is usually called the “error” variation in statistical software packages.)

Two-way ANOVA collects this information about the different sources of variation, using fairly complex formulas, in an ANOVA table as shown in Figure 19.24. [This is the output from StatTools, by selecting Two-Way ANOVA from the Statistical Inference group in StatTools, selecting Brand and Temperature as the categorical (C1 and C2) variables and Yards as the measurement (Val) variable. The output includes tables of sample sizes, sam- ple means, and sample standard deviations, as well as the ANOVA table.] The four sources of variation appear in rows 37–40. Rows 37 and 38 are for the main effects of brand and temperature, row 39 is for interactions, and row 40 is for the within (error) variation. Each source has a sum of squares and a degrees of freedom. Also, each has a mean square, the ratio of the sum of squares to the degrees of freedom. Finally, the first three sources have an F-ratio and an associated p-value, where each F-ratio is the ratio of the mean square in that row to the mean square error in cell D40.

300

275

250

225

200 Cool Mild Warm

A B

Figure 19.23 Another Possible Pattern of Interactions

Main effects are typically less important when interactions exist. Therefore, it is common to check for significant interactions first.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-30 Chapter 19 Analysis of Variance and Experimental Design

You test whether main effects or interactions are statistically significant in the usual way—by examining p-values. Specifically, you can claim statistical significance if the corresponding p-value is sufficiently small, less than 0.05, say. Looking first at the inter- actions, the p-value is about 0.03, which says that the lines in the interaction graphs are significantly nonparallel, at least at the 5% significance level. You might dispute whether this nonparallelism is practically significant, but there is statistical evidence that at least some interaction between brand and temperature exists. The two p-values for the main effects in cells F37 and F38 are practically 0, meaning that there are differences across brands and across temperatures. Of course, the main effect of temperature was a foregone conclusion—you already knew that balls do not go as far in cold temperatures—but the main effect of brand is more interesting. According to the evidence, some brands definitely go farther, on average, than some of the others. ■

A 7 Two-Way ANOVA for Yards by Brand and Temperature 8 ANOVA Sample Sizes 9 A

Cool Mild Warm Totals

Cool Mild Warm Totals

20 20 20 20 20

100 100 100

20 20 20 20 20

20 20 20 20 20

60 60 60 60 60

10 B 11 C 12 D 13 E 14 Totals

Totals

Balanced TRUE15 16 17

ANOVA Sample Means18 A 218.82 236.45 258.44 237.9019 B 224.15 245.13 258.27 242.5220 C 228.00 242.72 263.04 244.5821 D 215.00 237.62 256.11 236.2422 E 224.79 255.75 270.94 250.4923

24 222.15 243.53 261.36 25 26 27 28 29 30 31

TwoWay ANOVA Table

32 33 34 35 36 37 Brand

Temperature 77086.00 7702.44

38 39 Interac�on 1999.97 40 Error 33329.13 41 Total 120117.53

2 4

8 285 299

38543.00 1925.61 16.47

329.58 2.14

<0.0001 <0.0001

0.0325250.00 116.94

B C D E F

Cool Mild Warm Totals

Totals

ANOVA Sample Std Dev A 10.90 8.83 11.01 19.22 B 11.70 9.80 8.93 17.36 C 10.85 14.25 7.08 18.15 D 13.64 10.18 12.13 20.69 E 10.67 10.96 9.05 21.84

12.28 12.78 10.98

Sum of Degrees of Mean Squares Squares

F-Ra�o p-Value Freedom

Figure 19.24 StatTools Two-Way ANOVA Output for Golf Ball Data

ANOVA Tip: Unbalanced Designs StatTools can handle only balanced two-way designs. Unbalanced designs, where sample sizes are not equal across treatment level combinations, are mathematically more dif�cult to analyze. The best way to do this is with regression with dummy variables, similar to the method discussed in Section 19-3. You can �nd an excellent discussion of this issue in Chapters 23 and 24 of the textbook by Kutner et al. (2005).

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-5 Two-Way ANOVA 19-31

19-5a Confidence Intervals for Contrasts

If you �nd that main effects and/or interactions are signi�cant, then you will probably want to check which factor levels, or factor level combinations, produce signi�cantly larger means than others. Recall that the StatTools One-Way ANOVA procedure provides con�- dence intervals for differences between each pair of means. This same option is not pro- vided in two-way ANOVA because there would typically be too much output to digest, and much of it would probably not be very useful. Given the purposes of any particular study, there are usually a few comparisons you would like to make, and this can be done fairly easily after the StatTools Two-Way ANOVA procedure has been run. We illustrate the methods in this section.

First, recall that a contrast is any difference between weighted averages of means. An example of a simple contrast is the difference between two means, such as μ3 − μ1. You would study this contrast if you were interested in whether μ3 is different from μ1. An example of a more complex contrast is (μ1 + μ2)/2 − (μ3 + μ4 + μ5)/3. You would study this contrast if you were interested in whether the average of μ1 and μ2 is different from the average of μ3, μ4, and μ5. Note that the coef�cients of these contrasts sum to 0. For example, (1⁄1⁄1 2⁄2⁄ + 1⁄1⁄1 2⁄2⁄ ) – (1⁄1⁄1 3⁄3⁄ + 1⁄1⁄1 3⁄3⁄ + 1⁄1⁄1 3⁄3⁄ ) = 0 . All contrasts have this property. Obviously, many contrasts could be constructed. The ones you construct for any particular study depend entirely on what you are interested in. You might be interested in several simple contrasts or one or two more complex contrasts.

A contrast is any linear combination of means (sum of coefficients multiplied by means) such that the sum of the coefficients is 0. It is typically used to compare one weighted average of means to another.

Once StatTools has been used to run a two-way ANOVA, you can then form con�- dence intervals for any contrasts of interest. The general form of the con�dence interval is given by Expression (19.5). Here, the point estimate of the contrast is formed by sub- stituting sample means for the μ’s in the contrast, MSW is the mean square error from the MSW is the mean square error from the MSW ANOVA table, njnjn is the sample size corresponding to any particular mean in the contrast, cjcjc is the coef�cient of the corresponding μjμjμ in the contrast, and the summation is over all terms in the contrast.

The StatTools Two-Way ANOVA procedure finds MSW for this formula. However, you must calculate the other ingredients with Excel formulas.

Confidence Interval for Contrast

Point estimate of contrast ± multiplier × ÅMSMSM Waj c2jcjc /njnjnÅ (19.5)

As an example, if the contrast is a simple difference between means such as μ1 − μ4, then the point estimate is Y1 − Y4Y4Y , and the cjcjc ’s are c1 = 1 and c4 = −1, so that c

2 1 = 1 and

c24 = 1. Therefore, the con�dence interval becomes

Y1 − Y4Y4Y ± multiplier × "M"M" SMSM W(1/n1 + 1/n4)"

which is the same as the formula given in Sections 19-2 and 19-4 for one-way ANOVA. As in one-way ANOVA, the multiplier in the con�dence interval can be chosen in

several ways to handle the multiple comparison problem appropriately. We indicate typical possibilities in the following continuation of the golf ball example.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-32 Chapter 19 Analysis of Variance and Experimental Design

E X A M P L E 19.3 DRIVING DISTANCES FOR GOLF BALL BRANDS (CONTINUED)

One golf ball retail shop would like to test the claims that (1) brand C beats the average of the other four brands in cool weather and (2) brand E beats the average of the other four brands when it is not cool. Are these two claims supported by the data in the Golf Ball.xlsx file?

Objective To form and test contrasts for the golf ball data, and to interpret the results.

Solution Let μC,W be the mean yardage for brand C balls hit in warm weather, and define similar means for the other brands and temperatures. Then the first claim concerns the contrast

μC,C − μA,C + μB,C + μD,C + μE,C 4

and the second concerns the contrast

μE,M + μE,W 2

μAμAμ ,M + μAμAμ ,W 2

+ μB,M + μB,W

2 +

μC,M + μC,W 2

+ μD,M + μD,W

2 4

= μE,M + μE,W

2 −

μA,M + μA,W + μB,M + μB,W + μC,M + μC,W + μD,M + μD,W 8

(Note in this second contrast how we average over the mild and warm temperatures. This is because the second claim just specifies “not cool.”) A good way to handle the calculations in Excel is illustrated in Figure 19.25. For either contrast, you first record the coefficients of the means in the contrast. These appear in the ranges H13:J17 and H26:J30. (Note that the sum of the values in each of these ranges is 0. This is required for contrasts, as we discussed previously.) Then the point estimate of a contrast is the SUMPRODUCT of the sample means and these coefficients. For example, you calculate the point estimate of the first contrast in cell H19 with the formula

=SUMPRODUCT(H13:J17,B19:D23)

The multiplier for these confidence intervals is always a thorny issue, but most stat- isticians agree that if only a small number of confidence intervals are being formed, as in this example, you can use the usual t-value, where the degrees of freedom is the one corresponding to the error (within) variation. Therefore, the multiplier for each contrast is approximately 2, found in cell H18 with the formula

=T.INV(H8+(1-H8)/2,C40)

Then because each sample size is 20 (the value in cell B9), you can find the lower and upper limits of the confidence intervals from Expression (19.5). For example, the confi- dence interval for the first contrast is found with the formulas

=H19-H18*SQRT(D40*SUMSQ(H13:J17)/B9)

and

=H19+H18*SQRT(D40*SUMSQ(H13:J17)/B9)

in cells H20 and H21.

Remember that Excel’s SUMSQ function sums the squares of the values in a given range.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-5 Two-Way ANOVA 19-33

Figure 19.25 Confidence Intervals for Contrasts in Golf Ball Example

G 7 Confidence intervals for contrasts

Confidence level8 9

95%

Cool Mild Warm

10 11 12 13 14

Mul�plier 1.968 Point es�mate 7.31 Lower limit 1.99 Upper limit 12.63

15 16 17 18

A

19

B

20

C

21

D

22

E

23 24 25 26 27 28 29 30 31 32 33 34

H I J K

Comparing brand C against average of others in cool weather

Comparing brand E against average of others in non-cool weather

Matrix of coefficients

Matrix of coefficients

–0.25 0 0 0 0 0

0 0 0 0 0

–0.25

–0.25 –0.25

1

Cool Mild Warm

Mul�plier 1.968 Point es�mate 13.62 Lower limit 9.86 Upper limit 17.38

A B C D E

–0.1250 0 0 0 0

–0.125 –0.125 –0.125

0.5

–0.125 –0.125 –0.125 –0.125

0.5

As you can see, both claims are supported. The confidence intervals for the two con- trasts extend from 1.99 to 12.63 and from 9.86 to 17.38—all positive yardages. It looks like brand C beats the average of the competition by at least 1.99 yards in cool weather, and brand E beats the average of the competition by at least 9.86 yards in weather that is not cool. ■

If you want to examine a lot of contrasts, then you should use one of the other con- �dence interval methods discussed in Section 19-4, the two preferred methods being the Bonferroni and Scheffé methods. The only difference is in the multiplier used. For the Bonferroni method, suppose you want to form k con�dence intervals. Then rather than using the t-value that has probability α in the tails, you should use the t-value that has probability α/k in the tails. For example, if you want to form k = 2 con�dence intervals at the 95% con�dence level, as above, then α = 0.05 and α/k = 0.025, so you put probability 0.025 in the tails rather than 0.05. The effect is that each of the two con�dence intervals is constructed separately at the 97.5% level. The multiplier in the golf ball example (cell H18 in Figure 19.25) would use the formula

=T.INV(H8+(1-H8)/4,C40)

which evaluates to 2.253. This larger multiplier would result in slightly wider con�dence intervals.

The Scheffé method is the most “conservative” method in the sense that it generally produces the widest con�dence intervals. However, the relevant multiplier for this method is rather complex and will not be discussed here.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-34 Chapter 19 Analysis of Variance and Experimental Design

19-5b Assumptions of Two-Way ANOVA

The assumptions for the two-way ANOVA procedure are basically the same as for one-way ANOVA. If we focus on any particular combination of factor levels, such as brand A golf balls hit in cool weather, then we assume that (1) the distribution of values (yardages) for this combination is normal, and (2) the variance of values at this combination is the same as at any other combination. It is always wise to check for at least gross violations of these assumptions, especially the equal-variance assumption. The StatTools output provides an informal check by providing a table of standard deviations for the factor level combina- tions. For the golf ball example, this table is shown in Figure 19.26. Obviously, these stand- ard deviations are not all exactly equal, but we would never expect exact equality in any exact equality in any exact real study. Because these standard deviations are of similar magnitude, there is no reason to worry about the equal-variance assumption for these data. Besides, the equal-variance assumption is less important when the design is balanced, as this one is.

P R O B L E M S

Level A 18. Suppose a company that sells residential carpet

cleaning equipment wants to judge the sales effectiveness of two factors: factor A, the type of sales presentation used by its salespeople, and factor B, the type of previous experience or training its salespeople have had in selling this type of equipment. Specifically, there are two types of presentations the company wishes to test. These two levels of factor A are the “hard-sell” approach, level 1, and the more relaxed “soft-sell” approach, level 2. The company also differentiates among four levels of past experience/ training. These levels of factor B are labeled 1 through 4 and are defined as follows: (1) no past experience as a salesperson and no formal training in how to be a salesperson, (2) no past experience and some formal training, (3) some past experience and no formal

training, and (4) some past experience and some formal training.

To see how presentation and experience/training affect sales, the company runs an experiment with 80 of its recently hired salespeople, 20 of whom fall into each of the four experience/training levels described above. Within each group of 20 salespeople at a given experience/training level, 10 are told to use a hard-sell approach and the other 10 are told to use a soft-sell approach. Of course, the hard-sellers and soft-sellers are instructed very carefully in the types of presentation they are supposed to use. During a 4-month period, the number of sales for each of the 80 salespeople is recorded. The data are listed in the file P19_18.xlsx. The company wishes to infer from these data whether the different presentations and experience/training backgrounds cause significant differences in sales.

A 27 28 29 30 31 32 33

B C D E Cool Mild Warm Totals

Totals

ANOVA Sample Std Dev A 10.90 8.83 11.01 19.22 B 11.70 9.80 8.93 17.36 C 10.85 14.25 7.08 18.15 D 13.64 10.18 12.13 20.69 E 10.67 10.96 9.05 21.84

12.28 12.78 10.98

Figure 19.26 Checking the Equal-Variance Assumption

As we demonstrated in Example 19.2, however, the log transformation is often useful when variances are far from equal across factor level combinations. At least, this transfor- mation is often worth trying. If it works—that is, if it tends to equalize the variances and maybe even make the data more normal—then two-way ANOVA can be carried out on the log-transformed data exactly as we demonstrated in Example 19.2.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 More About Experimental Design 19-35

a. Assess the main effect of the presentation approach factor upon sales.

b. Assess the main effect of the previous experience and training factor upon sales.

c. Do you find evidence of significant interactions between the two factors in this case? Explain.

19. A study is performed on a sample of residential homes to discover whether the size of the monthly heating bill depends on the type of heat or the type of home. In particular, three types of heat are examined: electric, natural gas, and oil. Also, all homes are classified into two types: those on a single level and those with at least two stories. In a single community, ten houses of each type, using each type of heat, are located and their heating bills for February of the past year are observed. These data are listed in the file P19_19.xlsx. Assume that the homes in this study are approximately equivalent in terms of overall square footage and level of insulation. a. Do you find evidence of a significant main effect for

the heat type factor? Explain. b. Do you find evidence of a significant main effect for

the home type factor? Explain. c. Do you find evidence of significant interactions

between the two factors? Explain.

20. An automobile dealer would like to know whether the amount of money spent on a new automobile depends on (1) the age of the buyer, and (2) whether the buyer is accompanied by his or her spouse. Data on 60 recent new vehicle purchases, including purchase prices, are listed in the file P19_20.xlsx. Test for any significant main

effects and interactions at the 10% level, and briefly summarize your findings.

Level B 21. Consider again the two-way ANOVA hypothesis test

described in Problem 18. Construct a 95% confidence interval for each possible pairwise difference between means. Interpret your results. Recall that the relevant data are listed in the file P19_18.xlsx.

22. Consider again the two-way ANOVA hypothesis test described in Problem 19. Recall that the relevant data are listed in the file P19_19.xlsx. a. A natural gas supplier claims that homes which use

gas heat generate an average February heating bill that is less than the average February heating bill of all other homes that use electricity or heating oil. Is this claim supported by the given data? Explain.

b. A heating oil supplier claims that homes that use heating oil generate an average February heating bill that is less than the average February heating bill of all other homes that use electricity or natural gas. Is this claim supported by the given data? Explain.

23. The file P19_23.xlsx lists data for a two-way ANOVA in which each of the two factors has two levels. Note that there are 25 observations for each of the four treatment combinations. a. Are the assumptions of two-way ANOVA met for

these data? If not, do what you can to correct any problem(s).

b. Test for any significant main effects and interactions at the 5% level. Briefly summarize your results.

19-6 MORE ABOUT EXPERIMENTAL DESIGN The purpose of this chapter is to introduce key ideas and analysis techniques for the most common (and simple) single-factor and multi-factor models. In each of these models, we analyze how a dependent variable varies when one or more factors are varied at several lev- els. Although the same analysis can be used in observational studies or in designed exper- iments, we focus now on designed experiments. This is particularly important because many businesses are just now beginning to see the potential of designed experiments for reducing cost, increasing pro�t, and producing higher-quality items. (Examples of this were provided in the introductory vignette to this chapter.)

We can break up the topic of experimental design into two parts: (1) the actual design of the experiment, and (2) the analysis of the resulting data. In this section we expand on these, mostly on the design but to some extent on the analysis, just to provide a sense of what is possible. Speci�cally, we discuss some key issues in experimental design and some of the more popular designs. However, the discussion in this section is by no means com- plete. Many books have been written about experimental design and the required statistical analysis [see Berger and Maurer (2002), Schmidt and Launsby (1994), and DeVor et al. (1992), for example, for very readable accounts of the topic], so we can barely scratch the surface.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-36 Chapter 19 Analysis of Variance and Experimental Design

Experimental design, as opposed to the statistical methods for analyzing the result- ing data, has to do with the selection of factors, the choice of the treatment levels, the way experimental units are assigned to the treatment level combinations, and the condi- tions under which the experiment is run. These decisions must be made before the experi- ment is performed, and they should be made very carefully. Experiments are typically costly and time-consuming, so the experiment should be designed (and performed) in a way that will provide the most useful information possible.5 costly and time-consuming, so the experiment should be designed (and performed) in a

5 costly and time-consuming, so the experiment should be designed (and performed) in a

Unfortunately, proper exper- imental design is by no means intuitive. We want the most for our money, but it is usu- ally not clear how to achieve it. Therefore, a whole science of experimental design has developed through the years. We will summarize some of its most important results here.

19-6a Randomization

The purpose of most experiments is to see which of several factors have an effect on a dependent variable. The factors in question are chosen as those that are controllable and are most likely (among all possible factors) to have some effect. Often, however, there are “nuisance” factors that cannot be controlled, at least not directly. If nothing is done about these nuisance factors, they can possibly mask the effect of the “important” fac- tors, so that we do not achieve the desired results. One important method for dealing with such nuisance factors is randomization, where we attempt to spread the levels of the nui- sance factors randomly to the various levels of the experimental factors. We illustrate this extremely important idea in Example 19.4.

Randomization is the process of randomly assigning experimental units so that nuisance factors are spread uniformly across treatment levels.

E X A M P L E 19.4 TESTING FOR SHARPNESS IN INKJET PRINTERS

Acomputer magazine company regularly tests products from different manufacturers for differences in various aspects of quality. For its next issue, it would like to test sharpness of printed images across three popular brands of inkjet printers. It purchases one printer of each brand, prints several pages on each printer, and measures the sharpness of image on a 0–100 scale for each page. A subset of the data and the analysis appear in Figures 19.27 and 19.28. (See the file Printers.xlsx.) They indicate that printer A is best on average and C is worst. Why might these results be misleading?

Figure 19.27 Printer Data

A 1

2

3

4

5

6

28

29

30

31

B Printer Brand

A

A

A

A

C

C

C

C

A

Sharpness

85

88

92

85

85

76

86

87

92

© C

e n g

a g

e L

e a rn

in g

5For example, think of the car-crashing experiments you see on TV for evaluating car safety. They are expensive experiments!

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 More About Experimental Design 19-37

Figure 19.28 Results from an Experiment Before Randomizing

Objective To use randomization of paper types to see whether differences in sharpness are really due to different brands of printers.

Solution This is a single-factor design, where the single factor, brand of printer, is varied at three levels. Suppose, however, that there is another factor, type of paper, that is not the primary focus of the study but might affect the sharpness of image. For the sake of discussion, sup- pose further that all type 1 paper is used in printer A, all type 2 paper is used in printer B, and all type 3 paper is used in printer C. Then it is very possible that the apparent effect of printer is really an effect of paper type. Specifically, it is possible that type 1 paper tends to produce the sharpest image, regardless of the printer used. We can’t know this for sure, but it is certainly possible given our (flawed) experimental design. The solution is to rand- omize over paper type. For each sheet of paper to be printed by any printer, we randomly select a paper type. This will tend to even out the paper types across the printers. Then if the average sharpness of image from printer A is still higher than the averages from the other two brands, we will have more confidence that this is due to differences in printers, not types of paper. Note that it is not necessary to use equal numbers of sheets of each not necessary to use equal numbers of sheets of each not paper type in the experiment. For example, if paper type 1 is the most used paper type by

© C

e n g

a g

e L

e a rn

in g

A 7 One-Way ANOVA for Sharpness by Printer Brand

8 ANOVA Summary

9 Total Sample Size

Sharpness (A) Data Set #1

Sharpness (B) Data Set #1

Sharpness (C) Data Set #1

30

84.767

3.285

10.789

3

95.00%

10 Grand Mean

11 Pooled Std Dev

12 Pooled Variance

13 Number of Samples

14 Confidence Level

15

16

17 ANOVA Sample Stats

18 Sample Size 10 10 10

19 Sample Mean 88.800 83.700 81.800

20 Sample Std Dev 3.011 2.669 4.022

21 Sample Variance 9.067 7.122 16.178

22 Pooling Weight 0.3333 0.3333 0.3333

23

24

25

26

27

28

29

30

31

OneWay ANOVA Table

32

33

34

Between Varia�on

Within Varia�on 291.300

262.067

Total Varia�on 553.367

27

2

29

10.789

131.033 12.145 0.0002

B C D E F

Sum of Squares

Degrees of Freedom

Mean Squares

F-Ra�o p-Value

Confidence Interval Tests

Sharpness (A)-Sharpness (B)

Sharpness (A)-Sharpness (C)

Sharpness (B)-Sharpness (C)

7.000

5.100

1.900

3.35651367

1.45651367

–1.74348633

10.64348633

5.54348633

8.74348633

Difference of Means

Tukey UpperLower

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-38 Chapter 19 Analysis of Variance and Experimental Design

actual users, then we might use more of it in the experiment. The important point is that no printer is fed a much higher proportion of any paper type than any other printer.

We illustrate how this might be implemented with random numbers in Figure 19.29. Based on actual usage, suppose that approximately 50% of the paper used in the experi- ment is of type 1, 35% is of type 2, and 15% is of type 3. This information is entered in col- umns F and G. Then to randomize paper types across printers, we enter random numbers in column B with the RAND() function, enter the formula

=IF(B2<=$G$3,1,IF(B2<=$G$3+$G$4,2,3))

in cell C2, and copy down column C. Of course, Figure 19.29 shows only the experimen- tal design. Now it is up to the company to run the experiment with the printers and paper types shown (one piece of paper per row), measure the sharpness levels, and perform the same statistical analysis as described in Section 19-2. That is, after we randomize and collect the data, the analysis is the usual one-way ANOVA. This time, however, because we have randomized over paper types, we can be more confident that any observed differences across printers are indeed due to the printers themselves and not differences in paper. ■

Figure 19.29 Experimental Design Using Randomization

19-6b Blocking

Randomization is one method for eliminating the effects of one or more nuisance factors. Another method is called blocking. Like randomization, blocking is extremely important and is used in many applications. Actually, you have already seen perhaps the simplest form of blocking in Chapters 8 and 9 in the discussion of the paired-sample procedure. In a study of differences between pretest and post-test performance scores, for example, each person is de�ned as a “block.” The idea is that pretest and post-test tend to be correlated— some people do well on both, whereas some do poorly on both—so by using a paired- sample procedure, you “block out” the differences among people and are able to focus on the differences between the two tests.

There are many forms of blocking designs, but we will describe only the simplest: the randomized block design with a single experimental factor and a single blocking variable. Suppose there are T treatment levels of the single factor and B blocks. Then you use T × B experimental units and assign T of these to each block. If it is possible (or makes sense), you can also randomize the T experimental units in any block to the T treatment levels. We illustrate the typical setup in the following example.

A 1 Printer Brand Sharpness Distribu�on of paper type

2 A

3 A

A

A

A

A

C

C

C

C

C

4

5

6

7

27

28

29

30

31

C D E F G HB Random Number Paper Type

Type Pct

50%

15%

35%

0.487642251

0.721544637

0.404243214

0.647971901

0.752277178

0.036587599

0.715408714

0.598789252

0.221325535

0.974606651

0.00353146

1

2

1

1

2

2 3

2

1

2

2

1

3

1

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 More About Experimental Design 19-39

In a randomized block design, the experimental units are divided into several “similar” blocks. Then each experimental unit within a given block is randomly assigned a different treatment level.

E X A M P L E 19.5 THE EFFECT OF SOAP DISPENSERS ON SOAP SALES

SoftSoap Company is introducing a new product into the market: liquid soap for wash-ing hands. Four types of soap dispensers are being considered. SoftSoap has no idea which of these four dispensers will be perceived as the most attractive or easy to use, so it runs an experiment. It chooses eight supermarkets that have traditionally carried SoftSoap products, and it asks each supermarket to stock all four versions of its new product for a 2-week test period. It records the number of items purchased of each type at each store during this period. (See the file Soap Sales.xlsx.) How might we describe (and analyze) this experiment?

Objective To use a blocking design with store as the blocking variable to see whether type of dispenser makes a difference in sales of liquid soap.

Solution At first glance, this might look exactly like a one-way design as described in Section 19-2. There is a single factor, dispenser type, varied at four levels, and there are eight observa- tions at each level. For example, we obtain a count of sales for dispenser type 1 at each of eight stores. However, it is very possible that the dependent variable, number of sales, is correlated with store. That is, some stores might sell a lot of each dispenser type, whereas others might not sell many of any dispenser type. (For example, stores in areas where there are a lot of manual labor jobs might sell a lot more hand soap than stores in a university area.) Therefore, we treat each store as a block, so that the experimental design appears as in Figures 19.30 and 19.31. Each treatment level (dispenser type) is assigned exactly once to each block (store). As a practical matter, if each dispenser type is stocked on a different shelf in the store, randomization could also be used, where each store is instructed to rand- omize the order of dispenser types from top shelf to bottom shelf.

You can analyze these data essentially the same way you analyze a two-factor design, that is, with two-way ANOVA. There are two differences, one technical and one of interpretation. The technical difference is that because there is only one observation in each combination of treatment level and block, it is impossible to estimate an interaction

Figure 19.30 Soap Sales Data

A 1 Store Dispenser Sales

2 1

3 1

1

1

2

7

8

8

8

8

4

5

6

29

30

31

32

33

B C

68

82

94

72

72

70

65

77

80

81

1

2

3

4

1

4

1

2

3

4

As this example illustrates, the blocking variable—and even the decision whether to block—depends entirely on the specific problem.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-40 Chapter 19 Analysis of Variance and Experimental Design

Figure 19.31 Randomized Block Design for Soap Example

effect and a “within” error variance simultaneously. Therefore, we assume there are no important interaction effects between treatment levels and blocks, and we attribute all variation other than that from main effects to error variation. The output is shown in

© C

e n g

a g

e L

e a rn

in g

A 7 Two-WTwo-WT ay ANOwo-Way ANOwo-W VA for Sales by Store and Dispenser

8 ANOVA Sample Siz

9 1

1 2 3 4

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

1

8 8 8 8

Totals

4

4

4

4

4

4

4

4

10 2

11 3

12 4

13 5

6

7

8

14

Totals

Balanced TRUE

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

TwoWTwoWT ay ANOwoWay ANOwoW VA Table Table T

32

33

34

35

36

37

Store

Dispenser 1617.00

4313.50

38

39

Error 729.00

40

41

Total 6659.50

3

7

21

31

539.00

616.21 17.75

15.53

<0.0001

<0.0001

34.71

B C D E F

42

43

44

45

46

47

48

49

B C D E

ANOVA Sample Means

1

1 2 3 4

68.00

72.00

70.00

49.00

66.00

48.00

57.00

65.00

82.00

96.00

73.00

56.00

84.00

54.00

75.00

77.00

94.00

104.00

76.00

60.00

94.00

56.00

81.00

80.00

72.00

78.00

59.00

61.00

75.00

43.00

70.00

81.00

61.88 74.63 80.63 67.38

Totals

79.00

87.50

69.50

56.50

79.75

50.25

70.75

75.75

2

3

4

5

6

7

8 Totals

ANOVA Sample Std De

1

1 2 3 4

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

9.37 14.04 16.72 12.48

Totals

11.60

15.00

7.42

5.45

12.01

5.91

10.21

7.37

2

3

4

5

6

7

8 Totals

Sum of Degrees of Mean

Squares Squares F-Ra�F-Ra�F o p-Value-Value-V

Freedom

Sample Sizes

Sample Means

d Dev

able Table T

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 More About Experimental Design 19-41

Figure 19.31. To obtain this output, use the StatTools Two-Way ANOVA procedure, with Store and Dispenser as the two categorical variables. Because there is only one observation per store/dispenser combination, the ANOVA table has no Interaction row. Nevertheless, it still provides interaction charts, one of which appears in Figure 19.32, to check for the no-interaction assumption. If there were no interactions, the lines in this chart (one for each store) would be parallel. Although these lines are not exactly paral- lel, it appears that the effect of dispenser type is approximately the same at each store. Therefore, the no-interaction assumption appears justified.

Figure 19.32 Interaction Chart for Soap Example

Interac�on Plot: Store by Dispenser 120.00

100.00

80.00

60.00

40.00

20.00

0.00 1 2 3 4

1 2 3 4 5 6 7 8

There are two F-values and corresponding p-values in the ANOVA table in Figure 19.31. The one in row 47 is for the main effect of dispenser type, whereas the one in row 46 is for the main effect of store. The former is of more interest because this is the focus of the experiment. Its p-value is essentially 0, meaning that there are significant differences across dispenser types. In fact, judging by the sample means, the ranking of dispenser types in decreasing order is 3, 2, 4, 1, and there is a considerable gap between each of these. If SoftSoap had to market only one dispenser type, it would almost certainly select type 3. The p-value for the main effect of store is also essentially 0, which means that the stores differ significantly with respect to average sales. This is not as interesting a finding—in fact, we use a block design precisely because we suspect such an effect—but it does confirm that a block design is a good idea.

We can also confirm that blocking was useful by running a one-way ANOVA on the data, using Dispenser as the single factor and ignoring Store. The results appear in Figure 19.33. The differences across dispenser type are still significant at the 5% level (the p-value is still less than 0.05), but they are not as significant as when a blocking variable is used. By comparing the ANOVA tables in Figures 19.31 and 19.33, you can see that the error (within) sum of squares in the latter, 5042.5, is split into two parts in the former: the block sum of squares, 4313.5, and the error sum of squares, 729. By having a lower error sum of squares, you obtain a more powerful test for dispenser differences. The point is that when differences across stores are ignored, they tend to mask the differences across dispenser types.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-42 Chapter 19 Analysis of Variance and Experimental Design

Blocking is one of the most powerful methods in experimental design. It allows you to “control” for a variable, such as store, that is not of primary interest but could introduce an unwanted source of variation. Experimental designers should always be on the lookout for possible blocking variables. They generally result in more powerful tests. ■

Figure 19.33 Results for Soap Example Using One-Way ANOVA

19-6c Incomplete Designs

Recall that the two-factor designs discussed in Section 19-5 are called full factorial designs. full factorial designs. full factorial In a full factorial design you obtain one or more observations for each combination of treat- ment levels. For example, if there are two factors with 5 and 7 treatment levels, respectively, then you replicate the experiment at each of the 5 × 7 = 35 treatment level combinations. If there are three factors with 3, 5, and 7 treatment levels, respectively, then you replicate at each of the 3 × 5 × 7 = 105 combinations. By running an experiment in this way, you can estimate all main effects and interactions. A full factorial design is the preferred way to run an experiment from a statistical point of view, but it can be very expensive, even infeasible, if there are more than a few factors.

In industrial settings, there are often a large number of input factors that can be varied to produce a product. (Think, for example, of the number of factors that might be varied in an attempt to produce a car door that doesn’t rattle.) Each of these factors might have a main effect on some dependent variable of interest, and there might also be important interactions between input factors. The question is how to design an experiment so that you get as much useful information as possible and stay within budget (either time or money). To get an idea of the problem, suppose there are 12 input factors. Even if you use only two treatment levels (“low” and “high”) for each factor, there are 212 = 4096 treatment level combinations in a full factorial design—probably many more than could be tested.

© C

e n g

a g

e L

e a rn

in g

A 7 One-Way ANOOne-Way ANOOne-W VA for Sales by Dispenser

8 ANOVA Summary Summary Summar

9 Total Sample Size

Sales (1) Data Set #1

Sales (2) Data Set #1

Sales (3) Data Set #1

32

71.13

13.42

180.09

4

95.00%

10 Grand Mean

11 Pooled Std Dev

12 Pooled Varianceooled Varianceooled V

13 Number of Samples

14 Confidence Level

15

16

17 ANOVA Sample Stats

18 Sample Size 8 8 8

19 Sample Mean 61.88 74.63 80.63

20 Sample Std Dev 9.37 14.04 16.72

21 Sample VarianceSample VarianceSample V 87.84 197.13 279.70

22 Pooling Weight 0.2500 0.2500 0.2500

Sales (4) Data Set #1

8

67.38

12.48

155.70

0.2500

23

24

25

26

27

28

OneWay ANOOneWay ANOOneW VA Table Table T

Between Varia�onBetween Varia�onBetween V

Within Varia�onWithin Varia�onWithin V 5042.50

1617.00

Total Varia�ontal Varia�ontal V 6659.50

28

3

31

180.09

539.00 2.99 0.0477

B C D E FB C D E

Sum of Squares

Degrees of Freedom

Mean Squares

F-Ra�F-Ra�F o p-Value-Value-V

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-6 More About Experimental Design 19-43

Because this is very common in real applications, statisticians have devised incomplete, or fractional factorial, designs that test only a fraction of the possible treatment level combinations. Obviously, something is lost by not gaining information on all of the posall of the posall - sible combinations. Speci�cally, different effects are confounded, which means that they cannot be estimated independently. As an example, the main effect of factor D might be confounded with the three-way interaction effect of factors A, B, and C. In this case it is impossible to tell, because of the design, whether a particular set of observed differences is due to factor D or to the interaction of factors A, B, and C. You would probably conclude that the differences are due to factor D, simply because three-way interaction effects are typically not very important, but you cannot be absolutely sure.

This is a fairly dif�cult topic, and we will not be able to cover it in much detail. However, just to give you a taste of what is involved, we illustrate a “half-fractional” design with four factors, each at two levels, in Figure 19.34. (See the �le Fractional Design.xlsx.) If this were a full factorial design, there would be 24 = 16 combinations of treatment levels. The “half-fractional” design means that only half, or eight, of these are used. When using only two levels for each factor, it is customary to label the lower level with a −1 and the higher level with a +1. Therefore, each row in the �gure represents one of eight combina- tions of the factor levels. For example, the �rst row uses the higher level of each factor. (Then when implementing the experiment, several experimental units would be assigned to each combination, so that there would be several observations per row.)

A 1 Half-factorial design with 4 factoractorial design with 4 factoractorial design with 4 f s

2

3 A

1

1

1

1

–1

–1

–1

–1

B

1

1

–1

–1

1

1

–1

–1

C

1

–1

1

–1

1

–1

1

–1

D

1

–1

–1

1

–1

1

1

–1

4

5

6

7

8

9

10

11

3 A

B C DB CFigure 19.34 A Half-Fractional Design with Four Factors

To see how the confounding works, it is useful to create new columns by multiplying the appropriate original A–D columns. For example, the AC column is the product, row by row, of the A and C columns. As in usual algebra, the result is +1 if there are an even num- ber of −1’s, and −1 if there are an odd number of −1’s. The results appear in Figure 19.35. Note that there is now a column for each possible two-way and three-way interaction. If you compare these columns, you will notice that they come in pairs. For example, the A column has exactly the same pattern as the BCD column, the AB column has the same pat- tern as the CD column, and so on. When two columns are identical, we say that one is the alias of the other. The practical impact is that if two effects are aliases of one another, it is impossible to estimate their separate effects. Therefore, we try to design the experiment so that only one of these is likely to be important and the other is likely to be insigni�- cant. In this particular design, each main effect (single letter) is aliased with a three-way interaction—A with BCD, B with ACD, and so on. If three-way interactions are unlikely to be important, then any signi�cant �ndings can be attributed to main effects, not three-way interactions. But note that the two-way interactions are confounded with each other—AB with CD, AC with BD, and AD with BC. It will probably be dif�cult to unravel these.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-44 Chapter 19 Analysis of Variance and Experimental Design

As we have indicated, there is a whole science devoted to creating incomplete designs such as the one in Figure 19.34, and to analyzing the resulting data. [We again refer to Schmidt and Launsby (1994) and DeVor et al. (1992) for introductory accounts of the topic.] The usual approach, especially when there are a large number of potentially important input factors, is to run a highly fractional experiment (a small fraction of all possible treatment level combinations) to “screen” for the relatively few factors that have important effects. Having found these, a more detailed experiment, perhaps even a full factorial experiment, can be run to investigate the few important factors more fully. As the introductory vignette to this chapter explains, the results are often very impressive. These experiments can lead to lower costs, higher sales, higher reliability, and higher customer satisfaction—in short, to better products.

A 1 Half-factorial design with 4 factoractorial design with 4 factoractorial design with 4 f s

2

3 A

1

1

1

1

–1

–1

–1

–1

B

1

1

–1

–1

1

1

–1

–1

C

1

–1

1

–1

1

–1

1

–1

D

1

–1

–1

1

–1

1

1

–1

AB

1

1

–1

–1

–1

–1

1

1

AC

1

–1

1

–1

–1

1

–1

1

AD

1

–1

–1

1

1

–1

–1

1

BC

1

–1

–1

1

1

–1

–1

1

BD

1

–1

1

–1

–1

1

–1

1

CD

1

1

–1

–1

–1

–1

1

1

ABC

1

–1

–1

1

–1

1

1

–1

ABD

1

–1

1

–1

1

–1

1

–1

ACD

1

1

–1

–1

1

1

–1

–1

BCD

1

1

1

1

–1

–1

–1

–1

4

5

6

7

8

9

10

11

3 A

B C DB C E F GE F H I JH I NK L MK L

Two-way interac�ons Three-way interac�ons

Figure 19.35 Confounding Effects in an Incomplete Design

P R O B L E M S

Level A 24. Suppose that a producer of single-room air conditioners

wishes to test four prototype air conditioning units. The dependent variable is the number of days an air conditioner will function properly before its motor needs major repair. In this case the producer is interested in only one factor, the type of air conditioner, at four different levels. However, the manufacturer suspects that the type of use might affect the time until major repair. Specifically, these air conditioning units are used in three environments: (1) in residential homes located in northern climates, where they are used only on an occasional basis during the summer months; (2) in residential homes located in moderate climates, where they are used frequently during the summer months and seldom during other seasons of the year; and (3) in residential homes in southern climates, where they are used frequently throughout the year except during the cooler winter months. The producer suspects that these different environments may tend to obscure real differences among the four types of air conditioners.

To conduct this experiment, the producer has allocated 20 air conditioners of each type. Provided that the air conditioner producer is interested primarily in how the type of unit affects the time until major

repair, how can the company control for the type of environment? Assume that approximately 10% of all single-room air conditioners produced by this company are used in homes located in northern climates, 25% are used in homes located in moderate climates, and 65% are used in homes located in southern climates. Explain, in detail, how the producer should set up this experiment.

25. Consider again the one-way ANOVA hypothesis test described in Problem 6. How could blocking be employed to control for a factor that is not of primary interest yet could introduce an unwanted source of variation in this case?

26. Consider again the one-way ANOVA hypothesis test described in Problem 7. How could blocking be employed to control for a factor that is not of primary interest yet could introduce an unwanted source of variation in this case?

Level B 27. Following the example presented in Section 19-6c,

illustrate a half-fractional design with five factors, each at two levels. Specifically, generate figures similar to Figures 19.34 and 19.35 to support your verbal explanation. Identify the aliases.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-7 Conclusion 19-45

19-7 CONCLUSION This chapter has focused on the design of experiments and the statistical analysis of the resulting data, called analysis of variance. This methodology has long played an impor- tant role in agriculture and many natural sciences, particularly the medical sciences. The business world is just beginning to realize the importance of designed experiments for designing and producing better products, and this trend will undoubtedly continue as more people receive training in the techniques of experimental design and analysis of variance. It is important to keep sight of the overall goal: to see whether variations in one or more factors have signi�cant effects on a dependent variable of interest. The role of experimen- tal design is to set up experiments in a way—using randomization, blocking, fractional factorial designs, or whatever—to get as much information from the resulting data as pos- sible. Then the techniques of ANOVA indicate whether any main effects or interactions are signi�cant. If there are signi�cant effects, con�dence intervals can be formed to measure the magnitudes of speci�c differences between means or other contrasts. The goal of good experimental design is to identify important factor effects when they exist.

Term Explanation Excel Page Equation Number

Analysis of variance (ANOVA)

A collection of methods for testing for differences in means across subpopulations (or across a single population treated in different ways)

19-2

Observational study A study that uses readily available information

19-3

Designed experiment A study in which data are obtained under controlled experimental conditions

19-3

Experimental design The plan that determines how many observations to obtain at which combinations of experimental conditions

19-4

Dependent variable The variable that is measured in an ANOVA study

19-4

Factors The categorical variables that serve as the explanatory variables in an ANOVA study

19-4

Treatment levels The possible values of a factor 19-4

Experimental units The people, machines, or whatever, that are measured in an ANOVA study

19-4

One-way ANOVA An ANOVA study with a single factor StatTools/Statistical Inference/ One-Way ANOVA

19-4

Two-way ANOVA An ANOVA study with two factors StatTools/Statistical Inference/ Two-Way ANOVA

19-4

Balanced design An experimental design where the same number of experimental units is assigned to each treatment level combination

19-5

ANOVA table A table that includes the ingredients (sums of squares, degrees of freedom, mean squares, F-ratio, and p-value) for tests of equal means

StatTools/Statistical Inference/ One-Way (or Two-Way) ANOVA

19-8 19.1, 19.2, 19.3

Summary of Key Terms

(continued)

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-46 Chapter 19 Analysis of Variance and Experimental Design

Term Explanation Excel Page Equation Number

Confidence intervals in ANOVA

Confidence intervals for differences between pairs of means (or contrasts)

StatTools/Statistical Inference/ One-Way ANOVA

19-8 19.4, 19.5

Multiple comparison problem

The problem that when many statements are made, each with a stated level of confidence, the probability that at least one will be wrong is much larger than anticipated

19-20

Contrast A weighted combination of means where the weights sum to 0; used to contrast one combination of means with another

19-23

Bonferroni, Tukey, Scheffé methods

Methods that expand confidence interval lengths to correct for the multiple comparison problem

StatTools/Statistical Inference/ One-Way ANOVA

19-20

Full factorial design An experimental design in which observations are made at each combination of factor levels.

19-25

Incomplete (or fractional) design

An experimental design in which observations are made only at a selected subset of the combinations of factor levels

19-25

Main effects Indications of differences across levels of one factor (when averaged over the levels of the other factor)

Statistical Inference/Two-Way ANOVA

19-26

Interactions Situation where the effect of one factor on a dependent variable depends on the level of another factor

Statistical Inference/Two-Way ANOVA

19-26

Randomization The random assignment of experimental units to various levels of factors

19-36

Blocking A technique of assigning experimental units to similar blocks of experimental units to decrease error variation

Statistical Inference/Two-Way ANOVA

19-38

Confounding The (unavoidable) confusion of some effects with others in an incomplete experimental design

19-43

Summary of Key Terms (Continued )

P R O B L E M S

Conceptual Questions C.1. ANOVA is always a test of the equality of means. So

why is the method called analysis of variance?

C.2. In ANOVA terminology, there are “factors” and “treatment levels.” Give at least two examples of possible factors and treatment levels to illustrate that you understand what these terms mean.

C.3. Explain what the key ratio, the F ratio, in a one-way ANOVA table is all about and why it is the basis for a test of equal means.

C.4. Explain why there are several choices (in StatTools and other packages) for the type of confidence intervals in one-way ANOVA. Specifically, what problem do these variations attempt to solve?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C.5. Explain exactly how regression can be used as an alternative to the “standard” one-way ANOVA methodology. Which p-values from the two methods are guaranteed to be the same?

C.6. In academic papers that are based on data analysis, you often see a correlation matrix from the observed data with asterisks indicating the “significant” correlations (those that are significantly different from 0). How does Section 19-4 on the multiple comparison problem relate to this situation? (By the way, academic researchers often offer no evidence that they are even aware of the multiple comparison problem. Maybe they are, but who knows?)

C.7. What is the difference between a full factorial design and an incomplete factorial design? If the former is “better,” why would you ever use the latter?

C.8. A study is performed on a sample of residential homes to discover whether the size of the monthly heating bill depends on the type of heat or the type of home. In particular, three types of heat are examined: electric, natural gas, and oil. Also, all homes are classified into two types: those on a single level and those with at least two stories. What might an interaction effect look like in this situation? Intuitively, do you think there is any reason to expect an interaction effect?

C.9. Chapters 8 and 9 discussed paired comparisons as one possibility when analyzing the difference between two means. What does this have to do with blocking, as discussed in Section 19-6b?

C.10. Part of the title of this chapter is “experimental design.” Why is the design of an experiment so important? What is the main disadvantage of an experiment that is not properly designed?

Level A 28. Although four similar-sized small-car models exhibit

similar miles per gallon (mpg) sticker ratings, there is some skepticism as to whether their mean mpg values are really equal. To test this equal-means hypothesis, several cars of each model are driven for 10,000 miles under nearly identical driving conditions. The observed mpg values are listed in the file P19_28.xlsx. Use one-way ANOVA to help decide whether the different models have equal mean mpg values, and write a short report to summarize your findings.

29. A professional golf association wants to compare the mean distances traveled by four brands of golf balls when struck by the same driver. Specifically, a robotic golfer uses a driver to hit a random sample of 80 balls (i.e., 20 balls of each brand). Note that the 80 balls are hit in random order. The distance is recorded for each hit, and the results are listed in the file P19_29.xlsx. a. Is there any indication of differences in the mean

distances traveled by the four types of balls?

Perform an appropriate statistical test and report a p-value.

b. Select an appropriate significance level and construct confidence intervals for all pairs of differences between means. Which of these differences, if any, are statistically significant at the selected significance level?

30. Boxes of a popular cereal brand are filled by five identical machines at a local production plant. Independent samples are randomly drawn from a large number of cereal boxes filled by each machine, and the number of ounces of cereal in each selected box is listed in the file P19_30.xlsx. Use one-way ANOVA to help decide whether the five machines are yielding essentially equivalent average fills (in ounces). Briefly summarize your findings.

31. Assume that we gather independent random samples from large batches of each of three different brands of lightbulbs. We then list the lifetime of each selected bulb in the file P19_31.xlsx. a. Test whether the different brands of lightbulbs have

equal average lifetimes at the 10% significance level. b. Based on 90% confidence intervals for all pairs

of differences between means, which of these differences, if any, are significantly nonzero at the 10% significance level?

32. Consider again the one-way ANOVA hypothesis test described in Problem 28. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence overall confidence overall level of approximately 95%. How do these results compare to the uncorrected 95% confidence intervals?

33. Consider again the one-way ANOVA hypothesis test described in Problem 29. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confi-overall confi-overall dence level of approximately 99%. Compare the widths of the confidence intervals generated with each of these methods with those of uncorrected 99% confidence intervals. Explain your findings.

34. Consider again the one-way ANOVA hypothesis test described in Problem 30. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence overall confidence overall level of approximately 95%. Summarize your results.

35. Consider again the one-way ANOVA hypothesis test described in Problem 31. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 90%. Compare the widths of the confidence intervals generated with each of these methods with those of uncorrected 90% confidence intervals. Explain your findings.

36. A commuter airline wants to determine the combination of advertising medium (four levels) and

19-7 Conclusion 19-47 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

C A S E 19.1 KRENTZ APPRAISAL SERVICES

Nancy Krentz, the owner and manager of a property appraisal service based in York, Pennsylvania, is concerned that her four appraisers (Allen, Felan, Maloy, and Nelson) are producing appraisals of comparable properties that are generally not equivalent. She wants to conduct an investigation to determine whether her concerns are valid. Nancy directs her administrative assistant, Katie Shaffer, to identify 40 similar properties in the

York area for use in the study. Given the sample of comparable properties, Nancy then arbitrarily divides the 40 properties into four subsets of ten. Next, she randomly assigns each subset to one of the four appraisers for assessment. The appraisals of the given 40 properties are listed in the file C19_01.xlsx. Given Nancy’s limited background in statistical analysis, she has asked for your expert assistance in evaluating the data that her assistant

advertising agency (two levels) that would produce the largest increase in ticket sales per advertising dollar spent. Each of the two advertising agencies has prepared advertisements in formats required for distribution by each of the media (including television, radio, newspaper, and website). Forty small towns of roughly the same size have been selected for this experiment. Furthermore, groups of five of these small towns have been assigned to receive an advertisement prepared and distributed by each of the eight agency–medium combinations. The dollar increases in ticket sales per advertising dollar spent, based on a one-month period, are listed in the file P19_36.xlsx. Test for any significant main effects and interactions at the 5% level, and briefly summarize your results.

37. The file The file The f P19_37.xlsx lists the miles per gallon for each of three different octanes (Octane A, Octane B, and Octane C) of gasoline and three types of vehicles (light, medium, and heavy). Subsets of ten vehicles of each type have been randomly assigned to each octane level. a. Do you find evidence of a significant main effect for Do you find evidence of a significant main effect for Do you f

the octane factor? Explain. b. Do you find evidence of a significant main effect for Do you find evidence of a significant main effect for Do you f

the vehicle type factor? Explain. c. Do you find evidence of significant interactions Do you find evidence of significant interactions Do you f

between the two factors? Explain.

38. In an effort to increase unit sales of particular products In an effort to increase unit sales of particular products In an ef in the short run, many supermarkets reduce the price of these products and increase their display space. Consider three levels of each factor: for the price factor, (1) normal price, (2) moderately reduced price, and (3) heavily reduced price; and for the display factor, (1) normal display space, (2) moderately increased display space, and (3) heavily increased display space. Suppose that each of these nine treatment combinations was applied five times to a

specific product at a particular supermarket. Each treatment application lasted 7 days, and the dependent variable was unit sales for the week. The data for this experiment are listed in the file P19_38.xlsx. Test for any significant main effects and interactions at the 1% level, and briefly summarize your results.

39. Consider again the one-way ANOVA hypothesis test described in Problem 29. Suppose now that the pro- fessional golf association wants to compare the mean distances traveled by four brands of golf balls using human golfers instead of a robotic golfer. Each human golfer who participates in the experiment will employ the same type of driver to hit a subset of the 80 balls. a. Explain how a randomized experimental design

could be used to perform this one-way ANOVA. b. Explain how a randomized block design could be

used to perform this one-way ANOVA.

Level B 40. A production manager believes that the time required

to assemble a particular product depends on the type of training that workers on the line receive. Four different training programs have been administered to workers of roughly equal experience at the local plant during the past year. To test her hypothesis, the production manager gathers assembly time data for randomly selected subsets of workers who have participated in one of the four training programs. These times are listed in the file P19_40.xlsx. Use one-way ANOVA to help decide whether the different training programs yield equivalent average assembly times, and write a short report to summarize your findings.

41. Consider again the one-way ANOVA hypothesis test described in Problem 40. Address the multiple comparison problem by applying the Bonferroni, Tukey, and Scheffé methods to obtain an overall confidence level of approximately 95%. Briefly summarize your results.

19-48 Chapter 19 Analysis of Variance and Experimental Design Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

19-49

has compiled. She recalls that at one point in her business studies she learned a systematic method, called analysis of variance, for comparing the averages of related groups of quantitative data. However, she cannot recall the assumptions that must be met to apply this methodology, nor the procedures for implementing the appropriate method and correctly interpreting the results. Nancy has prepared the following list of questions that she would like for you to help her answer:

1. What requirements must be met to apply analy- sis of variance? Is it appropriate to use analysis of variance in this case?

2. Assuming that it is appropriate to apply a form of analysis of variance here, how can she use the appropriate method to analyze the data?

3. Does the statistical analysis confirm her suspicion that there are individual differences among the four appraisers? If so, which of the four appraisers are typically generating evaluations that are larger or smaller than those of the others?

4. Has the statistical test been formulated in the best manner? In particular, was it appropriate for Nancy to divide the 40 selected properties into four subsets of ten and then assign each subset to one of the appraisers? If not, how could the design of the study be modified to discover the most useful information in evaluating the appraisal staff at Krentz? Be as specific as possible.

5. In light of the results of this data analysis, what steps, if any, should Nancy take to improve the situation in her organization?

Case 19.1 Krentz Appraisal Services 19-49 Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-1

STATISTICAL PROCESS CONTROL AT NORTEL

Northern Telecom (Nortel) is a leading global provider of digital network hardware and software solutions for communications, information, entertainment, education, and commerce. As of 1996, it had annual worldwide revenues of $12.85 billion. Due to a 1995 U.S. Federal Communications Commission action, the auctioning of a section of frequency bandwidth reserved for advanced digital cellular communications, Nortel saw the opportunity to move into a new technology, personal communications services (PCS). The company decided to build a new manufacturing operation, Wireless Networks Raleigh (WNR) in Raleigh, North Carolina. The new plant was dedicated to manufacturing advanced cell-site base-station and antenna equipment, with many of the designs for the plant’s products coming from Nortel operations in France and the United Kingdom. From the outset, senior managers recognized that state-of-the-art manufacturing practices were necessary for WNR. Among other things, this included computer-based data collection from the manufacturing processes, statistical process control on literally hundreds of product characteristics, and the ability to act on the information in a timely manner, both in North Carolina and in European sites.

A team of analysts created a decision-support system to achieve these objectives. Their work is described in the article by Brinkley et al. (1998). A key component of the system is its statistical process control capability. The communications products developed at WNR contain circuit boards and other assembly items that must meet stringent quality specifications. To ensure that this happens, the system continually monitors hundreds of prod- uct characteristics and produces real-time control charts. Typical illustrations of these appear in Figures 20.1 and 20.2. (Much of this chapter deals with the meaning and interpretation of such charts, so we urge you to take another look at them after you have studied this chapter.) The basic objectives of

Statistical Process Control

C H A P T E R

20

W ill

ia m

P e ru

g in

i/S h u

tt e rs

to c k.

c o m

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-2 Chapter 20 Statistical Process Control

these charts are to show everyone involved—workers on the shop floor, design engineers, and senior managers—how the manufacturing process is currently operating and to suggest corrective actions in case the process is not behaving as desired. Such charts are in use in most manufacturing companies. However, an interesting aspect of the system developed by Nortel is that these charts (and the spreadsheet data on which they are based) are available instantly through the company’s intranet. For example, a design engineer in Paris can immediately see current data from Raleigh simply by logging onto the intranet. This real-time capability cuts the time for data analysis and decision making tremendously, compared to the traditional methods of report generation and distribution.

REFA Sinewave - mvpp Chart Date: Mon Apr 21 16:23:19 1997 Data Appears to be Normal HISTOGRAM/PROCESS CAPABILITY

USL 950.00

CP 1.47663 CPU 1.51257 CPL 1.44068 K 0.02342 CPK 1.44068

880.575

745.131

609.688

750.00

550.00LSL

0 5 10 15 20

COUNT (Individuals)

25 30 35 40

ULim

LLim

MeanNom

Figure 20.2 Process Capability Chart for Nortel System

© C

e n g

a g

e L

e a rn

in g

X-Bar

Range

USL

LSL

Nom ULim

296 294 291 288

286

10 6 4 2

290 LLim

Mean

USL ULim

LLim

Mean

ss=6 97/4/4/ 12:04:06first sample 97/4/4/ 12:08:52last sample

Temperature Preheater #1 Figure 20.1 X and R Charts for Nortel System

© C

e n g

a g

e L

e a rn

in g

The analysts developed and implemented this decision-support system within a 12-month period at a cost of $500,000. The annual costs of supporting the system were, at least initially, about $800,000. Given that revenues in 1996 at WNR were already $320 million, this low system cost is very impressive. The company estimated that the direct benefits of the system, primarily from reduced work-in-process and reduced rework and scrap production, were over $1 million annually. However, there are other more qualitative benefits from the system. It has had a definite positive impact on customer satisfaction due to improved quality and reliability, and employee satisfaction has improved as a result of increased knowledge and empowerment. ■

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-1 Introduction 20-3

20-1 INTRODUCTION One of the areas where statistics has had the largest impact in the business world is the area of quality. For many years quality was not emphasized, especially by U.S. companies. Gradually, spurred on by foreign competition, high levels of quality became a competitive advantage for the best companies, and today most companies are simply not competitive unless they have excellent quality. One of the best examples of this change is in the auto- mobile industry. All we need to do is compare U.S. cars produced in the 1970s with those produced now to see the tremendous improvements in quality that have been achieved in the past few decades. U.S. automobile manufacturers can now compete successfully with their Japanese and European counterparts, and much of this is due to the improvements in quality in U.S. manufacturing plants. Of course, this improvement in quality became nec- essary in the U.S. automobile industry. Without quality improvements, U.S. market shares would have continued to fall into the hands of foreign competitors.

The quality movement in the United States (and abroad) has taken on almost a reli- gious fervor in recent years. It has spawned a number of acronyms, including TQM (total quality management), QC (quality control), SPC (statistical process control), QFD (quality function deployment), and others. Some of the best-known consultants and researchers in the area, including Joseph Juran, Genichi Taguchi, Philip Crosby, and W. Edwards Deming, have become business heroes and are commonly referred to as “quality gurus.” Since its inception in 1987, there has been �erce competition for the Malcolm Baldrige National Quality Award, an award given to U.S. manufacturing and service companies on the basis of their superior quality initiatives and performance.

In the larger context, the quality movement comprises much more than just statistical or quantitative methods. It is also about leadership, worker empowerment, producer/ supplier relationships, interest in the customer, and other broad business issues. However, a large part of the success of the quality movement is due to the increased use of quantitative methods, both in manufacturing and in service industries. Our focus in this chapter is on a set of quantitative tools generally referred to as statistical process control (or SPC).

There are various goals of SPC, but perhaps the two most important goals can be summarized as:

■ Get it right the �rst time.

■ Reduce variation.

In the past, quality was often synonymous with inspection. Completed parts or assem- blies were routinely inspected for problems, and those that failed inspection were scrapped or sent back for rework. This emphasis on inspection is good in that it tries to keep faulty products from reaching the customer, but it is expensive. Time and resources used to �x mistakes could be used more pro�tably if there were no mistakes to �x. The quality gurus argued that it is much better to catch mistakes early in the production process, where they are less costly to �x, than to wait for �nal inspection. Besides, by focusing on the sources of problems early in the process, the causes of the problems become more apparent, and future problems can be prevented. Therefore, getting it right the �rst time is the focus of many quality program initiatives.

The second goal is to reduce variability. As Deming and others have preached, variability is the main culprit that hurts quality, and everything that is possible must be done to eliminate variability. However, to do so, companies must be able to measure it and give workers a way to reduce it. This is exactly the objective of control charts, the statisti- cal tool we will discuss throughout much of this chapter. Control charts enable an operator on the shop �oor to see what a production process is currently doing. Then by following

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Chapter 20 Statistical Process Control

established guidelines, the operator and/or management can often root out the causes of variability and produce a better product—before it passes on to �nal inspection.

The quality movement and the statistical tools for quality improvement are usually discussed in the context of manufacturing. Indeed, much of the impetus for SPC came from manufacturing industries. However, the same ideas that have resulted in dramatic improve- ments in manufacturing apply to service industries. The banking industry, the hotel indus- try, and others also need to reduce variability and get it right the �rst time. Fortunately, these service industries can also bene�t from control charts and other SPC tools. A bit more creativity is sometimes required to apply the tools appropriately, but it can be done.

20-2 DEMING’S 14 POINTS W. Edwards Deming is probably more responsible than any other single individual for today’s emphasis on quality.1 W. Edwards Deming is probably more responsible than any other single individual for

1 W. Edwards Deming is probably more responsible than any other single individual for

A statistician by trade, Deming took his theories and statisti- cal tools to Japan shortly after World War II. At that time, of course, Japan was just starting to rebound from the devastation of the war. Deming taught the newly emerging Japanese industries the principles of quality management, for which they are now well known. He became a legend in Japan. In fact, the quality award Japan gives that is comparable to our Baldrige Award is called the Deming Prize.

However, Deming (and his teachings) remained largely unknown in the United States until the early 1980s. At that time, U.S. manufacturing industries were �oundering with poor-quality products, and Deming—along with a few other quality gurus—began teaching them the statistical principles they would need to compete successfully. Today Deming’s philosophy greatly in�uences decision making at many major U.S. companies, including Procter and Gamble, Xerox, Ford, and General Motors.

Deming is perhaps best remembered for his famous 14 points, a list of precepts he taught in all of his seminars. We present and discuss these points here to give an overview of quality management. [They are adapted from Deming (1986).] As will be obvious, some of these 14 points are more quantitatively oriented than others. However, we reiterate that Deming was �rst and foremost a statistician who strongly believed in taking constant meas- urements and applying appropriate statistical techniques to reduce variation. He was no idle armchair philosopher!

1. CONSTANCY OF PURPOSE. Create constancy of purpose toward improve- ment of product and service, allocating resources to provide for long-range needs rather than only short-term profitability, with a plan to become competitive, stay in business, and provide jobs.

It is tempting for U.S. companies, whose attention is often on short-term finan- cial measures, to adopt quality initiatives (with a lot of fanfare) and then abandon them whenever they conflict with short-term objectives. This defeats the purpose of the quality initiatives. Besides, it leads employees to believe that a given quality initiative is simply the “gimmick of the month.” The only way to adopt Deming’s teachings successfully is for management to “walk the talk” and show a constancy of purpose that workers can appreciate.

2. THE NEW PHILOSOPHY. Adopt the new philosophy. We are in a new economic age, created in Japan. We can no longer live with commonly accepted levels of delays, mistakes, defective materials, and defective workmanship. Transformation of Western management style is necessary to halt the contin- ued decline of industry.

1Deming died at the age of 93 in 1993.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-2 Deming’s 14 Points 20-5

The type of change Deming envisioned is not simply a few quick changes that can be adopted overnight. It is an entirely new philosophy, and most companies have had to completely rethink the way they do things. However, unless companies strive continually to move in this direction, they are doomed to lose out to their more enlightened competitors.

3. CEASE DEPENDENCE ON MASS INSPECTION. Eliminate the need for mass inspection as a way to achieve quality by building quality into the product in the first place. Require statistical evidence of built-in quality in both manu- facturing and purchasing functions.

Companies should concentrate on preventing defects rather than detecting them. As stated earlier, the traditional emphasis in American companies was on final inspection. Unfortunately, final inspection of a defective product does not always provide information on how to improve product quality. It is better to use control charts and other statistical tools to monitor product quality at each step of a process. Then quality problems can be corrected as they occur. Besides, 100% inspection is costly and delays deliveries, and it is not always accurate. To illustrate that 100% inspection is not always accurate, simply ask several people to count the number of “f”s on this page. (Most will miss the “f”s in “of.”) So even if the inspectors know what they’re looking for, they don’t always find it.

4. END LOWEST-TENDER CONTRACTS. End the practice of awarding busi- ness solely on the basis of price tag.

It is sad but true that the lowest-price vendor may also have the lowest quality. Saving one cent on each “widget” placed in a car may later cost a company mil- lions of dollars in repair costs and lawsuits due to accidents caused by the faulty part. Deming believed a company should use as few suppliers as possible. Ideally he believed a company should use a single supplier (called single sourcing). He argued that single sourcing leads to a trusting relationship that increases the quality of goods produced. In accordance with Deming’s teachings, the automobile compa- nies have in recent years greatly reduced the number of suppliers they use. In this way, they and their suppliers no longer play an adversarial role but instead forge long-term relationships and work together to improve quality. This cooperation has become increasingly possible with Web technology and enterprise resource plan- ning (ERP) software, such as SAP, that enables companies to share information with their suppliers in real time.

5. IMPROVE EVERY PROCESS. Improve constantly and forever the system of production and service, to improve quality and productivity, and thus con- stantly decrease costs.

Deming believed that unenlightened managers often respond only to crises— that is, they wait until things get so bad that they are impossible to ignore. It is much better to make improvements continually and thereby try to keep crises from occur- ring in the first place. The statistical tools we will discuss are intended to do this. By using them continually, companies are able to detect a problem almost immediately when it occurs, and they are generally able to learn more about their processes so that lasting improvements can be made.

6. INSTITUTE TRAINING. Institute modern methods of training for every- body’s job, including management, to make better use of every employee.

Employees need to understand the entire process, not just their own jobs. Most Japanese companies, including Toyota, have adopted this philosophy. Deming believed that training is an investment for the long term in the company’s most

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Chapter 20 Statistical Process Control

important assets, its employees. For example, in its early days, Motorola University (Motorola’s employee training center) estimated a 3300% return on training at plants where managers supported the quality policy. Unfortunately, some companies fail to see the long-term value of worker training and scrap training programs as soon as financial resources become tight. Deming argued strongly that this is exactly the wrong strategy to take.

7. INSTITUTE LEADERSHIP OF PEOPLE. Adopt and institute leadership aimed at helping people to do a better job.

Supervisors should not focus on the negative. They should promote teamwork, not divisiveness, and they should stress quality, not quantity. One of Deming’s most controversial views is his rejection of performance appraisals. He believed that they undermine teamwork. His reasons are that (1) most variation is a part of the system, over which the workers have little or no control, so it makes little sense to reward or penalize workers for something they cannot control; (2) individual and departmental targets and objectives destroy cooperation between departments; and (3) reliance on pay as a motivator destroys pride in work and individual crea- tivity. Deming saw the ideal leader as a coach and teacher, not a watchman. He believed that the primary objective of leadership should be to motivate people to work to their maximum level of performance. When they complain about “worker attitudes” as the cause of poor quality, they usually miss the real cause: the system itself. It is actually worse than this: When workers are placed under conditions that force them to do a poor job, they are likely to stop caring, in which case they will probably perform even worse.

8. DRIVE OUT FEAR. Encourage effective two-way communication and other means to drive out fear throughout the organization so that everybody can work effectively and more productively for the company.

When all relationships between different levels of employees (workers versus supervisors, middle management versus upper management, and so on) are adver- sarial and based on fear, it is difficult to make improvements. Workers attempt to “hide” from their supervisors rather than cooperate with them, and each level of management is fed what the level below thinks it wants to hear. Fortunately, this style of management, once so prevalent in the United States, is now beginning to give way to one based on trust and cooperation.

9. BREAK DOWN BARRIERS. Break down barriers between departments and staff areas.

It is usually counterproductive to the company as a whole if the individual departments have little knowledge of one another’s roles, and it is even worse if individual departments work only for their own good, not the good of the company. Fortunately, we are now seeing more cross-functional teams, often formed to tackle specific problems. Obviously, this brings different areas of expertise to the solution of problems, and it encourages cooperation.

10. ELIMINATE EXHORTATIONS. Eliminate the use of slogans, posters, and exhortations for the workforce, demanding zero defects and new levels of pro- ductivity, without providing methods.

Deming’s point here is that it does little good to exhort workers to “do it right the first time” if the system prevents them from doing so. It actually discourages workers, since they are being exhorted to do something beyond their power to achieve. Management would be wiser to improve the system so that workers can do the jobs they are being asked to do.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-3 Introduction to Control Charts 20-7

11. ELIMINATE ARBITRARY NUMERICAL TARGETS. Eliminate work stand- ards that prescribe quotas for the workforce and numerical goals for people in management.

Establishing arbitrary standards for workers can be counterproductive. On one hand, if the standard is set too low, workers will do just enough to meet the standard, when in fact they could accomplish more. On the other hand, if the standard is set could accomplish more. On the other hand, if the standard is set could too high, workers will either become discouraged by the impossibility of meeting the standard or they will cut corners—and produce lower quality—in their attempt to turn out the numbers. A better approach is for management to provide helpful leadership and coaching so that workers can turn out better quality and achieve and achieve and higher productivity. After all, which worker is more productive: a worker who produces 50 parts per hour, 10 of which require rework, or a worker who produces 45 parts per hour, all of which meet specifications?

12. PERMIT PRIDE OF WORKMANSHIP. Remove the barriers that rob hourly workers, and people in management, of their right to pride of workmanship.

This is similar to the previous point. Managers must provide the workers with the motivation and tools to perform their jobs as well as possible. Most workers don’t just want to serve time at their jobs; they want to have pride in what they accomplish. Deming argued that when workers are placed in an environment where they can do their jobs properly, then productivity and quality will both improve, and workers will be happier with what they do.

13. ENCOURAGE EDUCATION. Institute a vigorous program of education, and encourage self-improvement for everyone.

Whereas point 6 is concerned primarily with job training, this point is broader. It refers to self-improvement in many dimensions. Deming’s idea is that a better educated workforce is a more valuable one. It is better able to evolve with today’s constantly changing technology, and it is more aware of broader business issues.

14. TOP MANAGEMENT COMMITMENT AND ACTION. Clearly define top management’s permanent commitment to ever-improving quality and produc- tivity, and their obligation to implement all of these principles.

This is essentially a summation of the other points. It says that if a company plans to initiate the quality improvements that are necessary to compete success- fully in today’s business world—as spelled out by the previous 13 points—then top management must lead the way. Otherwise, it won’t happen.

Deming’s 14 points are both a philosophy for becoming a quality leader and a prescrip- tion for how to do so. For the past several decades, Deming and his disciples have “spread the word” to numerous U.S. (and foreign) companies, and in many cases top management has taken the advice. We customers who now purchase high-quality cars, refrigerators, computers, and a host of other consumer items should thank Deming for his insights. They have resulted in lower prices, better and more useful features, and considerably longer times between repairs.

20-3 INTRODUCTION TO CONTROL CHARTS We now discuss control charts, one of the most important statistical tools available for reducing variability and improving quality. These types of charts were originally developed by Dr. Walter A. Shewhart of the Bell Telephone Laboratories in the 1920s, and they are still in widespread use today. They are generally easy to use, even for people not speci�- cally trained in statistics, and they provide a wealth of information about a process.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-8 Chapter 20 Statistical Process Control

To understand the reasoning behind control charts, you need to understand two types of variability in a process. No process, whether it be in a manufacturing or a service com- pany, ever produces outputs with exactly the same characteristics from item to item. There is always some variability. The question is whether the variability is an inherent part of the process or can be attributed to assignable causes. If the current variability in the output of a process is due entirely to the inherent nature of the process, we say that its variability is due to common causes and that the process is in statistical control, or simply, is an in-control process. On the other hand, if some of the current variability of the process is due to speci�c assignable causes, such as a bad batch of raw materials, an improperly adjusted machine, a new operator unfamiliar with the process, or others, we say that the process is an out-of-control process.

Common cause variability is the inherent variation in an in-control process. Assignable cause variability is the extra variation observed when a process goes out of control—which could be for any number of reasons.

One of the main purposes of control charts is to monitor a process so that a company can see when a process goes from an in-control condition to an out-of-control condition. When such a transition is discovered, then a person knowledgeable about the process (the operator of a machine, for example) can search for an assignable cause that led to the out- of-control condition and �x it, thereby bringing the process back into control.

It is important to realize that a process in control is not necessarily a good process. It good process. It good could be making a lot of items “out of specs.” There are two reasons we want to distinguish between in-control and out-of-control processes. First, an in-control process is at least predictable, regardless of whether it is any good. By measuring an in-control process, we can estimate the ability of the process to produce quality items. An out-of-control process, on the other hand, might not only be producing a lot of faulty items, but it is also unpre- dictable. It is dif�cult to change a process in a sensible way if we don’t know exactly how good or bad it is.

The second reason is that the assignable causes that produce out-of-control behavior can often be corrected by the workers on the shop �oor; that is, they generally do not require management intervention to correct. Once corrected, the process is brought back into control, and the charting can continue.

Unfortunately, there is little workers can do to improve an in-control process that has unacceptable variability. Control charts allow them to measure the amount of variability, but there is generally no way they can reduce the amount of variability without guidance from management. Essentially, workers are stuck with the current process, and (compare with Deming’s point 10) no amount of encouragement or exhortation can enable them to produce a higher-quality product unless management makes a fundamental improvement in the process itself. Control charts can measure how well an in-control process is doing, but they can’t improve a faulty process. That is the job of management.

Before looking at control charts in detail, we list the primary reasons they have become so popular.

■ They improve productivity and lower costs. Here we de�ne productivity as the number of good items produced per hour. Control charts typically allow mistakes good items produced per hour. Control charts typically allow mistakes good to be found (or prevented) early in the process—before they result in poor �nished products. Therefore, instead of having workers spend a lot of time producing items that are eventually scrapped or require rework, control charts enable them to get it right the �rst time. Obviously, when workers spend their time producing good items, they are more productive and the costs of scrap and rework are minimized.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-9

■ They prevent unnecessary process adjustments. Even an in-control process contains a certain amount of inherent common-cause variability. Without the guidance of control charts, a human operator is likely to respond to every observed up and down in the process. If the diameter of one part is too high, a downward adjustment of a machine might be made; if a subsequent diameter is too low, an upward adjustment might be made. However, if the process is actually in control and the observed ups and downs are really just “normal” amounts of variability, then such adjustments can actually make the process worse. Deming called this “tampering” and advised never to tamper with an in-control process. Control charts allow the operator to see when a process is really in need of an adjustment—because it has gone out-of-control. As long as the process is in control, adjustments shouldn’t be necessary.

■ They provide diagnostic information about the process. Control charts are similar to medical diagnostic tests. They not only signal when something is wrong, but they provide clues as to the cause of the problem. An experienced operator will monitor control charts for telltale signs of various problems. When these are spotted, then a search for assignable causes can be made, and in many cases problems can be �xed before they become major.

■ They provide information about process capability. Process capability is de�ned as the ability of a process to produce outputs that meet speci�cations. Obviously, man- agers want a high level of process capability. However, to achieve this, they need to know how well their current process is doing. Control charts help provide this inforcurrent process is doing. Control charts help provide this inforcurrent - mation, at least when the process is in control. For example, a control chart might indicate that under current in-control conditions, approximately 6 out of every 1000 parts fail to meet specs. This is the process capability. Armed with this information, management can decide whether fundamental changes in the process are warranted.

20-4 CONTROL CHARTS FOR VARIABLES There are two basic types of control charts: control charts for variables and control charts for attributes. Charts for variables are relevant when there is a measurable quantity, such as a diameter, a weight, or a thickness, that can be monitored. In this case the purpose of the chart is to see how this quantity varies through time. On the other hand, in many situa- tions an item is judged to conform to speci�cations or not—it is either a good item or a bad one—in which case a control chart for attributes is appropriate. This type of chart tracks the proportion of conforming (or nonconforming) parts through time. An attributes chart is also appropriate for tracking the number of defects (such as paint blemishes, scratches, and so on) through time. We will discuss control charts for attributes in the next section.

In this section we will illustrate two of the most common types of variables control charts: the X chart and the X chart and the X R chart. Consider any product that has some measurable characteristic such as a diameter or a thickness. To produce X and X and X R charts for this product, we typically proceed as follows. Every so often, say, every half hour, we randomly sample a small number of items and measure the characteristic. This “small number” is usually from 3 to 6, and the resulting sample of measurements is called a subsample. For the X chart we X chart we X calculate the average of the measurements in the subsample, and for the R chart we calcu- late the range (maximum minus minimum) of the measurements in the subsample. Then we plot the sequence of averages (X’s) and the sequence of ranges (R’s) in time series plots.

The resulting time series plots are more informative when centerlines and control limits are added to the charts. A centerline indicates the average value that the X’s (or R’s) vary around. Control limits place upper and lower bounds on where the X’s (or R’s) should

Tampering (making many unnecessary adjustments) with an in-control process will typically make it worse.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-10 Chapter 20 Statistical Process Control

be for a process in control. The following example provides an illustration of these charts. We will follow it up with more details on how the charts are formed.

E X A M P L E 20.1 MEASURING THE VOLUMES OF SODA CANS

The file Soda Cans.xlsx contains data on the number of ounces of soda in cans labeled “12-ounce” cans. Every half hour, five cans of soda from a production process were measured for fill volume. This was done for 70 consecutive half-hour periods. Create and interpret the X and X and X R charts.

Objective To use X and R charts to check whether the process of filling soda cans is performing as it should.

Solution Although X and R charts are quite easy to create by hand—this is the way they are often created on the shop floor—the process is tedious and better suited for computer implemen- tation. We have done so in StatTools and will explain the steps here. First, the Soda Cans .xlsx file is set up in the appropriate way for StatTools. There are five adjacent columns for the five observations taken each half hour. (These columns need not be adjacent, but that is the natural arrangement.)

To use StatTools, designate the data range as a StatTools data set in the usual way, and then select X/R Charts from the Quality Control group on the StatTools ribbon. Fill in the resulting dialog box as shown in Figure 20.3. In particular, select the variables

Figure 20.3 Dialog Box for X, R Chart Options

An X chart plots the averages of small subsamples through time. Its purpose is to see how the mean of the process is changing through time. An R chart plots the ranges (maximum minus minimum) of small subsamples through time. Its purpose is to see how the variability of the process is changing through time.

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-11

12.2

X-Bar: Obs1 – Obs5

12.15

12.1

12.05

12

11.95

11.9

11.85 1 6 11 16 21 26

Center Line Control Limit Sigma2 Limit Sigma1 Limit X-Bar

Figure 20.4 X Chart for Soda Can Fill Volumes

Obs1 through Obs5, limit the graph to observations 1 to 30, and base the control limits only on these observations.

StatTools creates a new sheet called X-R Charts. It contains the data that the control charts are based on, along with the X and R charts. These charts appear in Figures 20.4 and 20.5. On each chart, you can see that the points vary around a centerline and stay within upper and lower control limits (although one point on the X chart is very close to the upper limit). The behavior in these charts is typical in-control behavior. No points are outside in-control behavior. No points are outside in-control of the control limits, and there is no obvious “nonrandom” behavior, such as an upward trend through time. Therefore, this process appears to be in control. If there are specifica- tions on the soda cans—for example, the fill volume of a can should be between 11.88 and 12.20 ounces—then we could use the data (and the fact that the process is in control, that is, predictable) to estimate the percentage of all cans within specs. Again, this percentage all cans within specs. Again, this percentage all might not be as high as the company would like, but at least it’s predictable. ■

We now discuss in some detail how these charts are formed. The X chart is a plot of X chart is a plot of X the subsample averages, that is, the individual X’s. The centerline for this plot is the aver- age of all X’s, denoted X the subsample averages, that is, the individual

. The lower and upper control limits, denoted LCL and LCL and LCL UCL,

© C

e n g

a g

e L

e a rn

in g

Figure 20.5 R Chart for Soda Can Fill Volumes

0.55

0.45

0.35

0.25

0.15

0.05

–0.05 1 6 11 16 21 26

R: Obs1 – Obs5

Center Line Control Limit R

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-12 Chapter 20 Statistical Process Control

are approximately three standard deviations (of X) on either side of the centerline, where the standard deviation of X is X is X σ/!n!n!! and n is the subsample size. However, it has been tra- ditional to measure variability by ranges rather than standard deviations. (This is easier for nontechnical operators.) Fortunately, there is a simple relationship between them. If σ̂ is an estimate of the unknown standard deviation σ and R is the average of all R’s (one from each subsample), then

σ̂ = R/d2d2d

where d2d2d is a constant that depends only on the subsample size n. 2 The lower and upper

control limits in the X chart are then given by

LCLCLC = X − 3 σ̂/!n!n!! and

UCLCLC = X + 3 σ̂/!n!n!! For the R chart, we use the average R as the centerline and again go out three standard

deviations (of R) on either side to form the control limits. It turns out that the appropriate standard deviation is a multiple of R, so that we can write the lower and upper control limits as D3R and D4R. The constants D3 and D4 again depend only on the subsample size n and are tabulated in quality control books. We simply note that the “natural” lower control limit (three standard deviations below the centerline) can sometimes be negative. Because a negative range value makes no sense, we instead set LCLCLC = 0 in these cases. This means that the upper and lower control limits are not always the same distance from the centerline in R charts.

These details are not as important as the interpretation and use of the charts. The R chart measures within-subsample variation over time. Each R measures the variability in the process at a given point in time. If any point in the R chart goes beyond the control limits, this is an indication that the variability has changed, and we can begin searching for a reason—an assignable cause.

We typically look at the R chart �rst. Because the control limits for the X chart depend on R, they make little sense unless the R’s are in control. Assuming, however, that the R chart indicates in-control behavior, we then shift our attention to the X chart. It shows sub- sample averages over time. Any point beyond the control limits suggests a shift, either up or down, in the mean of the process. If we see such a point, we can begin searching for an assignable cause.

The description to this point might suggest that control charting is a static, one-time procedure. However, it is actually a dynamic, ongoing procedure. Typically, a company periodically recalculates (or calculates for the �rst time, if this is a new process) the control limits for X and X and X R by using a fresh set of subsamples. (At least 20 or 25 subsamples are recommended.) If any points are beyond the control limits, a search for assignable causes begins. If the search is successful, the problems are �xed. In any case, the points beyond the control limits are usually eliminated, and the remaining subsamples are used to reestimate new control limits. The purpose in this stage is to bring the process into control, if necessary.

Once the process is in control, we “continue” the control charts by plotting new points but using the just-established centerlines and control limits. We continue to do this until some type of out-of-control behavior is observed, at which time we search for assignable causes. As time proceeds, we learn more and more about the process. This learning not only enables us to keep the process from slipping out of control for extended periods of time, but it also enables us to make lasting improvements to the process. The following continuation of Example 20.1 illustrates how events might unfold.

The main thing to remember—for all control charts we will discuss—is that the lower and upper control limits are approximately three standard devia- tions below and above the centerline.

2This and other constants are tabulated in books on quality control. They have been incorporated automatically into StatTools.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-13

StatTools provides the �exibility to plot only certain subsamples and/or to base the control limits on certain subsamples or even on historical values. This enables us to mimic the way control charts are used on the shop �oor. We illustrate some of these possibilities in the following continuation of the soda can example.

E X A M P L E 20.1 MEASURING THE VOLUMES OF SODA CANS (CONTINUED)

We now assume that the first 30 subsamples of soda can fill volumes, the ones used previously in Example 20.1, were used to determine centerlines and control limits for the X and R charts. When we plot the other 40 subsamples, using the same centerlines and control limits, what do we learn about the process?

Objective To continue the X and X and X R charts to learn whether the soda can process stays in control beyond the subsamples on which the original charts were based.

Solution As the dialog box in Figure 20.3 indicates, StatTools allows you to choose the subsamples to plot, as well as the subsamples to base the control limits on. Here we will plot all of the subsamples but base the control limits (and centerlines) only on subsamples 1–30. The dialog box should be filled out as shown in Figure 20.6. The resulting X and R charts appear in Figures 20.7 and 20.8.

We first look at the R chart. It shows that the process stayed in control for at least 10 more half-hour periods beyond subsample 30. However, beginning shortly after subsample 40, the process variability appears to have increased (many points above the centerline), and finally two points, subsamples 49 and 53, jumped above the upper control limit. As if this weren’t enough evidence of an upward shift in variability, because we checked the

Figure 20.6 Dialog Box for Continuation of Control Charts

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-14 Chapter 20 Statistical Process Control

options for runs in the dialog box, we can also see runs of at least eight points above or below the centerline. (It is very unlikely to see a run this long in an in-control process.) StatTools colors such runs green.

Presumably, the operator of the process discovered the problem that was causing abnormally high variation and fixed it at around the time of subsample 55. After that point, the R chart goes back into control (where “in control” is relative to the first 30 subsam- ples). However, at about this same time, the X chart suggests a downward shift in the pro- cess mean. Many points are below the centerline, and one finally crosses the lower control limit on subsample 63. Many machines have a mechanism for adjusting the mean to some target level, such as 12.05 ounces. In the present case, it appears that this machine simply needs to be readjusted to bring its mean back up to the previous level. After this is done, both of the control charts should indicate an in-control process—at least until some other assignable cause forces it out of control again.

This example illustrates how control charts allow an operator to monitor a process con- tinuously and react quickly when problems are indicated. Without this continuous monitoring, out-of-control conditions could persist indefinitely, causing poor quality and higher costs. ■

Figure 20.7 X Chart for Continuation of Subsamples

12.2

12.15

12.1

12.05

12

11.95

11.9

11.85 0 10 20 30 40 50 60 70 80

X-Bar: Obs1 – Obs5

Center Line

Control Limit Sigma2 Limit Sigma1 Limit X-Bar

© C

e n g

a g

e L

e a rn

in g

Figure 20.8 R Chart for Continuation of Subsamples

0.55

0.45

0.35

0.25

0.15

0.05

–0.05 0 10 20 30 40 50 60 70 80

R: Obs1 – Obs5

Center Line

R

Control Limit

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-15

20-4a Control Charts and Hypothesis Testing

It is enlightening to think of control charts in the context of hypothesis testing. We let the null and alternative hypotheses correspond to in-control and out-of-control conditions, respectively. As we monitor the process with control charts, there are two types of errors we can make. The �rst, a type I error, is when we react to an out-of-control indication when in fact the process is still in control. We call this a false alarm. For example, there is some chance that a process operating in control will produce a point beyond the control limits. In this case we might begin a search for assignable causes when there are none. We might also make an unnecessary adjustment to the process to bring it back into control (unnecessary because it is still in control).

We want to make the probability of a type I error fairly small. If it is too large, we react to too many false alarms and, in Deming’s terminology, we tamper with the process. This could not only be costly, but it could actually cause an increase in the variability of the pro- cess. Therefore, we set the control limits fairly far apart—typically three standard deviations from the centerline—so that the chance of observing a point beyond them is very small.

To pursue this a bit further, assume that the X’s are normally distributed. (Because each X is an average of several observations, the central limit theorem suggests that this normal- ity assumption is reasonable.) Then we know that the probability of any X being more than three standard deviations from the mean is 0.0027. From this, we can calculate the mean number of subsamples, called the average run length, or ARL, until an in-control process produces a point beyond the control limits. It turns out to be3

ARL = 1/0.0027 ≃ 370 In other words, false alarms will be few and far between if the process remains in control.

Of course, the �ip side is a type II error. This means that the process has gone out of control but the control charts do not indicate it. As usual, it is dif�cult to calculate the probability of a type II error because there are many types of out-of-control conditions that could occur. However, let’s concentrate on one possible type of out-of-control condition, could occur. However, let’s concentrate on one possible type of out-of-control condition, could where the process variation remains constant but the mean shifts from μ to μ + kσ, where k is some �xed constant. For example, if k = 1, the process mean has shifted upward by one standard deviation. We would like to spot this shift immediately, but we won’t spot it until an X falls above the upper control limit. How long, on average, will this take?X falls above the upper control limit. How long, on average, will this take?X

Assuming that the X chart has centerline X chart has centerline X μ, the upper control limit is μ + 3σ/!n!n!! , and the mean of the process has shifted up to μ + σ, we �rst calculate the probability that an X is above the upper control limit. Because X now has mean μ + σ and standard deviation σ/!n!n!! , the calculation is a typical normal probability calculation, where we subtract the mean and then divide by the standard deviation:

P(X > μ + 3σ/!n!n!! ) = PaZ > (μ + 3σ/!n!n!! ) − (μ + σ) σ/!n!n!!

b = P(Z > 3 − !n!n!! )

Here, Z is normal with mean Z is normal with mean Z 0 and standard deviation 1. In the soda can example, n = 5, so this probability is

P(Z > 3 − !5!5!! ) = P(Z > 0.764) = 0.222 Therefore, there is less than 1 chance in 4 that any particular X will be beyond the upper X will be beyond the upper X control limit. Another way of looking at it is to calculate the ARL, the expected number of subsamples until the out-of-control behavior is spotted:

ARL = 1/0.222 ≃ 4.5

The ARL indicates the mean length of time between false alarms in an in-control process.

3An analogy is how long, on average, you would have to wait to roll double sixes with two dice. There are 36 pos- sible outcomes for the two dice, so the probability of double sixes on a single toss is 1/36. Therefore, the expected number of tosses until double sixes occurs is 1/(1/36) = 36.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-16 Chapter 20 Statistical Process Control

For example, if subsamples are taken every half hour, it will take, on average, over 2 hours to realize that the process has gone out of control.

We would like to keep both type I and type II errors to a minimum. That is, we would like to minimize the number of false alarms, but at the same time we would like to spot out- of-control conditions quickly. One strategy is to sample more frequently. Instead of sam- pling every half hour, we could sample every 15 minutes. Another strategy is to increase the subsample size n from, say, 5 to 10. Both of these strategies are intended to decrease the ARL when the process goes out of control.ARL when the process goes out of control.ARL

For example, if we use n = 10 instead of n = 5 in the above calculations, we obtain

P(Z > 3 − !10! ) = P(Z > − 0.162) = 0.564

and ARL = 1/0.564 ≃ 1.77

Now, assuming that we are still sampling every half hour, the average time to spot the out- of-control condition is less than an hour. Alternatively, if we keep n = 5 but sample every 15 minutes, then the previous ARL of 4.5 now translates to only slightly more than 1 hour.

20-4b Other Out-of-Control Indications

To this point, the only formal indication of an out-of-control process is a point beyond the control limits. There are a number of other possible indications of “nonrandom” behavior that we might want to react to. The usual ones that have been suggested include:

■ At least 8 upward (or downward) consecutive changes

■ At least 8 consecutive points above (or below) the centerline

■ At least 2 of 3 consecutive points beyond two standard deviations from the centerline (where both are on the same side of the centerline); usually applied only to X chartsX chartsX

■ At least 4 of 5 consecutive points beyond one standard deviation from the centerline (where all 4 are on the same side of the centerline); usually applied only to X charts

For these last two conditions it is common to divide the region between the centerline and either control limit into three “zones” of width one standard deviation each, as indi- cated in Figure 20.9. Then condition 3 is called the Zone A rule, and condition 4 is called the Zone B rule. In either case the idea is that although points within zone A and zone B

You can sample more frequently or you can take larger subsamples to detect out-of-control behavior more quickly.

12.2 Upper control limit

Lower control limit

Zone A

Zone A

Zone B

Zone B

Zone C

Zone C

12.15

12.1

12.05

12

11.95

11.9

11.85 0 10 20 30 40 50 60 70 80

X-Bar: Obs1 – Obs5

Center Line

Control Limit

Sigma2 Limit

Sigma1 Limit

Figure 20.9 Zones in an X Chart

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-17

We do not want to overemphasize these (or any other) possible indications of out-of-con- trol behavior. The more such conditions we check for, the more likely we will �nd false alarms. In a real situation an experienced operator is likely to give different emphasis to different out- of-control indications. For example, if he sees any of conditions 1–4, but no points beyond the control limits, he might start sampling more frequently—every 15 minutes instead of every half hour, say. If he then continues to see more instances of these conditions or see points beyond the control limits, he might start searching for assignable causes and possible �xes.

20-4c Rational Subsamples

The small number of observations taken periodically should be rational subsamples. This means that they should be taken in such a way that only common-cause variability can be attributed to the points in a particular subsample. There shouldn’t be any assignable causes of variability that affect some of the points in the subsample and not others. Typically, rational subsamples are obtained by taking observations nearby in time. For example, every half hour we might examine �ve consecutive soda cans coming off the production line. However, the following example illustrates what can happen if we are not careful.

Figure 20.10 Illustration of Zone B Rule

X-Bar: Obs1 – Obs5

12.2

12.15

12.1

12.05

12

11.95

11.9

11.85 0 10 20 30 40

special point

50 60 70 80

Center Line

Control Limit

Sigma2 Limit

Sigma1 Limit X-Bar

© C

e n g

a g

e L

e a rn

in g

are within the control limits, it is unlikely that an in-control process would have this many nearby points in zone A or B.

StatTools provides options to check for these four conditions (see Figure 20.3 or 20.6). When these options are requested, any offending points are designated by circles on the chart. If these checks are requested for the soda can data in the continuation of Example 20.1, you can check that none of conditions 1, 2, or 3 hold for the X chart, but conX chart, but conX - dition 4 holds for two different sets of �ve consecutive points, as indicated in Figure 20.10. The fourth point in each �ve-point set in zone B is circled. Since the �ve-point sets can overlap, there is actually just one circled point on the chart, the point corresponding to subsample 69. (Subsamples 65–69 and 66–70 both satisfy condition 4, and subsample 69 is the fourth point in zone B of each of these �ve-point sequences.)

E X A M P L E 20.2 CHECKING THE QUALITY OF GASKETS MADE ON DIFFERENT MACHINES

In a manufacturing process for gaskets, two parallel production machines produce identi-cal types of gaskets. A crucial dimension of the gaskets is their thickness, measured in millimeters. The file Gaskets.xlsx contains data from this process. Every 15 minutes, four gaskets were sampled, two from each machine. What can we learn from the X and X and X R charts?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-18 Chapter 20 Statistical Process Control

Figure 20.11 X Chart for Gasket Data from Both Machines

3.13 0 10 20 30 40 50 60

3.14

3.15

3.16

3.17

3.18

3.19

3.2

3.21

3.22

X-Bar: M1Obs1 – M2Obs2

Center Line Control Limit Sigma2 Limit Sigma1 Limit X-Bar

© C

e n g

a g

e L

e a rn

in g

Figure 20.12 R Chart for Gasket Data from Both Machines

0.01

0 10 20 30 40 50 60

R: M1Obs1 - M2Obs2

0.03

0.05

0.07

0.09

0.11

–0.01

Center Line Control Limit R

© C

e n g

a g

e L

e a rn

in g

Objective To see how nonrational samples can produce misleading information in X and R charts.

Solution The observations that comprise a particular subsample are labeled (in the file) M1Obs1, M1Obs2, M2Obs1, and M2Obs2. The first two are from machine 1; the last two are from machine 2. The X and X and X R charts for these data, where the centerline and control limits are based on all 50 subsamples, appear in Figures 20.11 and 20.12. The R chart looks perfectly well within control, and the X chart looks even better. In fact, it looks suspiciously too good, with almost no points outside the one standard deviation band, let alone the three standard deviation band. The process appears to be in control, but is the small amount of variation in the X chart (relative to the control limits) telling us something?X chart (relative to the control limits) telling us something?X

A simple look at the data shows that the observations from machine 1 are consistently below those from machine 2. The variability in the data from each machine is roughly the same, but they are varying around different means. Think of what this does to the control charts. First, each R is probably a large value from machine 2 minus a small value from machine 1. So the R’s are fairly large. This causes the control limits on the X chart to be fairly far apart. X chart to be fairly far apart. X However, each X is an average of two typical machine X is an average of two typical machine X 1 observations and two typical machine 2 observations. Such averages are not only fairly stable through time, but the highs tend to cancel the lows. The result is the unusually low variability we see in Figure 20.11.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-19

For the sake of illustration, we assume four observations were taken from each four observations were taken from each four machine each half hour. (These are labeled M1Obs1–M1Obs4 and M2Obs1–M2Obs4 in the file.) Only the first two observations from each machine were used in the above control charts. A rational subsample philosophy would suggest separate control charts for each rational subsample philosophy would suggest separate control charts for each rational machine. It turns out (you can check this) that the control charts for machine 1, based on the subsamples of size 4, indicate perfect in-control behavior. The charts for machine 2, again based on subsamples of size 4, appear in Figures 20.13 and 20.14. As you can see from the R chart, the variability in machine 2 suddenly increased shortly after subsample 25. This causes one out-of-control point in the X chart and nearly another. Machine 2 should be checked for assignable causes.

The problem here is that when the observations from the two machines are combined into subsamples, the out-of-control behavior is masked by the mixing of highs and lows. We are unable to learn about each machine separately. Therefore, the lesson from this example is that observations within any particular subsample should come from a single process, not the mixture of two or more processes. ■

Figure 20.13 X Chart for Gaskets from Machine 2

3.16 0 10 20 30 40 50 60

3.17

3.18

3.19

3.2

3.21

3.22

X-Bar: M2Obs1 – M2Obs4

Center Line Control Limit Sigma2 Limit Sigma1 Limit X-Bar

© C

e n g

a g

e L

e a rn

in g

Figure 20.14 R Chart for Gaskets from Machine 2

0

0 10 20 30 40 50 60

R: M2Obs1 – M2Obs4

0.02

0.03

0.04

0.05

0.07

–0.01

0.01

0.06

Center Line Control Limit R

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-20 Chapter 20 Statistical Process Control

20-4d Deming’s Funnel Experiment and Tampering

In the quest for reduced variability, it is tempting to make frequent small adjustments to a system. However, if the system is already in control, these adjustments can actually make a system worse. Deming called this “tampering” and often demonstrated it in his seminars with the following funnel experiment.

To illustrate the idea, suppose that you are in the business of drilling a tiny hole in the exact center of a square piece of wood. In the past, the holes you have drilled have aver- aged being in the center of the wood with both the x- and y-coordinates having a standard deviation of 0.1 inch. Also, the drilling process has been in control. Speci�cally, the devia- tions from the center of the square (measured in each of the x- and y-coordinates) follow a normal distribution with mean 0 and standard deviation 0.1 inch. This means, for example, that 68% of the holes have their x-coordinate within 0.1 inch of the center, 95% of the holes have their x-coordinate within 0.2 inch of the center, and 99.7% of the holes have their x-coordinate within 0.3 inch of the center. This describes the inherent variability in the inherent variability in the inherent drilling process. Without changing the process by which holes are drilled, you must live with this amount of common cause variation.

Now suppose that you drill a hole and its x- and y-coordinates are x = 0.1 and y = 0 [where the center of the square has coordinates (0, 0)]. A natural reaction is to reduce (if possible) the x-setting of the drill by 0.1 inch to correct for the fact that the x-coordinate was too high. Then if the next hole has coordinates x = −0.2 and y = 0.1, you might try to increase the x-coordinate by 0.2 inch and decrease the y-coordinate by 0.1 inch. Deming’s funnel experiment shows that this method of continually readjusting an in-control process—tampering—will actually increase the variability of the distance of the holes from the target. That is, tampering will generally make the process worse.

To illustrate the effects of tampering, Deming placed a funnel above a target on the �oor and dropped small balls through the funnel in an attempt to hit the target. As he demonstrated, many balls did not hit the target. His goal, however, was to make the balls fall as close to the not hit the target. His goal, however, was to make the balls fall as close to the not target as possible. Deming proposed four rules for adjusting the position of the funnel.

Rules for Funnel Experiment

1. Never move the funnel.

2. After each ball is dropped, move the funnel—relative to its previous position—to compensate for any error. To illustrate, suppose the funnel begins directly over the target, at coordinates (0, 0). If the ball lands at (0.5, 0.1) on the first drop, you com- pensate by repositioning the funnel at (−0.5, −0.1). If the second drop has coordinates (1,−2), you now reposition the funnel at (−0.5 − 1, −0.1 − (−2)) = (−1.5, 1.9).

3. Move the funnel—relative to its original position at (0, 0)—to compensate for any relative to its original position at (0, 0)—to compensate for any relative to its original position at error. If the ball lands at (0.5, 0.1) on the first drop, you compensate by reposition- ing the funnel at (−0.5, −0.1). If the second drop has coordinates (1, −2), you now reposition the funnel at (0 − 1, 0 − (−2)) = (−1, 2).

4. Always reposition the funnel directly over the last drop. Thus if the first ball lands at (0.5, 1), you reposition the funnel to (0.5, 1). If the second drop has coordinates (1, 2), you reposition the funnel to (1, 2). This rule might be followed, for example, by an automobile manufacturer’s painting department. With each new batch of paint, they attempt to match the color of the previous batch, regardless of whether the previous color was “correct.”

We can see how these rules work by running a simulation in Excel®. We assume that the x-coordinate on each drop is normally distributed with a mean equal to the x-coordinate of the funnel position and a standard deviation of 1. A similar statement holds for the y-coordinate. Also, we assume that the x- and y-coordinates are selected independently of one another. These assumptions describe the inherent variability in the process of dropping the balls.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-21

We now develop a spreadsheet to simulate the four rules. For each rule we simulate 50 consecutive drops of the ball and then use a data table to replicate the distance from the 50th drop to the target 100 times. That is, we replicate the experiment of 50 drops 100 times, and we record the distance of the 50th drop from the target on each replica- tion. A good rule should have a small average distance, and the standard deviation of the distances (across the replications) should also be small.

It helps to introduce some notation. Let PxPxP , t and PyPyP , t be the t be the t x- and y-coordinates of the position of the funnel just before drop t, where PxPxP ,1 and PyPyP ,1, the coordinates of the initial position, are both set to 0 for all of the rules. Also, let XtXtX and YtYtY be the coordinates where t be the coordinates where t drop t actually falls. Our assumptions imply that XtXtX and t and t YtYtY are normally distributed with means PxPxP , t and t and t PyPyP , t and standard deviations t and standard deviations t 1. The four rules determine the coordinates of the next funnel position, next funnel position, next PxPxP , t + 1 and PyPyP , t + 1, as follows:

These equations allow us to simulate 50 consecutive drops for any of the four rules in Excel. We illustrate this in Figure 20.15 for rule 2. (See the �le Funnel Experiment.xlsx.) After entering zeros in cells B6 and C6, we enter the formula

=NORM.INV(RAND(),B6,1)

in cell D6 and copy it to the range D6:E55 to generate normal random numbers with the appropriate means and standard deviation 1. Then we enter the formula

=B6-D6

in cell B7 and copy it to the range B7:C55. This implements the rule 2 positioning equa- tions. The formulas for the other three rules are similar and follow directly from the posi- tioning equations.

PxPxP ,t+1 = PxPxP , t, PyPyP ,t+1 = PyPyP , t (Rule 1) PxPxP ,t+1 = PxPxP , t − XtXtX , PyPyP ,t+1 = PyPyP , t − YtYtY (Rule 2)

PxPxP ,t+1 = 0 − XtXtX = − XtXtX , PyPyP ,t+1 = 0 − YtYtY = − YtYtY (Rule 3) PxPxP ,t+1 = XtXtX , PyPyP ,t+1 = YtYtY (Rule 4)

Move funnel rela�ve to its last posi�on to compensate for error.or.or

Deming’s funnel experiment: Rule 2 A B

Funnel posi�oned at: Drop X Posi�on Y Posi�on X Drop Y Drop

1 0 0 1.09 1.28 2 –1.09 –1.28 –1.31 –1.44 3 0.22 0.16 –0.59 –0.47

50 –1.78 –1.62 –2.63 –2.14 49 0.29 0.05 2.07 1.67 48 0.43 –2.45 0.14 –2.50 8 0.69 –0.61 0.72 0.81 7 –1.22 –0.50 –1.92 0.12 6 0.72 0.83 1.95 1.32 5 –1.88 –0.53 –2.60 –1.36

6 5 4 3 2 1

7 8

55 54 53 13 12 11 10 9 049 04 .81 0.63 2.69 1.16

Drop lands at:

C D E FA B

1 0 0 1 9 1

3 0

3 – 9 0 5 2 7 1

5 0 4 – 8 0

6 0

9 0 1 0 3 2 9 1

C D E FFigure 20.15 Simulation of Rule 2 for Funnel Experiment

© C

e n g

a g

e L

e a rn

in g

After implementing each of the four rules for 50 drops, we use a data table, as shown in Figure 20.16, to replicate 100 times the distance from the 50th drop to the target for each rule. (Each distance is the square root of the sum of squares of the coordinates of the 50th drop.) The average, standard deviation, and maximum of the 100 distances appear in rows

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-22 Chapter 20 Statistical Process Control

5–7. Because we want these distances to be small, we see that rule 1 is performing best, with rule 2 following fairly close behind, and rules 3 and 4 performing terribly.

This behavior is reinforced by the box plots of the 100 replicated distances for each of the rules in Figure 20.17. As you can see, the distances for rule 1 are not only small, but they vary very little. The distances for rule 2 are slightly larger and vary slightly more, and the distances for rules 3 and 4 are much larger and vary a lot. As Deming predicted, tamper- ing with an in-control system never helps—and it can have very negative consequences.

1.27 1.83 9.46 8.87

A 1 Data table for rData table for rData table f eplica�ng distance from center of 50th drop 2 3 Summary measures for replica�ons below 4 Rule1 Rule2 Rule3 Rule4 5 Average 6 06 06 0.67 07 0.90 40 4.78 48 4.41St6 0St6 0de6 0de6 06 0v6 0 7 Maximum 2.86 5.48 24.03 21.91 8 9 Replica�on Rule1 Rule2 Rule3 Rule4

10 0.94 1.65 10.54 7.67 11 1 11 1.30 10 1.37 13.91 8.67 12 2 12 1.10 20 2.75 55 5.04 94 9.16 13 3 13 1.36 06 0.47 27 2.61 14.81 14 2.86 0.68 11.89 9.214

107 97 0.37 2.40 2.68 7.16 108 98 1.78 3.37 13.44 9.55 109 99 0.14 1.78 9.96 4.61 110 100 0.82 1.16 11.48 3.47

B CB C D ED E

5 A 6 0 7 M

9 R

Figure 20.16 Distances from Drop 50 to Target for Four Rules

© C

e n g

a g

e L

e a rn

in g

Figure 20.17 Box Plots of Distances for the Four Rules

Rule4/Data Set #1

Rule3/Data Set #1

Rule2/Data Set #1

Rule1/Data Set #1

0 5 10 15 20 25 30

Box-Whisker Plot Comparison

*

*

*

*

© C

e n g

a g

e L

e a rn

in g

We conclude this discussion of the funnel experiment by noting that the system obtained by using rule 1, the leave-it-alone rule, is not necessarily a good system. It may good system. It may good indeed require improvement. The point, though, is that continual tampering with this sys- tem will not produce the required improvement; it will only tend to make things worse. The only way to make a lasting improvement to the system is for management to change it fundamentally. Workers on the shop �oor do not typically have the knowledge or authority to make such a fundamental change. It must come from management.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-23

20-4e Control Charts in the Service Industry

Although most applications of control charts are in the manufacturing area, it is certainly possible to apply the same analysis to problems in the service industry. The following example illustrates one possibility.

E X A M P L E 20.3 MEASURING THE TIMELINESS OF CHECK PROCESSING

Woodstock Company, a company in the construction industry, had recently experi-enced considerable expansion of its business volume. Due in part to this expansion, the finance department of the company was having difficulty processing checks to suppli- ers in a timely manner. Many of its suppliers were being paid beyond the normal 30-day period. This was not only making the suppliers unhappy, but Woodstock was also failing to obtain the discounts many suppliers offered for prompt payments. How could control charts help Woodstock solve its problem?

Objective To see how control charts can help Woodstock find the reasons for untimely check processing and suggest ways of decreasing check processing time.

Solution First, it is important to realize that control charts cannot magically solve a problem such as the one Woodstock faced. However, they can help to show what is happening and point to possible solutions. To produce control charts, we assume that Woodstock measured the processing times for five checks completed each day. Each processing time is defined as the time from when a supplier’s shipment is received until Woodstock sends the check to the supplier. The file Checks.xlsx contains these processing times for 60 consecutive business days. Observations for the first 30 days were used to form control limits. The R chart (not shown here) for these 30 days is well within control, but the X chart, shown in Figure 20.18, indicates out-of-control points on days 7 and 10.

Figure 20.18 X Chart for First 30 Days

20 1 6 11 16 21 26

22

24

26

28

30

32

34

36

38

40

X-Bar: Check1 – Check5

Center Line

X-Bar Sigma1 Limit Sigma2 Limit Control Limit

© C

e n g

a g

e L

e a rn

in g

Upon closer examination, Woodstock learned that on day 7 the people in finance, trying to improve a process with high variability and large processing times, implemented a change in the check preparation process. However, this change backfired—it actually made things worse—and was eliminated after 5 days. This change is a clear example of an assignable

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-24 Chapter 20 Statistical Process Control

4To do this in Excel, we copied the original data sheet to a new data sheet, deleted the rows corresponding to days 7–11, and formed control charts from the �rst 25 rows of this new data set.

Figure 20.19 X Chart for Days 1–60 (with Days 7–11 Eliminated)

40

X-Bar: Check1 – Check5

35

30

25

20

15

10

5

0

0 10 20 30 40 50 60 –5

X-Bar

Center Line

Sigma1 Limit Sigma2 Limit Control Limit

© C

e n g

a g

e L

e a rn

in g

Figure 20.20 R Chart for Days 1–60 (with Days 7–11 Eliminated)

0

0 10 20 30 40 50 60

5

–5

10

15

20

25

30

R: Check1 – Check5

Center Line Control Limit R

© C

e n g

a g

e L

e a rn

in g

cause. The points we observe in Figure 20.18 are actually the result of two separate pro- cesses, those without the change and those (points 7−11) with the change. To understand the original process, Woodstock needed to eliminate points 7−11 and form new charts. This was done, and the plots of days 1–6 and 12–30 (not shown here) showed statistical control.4

The process was now in statistical control, but this was no place to stop. Woodstock was alarmed at the high average processing times (about 30 days) and the high variability (average R’s of nearly 12 days). Management took a closer look at the check prepara- tion process and discovered several unnecessary steps—duplicate paperwork and exces- sive “hand-offs” from one person to another. They took steps to streamline the process, and they continued to plot, using the control limits and centerlines from days 1–6 and 12–30. The X and X and X R charts through day 60 (again, with days 7–11 eliminated) appear in Figures 20.19 and 20.20.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-4 Control Charts for Variables 20-25

These control charts both indicate out-of-control behavior, but of the kind Woodstock is happy to see. The R chart indicates a lower level of variability, and the X chart indicates a decreased average time to process checks. The R’s are now averaging about 6.5 days, and the average check processing times are about 20 days. These improvements are a direct result of Woodstock’s management interventions, but these interventions were prompted by observing control charts and trying to understand what was causing them.

Even after day 60, Woodstock should not become complacent. First, it should recalculate control limits and centerlines, based on new data, say, from days 51–80. It could use these to check whether the improved process is in control with respect to the new limits. At least as importantly, it should continue to search for potential improvements in the process. If the average check preparation time could be reduced from 30 days to about 20 days, and the vari- ability could be reduced as well, who’s to say that further improvements are not possible? ■

P R O B L E M S Note: Student solutions for problems whose numbers appear within a colored box are available for purchase at www.cengagebrain.com.

Level A 1. The file P20_01.xlsx contains data on the amount of

soda (in ounces) placed in aluminum cans by a particu- lar filling process. Ideally, the filling process should place 12 ounces of soda in each can. Every hour, 4 cans of soda were randomly selected from the produc- tion process and measured for amount of fill. This was repeated for 25 consecutive hours. Generate and inter- pret X and X and X R charts for the given data. Does this filling process appear to be in control?

2. The data in the file P20_02.xlsx consist of 25 subsamples of 4 observations each on the diameters (measured in centimeters) of ball bearings produced by a manufacturing process. The target diameter of these ball bearings is 4 centimeters. a. Generate and interpret X and X and X R charts for the given

data. Based on these charts, does this manufacturing process appear to be in control?

b. Are there any other indications that the given process may be out of control? If so, explain.

3. The data in the file P20_03.xlsx consist of 25 subsamples of 6 observations each on the fill weights of cans of paint. The ideal fill weight of these paint cans is 20 pounds. a. Generate and interpret X and X and X R charts for the given

data. Does this filling process appear to be in control? b. Are there any other indications that the given

process may be out of control? If so, explain.

4. Continuing the previous problem, operators have made an adjustment that they hope will improve the function- ing of this process. The file P20_04.xlsx contains 25 subsamples of 6 observations each on the fill weights of cans of paint, taken after the process was modified. a. Generate and interpret X and X and X R charts for the given

data. Which control limits do you believe are most appropriate? Explain. Does this filling process appear to be in control now?

b. Are there any other indications that the given process may be out of control now? If so, explain.

c. What advice would you give to the operators of this filling process based on your analysis of the latest sample information?

5. Producers of a particular brand of ready-to-eat break- fast cereal place, in theory, 15 ounces of cereal in each box of this product. In an effort to assess this stage of the manufacturing process, an operations manager gathers 25 subsamples of 4 observations each on the amount (measured in ounces) of cereal in selected boxes. These data are given in the file P20_05.xlsx. a. Generate and interpret X and X and X R charts for the given

data. Does this process appear to be in control? b. Are there any other indications that the given

process may be out of control? If so, explain. c. If your analysis reveals that a problem does exist

with the process, what advice would you give to the manager of this operation?

6. The data in the file P20_06.xlsx consist of 25 subsam- ples of 4 observations each on the lengths of particular bolts manufactured for use in large aircraft. The target length of these bolts is 37 centimeters. a. Generate and interpret X and X and X R charts for the given

data. Does this production process appear to be in control?

b. Are there any other indications that the given process may be out of control? If so, explain.

7. Continuing the previous problem, managers have made an adjustment that they hope will improve the func- tioning of this process. The file P20_07.xlsx contains 25 subsamples of 4 observations each on selected bolt lengths, taken after the production process was modified. a. Generate and interpret X and X and X R charts for the given

data. Which control limits do you believe are most appropriate? Explain. Does this production process appear to be in control now?

b. Are there any other indications that the given process may be out of control now? If so, explain.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-26 Chapter 20 Statistical Process Control

c. What advice would you give to the operators of this production process based on your analysis of the latest sample information?

8. The operations manager of an airline check-in counter is interested in evaluating the service provided to the company’s customers. In particular, she would like to make sure that customers are not waiting an exces- sively long time prior to being served at the check-in facility. Ideally, she would like to see that customers wait, on average, less than 7 minutes prior to being served at the check-in counter. The file P20_08.xlsx contains the waiting times (in minutes) of 5 randomly selected passengers, observed during the same hour on each of 25 different days. a. Construct and interpret X and X and X R charts for the

given data. Based on these charts, does this service process appear to be in control?

b. Are there any other indications that the given service process may be out of control? If so, explain.

c. What specific advice would you give to the operations manager for improving customer service, at least in the short run?

9. Continuing the previous problem, the operations manager of this airline check-in counter has recently made some changes to the operation of the counter that she hopes will reduce customer waiting times. Again, she observes the waiting times of 5 randomly selected passengers during the same hour on each of another 25 days. These observations are given in the file P20_09.xlsx. Characterize the impact of the operations manager’s refinements on the performance of this service operation. Does this facility, with respect to customer waiting times, appear to be operating well now? Explain why or why not.

10. The file P20_10.xlsx contains the breaking strengths (measured in pounds) of randomly selected pieces of a certain welded material. In particular, these data con- sist of 25 subsamples of 5 observed breaking strengths each. The target breaking strength of this welded mate- rial is 300 pounds. a. Generate and interpret X and X and X R charts for the given

data. Does this production process appear to be in control?

b. Are there any other indications that the given process may be out of control? If so, explain.

c. If the process is out of control, which subsamples could be eliminated to achieve in-control behavior in the R chart? Why might it be legitimate to eliminate these subsamples?

11. The file P20_11.xlsx contains data on the amount of liquid detergent (in ounces) placed in plastic contain- ers by a particular filling process. Ideally, the filling process should place 100 ounces of detergent in each container. Every hour, 6 detergent containers were randomly selected from the production process and

measured for amount of fill. This was repeated for 25 consecutive hours. a. Generate and interpret X and X and X R charts for the given

data. Does this filling process appear to be in control? b. Are there any other indications that the given

process may be out of control? If so, explain. c. Given your analysis of the sample information, what

steps, if any, should be taken to adjust this filling process?

12. Management of a local bank is interested in assessing the process used in opening new checking accounts for bank customers. In particular, management would like to examine the time required to process a customer’s request to open a new checking account. Currently, managers believe that it should typically take about 7 minutes to process such a request. The file P20_12. xlsx contains the time required to process new check- ing account requests for each of 6 customers selected randomly on a given day. A different subsample of 6 customer requests was collected on each of 25 days. Generate and interpret X and X and X R charts for the given data. Does this customer service process appear to be in control? Explain why or why not.

13. The manager of a supermarket would like to evaluate the effectiveness of a large freezer unit currently used to store excess supplies of various frozen food items in the supermarket’s inventory. Specifically, the manager wants to determine whether the current freezer is maintaining the valuable store inventory at a roughly constant tem- perature of 7 degrees. To make this evaluation, he asks his assistant to take 6 temperature readings within the freezer at various points in the day for a total of 30 days. These measurements are given in file P20_13.xlsx. a. Generate and interpret X and X and X R charts for the given

data. Do these data indicate the presence of one or more problems with the operation of this freezer? Explain.

b. How might you explain the trend in the R chart for subsamples 21 through 30?

c. What advice would you give to the supermarket manager regarding this freezer?

Level B 14. Consider a situation where a given process goes out of

control but the relevant control charts do not indicate so. Assume that the process variation remains constant but the mean shifts from μ to μ + kσ, where k is a fixed constant. a. Provided that k = 1.5 and n = 5, what is the mean

number of subsamples required for X to rise above X to rise above X the upper control limit?

b. Provided that k = 1.5 and n = 9, what is the mean number of subsamples required for X to rise above X to rise above X the upper control limit?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-5 Control Charts for Attributes 20-27

c. Provided that k = 2.0 and n = 5, what is the mean number of subsamples required for X to rise above X to rise above X the upper control limit?

15. Consider a situation where a given process goes out of control but the relevant control charts do not indicate so. Assume that the process variation remains constant but the mean shifts from μ to μ to μ μ − kσ, where k is a fixed k is a fixed k constant.

a. Provided that k = 1.0 and n = 4, what is the mean number of subsamples required for X to fall below X to fall below X the lower control limit?

b. Provided that k = 1.0 and n = 8, what is the mean number of subsamples required for X to fall below X to fall below X the lower control limit?

c. Provided that k = 0.5 and n = 4, what is the mean number of subsamples required for X to fall below X to fall below X the lower control limit?

20-5 CONTROL CHARTS FOR ATTRIBUTES Often there are no explicit measurements available. We are simply able to check whether each item produced conforms to speci�cations or not. For example, a computer chip either works as it should or it doesn’t. An item that fails to conform to speci�cations is called a nonconforming (or defective) item. When items can be classi�ed only as conforming or nonconforming, we typically chart the proportions that are conforming during consecu- tive periods of time. The resulting chart is called a p chart. It is one of several types of charts called attributes charts, where the term attribute indicates an “on/off” type of measurement: The item either has the attribute or it does not.

There are other types of attributes charts called c charts and u charts. These are used to chart the number (or rate) of defects in successive items, where a defect is any �aw in an item, such as a paint blemish on a car door, a defective weld in a pipeline, a broken rivet on an airplane wing, and so on. Clearly, different types of defects vary in their seriousness, and any combination of them could cause an item (a car door, for example) to be classi- �ed as nonconforming. We will not discuss c charts and u charts in this book, but they are very similar to the other control charts we discuss, and they can be formed easily with the StatTools Quality Control procedures.

20-5a The p Chart

We now discuss p charts in some detail. During consecutive periods of time, we sample a number of items from a process and label each of these as conforming or nonconforming. Speci�cally, suppose we sample ni items during period i items during period i i, and ki of these fail to conform to speci�cations. i of these fail to conform to speci�cations. i The number n

i either could be

i either could be

i all of the items produced during period all of the items produced during period all i, or it could represent a

sample of all items produced. Also, these sample sizes could be constant for all periods, or they could differ. In any case, we let p̂i be the proportion of nonconforming items in sample i be the proportion of nonconforming items in sample i i:

p̂i = ki/ni

A p chart is then a time series plot of the p̂i’s.

StatTools’s online help indicates how your data should be set up to use c charts and u charts.

A p chart plots the proportions of items that are nonconforming (defective) through time. It is a type of attributes chart.

The idea behind p charts is exactly the same as with X and X and X R charts. We place a center- line and control limits on the chart in such a way that the p̂i’s for an in-control process vary randomly around the centerline and almost never cross the control limits. The centerline is placed at the overall proportion of nonconforming items. This value, denoted by p, is given by

Centerline = p = Σi ki Σi ni

= number of nonconforming items

number of items produced

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-28 Chapter 20 Statistical Process Control

Again, the main thing to remember is that the lower and upper control limits are three standard deviations below and above the centerline, where the centerline is the proportion of all items that are nonconforming.

E X A M P L E 20.4 MEASURING THE PROPORTION OF DEFECTIVE CHIPS AT SOUNDTECH

SoundTech is a company that manufactures electronic chips for sound systems in personal computers. Each chip is classified as conforming or nonconforming. The nonconform- ing chips cannot be used and are discarded. Each hour 75 chips are tested for conformance. These 75 chips represent a random sample of all chips that are produced in a given hour. The file Chips1.xlsx lists the number of nonconforming chips (out of 75) for 25 consecu- tive hours (See Figure 20.21). Is the process currently in control? Is it behaving well?

1 A

Hour Sample Size Number NonconformingNumber NonconformingNumber Nonconf 75

75

75

75

75

75

75

75

75

17

18

18

16

20

22

15

21

16

1

2

3

4

5

6

23

24

25

B C

2

3

4

5

6

7

24

25

26

B CFigure 20.21 Data for Chips Example

© C

e n g

a g

e L

e a rn

in g

If the ni’s are constant across samples, then p is the average of the p̂i’s. To specify the control limits, we �rst examine the special case where the ni’s are con-

stant and equal to a common value n. If we can assume that each item is nonconforming with some constant probability p, then we know from Chapter 5 that the number of non- conforming items in sample i is binomially distributed with mean npnpn and standard devia- tion !n!n! pnpn (1 − p)! . Equivalently, the sample proportion p̂ has mean p and standard deviation !p!p! (1 − p)/n! . Because p is typically unknown, we use the value p as an estimate of p to form the following control limits:

LCLCLC = p − 3"p"p"" (1 − p )/n" and

UCLCLC = p + 3"p"p"" (1 − p )/n" That is, we go out three standard deviations (of p̂) on each side of the centerline value p.

If the sample sizes are not equal, then each sample has its own control limits of the formnot equal, then each sample has its own control limits of the formnot

p ± 3"p"p"" (1 − p )/ni" Now the denominator ni varies from sample to sample instead of being constant. The effect is i varies from sample to sample instead of being constant. The effect is i that the control limits vary through time and are not straight lines on the control chart. This is an annoying feature, so in practice the average of the ni’s is sometimes used in place of the ni’s as a “common sample size” unless the ni’s differ greatly from one another. StatTools provides the option of using a common sample size even if the individual sample sizes are not equal.

The following example illustrates how a p chart can be constructed and interpreted. Although some of the details are different, the basic interpretation and use of p charts are exactly the same as with X and R charts. Speci�cally, they are monitored through time to provide a better understanding of a process and suggestions for possible improvement.

Objective To use p charts to see whether the chip manufacturing process at SoundTech is in control and is producing a “small” number of nonconforming chips.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-5 Control Charts for Attributes 20-29

Solution The mechanics of constructing a p chart with StatTools are very similar to those for X and R charts. The main difference is that the data can be set up in several ways. First, the data can either list the numbers of nonconforming items or the fractions of nonconform- ing items. (Chips1.xlsx lists the former.) Second, a variable that lists the sample sizes, the ni’s, can either be present or absent. (There is such a variable in the file.) If the sample size variable is absent, it is assumed that the sample sizes are constant, and you must supply this common value.

To create the p chart, select P Chart from the StatTools Quality Control group to obtain the dialog box in Figure 20.22. For this example it should be filled out as shown. (Alternatively, you could check the Use Common Size option, in which case the value 75 would be entered manually in a box that would appear.) Note that the procedure prompts for the “Val” variable that contains the numbers nonconforming and the “Siz” variable that contains the sample sizes. The variables Number Nonconforming and Sample Size should be selected for this example. The other options in the dialog box are analogous to those for X/R charts.

Figure 20.22 Dialog Box for Specifying Variables for p Chart

© C

e n g

a g

e L

e a rn

in g

The p chart appears in Figure 20.23. You can see that the points, each of which indicates a proportion nonconforming, vary randomly around a centerline of p = 0.255. The control limits are at 0.104 and 0.407, and no points are beyond the control limits. Therefore, the current process appears to be in control. But is it any good? We would argue that an average percent nonconforming of about 25% is not very good. As usual, an in-control process is not very good. As usual, an in-control process is not predictable but not necessarily acceptable. SoundTech management should begin searching for improvements to its process. For example, they might select different suppliers of raw material, purchase new machinery, or institute better worker training. Then by charting future values, the company can see whether any improvements it employs have the desired effect.

Remember, “in control” does not necessarily mean good; it just means predictable.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-30 Chapter 20 Statistical Process Control

Figure 20.23 p Chart for Nonconforming Chips

–0.05

0

0 5 10 15

P: Number Nonconforming

20 25 30

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

Center Line Control Limit Sigma2 Limit Sigma1 Limit P

© C

e n g

a g

e L

e a rn

in g

Figure 20.24 A p Chart with Unequal Sample Sizes

0

0 5 10 15 20 25 30

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

0.45

P: Number Nonconforming

–0.05

Center Line Control Limit Sigma2 Limit Sigma1 Limit P

© C

e n g

a g

e L

e a rn

in g

For the sake of comparison, we illustrate a variation of this example where SoundTech samples a different number of chips each hour. For example, it might actually sample different number of chips each hour. For example, it might actually sample different all chips produced, but production quantities might vary considerably from hour to hour. The file Chips2.xlsx contains the data. The only difference is that the Sample Size vari- able in this file is not constant. You have two options. You can fill out the dialog box in Figure 20.22 exactly as before, or you can check the Use Common Size box and enter an “average” sample size in the box that appears. If you select the former option, the result- ing p chart appears in Figure 20.24. As you can see, the nonconstant sample sizes result in

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-5 Control Charts for Attributes 20-31

uneven control limits. Although we are still looking for points beyond the control limits, the bumpiness of these limits is somewhat distracting. Therefore, SoundTech might decide to base the chart on the average sample size (about 75). Fortunately, the practical differ- ence between these two approaches is usually minor. ■

20-5b The Red Bead Experiment

Recall that several of Deming’s 14 points concern the role of management in helping workers to do a better job. Deming believed that it is not management’s role simply to exhort workers not management’s role simply to exhort workers not to do a better job. Management needs to change a system that prevents workers from perform- ing up to standards. To illustrate this concept, Deming often used the following red bead experiment. It illustrates clearly that in a system subject only to common-cause variation, some workers are bound to be the “best” on some days and “worst” on others, for no particu- lar reasons (such as slacking off or working harder). It also illustrates how all workers can fail to live up to standards, through no fault of their own, if the system is not designed correctly.

The experiment is very simple. There is a large container of beads, 20% of which are red and 80% of which are white. Several people from the audience are asked to play the role of workers and others from the audience are asked to help out as inspectors. Each of the workers gets a “paddle” with 50 holes, where each hole can hold a single bead. The rules of the game are that each worker must put his or her paddle into the container and pull out exactly 50 beads. Each such draw corresponds to one day’s production quantity. That is, each worker “produces” exactly 50 beads per day. They are also told that red beads correspond to defectives. Each person’s job is to produce no more than two defectives per day; their continued employment depends on it. The inspectors then count the number of red beads for each worker for each day’s production and tally the results for all to see.

Let’s say the workers’ names are Jim, Tricia, Tom, and Lisa. Several things about the experiment are fairly obvious. First, the mechanics of the process make it impossible for workers to “�sh” for all white beads. Therefore, every worker gets a random sample of 50 red and white beads on each draw from the container. Some days Jim will—totally by luck—get the most red beads, and other days he will get the fewest red beads. The same applies for the other workers. Certainly, there is no reason to reprimand Jim in the �rst case or reward him in the second. But Deming says that this is exactly what occurs in many job settings.

Second, the experiment is stacked against the workers. It is impossible for them, on most days, to draw two or fewer red beads. On average, each draw will result in 20%, or 10, red beads. For them to do their job as instructed, the system must change. For example, management could remove a lot of the red beads from the container. Even though all of this was obvious to the “workers” in Deming’s experiments, it is interesting that many of them nevertheless tried their best to perform as instructed, and many were genuinely frustrated when they continued to draw too many red beads.

We can illustrate the red bead experiment with an Excel simulation, together with a p chart. The Red Bead Experiment.xlsx �le contains the results. We �rst simulate the number of red beads for each worker on 30 successive days. (See Figure 20.25.) For each worker and each day, the number of red beads is a binomial random value based on 50 trials and probability 0.2 of “success” (a red bead) on each trial. To simulate such a value, we can use the BINOM.INV function in Excel. Speci�cally, we enter the formula

=BINOM.INV(50,0.2,RAND())

in cell B6 and copy it to the range B6:E35. We then sum the number of red beads per day in column F, and in columns G–J we record

the “best” and “worst” workers each day. For example, the formulas in cells G6 and I6 are

=MIN(B6:E6) and

=IF(G6=$B6,”Jim”,IF(G6=$C6,”Tricia”,IF(G6=$D6,”Tom”,”Lisa”)))

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-32 Chapter 20 Statistical Process Control

(Note that if there is a tie for best or worst, only one of the workers in the tie is listed.) Finally, we tally the winners and losers in the range M5:N9. The formula in M5 is

=COUNTIF(I$6:I$35,$L5)

which is then copied to the range M5:N9. Using the daily production quantities of red beads in column F, we can also create a p

chart, as shown in Figure 20.26. It shows a process well in control. In particular, it shows how the daily proportion of red beads varies randomly around 0.2. Of course, this doesn’t mean the workers are producing what management wants them to produce (no more than two red beads per day), but it certainly is not the workers’ fault, and there is nothing they can do about it until the system changes.

Simula�on of 30 days Tally of winnerTally of winnerT s and losers

Red bead experiment A BA B

Day 1 2 3

30 29 28 5 4

Jim 11 10 11

13 7

18 13

9

Tricia 11

9 14

5 9

12 8

10

Tom 12

9 12

5 10

9 10 11

Lisa 11

8 14

6 5

11 11 10

Total 45 36 51

29 31 50 42 40

Best 11

8 11

5 5 9 8 9

Worst 12 10 14

13 10 18 13 11

Winner Jim Lisa Jim

Tricia Lisa Tom

Tricia Jim

Loser Tom Jim

Tricia

Jim Tom Jim Jim

Tom

Jim Tricia Tom Lisa Total

12 6 5 7

30

11 Wins Losses

5 10

4 30

6 5 4 3 2 1

7 8

35 34 33 10 9

C DC D E FE F G HG H I JI J K LK L M NM N

Figure 20.25 Simulation Results for Red Bead Experiment

© C

e n g

a g

e L

e a rn

in g

Figure 20.26 p Chart for the Red Bead Experiment

–0.05

0

0 5 10 15 20 25 3530

0.05

0.1

0.15

0.2

0.25

0.3

0.35

P: Total

Center Line Control Limit Sigma2 Limit Sigma1 Limit P

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-5 Control Charts for Attributes 20-33

If you look at the �nished version of the �le, you will see that all of the random numbers are “live,” so that they change any time the spreadsheet recalculates. Therefore, you will see values different from those in Figures 20.25 and 20.26. However, they should all tell approximately the same story:

■ Variation is inherent in any process.

■ The system determines workers’ performance; until it changes, workers are typically unable to improve their performance.

■ Only management can change the system.

■ Given an in-control process, some workers will appear to be best or worst on appear to be best or worst on appear different days, but at least part of this is a matter of luck, not skill or working harder. When this is the case, rewards or reprimands are likely to do more harm than good.

P R O B L E M S

Level A 16. Suppose that a manufacturer of electronic computer chips

classifies each chip as either defective or nondefective. Each hour 100 electronic chips are randomly selected from a very large batch of chips and tested for possible defectiveness. The file P20_16.xlsx lists the number of defective chips (out of the 100 sampled) found during each of 25 hours of production. Based on the given sample data, is this production process currently in control? Provide support for your conclusions.

17. Construct and interpret a p chart for the data provided in the file P20_17.xlsx. These data consist of the number of defective units found in each of 25 samples with a common size of 200 units. Is this production process currently in control? Is it behaving well?

18. Continuing the previous problem, suppose that the given production process has been modified in an effort to reduce the variation in the proportion of defective items. An additional 25 samples that share a common size of 200 are gathered, and the number of defective items in each sample is recorded in the file P20_18. xlsx. Have the refinements to this system achieved the desired result? Explain why or why not.

19. Construct and interpret a p chart for the data provided in the file P20_19.xlsx. These data consist of the number of defective units found in each of 25 samples with a common size of 100 units. Is this production process currently in control? Is it behaving well?

20. Suppose that a manufacturer of a particular automotive part classifies each unit produced as either defective or nondefective. Each hour 200 parts are randomly selected from a very large batch of manufactured items and tested for possible defectiveness. The file P20_20.xlsx lists the number of defective parts (out of the 200 sampled) found during each of 30 consecutive hours of production. a. Based on the given sample data, is this production

process currently in control? Provide support for your conclusions.

b. What advice, if any, would you give to the managers of this production process?

21. A new online bookstore ships thousands of books to its customers each week. The director of this firm’s shipping department is concerned about a seemingly large number of complaints from customers regarding errors in shipments. The managers of the organization know that the future prof-The managers of the organization know that the future prof-The managers of the organization know that the future prof itability of this virtual bookstore depends essentially on its ability to fill customer orders quickly and accurately. In an effort to investigate this problem further, the shipping direc- tor collects data on the number of shipments not conform- ing to corresponding customer orders for 25 days in a row. The file P20_21.xlsx contains the number of reported nonP20_21.xlsx contains the number of reported nonP20_21.xlsx - conforming shipments out of the 75 shipments randomly selected on each of the 25 days. Do these data indicate a high average proportion of shipment errors? Is there an excessive amount of variability in the error rate of the com- pany’s shipments? If so, what can managers do in both the short run and the long run to improve the situation?

22. Continuing the previous problem, the firm’s shipping director has implemented a new quality control program within her department. She is interested in determining whether this program is reducing the mean error rate of the company’s shipments. She also hopes that the qual- ity control program will serve to reduce the variability in the proportion of book shipments not conforming to customer orders. To assess the efficacy of the new pro- gram, she obtains another set of sample data. The file P20_22.xlsx contains the number of reported noncon- forming shipments out of the 75 shipments randomly selected on each of 25 consecutive days after the impleafter the impleafter - mentation of the quality control program. Based on these data, does the program appear to be meeting the shipping director’s goals? Explain why or why not.

23. Construct and interpret a p chart for the data provided in the file P20_23.xlsx. These data consist of the proportion of defective heating control units found in each of 30 samples with a common size of 150 units. Is this produc- tion process currently in control? Is it behaving well?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-34 Chapter 20 Statistical Process Control

20-6 PROCESS CAPABILITY Recall that one of the main goals of control charts is to bring a process into control so that it is predictable. In this section we assume that a process is in control, and we predict how capable it is of producing outputs that meet speci�cations. These speci�cations are typically set outside of a process from considerations of what an “acceptable” product is. For exam- ple, a team of engineers might determine that a rod can function properly only if its diameter is between 20.80 and 20.95 millimeters. Or a manager might decide that its check process- ing department is operating within acceptable limits only if check processing times are no more than 30 days. These examples illustrate what we want outputs to be. The question then want outputs to be. The question then want is whether the current process is capable of meeting these speci�cations. When we analyze whether a process is able to meet set speci�cations, it is called a process capability analysis.

Process capability measures the ability of an in-control process to produce items that meet specifications, which are typically defined by lower and upper specification limits.

24. Construct and interpret a p chart for the data provided in the file P20_24.xlsx. These data consist of the proportion of defective lightbulbs found in each of 30 samples with a common size of 100 units. Is this production process currently in control? Is it behaving well?

25. Continuing the previous problem, the managers of this manufacturing process have implemented more strin- gent quality control procedures to reduce the variability of the lightbulbs’ defective rate. The file P20_25.xlsx contains the proportion of defective lightbulbs found in each of 30 samples (again, with a common size of 100 units) taken after the implementation of the new quality control procedures. Use these sample observations to assess the impact of the managers’ corrective actions. Support your conclusions with a p chart.

26. Management of a new credit card company has recorded the number of nonconforming customer bills found in random samples of 150 bills obtained during the first 30 weeks of the firm’s operation. These obser- vations are provided in the file P20_26.xlsx. Given this sample information, how would you evaluate the per- formance of this company with respect to the accuracy of produced customer bills? Support your assessment with a relevant control chart.

27. A mail-order clothing retailer is interested in improv- ing the accuracy of its customer service agents who enter customer orders into the firm’s computerized record system. To monitor the accuracy of the agents’ data entry activities, a manager records the number of data entry errors detected in 150 randomly selected customer orders placed over the course of 1 month (i.e., 30 days). These data are stored in the file P20_27.xlsx. Construct a p chart for the given sample data. a. Based on the given sample data, is this data entry

process currently in control? Provide support for your conclusion here.

b. What advice, if any, would you give to the managers of this process?

28. Construct and interpret a p chart for the data provided in the file P20_28.xlsx. These data consist of the proportion of defective radar detectors found in each of 30 samples with a common size of 200 units. Is this production process currently in control? Is it behav- ing well? Comment on any discernible trend(s) in the p chart based on the given sample data.

29. Explain the difference in the actions a manager must take on a process when a point on a p chart exceeds the upper control limit versus when a point falls below the lower control limit.

Level B 30. Provided that p = 0.01, determine a sample size large

enough to avoid the construction of a p chart with a negative lower control limit. How does this required sample size change when p increases to increases to 0.10?

31. To establish the subsample size n for a p chart, a probability of 0.95 is specified for finding at least one nonconforming item in any subsample of n items. If the process has an average nonconformance rate of 5%, what subsample size n should be used? If the process has an average nonconformance rate of 1%, what subsample size n should be used?

32. For a fixed subsample size n, what values of p lead to a positive lower control limit on a p chart?

33. Use Excel to simulate Deming’s red bead experiment, with six workers instead of four. How do the results six workers instead of four. How do the results six change when the number of workers is increased to six? What new conclusions, if any, emerge from your revision of this simulation?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Process Capability 20-35

In a process capability analysis we are typically given lower and upper speci�cation limits, denoted LSLSLS and USUSU LSLS , and we want to calculate the proportion of outputs from a given process that fall within these limits.5

, and we want to calculate the proportion of outputs from a 5

, and we want to calculate the proportion of outputs from a Based on data generated from the process, we

perform a probability calculation to see how capable the current process is of producing out- puts within the speci�cation limits. The following example illustrates a typical calculation.

E X A M P L E 20.5 CHECKING WHETHER DIAMETERS OF MANUFACTURED RODS MEET SPECIFICATIONS

A manufacturing process produces rods for a mechanical device. Engineers have deter-mined that the diameters of the rods must be between 20.80 and 20.95 millimeters; rods with diameters outside these limits are unusable. As part of the standard control chart- ing the company performs, the data in the file Rods.xlsx have been collected. Here diam- eters of six randomly selected rods were measured every half hour for several production shifts. How capable is this process of meeting engineering specifications?

Objective To use control charts to check whether the manufacturing process is in control, and if it is, to use standard statistical procedures to estimate the proportion of rods that meet specs.

Solution The Data sheet in the file is set up exactly as in previous control chart examples. That is, there is a separate column for each observation in the subsamples of size 6. Therefore, we can—and should—examine X and R charts as a first step to see whether the current process is in control. If it isn’t in control, then it lacks the predictability necessary to judge isn’t in control, then it lacks the predictability necessary to judge isn’t whether it is capable of meeting specifications. Fortunately, control charts show that the current process is in control. We show the X chart in Figure 20.27. Note that its centerline

Figure 20.27 X Control Chart for Rod Diameters

20.84 0 5 10 15 20 25 30 35 40 45 50

20.85

20.86

20.87

20.88

20.89

20.9

20.91

20.92

20.93

20.94

X-Bar: Obs1 – Obs5

Center Line Control Limit Sigma2 Limit Sigma1 Limit X-Bar

© C

e n g

a g

e L

e a rn

in g

5In some cases, such as in the check processing example, only one of the limits is relevant. In that example, USUSU LSLS = 30, but there is no lower limit of interest.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-36 Chapter 20 Statistical Process Control

is 20.897 mm, and its lower and upper control limits are 20.862 mm and 20.932 mm. These values indicate how the process is operating. They might or might not bear any rela- tionship to how we would like it to be operating.

Now that we know the process is in control, hence predictable, we estimate the pro- portion of rods that fall within the specification limits LSLSLS = 20.80 and USUSU LSLS = 20.95. One obvious way to do this is to count the number of observed rods with diameters within the observed rods with diameters within the observed limits. There are 45(6) = 270 rods in the 45 subsamples, and a simple tally shows that none of the 270 diameters are less than the LSLSLS , whereas four are greater than the USUSU LSLS . Therefore, the proportion within the limits is 266/270 = 0.985.

However, this calculation uses only observed rods. What about other rods the process has been producing and will produce? To answer this question, we use a probability model. We assume the distribution of rod diameters is some standard distribution, typically the normal distribution, and then we perform a probability calculation based on the estimated parameters of this distribution. We will illustrate this procedure in a couple of steps.

First, is it reasonable to assume that rod diameters are normally distributed? We check this by creating a histogram of rod lengths. (To use StatTools to do this, we first need to obtain one long variable of 270 diameters. This can be done either manually by copying and pasting or with the StatTools Stack procedure.) The resulting histogram in Figure 20.28 indicates a reasonably bell-shaped distribution of diameters, so that a normal probability model is reasonable. The histogram also indicates that none of the diameters are near the LSLSLS , and that only a few are above the USUSU LSLS .

Figure 20.28 Histogram of Rod Diameters

Next, we use the normal probability model to calculate the probabilities of falling out- side the specification limits. We assume a typical rod has a diameter that is normally distrib- uted with mean and standard deviation equal to the observed mean and standard deviation observed mean and standard deviation observed from the sample. We then use the NORM.DIST function to calculate the probability below the LSLSLS and above the USUSU LSLS . (See Figure 20.29.) The formulas in cells E9 and E11 are

=NORM.DIST(E7,E3,E4,TRUE)

The specification limits, LSL and USL, are not shown on the control chart. This is the standard—and preferred—practice.

0

LSL USL

Histogram of Diameter/Stacked Data

10

20

30Fr eq

ue nc

y

20 .8

09 11

20 .8

27 33

20 .8

45 56

20 .8

63 78

20 .8

82 00

20 .9

00 22

20 .9

18 44

20 .9

36 67

20 .9

54 89

40

50

60

70

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Process Capability 20-37

and

=1-NORM.DIST(E8,E3,E4,TRUE)

We see that there is almost no probability of being below the LSLSLS , but the probability of being above the USUSU LSLS is just below 0.02. Therefore, slightly more than 98% of rods should meet speci�cations if the process continues to operate as it is currently operating.

Although the probabilities of not meeting specifications are quite small, it is common to project the results to a large number of items. Specifically, the capability of a process is often quoted in parts per million (ppm). We have done this in cells E10 and E12 by multi- plying each of the probabilities by 1,000,000. Surprisingly, the extremely small probability in cell E9 still implies that about 83 ppm will fall below the LSLSLS , and the probability in cell E11 implies that almost 20,000 ppm will fall above the USUSU LSLS . Perhaps this process isn’t as capable as we initially thought. Two other capability indices, denoted CpCpC and CpCpC k, are also listed in Figure 20.29. We will discuss them in the next subsection. ■

Normal probability calcula�ons

LSL 20.80

USL 20.95

P(below LSL) 0.00008

Per million 83.2

P(above USL) 0.01997

Per million

Capability indexes

19969.8

Cp 0.970

Cpk 0.685

Mean

D E

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

One Variable SummaryOne Variable SummaryOne V Stacked Data

Diameter

Std. Dev.

D E

20.89705

0.02577

Figure 20.29 Capability Analysis for Rod Diameters

Before continuing, we make one important point about control charts and speci�ca- tion limits. The speci�cation limits, LSLSLS and USUSU LSLS , should not be shown on a control chart. not be shown on a control chart. not If lines are drawn at these limits, they give the impression that the purpose of the charts is to get all of the points within these limits. Remember, however, that the real purpose of control charts is to show us what the process is doing, not what we want it to do. As want it to do. As want Deming preached, anyone who draws speci�cation limits on a control chart doesn’t really understand the purpose of the chart.

20-6a Process Capability Indexes

If the outputs from an in-control process are approximately normally distributed with mean μ and standard deviation σ, then we know that almost all of the items produced will be within three standard deviations of the mean, that is, within the interval μ ± 3σ. Note that this interval has length 6σ. On the other hand, we want the items to be within the interval want the items to be within the interval want from LSLSLS to USUSU LSLS , an interval of length USUSU LSLS − LSLSLS . One way to judge the capability of a

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-38 Chapter 20 Statistical Process Control

Cp Capability Index (Used When Process Mean Is on Target)

CpCpC = USUSU LSLS − LSLSLS

6σ (20.1)

process is to compare the lengths of these two intervals with a process capability index. Speci�cally, the capability index denoted by CpCpC is de�ned by Equation (20.1).

LSL USL

Figure 20.30 Distribution for a Process with CpCpC = 1

To understand CpCpC , assume that the ideal output value, called the “target,” is halfway between the LSLSLS and the USUSU LSLS . Also, assume that the current mean μ of the process is equal to the target, and that the distance from the target to either speci�cation limit is 3σ. Then CpCpC = 1, and we have the picture in Figure 20.30. In words, the current process is making just about what needs to be made, and the probability of falling outside the speci�cation limits is only 0.0027 (the probability that a normally distributed random value is more than three standard deviations from the mean). Alternatively, the ppm beyond the speci�cation limits is 2,700 [=0.0027(1,000,000)].

LSL USL

Figure 20.31 Distribution for a Process with CpCpC = 0.667

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Now consider changes from this “baseline” situation. There are essentially three ways we could make the process more or less capable: (1) we could change the speci�cation limits, LSLSLS and USUSU LSLS , (2) we could change the mean μ so that it is not equal to the target, and (3) we could increase or decrease the variability in the process, as measured by σ. For the time being, we will assume that LSLSLS and USUSU LSLS are �xed because of engineering require- ments and that μ continues to equal the target, so that only σ varies.

Figures 20.31 and 20.32 indicate two possible changes in σ. Figure 20.31 represents a more variable process, where the distance from the target to either speci�cation limit is only 2σ. The speci�cation limits haven’t changed, but σ has increased. In this case CpCpC = 4σ/6σ = 0.667, and the probability of falling outside the speci�cation limits is 0.045392 145,392 ppm2. On the other hand, Figure 20.32 represents a less variable process,

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Process Capability 20-39

where the distance from the target to either speci�cation limit is now 4σ. Again, the speci- �cation limits haven’t changed, but σ has decreased. In this case CpCpC = 8σ/6σ = 1.333, and the probability of falling outside the speci�cation limits is 0.000064 164 ppm2. Clearly, the relationship of σ to the distance between the speci�cation limits is crucial in determining the capability of the process, and we want CpCpC to be as large as possible. Most world-class manufacturers attempt to achieve a CpCpC of at least 1.333, and many even try to improve on this.

When the target is midway between the speci�cation limits, the process mean is equal to the target, and the process is normally distributed, it can be shown that the probability of falling outside the speci�cation limits is

P(beyond specification limits) = 2P(Z < −3CpCpC ) (20.2)

where Z is normal with mean 0 and standard deviation 1. We use Equation (20.2) in Figure 20.33 to show the effect of CpCpC . (See the �le Cp, Cpk Indexes.xlsx.) We treat CpCpC in cell B10 (range-named Cp) as an input. The formula in cell B12 is

=2*NORMSDIST(−3*Cp)

We then create the data table in columns D–F. Clearly, the ppm outside the speci�cation limits decreases dramatically as CpCpC increases.

LSL USL

Figure 20.32 Distribution for a Process with CpCpC = 1.333

© C

e n g

a g

e L

e a rn

in g

1 A B C D E FE F

2 3

Spec limits are fixed4 5

8

10 11 12 13 14 15 16 17

Cp Cp P(beyond) 0.002700 2700

0.31780.333 317795

0.00271 2700 0.00011.333 64 0.00001.667 1 0.00002 02 00.00002 00.0000

0.04540.667 45392

ppm

P(beyond spec limits)

1

0.0027 2700ppm beyond spec limits

Target is midway between spec limits 6 Process mean equals target 7 Process distribu�on is normal

Cp index

Assump�ons:

9 Typical calcula�oTypical calcula�oT n Data table

A B C D

2 0

n D

Figure 20.33 Effect of CpCpC on ppm Beyond Specification Limits

© C

e n g

a g

e L

e a rn

in g

An equivalent way of thinking about CpCpC is by considering its reciprocal. For exam- ple, suppose that CpCpC = 1.333, so that its reciprocal is 3/4. Speci�cally, let’s assume that LSLSLS = 92, USUSU LSLS = 108, μ = 100 (the target), and σ = 2. (You can check that CpCpC = 1.333

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-40 Chapter 20 Statistical Process Control

for these parameters.) Then we know that the interval μ ± 3σ, which contains almost all of the items produced, is from 94 to 106, an interval of length 12. In contrast, the interval de�ned by the speci�cation limits is from 92 to 108, an interval of length 16. Therefore, the ±3σ interval within which the process outputs fall takes up only 12/16 = 3/4 of the speci�cation-limit interval. In this sense the process is quite capable. Of course, if we can decrease σ, then CpCpC will increase and its reciprocal will decrease. Therefore, the ±3σ interval within which the process outputs fall will take up an even smaller fraction of the speci�cation-limit interval, and the process capability will be even greater.

Essentially, the CpCpC index indicates the capability of a process if it is centered properly— that is, if its mean is equal to the target. Then the only reason for parts falling outside the speci�cation limits is excess variation—a large σ—in the process. But what if there is variation in the process and the process mean is off target? In this case we need a slightly and the process mean is off target? In this case we need a slightly and different capability index, denoted by CpCpC k, to measure how close the process mean is to the nearest speci�cation limit. We concentrate on the nearest speci�cation limit because nearest speci�cation limit because nearest this is where most of the problems are likely to occur. The “baseline” case is now where the distance from the process mean to the nearest speci�cation limit is 3σ, for in this case the process will be producing just about what we want it to produce. We de�ne CpCpC k so that it is equal to 1 in this baseline case, as shown in Equation (20.3).

Cpk Capability Index (Used When Process Mean Is Not on Target)

CpCpC k = min e USUSU LSLS − μ

3σ , μ − LSLSLS

3σ f (20.3)

An illustration of CpCpC k similar to that for CpCpC in Figure 20.33 appears in Figure 20.34. (This is also in the Cp, Cpk Indexes.xlsx �le.) Here we assume that the process is nearer to USUSU LSLS than to LSLSLS . Then it can be shown that the probability of being beyond USUSU LSLS is P(Z > 3CpCpC k). Therefore, for any trial value of CpCpC k in cell B10 (range-named Cpk), we enter the formulas

=1-NORM.S.DIST(3*Cpk,TRUE)

and

=1000000*B12

in cells B12 and B13. Using these, we form a data table in columns D–F to show how the process capability varies as CpCpC k varies. Of course, this shows only half of the story, the probability of being beyond speci�cations on the high side. But the probability of being beyond speci�cations on the low side is even smaller, because we assumed the process mean is closer to USUSU LSLS than to LSLSLS .

To illustrate CpCpC k with data, we look again at Figure 20.29 from the example on rod k with data, we look again at Figure 20.29 from the example on rod k diameters. Because LSLSLS = 20.80 and USUSU LSLS = 20.95, the target is their midpoint, 20.875. However, the process mean, estimated by X = 20.897, appears to be closer to the USUSU LSLS . Therefore, it is likely that most rods beyond the speci�cation limits will be above the USUSU LSLS . We estimate σ for this process with the sample standard deviation, s = 0.025. Then the (estimated) CpCpC k is k is k 0.685, calculated in cell E16 with the formula

= (E8-E3)/(3*E4)

This is considerably below the baseline case where CpCpC k = 1, so that, as you can see in Figure 20.29, the current process has a fairly large ppm beyond speci�cations—almost all on the high side.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Process Capability 20-41

If the CpCpC k is unacceptably small—and again, most world-class manufacturers try to achieve a value of at least 1.333—there are two possibilities.6

is unacceptably small—and again, most world-class manufacturers try 6

is unacceptably small—and again, most world-class manufacturers try First, we could try to

“center” the process by adjusting the process mean to the target. In this case CpCpC and CpCpC k coincide. If we could do this for the rod example, we could achieve a CpCpC value of 0.970, as shown in cell E16 in Figure 20.29. This would be much more acceptable than the current process. Alternatively, we could try to reduce the process variation, with or without a shift in the mean. By reducing σ, we automatically reduce CpCpC k (and CpCpC ), regardless of whether the mean is on target.

Both CpCpC and CpCpC k are simply k are simply k indexes of process capability. The larger they are, the more capable the process is. An equivalent descriptive measure is the “number of sigmas” of a process. A k-sigma process is one for which the distance from the process mean to the nearest speci�cation limit is kσ. For example, a 3-sigma process is one where CpCpC k = 1, because this is exactly how CpCpC k is de�ned. (In case the process mean is on target, k is de�ned. (In case the process mean is on target, k CpCpC also equals 1 for a 3-sigma process.) As we will discuss in more detail below, Motorola has become famous for its 6-sigma processes, where CpCpC k = 2. This is remarkable quality. It implies that almost no items out of speci�cations per million items are produced. This is because an item is out of speci�cations in a 6-sigma process only if it is beyond six stand- ard deviations from the mean, an extremely unlikely event. Motorola and other world-class companies have achieved this by reducing variation to a bare minimum—and by continu- ally searching for ways to reduce it even further.

A k-sigma process is one in which the distance from the process mean to the nearest specification limit is kσ, where σ is the standard deviation of the process.

Cpk index

Typical calcula�onTypical calcula�onT

Assump�ons: Spec limits are fixed

A 1 2 3 4

6

8 9

10 11

14 15 16 17 18 19 20 21 22 23 24 25

B C D E F G

Cpk

12 P(above USL)

P(above USL) ppm above USL

13 ppm above USL 0.00135

1350 0.333 0.15890 158897

0.02270 226960.667

0.00000 02 0.00000 01.667 0.00003 321.333 0.00135 13501

Data table Cpk1

7 Process distribu�on is normal Process mean doesn’t equal the target (here we’ll assume it’s closer to USL than to LSL)

5 Target is midway between spec limits

7 P

B C D E F G

Because we’re assuming the mean is closer to USL than to LSL, P(below LSL) and ppm below LSL are even smaller than these values.

0.00135 1350

Figure 20.34 Effect of CpkCpkC on ppm Beyond the Nearest Specification Limit

© C

e n g

a g

e L

e a rn

in g

6 This assumes that changing the speci�cation limits is not an option.not an option.not

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-42 Chapter 20 Statistical Process Control

We can summarize the ideas in this section as follows.

■ The CpCpC index is appropriate for processes in which the mean is equal to the target value (midway between the speci�cation limits). Processes with CpCpC = 1 produce about 2700 out-of-speci�cation items per million, but this number decreases dramati- cally as CpCpC increases.

■ The CpCpC k index is appropriate for all processes, but it is especially useful when the mean is off target. (In case the mean is on target, CpCpC and CpCpC k are equivalent.) Processes with CpCpC k = 1 produce about 1350 out-of-speci�cation items per million on the side nearest the target (and fewer on the other side), and again this number decreases dramatically as CpCpC k increases.

■ Both CpCpC and CpCpC k are only indexes of process capability. However, they imply the probability of an item being beyond speci�cations (and the ppm beyond speci�ca- tions), as illustrated in Figures 20.33 and 20.34.

■ A 3-sigma process has CpCpC k = 1, whereas a 6-sigma process has CpCpC k = 2. In general, the distance from the process mean to the nearest speci�cation limit in a k-sigma process is kσ. Quality improves dramatically as k increases.k increases.k

20-6b More on Motorola and 6-sigma We de�ned a k-sigma process as one where the distance from the target to the nearest speci�cation limit is kσ. Until the 1990s most companies were content to achieve a 3-sigma process, that is, CpCpC = 1. Assuming that each part’s measurement is normally distributed, they reasoned that 99.73% of all parts would be within speci�cations. Motorola questioned this wisdom on two counts:

■ Products are made of many parts. The probability that a product is acceptable is the probability that all parts making up the product are acceptable.all parts making up the product are acceptable.all

■ When using control charts to monitor quality, shifts of 1.5 standard deviations or less in the process mean are dif�cult to detect. Therefore, when we are producing a product, there is a reasonable chance that the process mean will shift by as much as 1.5σ up or down without being detected (at least in the short run).

Given that the process mean might be as far as 1.5σ from the target and that a product is made up of many parts, a 3-sigma process might not be as good as we originally stated. Just how good is it? Generally, the following analysis is referred to as Motorola 6-sigma analysis.

Suppose a product is composed of m parts. We will calculate the probability that all m parts are within speci�cations when the process mean is 1.5σ above the target and the distance from the target to either speci�cation limit is kσ.7

parts are within speci�cations when the process mean is 7

parts are within speci�cations when the process mean is That is, we are considering a

k-sigma process with a process mean off center by an amount 1.5σ. Let X be the meas- urement for a typical part, and let p be the probability that X is within the speci�cation limits, that is, p = P(LSLSLS < X < USUSU LSLS ). If pm is the probability that all m parts are within the speci�cation limits, then assuming that all parts are identical and probabilistically independent, the multiplication rule for probability implies that pm = p

m. To calculate p = P(LSLSLS < X < USUSU LSLS ), we need to standardize each term inside the

probability by subtracting the process mean μ and dividing the difference by σ. Let T be the target. Then we have LSLSLS = T − kσ and USUSU LSLS = T + kσ (because the process is a k-sigma process) and μ = T + 1.5σ (because the mean has shifted upward by an amount 1.5σ). Therefore, the standardized speci�cation limits are

LSLSLS − μ σ

= (T − kσ) − (T + 1.5σ)

σ = −k − 1.5

7The case where the process mean is 1.5σ below the target is completely analogous.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-6 Process Capability 20-43

p = P(−k − 1.5 < Z < k − 1.5) = P(Z < k − 1.5) − P(Z < −k − 1.5) (20.4)

and

USUSU LSLS − μ σ

= (T + kσ) − (T + 1.5σ)

σ = k − 1.5

This implies Equation (20.4), where Z is normal with mean 0 and standard deviation 1.

Each product has m iden�cal, probabilis�cally independent parts The process is a k-sigma process The process mean is C stdevs above the target

Shi� mul�ple C

A 1 2 3 4 5 6 7 8 9

10 11 12 13 14 15 16

B C D E

k 2 3 4 5 6

0.00000 0.00000 0.00197 0.79243 0.99661

0.00000 0.00099 0.53638 0.97700 0.99966

0.02490 0.50084 0.93961 0.99768 0.99997

0.69123 0.93319 0.99379 0.99977 1.00000

p p10 p100 p1000

Process capability for mul�ple-part products

Assump�ons:

Calcula�ons

B C D E

p p

1.5

Figure 20.35 Probability of Multipart Products Meeting Specifications

© C

e n g

a g

e L

e a rn

in g

We can easily implement this in Excel, as shown in Figure 20.35. (See the �le Multi- Part Product.xlsx.) Equation (20.4) is implemented in cell B12 with the formula

=NORM.S.DIST(A12−1.5,TRUE)−NORM.S.DIST(−A12−1.5,TRUE)

and this probability is raised to the 10th, 100th, and 1000th powers in cells C12 to E12. All of this is then copied down for other values of k. As you can see, a 3-sigma process (row 13) is not all that great. Almost 7% of its individual parts are out of speci�cations, about half of its 10-part products are out of speci�cations, and almost all of its all of its all 100-part and 1000-part products are out of speci�cations. In contrast, a 6-sigma process (row 16) is extremely capable, with only 0.34% of its 1000-part products out of speci�cations. No wonder Motorola’s 5-year goal (as early as 1992) was to achieve “6-sigma capability in everything we do.”

By the way, if 1 minus the probability in cell B16 is multiplied by 1,000,000, the result is 3.4. (The exact value in cell B16 is exact value in cell B16 is exact 0.9999966; its format does not show it, how- ever.) This value has become very well known in the quality world. It says that if a process is a 6-sigma process with the mean off target by an amount 1.5σ, the process will produce only 3.4 ppm out of speci�cations. Again, this is remarkable quality.

The previous analysis shows how we can calculate the capability of a process if we know it is a k-sigma process for any speci�c k. We conclude this section by asking a slightly different question. If a company has produced many parts and has observed a certain frac- tion to be out of speci�cations, what is the estimated value of k? For example, suppose that after monitoring thousands of gaskets produced on its machines, a company has observed that 0.545% of them are out of speci�cations. Is this company’s process a 3-sigma process, a 4-sigma process, or what?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-44 Chapter 20 Statistical Process Control

To answer this question, we again assume a “worst-case” scenario where the mean is above the target by an amount 1.5σ. Then, from Equation (20.4), we know that the prob- ability of being within speci�cations is

p = P(Z < k − 1.5) − P(Z < −k − 1.5)

if the process is a k-sigma process. However, we now know p from observed data, and we want to estimate k. This can be done with Excel’s Goal Seek tool, as shown in Figure 20.36. (See the �le k-Sigma Process.xlsx.) First, we enter the observed fractions in and out of speci�cations in cells B9 and B10. Next, we enter any trial value of k in cell B12 and use it k in cell B12 and use it k to calculate the probability of being within speci�cations in cell B14 with the formula

= NORM.S.DIST(B12−B6,TRUE)−NORM.S.DIST(−B12−B6,TRUE)

Finally, we select Goal Seek from the What-If Analysis dropdown list on the Data ribbon and �ll out the dialog box as in Figure 20.37. It immediately shows that this process is slightly better than a 4-sigma process.8 and �ll out the dialog box as in Figure 20.37. It immediately shows that this process is

8 and �ll out the dialog box as in Figure 20.37. It immediately shows that this process is

Assump�on:

Shi� mul�ple C 1C 1C 1.5

0.00545 0.99455

4.077

0.99501

Observed frac�ons

Trial value of k

P(within specs)14 13 12 11 10 9 8 7 6 5 4 3 2 1

A BA B

Out of specs Within specs

Mean is C sigmas above tMean is C sigmas above target

Finding k for a k-sigma process Figure 20.36 Finding k for a k-sigma Process

Figure 20.37 Goal Seek Dialog Box Settings

P R O B L E M S

Level A 34. The file P20_01.xlsx contains data on the amount

of soda (in ounces) placed in aluminum cans by a particular filling process. The filling process should place between LSLSLS = 11.95 ounces and USUSU LSLS = 12.05 ounces of soda in each can. Every hour, 4 cans of soda were randomly selected from the production process and measured for amount of fill. This was repeated for 25 consecutive hours.

a. Based on the given sample data, calculate the probabilities that this process will yield soda cans (i) falling below the lower specification limit and (ii) exceeding the upper specification limit.

b. Represent your results found in part a in parts per million (ppm).

c. Estimate CpCpC and CpCpC k. If a difference exists between these two capability indexes, explain it.

8 Note that Goal Seek’s solution in cell B12 doesn’t match the probability in cell B8 exactly, but it is close enough for all practical purposes.

© C

e n g

a g

e L

e a rn

in g

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-7 Conclusion 20-45

20-7 CONCLUSION Some critics have claimed that the quality movement, with all of its acronyms, is a fad that will eventually lose favor in the business world. We do not believe this is true. In the past few decades, many companies in the United States and abroad have embraced the teach- ings of Deming and others to gain a competitive advantage with superior quality. By now, quality has improved to such a level in many industries that superior quality no longer ensures a competitive advantage; it is a prerequisite for staying in business.

In this chapter, we have discussed two quantitative tools from the quality movement: control charts and process capability analysis. It is clear from Deming’s 14 points that there is much more to achieving quality than crunching numbers—for example, good manage- ment and worker training are crucial—but the use of proven statistical techniques is key to any program of continual improvement. The fanfare surrounding the quality movement may indeed die down in the future, but the careful monitoring of processes, together with the use of the statistical tools we have discussed, will still be required elements for compa- nies that want to remain competitive.

35. The data in the file P20_07.xlsx consist of 25 subsamples of 4 observations each on the lengths of particular bolts manufactured for use in large aircraft. The target length of these bolts is 37 centimeters. Furthermore, the bolt manufacturer has established LSLSLS = 36.95 centimeters and USUSU LSLS = 37.05 centimeters. a. Estimate CpCpC and the probability of meeting

specifications. Is this a highly capable production process?

b. Estimate CpCpC k. Does your estimate of CpCpC k differ from k differ from k that of CpCpC computed in part a? If so, how do you explain this difference?

36. Management of a local bank is interested in assessing the process used in opening new checking accounts for bank customers. In particular, management would like to examine the time required to process a customer’s request to open a new checking account. Currently, managers believe that it should take about 7 minutes to process such a request. Furthermore, they believe that the time required to process this type of request should be between LSLSLS = 5.5 minutes and USUSU LSLS = 8.5 minutes. The file P20_12.xlsx contains the time required to process new checking account requests for each of 6 customers selected randomly on a given day. A different subsample of 6 customer requests was collected on each of 25 days. a. Estimate CpCpC and the probability of meeting

specifications. Is this a highly capable production process?

b. Estimate CpCpC k. Does your estimate of CpCpC k differ from k differ from k that of CpCpC computed in part a? If so, how do you explain this difference?

37. A computer printout shows that a certain process has a CpCpC of 1.50 and a CpCpC k of 0.80. Assuming that this process is in control, what do these two index values indicate about the capability of the process?

Level B 38. For a given process, can CpCpC k ever exceed CpCpC ? Provide a

mathematical and/or verbal argument to support your answer.

39. Suppose that a product is composed of 25 identical and probabilistically independent parts. Assume that this product is manufactured through the use of a k-sigma process with a process mean that is 1.25 standard deviations above the target mean. Assuming that k = 3, what proportion of these multipart products are not within specification limits? Answer this question not within specification limits? Answer this question not again for the case where k = 6. Explain the difference between these two probabilities.

40. Suppose that a product is composed of m identical and probabilistically independent parts. Assume that this product is manufactured through the use of a 6-sigma process with a process mean that is 1.5 standard deviations below the target mean. Assuming that m = 5, what proportion of these multipart products are not within specification limits? Answer this question again for the cases where m = 50 and m = 500. Explain the differences among the three probabilities.

41. Suppose that after monitoring a large number of electronic computer chips, a manufacturer observes that 1% of them are out of specifications. Assume that the process mean exceeds the target mean by 1.25 standard deviations. Given this information, it is possible to conclude that this manufacturer is employing a k-sigma process. What is k approximately?

42. Suppose that after monitoring thousands of ball bearings, a manufacturer observes that 0.27% of them are out of spec. Assume that the process mean is 1.5 standard devi- ations below the target mean. Given this information, it is possible to conclude that this manufacturer is employ- ing a k-sigma process. What is k approximately?k approximately?k

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-46 Chapter 20 Statistical Process Control

Summary of Key Terms

Term Symbol Explanation Excel Page Equation Number

Statistical process control (SPC)

A set of statistical tools, including control charts, for monitoring quality

20-3

Deming’s 14 points

A list of rules espoused by Deming for creating quality improvements in manufacturing and service operations

20-4

Common cause variability

The inherent variability in an in-control process

20-8

Assignable cause variability

The extra variability observed when a process goes out of control

20-8

In-control process

Process that is predictable and is subject only to common cause variability

20-8

Out-of-control process

Process that is unpredictable because of assignable cause variability

20-8

Control chart Graphical device for monitoring a process to see whether and when it goes out of control

StatTools/Quality Control

20-9

Subsample A small set of observations (usually 3 to 6) from a process taken at approximately the same moment in time

20-9

X chart Plot of subsample averages through time, used to monitor the process mean

StatTools/Quality Control/XControl/XControl/ /X/X R/R/ Charts

20-10

R chart Plot of subsample ranges (maximum minus minimum) through time, used to monitor process variability

StatTools/Quality Control/XControl/XControl/ /X/X R/R/ Charts

20-10

Lower and upper control limits

LCL,LCL,LCL UCL Lines on a control chart, based on the observed data, typically three standard deviations below and above the centerline

StatTools/Quality Control

20-11

Average run length

ARL Mean time until an out-of-control point occurs on a control chart; reciprocal of the probability of an out-of-control point

20-15

Other out- of-control indications

Excessive runs in one direction or on one side of the centerline, or sequences satisfying “zone” rules that would be unexpected from an in-control process

StatTools/Quality Control

20-16

Rational subsample

A subsample such that its observations are subject to the same common cause variability

20-17

Funnel experiment

Deming’s experiment used to illustrate the harmful effects of tampering with an in-control process

20-20

p chart Plot of proportions of nonconforming (defective) items through time

StatTools/Quality Control/P Chart

20-27

Red bead experiment

Deming’s experiment used to illustrate how workers’ performance is limited by the system

20-31

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-7 Conclusion 20-47

P R O B L E M S

Conceptual Questions C.1. Why is a process that is “in control” not necessarily a

“good” process? What does it really mean for a pro- cess to be in control?

C.2. Is the level of common-cause variation something that level of common-cause variation something that level a company is necessarily stuck with? Why or why not?

C.3. The range of a small set of measurements has tra- ditionally been used as a measure of variability for X and X and X R charts. Why isn’t standard deviation used instead? And why are two charts necessary, an X chart and an R chart?

C.4. In an X chart, is the center line where the company X chart, is the center line where the company X wants the average of its measurements to be? Are the lower and upper control limits the bounds beyond which the produced parts fail to meet specifications?

C.5. If a company estimates the average run length (ARL) to be 430, explain what this really means.

C.6. If you apply the ideas of hypothesis testing to control charts, what does a type II error represent?

C.7. When creating X and X and X R charts, it is customary to meas- ure a few observations at nearly the same time, such as 5 parts every 15 minutes. Each set of 5 parts is called a subsample. Why is it done this way? Why not just observe 1 part every 15 minutes?

C.8. What was the point of Deming’s funnel experiment? What was the point of his red bead experiment?

C.9. How do control charts for variables (X andX andX R charts) differ from control charts for attributes (pdiffer from control charts for attributes (pdiffer from control charts for attributes ( charts)?

More specifically, why are they relevant for different situations?

C.10. How are control limits in typical control charts dif- ferent from specification limits in process capability analysis?

C.11. Why is it virtually impossible to measure whether a process is capable (in the sense of having a high prob- ability of being within specification limits) if it isn’t in control?

C.12. In the formula for the CpCpC index, why does the term 6σ in the denominator imply that this index equals 1 for a “3-sigma” process and equals 2 for a “6-sigma” pro- cess? You can assume that the mean of the process is midway between LSL and USL.

Level A 43. To monitor product quality, Wintel inspects To monitor product quality, Wintel inspects T 30 chips

each week and determines the fraction of defective chips. The resulting data are in the file P20_43.xlsx. Construct a p chart based on 12 weeks of data. Is week 5 out of control? Why or why not? Is week 6 out of control? Why or why not? What do these charts tell you about Wintel’s production process?

44. Eleven samples of size 3 were taken in an effort to monitor the voltage held by a regulator. The data are in the file P20_44.xlsx. A regulator meets specifications if it can hold between 40 and 60 volts. a. Construct X and X and X R charts for the data. Is the process

in control?

Term Symbol Explanation Excel Page Equation Number

Process capability

Measures the ability of an in-control process to produce items that meet specifications

20-34

Lower and upper specification limits

LSL,LSL,LSL USL Limits that prescribe where measurements must fall for items to function as they should

20-35

Process capability index

CpCpC , CpkCpkC Index of process capability; the larger the better

Must be calculated manually

20-38 20.1, 20.3

k-sigma process Process in which the distance to the nearest specification limit is kσ; the larger k is, the betterk is, the betterk

20-41

Motorola 6-sigma

The goal of Motorola and other companies to produce no more than 3.4 nonconforming parts per million

20-42

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-48 Chapter 20 Statistical Process Control

b. Estimate CpCpC and the probability of meeting specifications.

45. You are the manager of a hospital emergency room. You are interested in analyzing the time patients wait to see a physician. For 25 samples of 5 patients each, the file P20_45.xlsx contains the time each patient had to wait before seeing a physician. Construct and interpret X and R charts for this situation. Also answer the following questions: a. We are 68% sure that a patient will wait between

what two values (in minutes) to see a physician? b. We are 95% sure that a patient will wait between

what two values (in minutes) to see a physician? c. We are 99.7% sure that a patient will wait between

what two values (in minutes) to see a physician?

46. A mail-order company (Seas Beginning) processes 100 invoices per day. For each of several days, they have kept track of the number of invoices that contain errors. The data are in the file P20_46.xlsx. Use these data to construct a p chart and then interpret the chart.

47. The file P20_47.xlsx contains the measured diameters (in inches) reported by the production foreman of 500 rods produced by Rodco. A rod is considered accept- able if it is at least 1.0 inch in diameter. In the past the diameter of the rods produced by Rodco has followed a symmetric distribution. a. Construct a histogram of these measurements. b. Comment on any unusual aspects of the histogram. c. Can you guess what might have caused the unusual

aspect(s) of the histogram? (Hint: One of Deming’s 14 points is to “Drive Out Fear.”)

48. John makes 20 computers per day for Pathway computer. Production data appear in the file P20_48 .xlsx. Construct a control chart based on the number of defective computers produced during each of the last 30 days. Explain as fully as possible what you learn from this control chart.

49. For the data in the file P20_49.xlsx, suppose USUSU LSLS = 1.06 inches and LSLSLS = 0.94 inch. a. Is the process in control? If it is out of control,

describe any observed out-of-control pattern. b. If possible, estimate CpCpC , CpCpC k, and the probability of

meeting specifications.

50. For the data in the file P20_50.xlsx, suppose that LSLSLS = 190 and USUSU LSLS = 210. a. Is the process in control? If it is out of control,

describe any observed out-of-control pattern. b. If possible, estimate CpCpC , CpCpC k, and the probability of

meeting specifications.

51. For the data in the file P20_51.xlsx, suppose that LSLSLS = 195 and USUSU LSLS = 205. a. Is the process in control? If it is out of control,

describe any observed out-of-control pattern.

b. If possible, estimate CpCpC , CpCpC k, and the probability of meeting specifications.

52. Consider a k-sigma process. a. If k = 4, determine the fraction of all parts that meet

specifications and calculate CpCpC . Now suppose that a car consists of 1000 parts, each of which is governed by a 4-sigma process. What fraction of all cars will be perfect (meaning all 1000 parts meet specs)?

b. Repeat part a for a 6-sigma process. Now can you see why companies like Motorola are not satisfied with anything less than a 6-sigma process?

53. A part is considered within specifications if its tensile strength is between 180 and 200. For 20 straight hours the tensile strength of 4 randomly chosen parts was measured. The data are in the file P20_53.xlsx. a. Is the process in control? b. What is CpCpC ? c. What is the probability that the specifications will be

met on a typical part?

54. Twelve samples of size 4 were taken in an effort to monitor the voltage held by a regulator. The data are in the file P20_54.xlsx. A regulator meets specifications if it can hold between 18 and 56 volts. Estimate CpCpC and the probability of meeting specifications.

55. Suppose that the employees of D&D’s each service 100 accounts per week. The file P20_55.xlsx contains the number of accounts that each employee “messed up” during the week. Do these data indicate that Jake should receive a raise and Billy should be fired? Discuss.

Level B 56. Continuing the previous problem, the file P20_56.xlsx

contains 2 more weeks of data for D&D’s. a. By plotting each employee’s weekly fraction

of “mess ups,” does it appear that Amanda is a problem? Discuss.

b. Now combine the 2 weeks of data for each employee and answer the question in part a.

57. A company has a 3-sigma process. What must the company do to change it to a 6-sigma process? Be as specific as possible.

58. For Ford to designate a supplier as Q-1 (its highest designation), Ford requires that the supplier have a CpCpC equal to 1.33. Currently your firm has CpCpC = 1. What must you do to increase your CpCpC to 1.33? Be as specific as possible.

59. How does continuous improvement manifest itself on a p chart? What about on X and R charts?

60. A screw manufacturer produces screws that are supposed to be 0.125 inch in diameter. A screw is deemed satisfactory if its diameter is between 0.124 inch and 0.126 inch. The company quality manager therefore uses an X chart with a centerline of

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-7 Conclusion 20-49

0.125 inch, a UCLCLC of 0.126 inch, and an LCLCLC of 0.124 inch. Why is this incorrect?

61. A sudden change in a particular production process has lowered the process mean by lowered the process mean by lowered 1 standard deviation. It has been determined that the weight of the product being measured is approximately normally distributed. Furthermore, it is known that the recent change had virtually no effect on the variability of this process. What proportion of points is expected to fall outside the control limits on the X chart if the subsample size is 4? Compute this proportion again for the case where the subsample size is 9. Provide an explanation for the difference between these two proportions.

62. The SteelCo company manufactures steel rods. The specification limits on the lengths of these rods are from 95.6 inches to 95.7 inches. The process that produces these rods currently yields lengths that are normally distributed with mean 95.66 inches and standard deviation 0.025 inch. a. What is the probability that a single rod will be

within specification limits? b. What is the probability that at least 90 of 100 rods

will be within specification limits? c. SteelCo’s best customer currently buys 200 of

these rods each day and pays the company $20 apiece. However, it gets a $40 refund for each rod that doesn’t meet specifications. What is SteelCo’s current expected profit per day? How small would its standard deviation need to be before it would net an expected $3900 per day?

63. Continuing the previous problem, suppose that SteelCo can pay money to reduce the standard deviation of the process. It costs e1000d dollars to reduce the standard deviation from 0.025 to 0.025 − d. (This reflects the fact that small reductions are fairly cheap, but large reductions are quite expensive.) If the company wants to make sure that at least 99% of all rods meet specifica- tions, how much will it have to spend? (Remember that you evaluate ex in Excel with the EXP function.)

64. We reconsider SteelCo from the previous two problems from a different point of view. Now we assume SteelCo doesn’t know its process mean and standard deviation, so it uses sampling. The file P20_64.xlsx lists 150 randomly sampled rod lengths. a. Calculate a 95% confidence interval for the

population mean length of all rods produced. b. Continuing part a, find a 95% confidence interval

for the population proportion that meet the specifications listed at the top of the spreadsheet (the same as in the previous problem).

c. Using the sample standard deviation found in part a as a best guess for the population standard deviation, how large a sample size is required to achieve a 95% confidence interval for the mean of the form “point estimate plus or minus 0.002”?

65. Simulation is useful to see how long it might take before an out-of-control condition is recognized by an X or R control chart. Proceed as follows: a. Generate 30 subsamples of size n = 5 each, where

each observation comes from a normal distribution with a given mean μ and standard deviation σ. (You can choose μ and σ.) Then “freeze” these values (with the Copy and PasteSpecial/Values commands), and form X and X and X R control charts based on all 30 subsamples.

b. Below the subsamples in part a, generate 30 more subsamples of size n = 5 each, where each observation comes from a normal distribution with mean μ + k1σ and standard deviation k2σ. That is, the mean has shifted by an amount k1σ, and the standard deviation has been multiplied by a factor k2. The values k1 and k2 should be entered as input parameters that you can change easily. Initially, set k1 = 1.5 and k2 = 1, although you can try other values in a follow-up sensitivity analysis. Do not freeze the observations in these 30 new subsamples. Create new X and X and X R control charts that plot all 60 subsamples but have the same control limits from part a. By pressing the F9 key and/or changing the values in the k1 and k2 input cells, you change the behavior of the control charts.

c. Write up your results. In particular, indicate how long it takes for the control charts to realize that the process is out of control with respect to the original control limits, and how this depends on k1 and k2.

66. Are all “capable” processes the same? Consider the data in the file P20_66.xlsx. The data come from two pro- cesses that produce the same type of part. These parts should be within the specification limits 10.45 inches to 10.55 inches, with a target of 10.50 inches. Are both processes capable of staying within the specification limits? If you were a manufacturer and had to select one of these processes as a supplier of parts, which would you choose? Why?

67. Continuing the previous problem, one of the leading quality gurus, Genichi Taguchi of Japan, suggested the idea of a quadratic loss function when judging quality. Rather than saying that a part is “good” when its measurement falls within specification limits and is “bad” otherwise, the quadratic loss function estimates the part’s quality as (x − T)T)T 2, where x is the part’s x is the part’s x measurement and T is the target measurement. a. Using this loss function, estimate the average quality

of parts from process 1, given the data in the file P20_66.xlsx and a target of 10.50 inches. Do the same for process 2. Which process appears to be better?

b. Explain intuitively why a quadratic loss function might be preferable to a simple 0 − 1 function (where a part either meets specifications or it doesn’t) when assessing quality.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

20-50 Chapter 20 Statistical Process Control

68. A manufacturer supplies a certain type of assembly to customers. The manufacturer recognizes the advan- tages of control charts and uses them consistently. In the past month, its X and X and X R charts for the assembly indicated a process well within control. For these charts, 100 subsamples of size n = 5 each were used. In addition, the manufacturer compared the 100 X’s to the specification limits set by one of its customers. Only 2 out of these 100 averages were outside the specification limits. This was good news because the customer was willing to accept orders with no more than 5% out of specifications. However, the manufac- turer was shocked when the customer rejected an order for 1000 assemblies. The customer claimed that it inspected 50 of the 1000 assemblies, and 10% (i.e., 5) of them were out of specifications. What is going on here? Is it likely that the customer could see so many bad assemblies, given what the manufacturer observed in its process? Perform appropriate calculations, and write up your results in a short report. Make whatever assumptions you deem relevant.

69. A type of assembly is produced by gluing 5 identical wafers together in a sandwich-like arrangement. The critical dimension of this assembly is its width, the sum of the widths of the 5 wafers. The specifications

for the assembly width are from 4.95 inches to 5.05 inches, with a target of 5.00 inches. The manufacturer wants at least 99.5% of the assemblies to meet speci- fications. Based on a lot of evidence, the individual wafer widths are normally distributed with mean 1 inch and some standard deviation σ. a. One engineer, Bob Smith, argues that the company

should try to achieve a value of σ (through appropriate changes in the process) such that 99.5% of all individual wafer widths are between individual wafer widths are between individual 0.99 inch and 1.01 inches. What value of σ is necessary to achieve this?

b. A second engineer, Ed Jones, argues that Smith is solving the wrong problem. Instead, he says, the company should try to achieve a value of σ such that the sum of 5 normally distributed random values has only a 0.5% chance of falling outside the interval from 4.95 inches to 5.05 inches. What value of σ is necessary to achieve this?

c. Which of the engineers is solving the “correct” problem? If the company follows the advice of the wrong engineer, will it err on the high side (too many assemblies out of specifications) or the low side? Is there any disadvantage to erring on the low side?

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-1

A Statistical Reporting A-1 INTRODUCTION

By now, you have learned a wide variety of statistical tools, ranging from simple charts and descriptive measures to more complex tools, such as regression and time series analysis. We suspect that all of you will be required to use some of these tools in your later course- work and in your eventual jobs. This means that you will not only need to understand the statistical tools and apply them correctly, but you will also have to write reports of your analyses for someone else—an instructor, a boss, or a client—to read. Unfortunately, the best statistical analysis is worth little if the report is written poorly. A good report must be accurate from a statistical point of view, but maybe even more important, it must be written in clear, concise English.1

As instructors, we know from experience that statistical report writing is the downfall of many students taking statistics courses. Many students appear to believe that they will be evaluated entirely on whether the numbers are right and that the quality of the write-up is at best secondary. This is simply not true. It is not true in an academic environment, and it is certainly not true in a business environment. Managers and executives in business are very busy people who have little time or patience to wade through poorly written reports. In fact, if a report starts out badly, the remainder will probably not be read at all. Only when it is written clearly, concisely, and accurately will a report have a chance of making any impact. Stated simply, a statistical analysis is often worthless if not reported well.

The goals of this brief appendix are to list several suggestions for writing good reports and to provide examples of good reports based on the analyses presented in this textbook. You have undoubtedly taken several classes in writing throughout your school years, and we cannot hope to make you a good writer if you have not already developed good basic writing skills. However, we can do three things to make you a competent statistical report writer. First, we can motivate you to spend time on your report writing by stressing how important it is in the business world. Indeed, we believe that poor writing often occurs because writers do not believe the quality of their writing makes any difference to anyone. However, we promise you that it does make a difference in the business world—your job might depend on it. Second, we can list several suggestions for improving your statistical report writing. Once you believe that good writing is really important, these tips might be all you need to help you improve your report writing signi�cantly. Finally, we can provide examples of good reports. Some people learn best by example, so these “templates” should come in very handy.

There is no single best way to write a statistical report. Just as there are many different methods for writing a successful novel or a successful biography, there are many different methods for writing a successful statistical report. The examples we provide look good to us, but you might want to change them according to your own tastes—or maybe even

1This appendix discusses report writing. However, we acknowledge that oral presentation of statistical analysis is also very important. Fortunately, virtually all of our suggestions for good report writing carry over to making effective presentations. Also, we focus here on statistical reporting. The same comments apply to other quantitative statistical reporting. The same comments apply to other quantitative statistical reports, such as those dealing with optimization or simulation models.

A P P E N D I X

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-2 Appendix A Statistical Reporting

improve on them. Nevertheless, there are some bad habits that practically all readers will object to, and there are some good habits that will make your writing more effective. We list several suggestions here and expand on them in the next section.

Planning

■ Clarify the objective.

■ Develop a clear plan.

■ Give yourself enough time.

Developing a Report

■ Write a quick �rst draft.

■ Edit and proofread.

■ Give your report a professional look.

Be Clear

■ Provide suf�cient background information.

■ Tailor statistical explanations to your audience.

■ Place charts and tables in the body of the report.

Be Concise

■ Let the charts do the talking.

■ Be selective in the computer outputs you include.

Be Precise

■ List assumptions and potential limitations.

■ Limit the decimal places.

■ Report the results fairly.

■ Get advice from an expert.

A-2 SUGGESTIONS FOR GOOD STATISTICAL REPORTING To some extent, the habits that make someone a good statistical report writer are the same habits that make someone a good writer in general. Good writing is good writing. However, there are some speci�c aspects of good statistical reporting that do not apply to other forms of writing. In this section, we list several suggestions for becoming a good writer in general and for becoming a good statistical report writer in particular.

A-2a Planning Clarify the objective. When you write a statistical report, you are probably writing it for someone—an instructor, a boss, or maybe even a client. Make sure you know exactly for someone—an instructor, a boss, or maybe even a client. Make sure you know exactly for what this other person wants, so that you do not write the wrong report (or perform the wrong statistical analysis). If there is any doubt in your mind about the objective of the report, clarify it with the other person before proceeding. Do not just assume that coming close to the target objective is good enough.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-2 Suggestions for Good Statistical Reporting A-3

Develop a clear plan. Before you start writing the report, make a plan for how you are going to organize it. This can be a mental plan, especially if the report is short and straightforward, or it can be a more formal written outline. Think about the best length for the report. It should be long enough to cover the important points, but it should not be verbose. Think about the overall organization of the report and how you can best divide it into sections (if separate sections are appropriate). Think about the computer outputs you need to include (and those you can exclude) to make your case as strong as possible. Think about the audience for whom you are writing and what level of detail they will demand or will be able to comprehend. If you have a clear plan before you begin writing, the writing itself will flow much more smoothly and easily than if you make up a plan as you go. Most effective statistical reports essentially follow the outline below. We recom- mend that you try it.

■ Executive summary

■ Problem description

■ Data description

■ Statistical methodology

■ Results and conclusions

Give yourself enough time. If you plan to follow the suggestions listed here, you need to give yourself time to do the job properly. If the report is due �rst thing Monday morning and you begin writing it on Sunday evening, your chances of producing anything of high quality are slim. Get started early, and don’t worry if your �rst effort is not perfect. If you produce something a week ahead of time, you will have plenty of time to polish it in time for the deadline.

A-2b Developing a Report

Write a quick first draft. We have all seen writers in movies who agonize over the first sentence of a novel, and we suspect that many of you suffer the same problem when writing a report. You want to get it exactly right the first time through, so you agonize over every word, especially at the beginning. We suggest writing the first draft as quickly as possible—just get something down in writing—and then worry about improving it with careful editing later on. The worst thing many of us face as writers is a blank piece of paper (or a blank computer document). Once there is something written, even if it is only in pre- liminary form, the hard part is over and the perfecting can begin.

Edit and proofread. The secret of good writing is rewriting. We believe this sugges- tion (when coupled with the previous suggestion) can have the most immediate impact on the quality of your writing. Fortunately, it is relatively easy to do. With today’s software, there is no excuse for not editing and checking thoroughly, yet we are con- stantly amazed at how many people fail to do so. Spell checkers and grammar checkers are available in all of the popular word processors, and although they do not catch all errors, they should definitely be used. Then the real editing task can begin. A report that contains no spelling or grammatical errors is not necessarily well written. We believe a good practice, given enough time and planning, is to write a report and then reread it with a critical eye a day or two later. Better yet, get a knowledgeable friend to read it. Often the wording you thought was fine the first time around will sound awkward or confusing on a second reading. If this is the case, rewrite it! And don’t just change a word or two. If a sentence sounds really awkward or a paragraph does not get your

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-4 Appendix A Statistical Reporting

point across, don’t be afraid to delete the whole thing and explore better ways of struc- turing it. Finally, proofread the final copy at least once, preferably more than once. Just remember that this report has your name on it, and any careless spelling or grammar your name on it, and any careless spelling or grammar your mistakes will reflect badly on you. Admittedly, this editing and proofreading process can be time-consuming, but it can also be very rewarding when you realize how much better the final report reads.

Give your report a professional look. We are not necessarily fans of the glitz that today’s software enables (fancy colored fonts, 3-D charts, and so on), and we suspect that many writers spend too much time on glitz as opposed to substance. Nevertheless, it is important to give your reports a professional look. If nothing else, an attractive report makes a good first impression, and a first impression matters. It indicates to the reader that you have spent some time on the report and that there might be something inside worth might be something inside worth might reading. Of course, the fanciest report in the world cannot overcome a lack of substance, but at least it will gain you some initial respect. A sloppy report, even if it presents a great statistical analysis, might never be read at all. In any case, leave the glitz until last. Spend sufficient time to ensure that your report reads well and makes the points you want to make. Then you can have some fun dressing it up.

A-2c Be Clear

How many times have you read a passage from a book, only to �nd that you need to read it again—maybe several times—because you keep losing your train of thought? It could be that you were daydreaming about something else, but it could also be that the writing itself is not clear. If a report is written clearly, chances are you will pick up its meaning on the �rst reading. Therefore, strive for clarity in your own writing. Avoid long, convoluted sentence structure. Don’t beat around the bush, but come right out and say what you mean to say. Make sure each paragraph has a single theme that hangs together. Don’t use jargon (unless you de�ne it explicitly) that your intended readers are unlikely to understand. And, of course, read and reread what you have written—that is, edit it—to ensure that your writing is as clear as you initially thought.

Provide sufficient background information. After working on a statistical analysis for weeks or even months, you might lose sight of the fact that others are not as familiar with the project as you are. Make sure you include enough background information to bring the reader up to speed on the context of your report. As instructors, we have read through the fine details of many student reports without knowing exactly what the overall report is all about. Don’t put your readers in this position.

Tailor statistical explanations to your audience. Once you begin writing the Statistical Methodology and Results sections of a statistical report, you will probably start wondering how much explanation you need to include. For example, if you are describing the results of a regression analysis, you certainly want to mention the R2

value, the standard error of estimate, and the regression coefficients, but do you need to explain the meanings of these statistical concepts? This depends entirely on your intended audience. If this report is for a statistics class, your instructor is certainly famil- iar with the statistical concepts, and you do not need to define them in your report. But if your report is for a nontechnical boss who knows very little about statistics beyond means and medians, some explanation is certainly warranted. Even in this case, how- ever, keep in mind that your task is not to write a statistics textbook; it is to analyze a particular problem for your boss. So keep the statistical explanations brief, and get on with the analysis.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-2 Suggestions for Good Statistical Reporting A-5

Place charts and tables in the body of the report. This is a personal preference and can be disputed, but we favor placing charts and tables in the body of the report, right next to where they are referenced, rather than at the back of the report in an appendix. This way, when readers see a reference to Figure 3 or Table 2 in the body of the report, they do not have to flip through pages to find Figure 3 or Table 2. Given the options in today’s word processors, this can be done in a visually attractive manner with very little extra work. Alternatively, you can use hyperlinks to the charts and tables.

A-2d Be Concise

Statistical report writing is not the place for the �owery language often used in novels. Your readers want to get straight to the point, and they typically have no patience for verbose reports. Make sure each paragraph, each sentence, and even each word has a purpose, and eliminate everything that is extraneous. This is the time where you should put critical editing to good use. Just remember that many professionals have a one-page rule—they refuse to read anything that does not �t on a single page. You might be sur- prised at how much you can say on a single page once you realize that this is the limit of your allotted space.

Let the charts do the talking. After writing this book, we are the first to admit that it can sometimes be very difficult to explain a statistical result in a clear, concise, and precise manner. It is sometimes easy to get mired in a tangle of words, even when the statistical concepts are fairly simple. This is where charts can help immensely. A well-constructed chart can be a great substitute for a long, drawn-out sentence or paragraph. For example, we have seen many confusing discussions of interaction effects in regression or two-way ANOVA studies, although an accompanying chart of interactions makes the results clear and simple to understand. Do not omit the accompanying verbal explanations completely, but keep them short and refer instead to the charts.

Be selective in the computer outputs you include. With today’s statistical software, it is easy to produce masses of numerical outputs and accompanying charts. Unfortunately, there is a tendency to include everything the computer spews out—often in an appendix to the report. Worse yet, there are often no references to some of these outputs in the body of the report; the outputs are just there, supposedly self-explanatory to the intended reader. This is a bad practice. Be selective in the outputs you include in your report, and don’t be afraid to alter them (with a text processor or a graphics package, say) to help clarify your points. Also, if you believe a table or chart is really important enough to include in the report, be sure to refer to it in some way in your write-up. For example, you might say, “You can see from the chart in Figure 3 that men over 50 years old are much more likely to try our product than are women under 50 years old.” This observation is probably clear from the chart in Figure 3—this is probably why you included Figure 3—but it is a good idea to bring attention to it in your write-up.

A-2e Be Precise

Statistics is a science as well as an art. The way a statistical concept or result is explained can affect its meaning in a critical way. Therefore, use very precise language in your stat- istical reports. If you are unsure of the most precise wording, look at the wording used in this book (or another statistics book) for guidance. For example, if you are reporting a con�dence interval, don’t report, “The probability is 95% that the sample mean is between 97.3 and 105.4.” This might sound good enough, but it is not really correct. A more precise

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-6 Appendix A Statistical Reporting

statement is, “We are 95% con�dent that the true but unobserved population mean is between 97.3 and 105.4.” Of course, you must understand a statistical result (and some- times the theory behind it) before you can report it precisely, but we suspect that imprecise statements are often due to laziness, not lack of understanding. Make the effort to phrase your statistical statements as precisely as possible.

List assumptions and potential limitations. Many of the statistical procedures we have discussed rely on certain assumptions for validity. For example, in standard regression analysis there are assumptions about equal error variance, lack of residual autocorrelation, and normality of the residuals. If your analysis relies on certain assump- tions for validity, mention these in your report, especially when there is some evidence that they are violated. In fact, if they appear to be violated, warn the reader about the possible limitations of your results. For example, a confidence interval reported at the 95% level might, due to the violation of an equal variance assumption, really be valid at only the 80% or 85% level. Don’t just ignore assumptions—with the implication that they do not matter.

Limit the decimal places. We are continually surprised at the number of students who quote statistical results (directly from computer outputs, of course) to 5–10 decimal places, even when the original data contain much less precision. For example, when fore- casting sales a year from now, given historical sales data such as $3440, $4120, and so on, some people report a forecast such as $5213.2345. Who are they kidding? Statistical methods are exact only up to a certain limit. If you quote a forecast such as $5213.2345, just because this is what appears in your computer output, you are not gaining precision; you are showing your lack of understanding of the limits of the statistical methodology. If you instead report a forecast of “about $5200,” you will probably gain more respect from critical readers.

Report the results fairly. We have all heard statements such as, “It is easy to lie with statistics.” It is true that the same data can often be analyzed and reported by two different analysts to support diametrically opposite points of view. Certain results can be omitted, the axes of certain charts can be distorted, important assumptions can be ignored, and so on. This is partly a statistical issue and partly an ethical issue. There is not necessarily any- thing wrong with two competent analysts using different statistical methods to arrive at dif-thing wrong with two competent analysts using different statistical methods to arrive at dif-thing wrong with two competent analysts using different statistical methods to arrive at dif ferent conclusions. For example, in a case where gender discrimination in salary has been charged, honest statisticians might very well disagree as to the legitimacy of the charges, depending on how they analyze the data. The world is not always black and white, and statistical analysts often find themselves in the gray areas. However, you are ethically obli- gated to report your results as fairly as possible. You should not deliberately try to lie with statistics.

Get advice from an expert. Even if you have read and understood every word in this book, you are still not an expert in statistics. You know a lot of useful techniques, but there are many specific details and nuances of statistical analysis that we have not had time to cover. A good example is violation of assumptions. We have discussed how to detect violations of assumptions several times, but we have not always discussed possible reme- dies because they require advanced methods. If you become stuck on how to write a specific part of your report because you lack the statistical knowledge, don’t be afraid to consult someone with more statistical expertise. For example, try e-mailing former instructors. They might be flattered that you remember them and value their knowledge—and they can probably provide the information you need.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-7

A-3 EXAMPLES OF STATISTICAL REPORTS Because many of you probably learn better from examples of report writing than from lists of suggestions, we now present several example reports. As stated earlier, our reports represent just one possible style of writing, and other styles might be equally good or even better. But we have attempted to follow the suggestions listed in the previous section. In particular, we have strived for clarity, conciseness, and precision—and the �nal reports you see here are the result of much editing.

Iam working for Spring Mills Company, and my boss, Sharon Sanders, has asked me to report on the accounts receivable problem our company is currently experiencing. My task is to describe data on our customers, analyze the magnitude of interest lost because of late payments from our customers, and suggest a solution for remedying the problem. Ms. Sanders knows basic statistics, but she probably needs a refresher on the meaning of box plots.

SPRING MILLS COMPANY ZANESVILLE, OHIO

To: Sharon Sanders From: Wayne Winston Subject: Report on accounts receivable Date: July 6, 2016

EXECUTIVE SUMMARY Our company produces and distributes a wide variety of manufactured goods. Due to this variety, we have a large number of customers. We have classified our customers as small, medium, or large depending on the amount of business they do with us. Recently, we have had problems with accounts receivable. We are not getting paid as promptly as we would like, and we sense that it costs our company a good deal of money in potential interest. You assigned me to investigate the magnitude of the problem and to suggest a strategy for fixing it. This report discusses my findings.

DATA SET I collected data on 280 customer accounts. The breakdown by size is: 150 small customers, 100 medium customers, and 30 large customers. For each account, my data set includes the number of days since the customer was originally billed (Days) and the amount the customer currently owes (Amount). If necessary, we can identify any of these accounts by name, although specific names do not appear in this report. The data and my analysis are in the file Accounts Receivable.xlsx. I have attached this file to my report in case you want to see further details.

SOFTWARE My analysis was performed entirely in Excel® 2016, using Palisade’s StatTools add-in where necessary.

E X A M P L E A . 1 SPRING MILLS COMPANY

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-8 Appendix A Statistical Reporting

ANALYSIS Given the objectives of the analysis, my analysis is broken down by customer size. Exhibit A.1 shows summary statistics for the Days and Amount for each customer size. [Small, medium, and large are coded throughout as 1, 2, and 3. For example, Days(1) refers to the Days variable for small customers]. You can see, not surprisingly, that larger cus- tomers tend to owe larger amounts. The median amounts for small, medium, and large customers are $250, $470, and $1395, and the mean amounts follow a similar pattern. In contrast, medium and large companies tend to delay payments equally long (median days delayed is about 19–20), whereas small companies tend to delay only about half as long. The standard deviations in this exhibit indicate some variation across companies of any size, but this variation is considerably smaller for the amounts owed by small companies.

Graphical comparisons of these different size customers appear in Exhibits A.2 and A.3. Each of these shows side-by-side box plots (the first of Days, the second of Amount) for easy visual comparison. (For any box plot, the box contains the middle 50% of the

7 8 9

10 11 12 13 14 15 16 17 18 19 20 21 22 23

Days(1)

Amount(1) Amount(2) Amount(3)

Days(2) Days(3) One Variable Summary Data Set #2

A BA B C DC D

Data Set #2 Data Set #2

Mean 9.800 Std. Dev. 3.128 Median 10.000 Minimum 2.000 Maximum 17.000 Count 150

20.550 19.233 6.622 6.191 20.000 19.000 8.000 3.000 39.000 32.000 100 30

One Variable Summary Data Set #2 Data Set #2 Data Set #2

Mean 254.53 Std. Dev. 49.28 Median 250.00 Minimum 140.00 Maximum 410.00 Count 150

481.90 1454.33 99.15 293.89 470.00 1395.00 280.00 930.00 750.00 2220.00 100 30

Exhibit A.1 Summary Measures for Different Size Customers

Size = 3

Box Plot of Comparison of Days

Size = 1

Size = 2

0 5 10 15 20 25 30 35 40 45

Exhibit A.2 Box Plots of Days by Different-Size Customers

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-9

observations, the line and the dot inside the box represent the median and mean, respec- tively, and individual points outside the box represent extreme observations.) These box plots graphically confirm the patterns seen in Exhibit A.1.

Exhibits A.1–A.3 describe the variables Days and Amount individually, but they do not indicate whether there is a relationship between them. Do our customers who owe large amounts tend to delay longer? To investigate this, I created scatterplots of Amount versus Days for each customer size. The scatterplot for small customers (not shown) indicates no relationship whatsoever; the correlation between Days and Amount is a negligible −0.044. However, the scatterplots for medium and large customers both indicate a fairly strong positive relationship. The scatterplot for medium-size customers is shown in Exhibit A.4.

Box Plot of Comparison of Amount

0 500 1000 1500 2000 2500

Exhibit A.3 Box Plots of Amount by Different-Size Customers

Sca�erplot of Amount(2) vs Days(2)

0 0

100

200

300

400

A m

ou nt

(2 )

500

600

700

800

5 10 15 20 Days(2)

25 30 35 40 45

Exhibit A.4 Scatterplot of Amount versus Days for Medium Customers

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-10 Appendix A Statistical Reporting

(The one for large customers is similar, only with many fewer points.) The correlation is fairly large, 0.612, and the upward sloping (and reasonably linear) pattern is clear: the larger the delay, the larger the amount owed—or vice versa.

The analysis up to this point describes our customer population, but it does not directly answer our main concerns: How much potential interest are we losing, and what can we do about it? The analysis in Exhibit A.5 and accompanying pie chart in Exhibit A.6 address the first of these questions. To create Exhibit A.5, I assumed that we can earn an annual rate of 12% on excess cash. Then for each customer, I calculated the interest lost by not having a payment made for a certain number of days. (These calculations are shown for only a few of the customers.) Then I summed these lost interest amounts to obtain the totals in row 5 and created a pie chart from the sums in row 5 (expressed as percent- ages of the total). By the way, if you think the 12% value is too large, you can change it in cell C7 and everything will update automatically.

The message from the pie chart is fairly clear. We do not need to worry about our many small customers; the interest we are losing from them is relatively small. However, we might want to put some pressure on the medium and large customers. I would suggest targeting the large customers first, especially those with large amounts due. There are fewer of them, so we can concentrate our efforts more easily. Also, remember that amounts due and days delayed are positively correlated for the large customers. Therefore, the accounts with large amounts due are where we are losing the most potential interest.

Attachment: Accounts Receivable.xlsx ■

Exhibit A.6 Pie Chart of Lost Interest

© C

e n g

a g

e L

e a rn

in g

Exhibit A.5 Table of Lost Interest

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-11

I’m a student in a MBA statistics course. For the statistical inference part of the course, each student has been assigned to gather data in a real setting that can be used to find a suitably narrow confidence interval for a population parameter. Although the instructor, Rob Jacobs, certainly knows statistics well, he has asked us to include explanations of rel- evant statistical concepts in our reports, just to confirm that we know what we are talking about. Professor Jacobs has made it clear that he does not want a lot of padding. He wants our reports to be brief and concise.

Report on Confidence Intervals for Professor Rob Jacobs Managerial Statistics, S540, Spring semester, 2016 Submitted by Teddy Albright

EXECUTIVE SUMMARY This report summarizes my findings on potential differences between husbands and wives in their ratings of automobile presentations. I chose this topic because my uncle manages a Honda dealership in town, and he enabled me to gain access to the data for this report. The report contains the following: (1) an explanation of the overall study, (2) a rationale for the sample size I chose, (3) the data, (4) the statistical methodology, and (5) a summary of my results.

THE STUDY We tend to associate automobiles with males—horsepower, dual cams, and V-6 engines are arguably macho terms. I decided to investigate whether husbands, when shopping for new cars with their wives, tend to react more favorably to salespeople’s presentations than their wives. (My bias that this is true is bolstered by the fact that all salespeople I have seen, including all of those in this study, are men.) To test this, I asked a sample of couples at the Honda dealership to rate the sales presentation they had just heard on a 1 to10 scale, 10 being the most favorable. The husbands and wives were asked to give independent ratings. I then used these data to calculate a confidence interval for the mean difference between the husbands’ and wives’ ratings. If my initial bias was correct, this confidence interval should be predominantly positive.

THE SAMPLE SIZE Before I could conduct the study, I had to choose a sample size: the number of couples to sample. The eventual sample was based on two considerations: the time I could devote to the study and the length of the confidence interval I desired. For the latter consideration, I used StatTools’s sample size determination procedure to get an esti- mate of the required sample size. This procedure requests a confidence level (I chose the usual 95% level), a desired confidence interval half-length, and a standard deviation of the differences. I suspected that most of the differences (husband rating minus wife rating) would be from −1 to +3, so I (somewhat arbitrarily) chose a desired half- length of 0.25 and guessed a standard deviation of 0.75. StatTools reported that this would require a sample size of 35 couples. I decided that this was reasonable, given the amount of time I could afford, so I used this sample size and proceeded to gather data from 35 husbands and wives. Of course, I realize that if the actual standard deviation of differences turned out to be larger than my guess, my confidence interval would not be as narrow as I specified.

E X A M P L E A . 2 REPORTING CONFIDENCE INTERVALS

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-12 Appendix A Statistical Reporting

THE DATA The data I collected includes a husband and a wife rating for each of the 35 couples in the sample. Exhibit A.7 presents data for the first few couples, together with several summary statistics for the entire data set. As the sample means and medians indicate, husbands do tend to rate presentations somewhat higher than their wives, but this comparison of means and medians is only preliminary. The statistical inference is discussed next.

STATISTICAL METHODOLOGY My goal is to compare two means: the mean rating of husbands and the mean rating of wives. There are two basic statistical methods for comparing two means: the two-sample method and the paired-sample method. I chose the latter. The two-sample method assumes that the observations from the two samples are independent. Although I asked each husband–wife pair to evaluate the presentation independently, I suspected that hus- bands and wives, by the very fact that they live together and tend to think alike, would tend to give positively correlated ratings. The data confirmed this. The correlation between the husband and wife ratings was a fairly large and positive 0.44. When data come in natural pairs and are positively correlated, the paired-sample method for comparing means is preferred. The reason is that it takes advantage of the positive correlation to provide a narrower confidence interval than the two-sample method.

RESULTS To obtain the desired confidence interval, I used StatTools’s paired-sample procedure. This calculates the “husband minus wife” differences and then analyzes these differences. Exhibit A.8 contains the StatTools output. The summary measures at the top of this output pro- vide one more indication that husbands react, on average, more favorably to presentations than their wives. The mean difference is about 1.6 rating points. A graphical illustration of this difference appears in Exhibit A.9, which includes a box plot of the “husband minus wife” negative differences. It shows that the vast majority of the differences are positive.

The right section of Exhibit A.8 contains the statistical inference, including the 95% confidence interval for the mean difference. This interval extends from approximately 1.0 to 2.2. To understand how it is formed, the method first calculates the standard error (not shown) of the sample mean difference. This is the standard deviation of the differ-(not shown) of the sample mean difference. This is the standard deviation of the differ-(not shown) of the sample mean difference. This is the standard deviation of the differ ences divided by the square root of the sample size. Then it goes out approximately two standard errors on either side of the sample mean difference to form the limits of the confidence interval.

Exhibit A.7 Data and Summary Measures

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-13

Because the confidence interval includes only positive values (and the lower limit is not even close to 0), there is little doubt that husbands, on average, react more positively to sales presentations than their wives. Note, however, that the confidence interval is not nearly as narrow as I specified in the sample size section. This is because the stand- ard deviation of negative differences turned out to be considerably larger than I guessed (1.66 versus 0.75). If I wanted a narrower confidence interval, I would need a considerably larger sample. Given that I have essentially proved my conjecture that the mean difference is positive, however, a larger sample does not appear to be necessary. ■

Exhibit A.8 Paired-Sample Output from StatTools

© C

e n g

a g

e L

e a rn

in g

–3 –2 –1 0 1 2 3 4 5 6

Box Plot of DifferenceExhibit A.9 Box Plot of Husband-Wife Differences

© C

e n g

a g

e L

e a rn

in g

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-14 Appendix A Statistical Reporting

Iam a statistical consultant, and I have been hired by Bendrix Company, a manufacturing company, to analyze its overhead data. The company has supplied me with historical monthly data from the past three years on overhead expenses, machine hours, and the num- ber of production runs. My task is to develop a method for forecasting overhead expenses in future months, given estimates of the machine hours and number of production runs that are expected in these months. My contact, Dave Clements, is in the company’s finance department. He obtained an MBA degree about 10 years ago, and he vaguely remembers some of the statistics he learned at that time. However, he does not profess to be an expert. The more I can write my report in nontechnical terms, the more he will appreciate it.

ALBRIGHT STATISTICAL CONSULTING SERVICES BLOOMINGTON, INDIANA

To: Dave Clements, financial manager Subject: Forecasting overhead Date: July 20, 2016

Dave, here is the report you requested. (See also the attached Excel file, Overhead Costs.xlsx, which contains the details of my analysis. By the way, it was done with the help of Palisade’s StatTools add-in for Excel. If you plan to do any further statistical anal- ysis, I  would strongly recommend purchasing this add-in.) As I explain in this report, regression analysis is the best-suited statistical methodology for your situation. It fits an equation to historical data, uses this equation to forecast future values of overhead, and provides a measure of the accuracy of these forecasts. I believe you will be able to sell this analysis to your colleagues. The theory behind regression analysis is admittedly complex, but the outputs I provide are quite intuitive, even to people without a statistical background.

OBJECTIVES AND DATA To ensure that we are on the same page, I will briefly summarize my task. You supplied me with Bendrix monthly data for the past 36 months on three variables: Overhead (total overhead expenses during the month), MachHrs (number of machine hours used during the month), and ProdRuns (number of separate production runs during the month). You suspect that Overhead is directly related to MachHrs and ProdRuns, and you want me to quantify this relationship so that you can forecast future overhead expenses on the basis of (estimated) future values of MachHrs and ProdRuns. Although you did not state this explicitly in your requirements, I assume that you would also like a measure of the accu- racy of the forecasts.

STATISTICAL METHODOLOGY Fortunately, there is a natural methodology for solving your problem: regression analysis. Regression analysis was developed specifically to quantify the relationship between a single dependent variable and one or more dependent variable and one or more dependent explanatory variables (assuming that there is a relaexplanatory variables (assuming that there is a relaexplanatory - tionship to quantify). In your case, the dependent variable is Overhead, the explanatory variables are MachHrs and ProdRuns, and from a manufacturing perspective, there is every reason to believe that Overhead is related to MachHrs and ProdRuns. The outcome of the regression analysis is a regression equation that can be used to forecast future values of Overhead and provide a measure of the accuracy of these forecasts. There are a lot of

E X A M P L E A . 3 ANALYSIS OF OVERHEAD COSTS

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-15

calculations involved in regression analysis, but statistical software, such as StatTools, per-calculations involved in regression analysis, but statistical software, such as StatTools, per-calculations involved in regression analysis, but statistical software, such as StatTools, per forms these calculations easily, allowing you to focus on the interpretation of the results.

PRELIMINARY ANALYSIS OF THE DATA Before diving into the regression analysis itself, it is always a good idea to check graphically for relationships between the variables. The best type of chart for your problem is a scat- terplot, which shows the relationship between any pair of variables. The scatterplots in Exhibits A.10 and A.11 illustrate how Overhead varies with MachHrs and with ProdRuns. In both charts, the points follow a reasonably linear pattern from bottom left to upper right. That is, Overhead tends to increase linearly with MachHrs and with ProdRuns, which is probably what you suspected. The correlations below these plots indicate the strength of the linear relationships. These correlations, 0.632 and 0.521, are fairly large. (The maxi- mum possible correlation is 1.0.) They suggest that regression analysis will yield reason- ably accurate forecasts of overhead expenses.

Exhibit A.10 Scatterplot of Overhead Versus MachHrs

Exhibit A.11 Scatterplot of Overhead Versus ProdRuns

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-16 Appendix A Statistical Reporting

You should also check the time series nature of your overhead data. For example, if your overhead expenses are trending upward over time, or if there is a seasonal pattern to your expenses, then MachHrs and ProdRuns, by themselves, would probably not be adequate to forecast future values of Overhead. However, as illustrated in Exhibit A.13 a time series graph of Overhead indicates no obvious trends or seasonal patterns.

REGRESSION ANALYSIS The plots in Exhibits A.10–A.13 provide some evidence that regression analysis for Overhead, using MachHrs and ProdRuns as the explanatory variables, will yield useful results. Therefore, I used StatTools’s multiple regression procedure to estimate the regres- sion equation. As you may know, the regression output from practically any software pack- age, including StatTools, can be somewhat overwhelming. For this reason, I report only the most relevant outputs. (You can see the rest in the Excel file if you like.) The estimated regression equation is

Forecast Overhead = 3997 + 43.54MachHrs + 883.62ProdRuns

Two important summary measures in any regression analysis are R-square and the stand- ard error of estimate. Their values for this analysis are 93.1% and $4109.

Now let’s turn to interpretation. The two most important values in the regression equation are the coefficients of MachHrs and ProdRuns. For each extra machine hour your company uses, the regression equation predicts that an extra $43.54 in overhead will be incurred. Similarly, each extra production run is predicted to add $883.62 to over- to over- to over head. Of course, these values should be considered as approximate only, but they provide a sense of how much extra machine hours and extra production runs add to overhead.

Before moving to the regression analysis, there are two other charts you should consider. First, you ought to check whether there is a relationship between the two explanatory variables, MachHrs and ProdRuns. If the correlation between these variables is high (negative or positive), then you have a phenomenon called multicollinearity. This is not necessarily bad, but it complicates the interpretation of the regression equation. Fortunately, as Exhibit A.12 indicates, there is virtually no relationship between MachHrs and ProdRuns, so multicollinearity is not a problem for you.

Exhibit A.12 Scatterplot of MachHrs versus ProdRuns

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-3 Examples of Statistical Reports A-17

(Don’t spend too much time trying to interpret the constant term 3997. Its primary use is to get the forecasts to the correct “level.”)

The R-square value indicates that 93.1% of the variation in overhead expenses you observed during the past 36 months can be explained by the values of MachHrs and ProdRuns your company used. Alternatively, only 6.9% of the variation in overhead has not been explained. To explain this remaining variation, you would probably need data on one or more other relevant variables. However, 93.1% is quite good. In statistical terms, you have a good fit.

For forecasting purposes, the standard error of estimate is even more important than R-square. It indicates the approximate magnitude of forecast errors you can expect when you base your forecasts on the regression equation. This standard error can be interpreted much like a standard deviation. Specifically, there is about a 68% chance that a forecast will be off by no more than one standard error, and there is about a 95% chance that a forecast will be off by no more than two standard errors.

FORECASTING Your forecasting job is now quite straightforward. Suppose, for example, that you expect 1525 machine hours and 45 production runs next month. (These values are in line with your historical data.) Then you simply plug these values into the regression equation to forecast overhead:

Forecast overhead = 3997 + 43.54(1525) + 883.62(45) = $101, 158

Given that the standard error of estimate is $4109, you can be about 68% confident that this forecast will be off by no more than $4109 on either side, and you can be about 95% confident that it will be off by no more than $8218 on either side. Of course, I’m sure you know better than to take any of these values too literally, but I believe this level of forecasting accuracy should be useful to your company.

80000

100000

120000

140000

Time Series of Overhead

0

20000

40000

60000

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

Month

Exhibit A.13 Time Series Graph of Overhead

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

A-18 Appendix A Statistical Reporting

One last recommendation I have is to update the analysis as time moves on. As you observe future values of the variables, incorporate them into the data set (and remove old values if you believe they are obsolete), and rerun the regression analysis. You can do this easily with the same Excel file I have attached.

If you have any questions, feel free to call me at any time. You have my number. ■

A-4 CONCLUSION Many people believe that statistical analysis is heavy-duty number crunching and little else. As many of our former students have told us, however, this is de�nitely not true. They con- tinually testify to the importance of written reports (and oral presentations) in their jobs. In fact, we believe that many of you will be judged more by the quality of your writing (and speaking) than by the quality of your quantitative analysis. Therefore, keep the suggestions and examples in this appendix handy—you might need them more than you realize. Just remember that well-designed studies and careful statistical analysis are often worthless unless they are communicated clearly and effectively to the audience who needs them.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

943

R E F E R E N C E S

Afshartous, D. “Sample Size Determination for Binomial Proportion Confidence Intervals: An Alternative Perspective Motivated by a Legal Case.” The American Statistician 62, no. 1 (2008): 27–31.

Appleton, D., J. French, and M. Vanderpump. “Ignoring a Covariate: An Example of Simpson’s Paradox.” The American Statistician 50 (1996): 340–341.

Armstrong, S. “Research on Forecasting: A Quarter- Century Review, 1960–1984.” Interfaces 16, no. 1 (1986): 89–103.

Babich, P. “Customer Satisfaction: How Good Is Good Enough?” Quality Progress 25 (1992): 65–68.

Balson, W., J. Welsh, and D. Wilson. “Using Decision Analysis and Risk Analysis to Manage Utility Environmental Risk.” Interfaces 22, no. 6 (1992): 126–139.

Barnett, A. “Genes, Race, IQ, and The Bell Curve.” ORMS Today 22, no. 1 (1994): 18–24.

Bean, J., C. Noon, and G. Salton. “Asset Divestiture at Homart Development Company.” Interfaces 17, no. 1 (1987): 48–65.

Bean, J., C. Noon, S. Ryan, and G. Salton. “Selecting Tenants in a Shopping Mall.” Interfaces 18, no. 2 (1988): 1–10.

Berger, P., and R. Maurer. Experimental Design. Belmont, CA: Duxbury, 2002.

Blyth, C. “On Simpson’s Paradox and the Sure-Thing Principle.” Journal of the American Statistical Association 67 (1972): 364–366.

Brinkley, P., D. Stepto, J. Haag, K. Liou, K. Wang, and W. Carr. “Nortel Redefines Factory Information Technology: An OR-Driven Approach.” Interfaces 28, no. 1 (1998): 37–52.

Brown, G., J. Keegan, B. Vigus, and K. Wood. “The Kellogg Company Optimizes Production, Inventory, and Distribution.” Interfaces 31, no. 6 (2001): 1–15.

Cawley, J., and P. Sommers, “Voting Irregularities in the 1995 Referendum on Quebec Sovereignty.” Chance 9, no. 4 (Fall 1996): 29–30.

Deming, E., Out of the Crisis. Cambridge, MA: MIT Center for Advanced Engineering Study, 1986.

DeVor, R., T. Chang, and J. Sutherland. Statistial Quality Design and Control. New York: Macmillan, 1992.

Duffy, T., M. Hatzakis, W. Hsu, R. Labe, B. Liao, X. Luo, J. Oh, A. Setya, and L. Yang. “Merrill Lynch Improves Liquidity Risk Management for Revolving Credit Lines.” Interfaces 35, no. 5 (2005): 353–369.

Hammond, J., R. Keeney, and H. Raiffa. Smart Choices. Harvard Business Review Press, 2015.

Herrnstein, R., and C. Murray. The Bell Curve. Free Press, 1994.

Hoppensteadt, F., and C. Peskin. Mathematics in Medicine and the Life Sciences. New York: Springer-Verlag, 1992.

Howard, R. “Decision Analysis: Practice and Promise.” Management Science 34, no. 6 (1988): 679–695.

Keefer, D., and S. Bodily. “Three-Point Approximations for Continuous Random Variables.” Management Science 29, no. 5 (1983): 595–609.

Kelly, J. “A New Interpretation of Information Rate.” Bell System Technical Journal 35 (1956): 917–926.System Technical Journal 35 (1956): 917–926.System Technical Journal

Kimes, S., and J. Fitzsimmons. “Selecting Profitable Hotel Sites at La Quinta Motor Inns.” Interfaces 20, no. 2 (1990): 12–20.

Kirkwood, C. “An Overview of Methods for Applied Decision Analysis.” Interfaces 22, no. 6 (1992): 28–39.

Kutner, M. H., C. J. Nachtsheim, J. Neter, and W. Li. Applied Linear Statistical Models. 5th ed. New York: McGraw-Hill/Irwin, 2005.

Levy, P., and S. Lemeshow. Sampling of Populations: Methods and Applications. 4th ed. New York: Wiley, 2008.

Lindsey, George. “Statistical Data Useful for the Operation of a Baseball Team.” Operations Research 7, no. 2 (1959): 197–207.

Love, R., and J. Hoey. “Management Science Improves Fast Food Operations.” Interfaces 20, no. 2 (1990): 21–29.

Marcus, A. “The Magellan Fund and Market Efficiency.” Journal of Portfolio Management (Fall 1990): 85–88.

McDaniel, S., and L. Kinney. “Ambush Marketing Revisited: An Experimental Study of Perceived Sponsorship Effects on Brand Awareness, Attitude Toward the Brand, and Purchase Intention.” Journal of Promotion Management 3 (1996): 141–167.Promotion Management 3 (1996): 141–167.Promotion Management

Metters, R., C. Queenan, M. Ferguson, L. Harrison, J. Higbie, S. Ward, B. Barfield, T. Farley, H. A. Kuyumcu, and A. Duggasani. “The Killer Application of Revenue Management: Harrah’s Cherokee Casino & Hotel.” Interfaces 38, no. 3 (2008): 161–175.

Miser, H., “Avoiding the Corrupting Lie of a Poorly Stated Problem.” Interfaces 23, no. 6 (1993): 114–119.

Morrison, D., and R. Wheat. “Pulling the Goalie Revisited.” Interfaces 16, no. 6 (1984): 28–34.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

944 References

Patterson, Scott. The Quants. Random House, 2010. Press, S.J. “Sample-Audit Tax Assessment for Businesses:

What’s Fair?” Journal of Business & Economic Statistics 13, no. 3 (1995): 357–359.

Reichheld, F. The Loyalty Effect. Boston, MA: Harvard Business School Press, 1996.

Roselka, Rita. “The New Mantra: MVT.” Forbes (March 11, 1996): 114–118.

Schmidt, S., and R. Launsby. Understanding Industrial Designed Experiments. 4th ed. Colorado Springs: Air Academy Press, 1994.

Schnarrs, S., and J. Bavuso. “Extrapolation Models on Very Short-Term Forecasts.” Journal of Business Research 14 (1986): 27–36.

Simonoff, J., and I. Sparrow. “Predicting Movie Grosses: Winners and Losers, Blockbusters and Sleepers.” Chance 13, no. 3 (2000): 15–24.

Sonderman, D., and P. Abrahamson. “Radiotherapy Design Using Mathematical Programming.” Operations Research 33, no. 4 (1985): 705–725.

Stonebraker, J. “How Bayer Makes Decisions to Develop New Drugs.” Interfaces 32, no. 6 (2002): 77–90.

Taleb, Nassim Nicholas. The Black Swan. Random House, 2007.

Tyagi, R., P. Kalish, K. Akbay, and G. Munshaw. “GE Plastics Optimizes the Two-Echelon Global Fulfillment Network at Its High Performance Polymers Division.” Interfaces 34, no. 5 (2004): 359–366.

van den Briel, M., R. Villalobos, and G. Hogg. “America West Airlines Develops Efficient Boarding Strategies.” Interfaces 35, no. 3 (2005): 191–201.

Volkema, R. “Managing the Process of Formulating the Problem.” Interfaces 25, no. 3 (1995): 81–87.

Westbrooke, I. “Simpson’s Paradox: An Example in a New Zealand Survey of Jury Composition.” Chance 11, no. 2 (1998): 40–42.

Winston, W. L. Operations Research: Applications and Algorithms. 4th ed. Belmont, CA: Duxbury Press, 2003.

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

945

A @RISK add-in, 7, 794–811

Color coding, 798–799 Features, 795 Limitations, 806 Loading, 795–796 Modeling issues, 819 Models with random input variables, 796–805 Models with several random input variables, 806–810 Percentiles, 801 Probability distributions, 770–779 Saving graphs and tables, 801–802 Technical issues, 799–800

@RISK functions RISKBINOMIAL function, 778–779 RISKCORRMAT function, 817–819 RISKDISCRETE function, 773–774 RISKGAMMA function, 838–840 RISKINTUNIFORM function, 880–881 RISKMEAN, other statistical functions, 798 RISKNORMAL function, 775 RISKOUTPUT function, 798, 856 RISKSIMTABLE function, 803 RISKTRIANG function, 776 RISKUNIFORM function, 769–770

Additive seasonal model, 580 Additivity property, 627 Aggregate planning models, 693–702 Algebraic models, 11–12, 604–605, 633, 642–643, 649–650 Alternative hypothesis, 364, 366 ANOVA table, 492–494 Attributes, 23 Autocorrelated residuals, 519–521 Autocorrelation, 420, 552–555

B Bayes’ rule, 245–249 Bidding for contracts, 831–835 Big data, 3 Binding constraint, 615 Binned variables, 25 Binomial distribution, 190–204, 777–778

Applications of, 195–204 in Context of sampling, 193–194 Excel functions for, 191–193 Mean, standard deviation of, 193 Normal approximation to, 194–195

Bins, 25, 46–49 Blending models, 670–676 Box plots (box-whisker plot), 45, 49–52, 90–92, 337 Business analytics, 3

C Cases, 23 Cash balance models, 852–857 Categorical variables, 24

Descriptive measures for, 26–29 Relationships among, 82–84 Relationships among numerical variable and, 86–92 Summaries of, 28

Central limit theorem, 280, 299–304 Certainty equivalent, 262–263 Chi-square distribution, 332 Chi-square test for independence, 401–405 Chi-square test for normality, 395–400 Churn, 864 Classification analysis, 899 Classification methods, 912–930, 933 Classification trees, 926–927 Classification with rare events, 930 Cluster analysis, 899 Cluster sampling, 289–290 Clustering, 933–934 Combining forecasts, 543 Comparison problem, 86, 335, 379–380 Concatenation, 35 Conditional mean, 154–155 Conditional variance, 154–155 Confidence intervals, 294, 313, 788–789

Controlling length of, 344–351 for Difference between means, independent samples,

335–341 for Difference between means, paired samples,

339–341 for Difference between proportions, 342–344 for Mean, 317–322 for Proportion, 326–330 for Standard deviation, 331–334 for Total, 324–325

Constant elasticity relationships, 464–468 Constant error variance, 485 Constraints, 601 Contingency plans, 240 Contingency tables, 82

I N D E X

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

946 Index

Continuous random variable, 150 Continuous variable, 25 Correlated input variables, 815–819 Correlation (data), 101–105, 428–430 Correlation formula, 102, 429 Covariance (data), 101–103, 429 Covariance formula, 101 Cross-sectional data, 26, 419 Crosstabs, 82 Cumulative probability, 150

D Data Analysis Taxonomy file, 71, 82, 131 Data analytics, 3 Data exploration and visualization, 900–911 Data formats, 86 Data marts, 898 Data mining, 7, 897–911

Classification and lift, 929–930 Classification methods, 912–930 Classification trees, 926–927 Classification with rare events, 930 Clustering, 933–937 Data exploration and visualization, 900–911 Logistic regression, 913–918 Measures of classification accuracy, 927–930 Naïve bayes, 923–926 Neural networks, 918–922 Online Analytical Processing (OLAP), 901–903 PowerPivot and Self-Service BI tools in Excel, 904–911 Visualization software, 911

Data models, 904 Data partitioning, 912 Data sets, 23 Data tables

Repeat simulations, 791–792 Two-way, 792–793

Data warehouses, 898 Data type, 24 Decision making analysis, 225–232

Decision criterion, 227–228 Decision trees, 230–232 EMV criterion, 228–230 Identifying the problem, 225–226 Payoffs and costs, 227 Possible decisions, 226 Possible outcomes, 226 Probabilities of outcomes, 226–227

Decision making under uncertainty Decision trees, 230–232 EMV criterion, 228–230 Expected utility criterion, 258, 263 Folding-back procedure, 231–232 Multistage decision problems, 239–256 Payoff and cost, 227 Possible decisions criteria, 226

with Risk aversion, 257–263 Risk profile, 242 Sensitivity analysis, 229, 253–256 Using Bayes’ rule with, 245–249 Using PrecisionTree, 236–239 Value of information, 251–253

Decision support system (DSS), 650–652 DecisionTools Suite, 8–9 Decision trees, 230–232 Density functions, 168–169 Decision variable cells, 601 Dependent variables, 420 Descriptive measures

for Categorical variables, 26–29 for Numerical variables, 30–52

Deterministic checks, 787–788 Discrete distribution, 772–774 Discrete random variable, 150 Discrete variables, 25 Discriminant analysis, 918 Divisibility property, 627–628 Dummy variables, 24, 25, 450–456, 585–586 Durbin-Watson statistic, 487, 519–520, 555

E Econometric models, 542–543 Efficient frontier, 747–748 Empirical rules, 37–38, 172, 177 Employee scheduling models, 663–669 Equal variance assumption, 338, 387–388 Estimation, 292–306 Evolver add-in, 9 EVPI (expected value of perfect information), 252–253 EVSI (expected value of sample information), 252 Exact multicollinearity, 487 Excel 2010 changes

BINOMDIST, CRITBINOM functions, 191–193 CHISQ function, 332 COVAR function, 102–103 EXPONDIST function, 211 FDIST, FINV functions, 388 MODE function, 32–33 NORMDIST, NORMSDIST, NORMINV, NORMSINV

functions, 174 PERCENTILE and QUARTILE functions, 34 POISSON function, 208 Slicers (for pivot tables), 127–128 Sparkline, 58 TDIST, TINV functions, 316 VAR, STDEV functions, 36

Excel 2013 changes PowerPivot and Self-Service BI tools, 904–911 Power View add-in, 904 Slicers (for pivot tables), 127–128

Excel functions, 768 AVEDEV function, 39

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Index 947

AVERAGE function, 32 BINOMDIST, CRITBINOM functions, 191–193 CORREL function, 102, 430 COUNTIF function, 28, 35, 690–691 COUNTIFS function, 82–83 COVAR function, 102 INDEX function, 843 KURT function, 40 MAX function, 34 MEDIAN function, 32 MIN function, 34 MMULT function, 741–743 MODE function, 33 NORMDIST, NORMSDIST, NORMINV, NORMSINV

functions, 174–177 PERCENTILE function, 34 QUARTILE function, 34 RANDBETWEEN function, 768, 880 RAND function, 156–157, 767–768 Regression functions, 433 SKEW function, 39 STANDARDIZE, 172 STDEV, STDEVP functions, 36 SUMIF function, 683 SUMPRODUCT function, 153 VAR, VARP functions, 36 VLOOKUP function, 26, 157, 158

Excel tips and tools Cell comments, 25 Continuity correction, 194–195 Copying with Ctrl-Enter, 158, 666 Creating a condition, 35 Creating charts, 29, 84 Data labels, 98 Data tables, 790–793 Entering arguments, 34 Filtering, 66–70 Formatting long variables, 55–56 Goal seek, 329–330 Horizontal alignment conventions, 24–25 Inequality/equality labels, 613 Pivot table creation, 125 Range names, 609, 612, 634 Recalculation (F9) key, 762–763 Regression, 436 Rescaling a model, 628–629 Roundoff error, 636 Row and column sums, 697 Selecting multiple ranges, 96–98, 620–626 Tables, 63–70 Trendlines in charts, 99–101

Excel Tutorial file, 8 Expected utility maximisation, 258–259 Expected value of information (EVI), 252 Expected value of perfect information (EVPI), 252–253 Explanatory variables, 420

Exponential distribution, 210–211 Exponential smoothing, 570–578

Holt’s method, 575–578 Simple method, 571–575 Smoothing constants, 571–575, 580 Winters’ method, 581–584

Exponential trend models, 559–561 Exponential utility, 258–259 Extrapolation and noise, 548 Extrapolation models, 541–542

F F distribution, 387–388F distribution, 387–388F Feasible region, 602 Feasible solution, 602 Fields, 23 Financial models, 703–713, 847–862 Financial planning models, 847–852 Finite population correction, 298–299 Fitted values, 431 Fixed-cost models, 720–728 Fixed costs, 720 Flat files, 900 Flaw of averages, 780–783 Flow balance constraints, 682, 686 Forecast error, 546 Forecasting, 540–541, 899

Autocorrelation, 552–555 Combining methods, 543 Deseasonalizing, 584–585 Econometric (causal) methods, 542–543 Exponential smoothing, 570–578, 581–584 Extrapolation methods, 541–542 Measures of accuracy, 546–548 Moving averages, 565–569 Random walk model, 562–564 Regression-based trend models, 556–561 Runs test, 550–552 Seasonal models, 580–588 Testing for randomness, 548–555 Time series data, 543–546 Using regression in seasonal models, 585–588

Foreign key, 901 Frames, 281 Freezing random numbers, 770 F test for equality of two variances, 387–388F test for equality of two variances, 387–388F

G Games of chance, 879–884 Gamma distribution, 837 Graphical models, 10–11, 605–606

H Heteroscedasticity, 485–486 Histograms, 45–49 Holt’s method, 575–578 Homoscedasticity, 485–486

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

948 Index

Hypergeometric distribution, 194 Hypothesis testing

for Difference between means (paired-sample t test), 379–384

for Difference between means (two-sample t test), 384–387 for Difference between proportions, 388–390 for Equal variances (F test), 387–388F test), 387–388F for Independence, 401–405 for Mean (one-sample t test), 372–376 for Normality, 395–400 Null and alternative hypotheses, 366 One-tailed vs. two-tailed, 366–367 Practical vs. statistical significance, 371–372 for Proportion, 377–379 p-value, 368–370 for Regression coefficients and p-values, 491–492 Rejection region, 368 Relationship to confidence intervals, 371 Significance level, 368 Types of errors, 367–368, 370–371

I Include/exclude decisions, 502–506 Independent variables, 420 Infeasibility, 629–630 Infeasible solution, 602 Influential point, 513 Input distributions, 811–819 Integer programming (IP) models, 714–733

Binary (0-1) variables, 714, 716, 718, 720 Capital budgeting models, 714–720 Fixed-cost models, 720–728 Knapsack problem, 720 Set-covering models, 729–733

Interaction variables, 456–460 Investment models, 857–862 IQR (interquartile range), 35

J Judgmental sample, 281

K K-Means algorithm, 934 Kurtosis, 39

L Latin hypercube sampling, 799–800 Law of total probability, 248 Learning curve estimation, 466–468 Least square lines, 432 Lift charts, 929–930 Lilliefors test for normality, 398–399 Linear programming (LP) models, 600. See also

Optimization models in Excel Aggregate planning models, 693–702 Backlogging, 699–700

Blending models, 670–676 Financial models, 703–713 Infeasibility, 629–630 Logistics models, 676–691 Modeling issues, 719–720 Modeling issues, 685, 691 Multiperiod production models, 640–649 Product mix models, 602–615, 631–639 Properties of, 626–629 Scaling, 628–629 Transportation models, 677–685 Unboundedness, 629–630 Worker scheduling models, 663–669

Linear regression, 420. See also Regression analysis Linear trend models, 556–558 Logarithmic relationships, 463–466 Logistic regression, 913–918 Logistics models, 676–691 Logit (log odds), 914

M Managerial economic models, 736–740 Market basket analysis, 899, 933 Marketing models, 864–877 Mathematical programming models, 626 Matrix multiplication, 741–743 Mean (data), 32 Mean (probability distribution), 151 Mean absolute deviation (MAD), 39 Mean absolute error (MAE), 547 Mean absolute percentage error (MAPE), 547 Measures of classification accuracy, 927–930 Median, 32 Missing values, 61–62 Mode, 32–33 Modeling process, 13–15 Moving averages, 565–569 Multicollinearity, 496–500 Multiperiod production model, 640–649 Multiple regression, 420, 443–447 Multiplicative seasonal model, 580 Multistage sampling schemes, 290

N Naïve Bayes, 923–926 Neural networks, 918–922 NeuralTools add-in, 9 Nominal variables, 24 Nonbinding constraint, 615 Nonconstant error variance, 486, 517–518 Nonlinear optimization models, 735–748 Nonlinear programming (NLP) models, 735–748

Local, global optima, 735 Modeling issues, 748 Portfolio optimization models, 740–748 Pricing models, 736–740

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Index 949

Nonlinear transformations, 460–468 Nonnegativity, 601, 607 Nonnegativity constraints, 601 Nonsampling errors, 293

Measurement error, 293 Nonresponse bias, 293 Nontruthful responses, 293 Voluntary response bias, 293

Normal density function, 169–170 Normal distribution, 168–187, 774–775

Density function, 169–170 Empirical rules, 177 Excel functions for, 174–177 Normal tables, 172–174 Standardizing and z-values, 170–172 Weighted sums of normal random variables,

177–178 Z-values, 172–174

Null hypothesis, 364, 366 Numerical variables, 24

Relationship with categorical variables, 86–92 Relationships among, 95–105

O Objective, 601 Objective cell, 601 Observations, 23 Odds ratio, 913 OLAP cubes, 903 One-stage decision problems, 232–236 Online Analytical Processing (OLAP),

901–903 Online Transactional Processing (OLTP), 901 Operations models, 831–846 Optimal solution, 602 Optimization models in Excel, 601–602. See also Linear

programming (LP) models Binding, nonbinding constraints, 615 Color coding conventions, 607 Constraints, 601, 607 Decision variable cells, 601, 607 Nonnegativity, 601, 607 Objective cell, 601, 607 Sensitivity analysis, 602, 615–626 Simplex method, 602, 606 Solver add-in, 602 Spreadsheet models, 607–615

Ordinal variables, 24 Outliers, 50, 61, 426–427, 512–516 Output distribution, 815

P Parsimony, 488–489 Percentiles, 34, 44–45 Pivot tables, 108–128

Field settings, 116–117

Filtering, 114–115 Grouping, 122–125 Multiple data variables, 118–119 Pivot charts, 117–118 Pivoting, 116 PowerPivot and Power View, 904–911 Sorting, 115 Summarizing by count, 119–122

Point estimates, 294 Point prediction, 523 Poisson distribution, 207–210 Population, 22, 280–281 Population mean, 32 Population regression line

with Error, 485 joining Means, 485

Population standard deviation, 36 Population variance, 35–36, 387–388 Portfolio optimization models, 740–748 Posterior probabilities, 245 PowerPivot, 904–911 Power View, 904, 909–910 PrecisionTree add-in, 9, 236–239

Decision tree model, 236–239 Prediction, 521–526, 542, 899 Prediction data set, 913 Predictor variables, 420 Primary key, 901 Prior probabilities, 245 Probability, 142–148

Addition rule for mutually exclusive events, 142–143

Conditional probability, 143–144 Equally likely events, 147 Law of large numbers, 147 Multiplication rule, 143–144, 146 Objective vs. subjective, 147–148 Posterior, 245 Probabilistic independence, 146–147 Prior, 245 Probability tree, 145 Relative frequency, 147 Rule of complements, 142 Sample, 281

Probability distribution, 140 Bounded vs. unbounded, 766 Cumulative, 150 Discrete vs. continuous, 150, 764 Nonnegative vs. unrestricted, 766 For simulation input variables, 762–779 of Single random variable, 150–155 Symmetric vs. skewed, 764–766

Proportional sample sizes, 289 Proportionality property, 627 Pseudo-random numbers, 769 p-value, 368–370, 491–492

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

950 Index

Q Quadratic relationships, 462 Quantile-quantile (Q-Q) plot, 399–400 Quartiles, 34, 44–45

R Random variables, 140

Discrete vs. continuous, 150 Weighted sums, 740–741

Random walk models, 562–563 Range, 35 Ratio-to-moving-averages method, 584–585 Records, 23 Reduced cost (in LP model), 617 Regression analysis, 418–421

Adjusted R-square, 447 ANOVA table for overall fit, 492–494 Causation, 423 Correlations, 428–430 Dependent and predictor variables, 420 with Dummy variables, 449–456 Effect of outliers, 512–516 Fitted value, residual, 431 Formulas for slope, intercept, 432 Forward, backward, stepwise, 507–511 Include/exclude decisions, 502–506 Inferences about regression coefficients, 488–492 with Interaction variables, 456–460 Interpretation of regression coefficients, 443 Least squares estimation, 430–438 Linear vs. nonlinear relationships, 426 with Logarithmic transformations, 462–468 Methods, 507–511 Multicollinearity, 496–500 Multiple R, 446 Multiple regression, 443 with Nonlinear transformations, 460–468 Outliers, 426–427 Parsimony, 488 Prediction, 521–526 Regression assumptions and violations, 484–488,

517–521 R-square, 440–441, 446–447 Scatterplots, 421–428 Seasonal models, 585–588 Simple linear regression, 430–441 Simple vs. multiple, 420 Standard error of estimate, 438–439, 446–447 Trend models, 556–561 Unequal variance, 427 Validation with new data, 470–472 Warning about exact multicollinearity, 488

Regression-based trend models, 556–561 Regression coefficients, 443–444, 488–494 Rejection region, 368 Relational database, 900–901

Relationships between variables Categorical vs. categorical, 82–84 Categorical vs. numerical, 86–92 Numerical vs. numerical, 95–105

Relative frequency, 147 Research hypothesis, 364 Response variables, 420 Risk aversion, 257–263 Risk tolerance (for exponential utility), 259 Risk vs. uncertainty, 141–142 Rolling planning horizon, 647, 699 Root mean square error (RMSE), 547 R-square, 440–441 Runs test, 550–551

S Sample mean, 32 Samples, 22–23 Sample size

Determination, 329, 344–351, 789 Selection, 304–305, 344–351 Significance, 384

Sample standard deviation, 36 Sample variance, 35 Sampling, 280–290

Cluster and multistage, 289–290 Simple random, 282–287, 305–306 Stratified, 288–289 Systematic, 287–288 Terminology, 280–281

Sampling distribution, 295–299, 314–317 Sampling errors, 292–293, 294 Scatterplots, 95–101

Graphing relationships, 421–428 Trend lines, 99–101

Seasonal models, 580–588 Segmentation, 933 Set-covering models, 729–733 Shadow prices, 617–618 Significance level, 368 Simple random sampling, 282–287, 305–306 Simple regression, 420 Simplex method, 602 Simulation models, 156–159, 183–187, 345–347, 760–762

Bidding simulation, 831–835 Cash balance models, 852–857 Correlated inputs, 815–819 Customer loyalty models, 864–872 Financial models, 846–857 Flaw of averages, 780–783 Games of chance, 879–884 Investment models, 857–862 Marketing models, 872–877 Newsvendor ordering models, 783–793, 794–810,

811–819 Operations models, 831–835

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Index 951

Uncertain timing, 844 Using @RISK, 794–810 Using data tables with, 791–793 Using Excel tools only, 783–793 Warranty costs, 835–840 Yields, 840–846

Single random variable, 150–155 Single-stage decision problems, 232–236 Single-table databases, 900 Skewness, 39 Smoothing constant, 571 Software in book, 7–10 Solver add-in, 8, 602, 611–612, 613–614, 727–728

Capital budgeting model, 716 Fixed-cost model, 724–725 IF functions, 727–728 Investment model, 706–707 Nonsmooth functions, 701–702 Optimality setting, 667, 747 Pension fund model, 711–712 Portfolio model, 746 Pricing model, 738–739 Sensitivity report, 616–618, 626 Set-covering model, 731–732 Specifying binary constraints, 665–666 Specifying integer constraints, 667

SolverTable add-in, 8, 619–626 Spreadsheet models, 12–13, 607–615 Spreadsheet simulation, 763 SQL server, 902–903 SSAS (SQL Server Analysis Services), 927, 937 Stacked formats, 86–88 Standard deviation, 36–39, 151 Standard error, 294

of Estimated mean, 789 of Estimate in multiple regression, 446 of Mean with finite population correction factor, 298 of Point estimate for population total, 324 of Prediction from regression, 524 in Regression, 490 of Sample mean, 296 of Sample mean difference, 336–338 of Sample proportion, 327 of Sample proportion difference, 343, 388

Standard normal distribution, 170–172 Star schema, 901–902 StatTools add-in, 9

Application settings, 41–42 Box plots, 50–52 Confidence intervals, 319–320, 325, 333–334, 338, 343 Correlation, covariance, 103, 104 Data set manager, 42 Generating random samples, 285–287 Histogram, 45–49 Hypothesis testing, 374, 379, 387 Logistic regression, 915–916

One-variable summary, 43–44 Regression, 433, 443, 444, 508–509, 525 Stacked, unstacked formats, 87–88, 338 StatDurbinWatson function, 520 Test for independence, 403 Tests for normality, 396–400 Time series and forecasting, 551–552, 554, 567–568,

572–573, 576–577, 581–582 Time series graph, 54–58 Unloading, 42

StatTools tips Educational comments, 436 Multiple variables, 98 Previous choices, 57 Saving favorite choices, 43 Scatterplot options, 98 Stacked vs. unstacked data sets, 338

Strategy region graph, 254 Stratified sampling, 288–289 Stepwise regression, 507–511 Summary measures for numerical variables, 31–45 Supervised data mining techniques, 933 Systematic sampling. 287–288

T Tableau Public, 911 Target variables, 420 Technological coefficients, 609 t distribution, 314–316t distribution, 314–316t Testing for randomness, 548–555 Testing sets, 471 Time series data, 26, 54–59, 420, 519, 543–546 Time series graphs, 45, 54–58 Training sets, 471 Trend lines, 99–101 Triangular distribution, 775–776 Trimmed mean, 295 t values, 315, 372, 491–492, 502t values, 315, 372, 491–492, 502t Two-variable product mix model, 602–615

U Unbiased estimates, 294 Unboundedness, 629–630 Uncertainty Flow chart for modeling, 140–142 Uncertainty vs. risk, 141–142 Uniform distribution, 300, 766–767 Uniformly distributed random numbers, 156–157 Unstacked formats, 86–88 Unsupervised data mining techniques, 933 Utility function, 258–259

V Validation of the fit, 470–472 Validation sets, 471 Value at risk (VAR), 850, 862 Value of information, 240, 251–253

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

952 Index

Variables (in data set), 23 Variance (data), 35 Variance (probability distribution), 151 Violations of regression assumptions, 517–521 Visualization software, 911

W Warranty costs, 835–840 Weighted sums of random variables, 740–741 Winters’ method, 571, 581–585

X X-Y chart, 95

Y Yields, 840–846

Z z test for difference between proportions, 388 z-values, 172–174

mutual funds return and, 171 standardizing, 170–172

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Overview of Applications in the Book, by Discipline

Accounting Accounts receivable 285, 297 Auditing for price errors 329 Developing a flexible budget 537 Estimating total tax refunds 325 Estimating total taxable income 325 Overhead cost analysis 423, 437, 471, 490, 520, 524

Economics/Government Demand and cost for electricity 461 Demand for desktops and laptops 402 Demand for French bread 481 Demand for heating oil 536 Demand for microwaves 182 Electricity pricing 736 Home and condo prices 78 Housing price structure 480 Presidential elections 19 Sales of new houses 566, 572

Finance Bond investment strategy 893 Capital budgeting 714 Cash management 852 DJIA index 58, 77 Investing for college 892 Investing for retirement 481, 857 Investment strategy 703 Investor’s after-tax profit 181 Land purchase decision 274 Liquidity risk management 829 Market return scenarios 152, 157 Mutual fund returns 171, 195 New car development 847 Pension fund management 708 Portfolio analysis 743 Random walk of stock prices 562 Stock hedging 757

Human Resources Employee empowerment 389 Employee retention 361 Gender discrimination 450, 457, 514 Jobs in statistics and mathematics 897 Personnel testing 178 Productivity due to exercise 384

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Marketing Catalog marketing 503, 508 Churn in cellular phone market 136 Clustering shoe customers 934 Customer complaints 349, 378 Customer valuation 865 DVD movie renters 310 Electronics sales 108 Frozen lasagna dinner buyers 125, 915, 919, 923 Furniture pricing 480 Marketing and selling condos 873 New pizza style decisions 365, 373 New product decisions 233, 240, 243, 260 Olympics sponsors 363 Response to new sandwich 319, 346, 348 Running shoe style decisions 274 Sales presentation ratings 339 Sales response to coupons 343 Sales versus promotions 421, 433 Soft-drink can style decisions 380 Supermarket sales 197 Supermarket transactions 27 Value of free maintenance agreement 868

Miscellaneous Statistical Crime in the U.S. 54 Cruise ship entertainment 16 Election returns 200 Family income sampling 283 Forecasting U.S. population 557 IQ and bell curve 166 Predictors of successful movies 79, 482 Questionnaire responses 23 Relationship between smoking and drinking 82 Removing Vioxx from market 412 Sample size determination in legal case 279 Saving, spending, social climbing 136 Simpson’s paradox 165 University admissions 360

Operations Management Aggregate planning 693 Airline boarding strategies 759 Airline hub location decisions 729 Arrivals at bank 135 Automobile production 755 Battery lifetimes 191 Bidding for contracts 831 Blending oil 670 Developing Army helicopter component 276

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Developing electronic timing system 275 Delivery times at restaurant 361 Distribution of metal strip widths 396 Employee scheduling 663 Expensive watch production 219 Forecasting sales 551, 554, 559, 566, 572, 576, 581, 586 Inventory management 208 Learning curve for production 466 Manufacturing plastics operations 599 Ordering decisions 781, 784, 796, 806, 812, 815 Out-of-spec products 350 Overbooking at airlines 198 Product mix decisions 603, 631, 721 Production quantity decisions 827, 828 Production scheduling 641, 840 Production, inventory, distribution decisions 661 Quality control at paper company 179 Reliability of motors 336 Site selection of motor inns 417 Timing uncertainty in construction 144 Transportation, logistics decisions 677, 686 Variability in machine parts 333 Warranty costs 835

Sports/Gaming Baseball salaries 31, 40, 46, 49, 88 Games at McDonald’s 139 Golf stats on PGA tour 95 NCAA basketball tournament simulation 882 Revenue management at casino 539 Streak shooting in basketball 201 Wheel of fortune simulation 300 Winning at craps 879 Winning the lottery 220

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

Copyright 2017 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. WCN 02-200-203

  • Cover
  • Preface
  • Chapter 1: Introduction to Business Analytics
    • 1-1 Introduction
    • 1-2 Overview Of The Book
      • 1-2a The Methods
      • 1-2b The Software
    • 1-3 Modeling And Models
      • 1-3a Graphical Models
      • 1-3b Algebraic Models
      • 1-3c Spreadsheet Models
      • 1-3d A Seven-Step Modeling Process
    • 1-4 Conclusion
  • Part 1: Exploring Data
    • Chapter 2: Describing the Distribution of a Single Variable
      • 2-1 Introduction
      • 2-2 Basic Concepts
        • 2-2a Populations and Samples
        • 2-2b Data Sets, Variables, and Observations
        • 2-2c Types of Data
      • 2-3 Descriptive Measures For Categorical Variables
      • 2-4 Descriptive Measures For Numerical Variables
        • 2-4a Numerical Summary Measures
        • 2-4b Numerical Summary Measures with StatTools
        • 2-4c Analysis ToolPak Add-In
        • 2-4d Charts for Numerical Variables
      • 2-5 Time Series Data
      • 2-6 Outliers And Missing Values
        • 2-6a Outliers
        • 2-6b Missing Values
      • 2-7 Excel Tables For Filtering, Sorting, And Summarizing
      • 2-8 Conclusion
        • Summary of Key Terms
    • Chapter 3: Finding Relationships among Variables
      • 3-1 Introduction
      • 3-2 Relationships Among Categorical Variables
      • 3-3 Relationships Among Categorical Variables And A Numerical Variable
        • 3-3a Stacked and Unstacked Formats
      • 3-4 Relationships Among Numerical Variables
        • 3-4a Scatterplots
        • 3-4b Correlation and Covariance
      • 3-5 Pivot Tables
      • 3-6 Conclusion
  • Part 2: Probability and Decision Making under Uncertainty
    • Chapter 4: Probability and Probability Distributions
      • 4-1 Introduction
      • 4-2 Probability Essentials
        • 4-2a Rule of Complements
        • 4-2b Addition Rule
        • 4-2c Conditional Probability and the Multiplication Rule
        • 4-2d Probabilistic Independence
        • 4-2e Equally Likely Events
        • 4-2f Subjective Versus Objective Probabilities
      • 4-3 Probability Distribution Of A Single Random Variable
        • 4-3a Summary Measures of a Probability Distribution
        • 4-3b Conditional Mean and Variance
      • 4-4 Introduction To Simulation
      • 4-5 Conclusion
    • Chapter 5: Normal, Binomial, Poisson, and Exponential Distributions
      • 5-1 Introduction
      • 5-2 The Normal Distribution
        • 5-2a Continuous Distributions and Density Functions
        • 5-2b The Normal Density
        • 5-2c Standardizing: Z-Values
        • 5-2d Normal Tables and Z-Values
        • 5-2e Normal Calculations in Excel
        • 5-2f Empirical Rules Revisited
        • 5-2g Weighted Sums of Normal Random Variables
      • 5-3 Applications Of The Normal Distribution
      • 5-4 The Binomial Distribution
        • 5-4a Mean and Standard Deviation of the Binomial Distribution
        • 5-4b The Binomial Distribution in the Context of Sampling
        • 5-4c The Normal Approximation to the Binomial
      • 5-5 Applications Of The Binomial Distribution
      • 5-6 The Poisson And Exponential Distributions
        • 5-6a The Poisson Distribution
        • 5-6b The Exponential Distribution
      • 5-7 Conclusion
    • Chapter 6: Decision Making Under Uncertainty
      • 6-1 Introduction
      • 6-2 Elements Of Decision Analysis
        • 6-2a Identifying the Problem
        • 6-2b Possible Decisions
        • 6-2c Possible Outcomes
        • 6-2d Probabilities of Outcomes
        • 6-2e Payoffs and Costs
        • 6-2f Decision Criterion
        • 6-2g More about the EMV Criterion
        • 6-2h Decision Trees
      • 6-3 One-stage Decision Problems
      • 6-4 The PrecisionTree Add-in
      • 6-5 Multistage Decision Problems
      • 6-6 The Role Of Risk Aversion
        • 6-6a Utility Functions
        • 6-6b Exponential Utility
        • 6-6c Certainty Equivalents
        • 6-6d Is Expected Utility Maximization Used?
      • 6-7 Conclusion
  • Part 3: Statistical Inference
    • Chapter 7: Sampling and Sampling Distributions
      • 7-1 Introduction
      • 7-2 Sampling Terminology
      • 7-3 Methods For Selecting Random Samples
        • 7-3a Simple Random Sampling
        • 7-3b Systematic Sampling
        • 7-3c Stratified Sampling
        • 7-3d Cluster Sampling
        • 7-3e Multistage Sampling Schemes
      • 7-4 Introduction To Estimation
        • 7-4a Sources of Estimation Error
        • 7-4b Key Terms in Sampling
        • 7-4c Sampling Distribution of the Sample Mean
        • 7-4d The Central Limit Theorem
        • 7-4e Sample Size Selection
        • 7-4f Summary of Key Ideas for Simple Random Sampling
      • 7-5 Conclusion
    • Chapter 8: Confidence Interval Estimation
      • 8-1 Introduction
      • 8-2 Sampling Distributions
        • 8-2a The t Distribution
        • 8-2b Other Sampling Distributions
      • 8-4 Confidence Interval For A Total
      • 8-5 Confidence Interval For A Proportion
      • 8-6 Confidence Interval For A Standard Deviation
      • 8-7 Confidence Interval For The Difference Between Means
        • 8-7a Independent Samples
        • 8-7b Paired Samples
      • 8-8 Confidence Interval For The Difference Between Proportions
      • 8-9 Sample Size Selection
        • 8-9a Sample Size Selection for Estimation of the Mean
        • 8-9b Sample Size Selection for Estimation of Other Parameters
      • 8-10 Conclusion
        • Summary of Key Terms
    • Chapter 9: Hypothesis Testing
      • 9-1 Introduction
      • 9-2 Concepts In Hypothesis Testing
        • 9-2a Null and Alternative Hypotheses
        • 9-2b One-Tailed Versus Two-Tailed Tests
        • 9-2c Types of Errors
        • 9-2d Significance Level and Rejection Region
        • 9-2e Significance from p-values
        • 9-2f Type II Errors and Power
        • 9-2g Hypothesis Tests and Confidence Intervals
        • 9-2h Practical versus Statistical Significance
      • 9-3 Hypothesis Tests For A Population Mean
      • 9-4 Hypothesis Tests For Other Parameters
        • 9-4a Hypothesis Tests for a Population Proportion
        • 9-4b Hypothesis Tests for Differences between Population Means
        • 9-4c Hypothesis Test for Equal Population Variances
        • 9-4d Hypothesis Tests for Differences between Population Proportions
      • 9-5 Tests For Normality
      • 9-6 Chi-square Test For Independence
      • 9-7 Conclusion
  • Part 4: Regression Analysis and Time Series Forecasting
    • Chapter 10: Regression Analysis: Estimating Relationships
      • 10-1 Introduction
      • 10-2 Scatterplots: Graphing Relationships
        • 10-2a Linear versus Nonlinear Relationships
        • 10-2b Outliers
        • 10-2c Unequal Variance
        • 10-2d No Relationship
      • 10-3 Correlations: Indicators Of Linear Relationships
      • 10-4 Simple Linear Regression
        • 10-4a Least Squares Estimation
        • 10-4b Standard Error of Estimate
        • 10-4c The Percentage of Variation Explained: R-Square
      • 10-5 Multiple Regression
        • 10-5a Interpretation of Regression Coefficients
        • 10-5b Interpretation of Standard Error of Estimate and R-Square
      • 10-6 Modeling Possibilities
        • 10-6a Dummy Variables
        • 10-6b Interaction Variables
        • 10-6c Nonlinear Transformations
      • 10-7 Validation of the Fit
      • 10-8 Conclusion
    • Chapter 11: Regression Analysis: Statistical Inference
      • 11-1 Introduction
      • 11-2 The Statistical Model
      • 11-3 Inferences About The Regression Coefficients
        • 11-3a Sampling Distribution of the Regression Coefficients
        • 11-3b Hypothesis Tests for the Regression Coefficients and p-Values
        • 11-3c A Test for the Overall Fit: The ANOVA Table
      • 11-4 Multicollinearity
      • 11-5 Include/Exclude Decisions
      • 11-6 Stepwise Regression
      • 11-7 Outliers
      • 11-8 Violations Of Regression Assumptions
        • 11-8a Nonconstant Error Variance
        • 11-8b Nonnormality of Residuals
        • 11-8c Autocorrelated Residuals
      • 11-9 Prediction
      • 11-10 Conclusion
    • Chapter 12: Time Series Analysis and Forecasting
      • 12-1 Introduction
      • 12-2 Forecasting Methods: An Overview
        • 12-2a Extrapolation Models
        • 12-2b Econometric Models
        • 12-2c Combining Forecasts
        • 12-2d Components of Time Series Data
        • 12-2e Measures of Accuracy
      • 12-3 Testing For Randomness
        • 12-3a The Runs Test
        • 12-3b Autocorrelation
      • 12-4 Regression-based Trend Models
        • 12-4a Linear Trend
        • 12-4b Exponential Trend
      • 12-5 The Random Walk Model
      • 12-6 Moving Averages Forecasts
      • 12-7 Exponential Smoothing Forecasts
        • 12-7a Simple Exponential Smoothing
        • 12-7b Holt’s Model for Trend
      • 12-8 Seasonal Models
        • 12-8a Winters’ Exponential Smoothing Model
        • 12-8b Deseasonalizing: The Ratio-to-Moving-Averages Method
        • 12-8c Estimating Seasonality with Regression
      • 12-9 Conclusion
  • Part 5: Optimization and Simulation Modeling
    • Chapter 13: Introduction to Optimization Modeling
      • 13-1 Introduction
      • 13-2 Introduction To Optimization
      • 13-3 A Two-variable Product Mix Model
      • 13-4 Sensitivity Analysis
        • 13-4a Solver’s Sensitivity Report
        • 13-4b SolverTable Add-In
        • 13-4c Comparison of Solver’s Sensitivity Report and SolverTable
      • 13-5 Properties Of Linear Models
      • 13-6 Infeasibility And Unboundedness
      • 13-7 A Larger Product Mix Model
      • 13-8 A Multiperiod Production Model
      • 13-9 A Comparison Of Algebraic And Spreadsheet Models
      • 13-10 A Decision Support System
      • 13-11 Conclusion
        • Summary of Key Terms
        • Summary of Key Terms (Continued )
    • Chapter 14: Optimization Models
      • 14-1 Introduction
      • 14-2 Employee Scheduling Models
      • 14-3 Blending Models
      • 14-4 Logistics Models
        • 14-4a Transportation Models
        • 14-4b Other Logistics Models
      • 14-5 Aggregate Planning Models
      • 14-6 Financial Models
      • 14-7 Integer Optimization Models
        • 14-7a Capital Budgeting Models
        • 14-7b Fixed-Cost Models
        • 14-7c Set-Covering Models
      • 14-8 Nonlinear Optimization Models
        • 14-8a Basic Ideas of Nonlinear Optimization
        • 14-8b Managerial Economics Models
        • 14-8c Portfolio Optimization Models
      • 14-9 Conclusion
    • Chapter 15: Introduction to Simulation Modeling
      • 15-1 Introduction
      • 15-2 Probability Distributions For Input Variables
        • 15-2a Types of Probability Distributions
        • 15-2b Common Probability Distributions
        • 15-2c Using @RISK to Explore Probability Distributions
      • 15-3 Simulation And The Flaw Of Averages
      • 15-4 Simulation With Built-in Excel Tools
      • 15-5 Introduction To @RISK
        • 15-5a @RISK Features
        • 15-5b Loading @RISK
        • 15-5c @RISK Models with a Single Random Input Variable
        • 15-5d Some Limitations of @RISK
        • 15-5e @RISK Models with Several Random Input Variables
      • 15-6 The Effects Of Input Distributions On Results
        • 15-6a Effect of the Shape of the Input Distribution(s)
        • 15-6b Effect of Correlated Input Variables
      • 15-7 Conclusion
    • Chapter 16: Simulation Models
      • 16-1 Introduction
      • 16-2 Operations Models
        • 16-2a Bidding for Contracts
        • 16-2b Warranty Costs
        • 16-2c Drug Production with Uncertain Yield
      • 16-3 Financial Models
        • 16-3a Financial Planning Models
        • 16-3b Cash Balance Models
        • 16-3c Investment Models
      • 16-4 Marketing Models
        • 16-4a Models of Customer Loyalty
        • 16-4b Marketing and Sales Models
      • 16-5 Simulating Games Of Chance
        • 16-5a Simulating the Game of Craps
        • 16-5b Simulating the NCAA Basketball Tournament
      • 16-6 Conclusion
  • Part 6: Advanced Data Analysis
    • Chapter 17: Data Mining
      • 17-1 Introduction
      • 17-2 Data Exploration And Visualization
        • 17-2a Introduction to Relational Databases
        • 17-2b Online Analytical Processing (OLAP)
        • 17-2c Power Pivot and Self-Service BI Tools in Excel
        • 17-2d Visualization Software
      • 17-3 Classification Methods
        • 17-3a Logistic Regression
        • 17-3b Neural Networks
        • 17-3c Naïve Bayes
        • 17-3d Classification Trees
        • 17-3e Measures of Classification Accuracy
        • 17-3f Classification with Rare Events
      • 17-4 Clustering
      • 17-5 Conclusion
  • Part 7: Bonus Online Material
    • Chapter 18: Importing Data into Excel
      • 18-1 Introduction
      • 18-2 Rearranging Excel Data
      • 18-3 Importing Text Data
      • 18-4 Importing Data Into Excel
        • 18-4a Importing from Access with Old Tools
        • 18-4b Importing from Access with Power Query
        • 18.4c Using Microsoft Query
        • 18.4d SQL Statements and M
        • 18-4e Web Queries
      • 18.5 Cleansing Data
      • 18.6 Conclusion
    • Chapter 19: Analysis of Variance and Experimental Design
      • 19-1 Introduction
      • 19-2 One-way ANOVA
        • 19-2a The Equal-Means Test
        • 19-2b Confidence Intervals for Differences between Means
        • 19-2c Using a Logarithmic Transformation
      • 19-3 Using Regression To Perform ANOVA
      • 19-4 The Multiple Comparison Problem
      • 19-5 Two-way ANOVA
        • 19-5a Confidence Intervals for Contrasts
        • 19-5b Assumptions of Two-Way ANOVA
      • 19-6 More About Experimental Design
        • 19-6a Randomization
        • 19-6b Blocking
        • 19-6c Incomplete Designs
      • 19-7 Conclusion
    • Chapter 20: Statistical Process Control
      • 20-1 Introduction
      • 20-2 Deming’s 14 Points
      • 20-3 Introduction To Control Charts
      • 20-4 Control Charts For Variables
        • 20-4a Control Charts and Hypothesis Testing
        • 20-4b Other Out-of-Control Indications
        • 20-4c Rational Subsamples
        • 20-4d Deming’s Funnel Experiment and Tampering
        • 20-4e Control Charts in the Service Industry
      • 20-5 Control Charts For Attributes
        • 20-5a The p Chart
        • 20-5b The Red Bead Experiment
      • 20-6 Process Capability
        • 20-6a Process Capability Indexes
        • 20-6b More on Motorola and 6-sigma
      • 20-7 Conclusion
    • Appendix A: Statistical Reporting
      • A-1 Introduction
      • A-2 Suggestions For Good Statistical Reporting
        • A-2a Planning
        • A-2b Developing a Report
        • A-2c Be Clear
        • A-2d Be Concise
        • A-2e Be Precise
      • A-3 Examples Of Statistical Reports
      • A-4 Conclusion
  • References
  • Index
    1. 2016-05-06T14:53:12+0000
    2. Preflight Ticket Signature