# Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 20 Curved Patterns.

## Presentation on theme: "Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 20 Curved Patterns."— Presentation transcript:

Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 20 Curved Patterns

Copyright © 2014, 2011 Pearson Education, Inc. 2 20.1 Detecting Nonlinear Patterns What improvement in mileage should a manufacturer expect from reducing the weight of a car?  Use regression analysis to find an equation that summarizes the association between gas mileage and weight  This pattern of association is not linear, but curved

Copyright © 2014, 2011 Pearson Education, Inc. 3 20.1 Detecting Nonlinear Patterns Recognizing Nonlinearity  Will changes in the explanatory variable result in equal sized changes in the estimated response, regardless of the value of x?  Does trimming 200 pounds from a large SUV have the same effect on mileage as trimming 200 pounds from a small compact?

Copyright © 2014, 2011 Pearson Education, Inc. 4 20.1 Detecting Nonlinear Patterns Scatterplot with Fitted Line

Copyright © 2014, 2011 Pearson Education, Inc. 5 20.1 Detecting Nonlinear Patterns Mileage (MPG) vs Weight (1000’s pounds)  The least squares fitted line is Estimated Combined MPG = 43.3 – 5.19 Weight (1,000 lbs).  The line has an r 2 = 0.70 and s e = 2.9 MPG.  The equation estimates that mileage would increase, on average, by 1.038 MPG by trimming 200 pounds from the weight of a vehicle.

Copyright © 2014, 2011 Pearson Education, Inc. 6 20.1 Detecting Nonlinear Patterns Residual Plot Easier to spot curved pattern in the residuals.

Copyright © 2014, 2011 Pearson Education, Inc. 7 20.2 Transformations  Transformation: re-expression of a variable by applying a function to each observation.  Transformations allow the use of regression analysis to describe a curved pattern.  Two nonlinear transformations useful in business applications: reciprocal and logarithms.

Copyright © 2014, 2011 Pearson Education, Inc. 8 20.2 Transformations Choosing An Appropriate Transformation  The process of choosing the right transformation is usually iterative.  Among the possible choices, select the one that captures the curvature of the data and produces an interpretable equation.

Copyright © 2014, 2011 Pearson Education, Inc. 9 20.2 Transformations Choosing An Appropriate Transformation Match the pattern in a scatterplot of y on x to one of the shapes to find an appropriate transformation.

Copyright © 2014, 2011 Pearson Education, Inc. 10 20.3 Reciprocal Transformation Convert Observed Data d into 1/d  The reciprocal transformation is useful when dealing with variables that are already in the form of a ratio, such as miles per gallon.  In the car example, apply this transformation to the response variable and multiply by 100. The resulting response is number of gallons it takes to go 100 miles.

Copyright © 2014, 2011 Pearson Education, Inc. 11 20.3 Reciprocal Transformation Scatterplot with Fitted Line Estimated Gallons/100 Miles = - 0.11 + 1.20 Weight r 2 = 0.713 s e = 0.667 Fuel consumption (gallons/100 miles) vs. weight has a linear pattern.

Copyright © 2014, 2011 Pearson Education, Inc. 12 20.3 Reciprocal Transformation Residual Plot Outliers apparent (i.e., sports cars).

Copyright © 2014, 2011 Pearson Education, Inc. 13 20.3 Reciprocal Transformation Comparing Linear and Nonlinear Equations  r 2 is slightly larger for the nonlinear equation (71% to 70%); however, this is not a valid comparison since the equations have different response variables.  Valid comparisons are visual and substantive.

Copyright © 2014, 2011 Pearson Education, Inc. 14 20.3 Reciprocal Transformation Visual Comparison The curve produced by transforming MPG provides a better fit to the data.

Copyright © 2014, 2011 Pearson Education, Inc. 15 20.3 Reciprocal Transformation Visual Comparison Comparison of estimated MPG from two regression equations.

Copyright © 2014, 2011 Pearson Education, Inc. 16 20.3 Reciprocal Transformation Substantive Comparison  The reciprocal equation treats weights differently than the linear equation.  In the reciprocal equation, differences in weight matter less as cars get heavier.  This diminishing effect of changes in weight makes more sense than a constant decrease.

Copyright © 2014, 2011 Pearson Education, Inc. 17 20.3 Reciprocal Transformation Substantive Comparison What is the estimated mileage saved by shaving 200 pounds from a vehicle? Linear equation predicts 1.04 MPG. Reciprocal equation predicts 2.1 MPG for a 3,000- pound car but only 0.5 MPG for a 6,000-pound SUV.

Copyright © 2014, 2011 Pearson Education, Inc. 18 20.4 Logarithm Transformation Convert Observed Data d into log d  The logarithm transformation is useful when the association between variables is more meaningful on a percentage scale.  Example: How much should a supermarket chain charge for a national brand of pet food?

Copyright © 2014, 2011 Pearson Education, Inc. 19 20.4 Logarithm Transformation Timeplots of Sales and Price of Pet Food

Copyright © 2014, 2011 Pearson Education, Inc. 20 20.4 Logarithm Transformation Scatterplot with Fitted Line Estimated Sales Volume = 190,480 – 125,190 Price r 2 = 0.83

Copyright © 2014, 2011 Pearson Education, Inc. 21 20.4 Logarithm Transformation Residual Plot Easier to spot curved pattern in the residuals.

Copyright © 2014, 2011 Pearson Education, Inc. 22 20.4 Logarithm Transformation Scatterplot with Fitted Line Estimated log e (Sales Volume) = 11.05 – 2.442 log e Price r 2 = 0.955

Copyright © 2014, 2011 Pearson Education, Inc. 23 20.4 Logarithm Transformation Residual Plot No apparent curved pattern left in the residuals.

Copyright © 2014, 2011 Pearson Education, Inc. 24 20.4 Logarithm Transformation Comparing Equations The curve produced by taking log transformations of the data provides a better fit to the data.

Copyright © 2014, 2011 Pearson Education, Inc. 25 20.4 Logarithm Transformation Comparing Equations Predicting sales volume with the linear and log-log equation.

Copyright © 2014, 2011 Pearson Education, Inc. 26 20.4 Logarithm Transformation Comparing Equations  The log-log equation shows that customers are more price sensitive at low prices.  For example, an average price change from \$0.80 to \$0.90 leads to a drop of more than 27,000 cans in estimated sales volume. In contrast, a change from \$1.10 to \$1.20 leads to a smaller drop in sales of about 9,500 cans.

Copyright © 2014, 2011 Pearson Education, Inc. 27 20.4 Logarithm Transformation Elasticity  Elasticity: measure that relates % change in x to % change in y; slope in a log-log regression equation.  Can use elasticity to find the optimal price of pet food for the supermarket chain.

Copyright © 2014, 2011 Pearson Education, Inc. 28 20.4 Logarithm Transformation Elasticity Optimal Price = Cost = = \$1.017 Estimated profit is maximized at this price.

Copyright © 2014, 2011 Pearson Education, Inc. 29 4M Example 20.1: OPTIMAL PRICING Motivation How much should a convenience store charge for a half-gallon of orange juice? The orange juice costs the chain \$1 to stock and sell.

Copyright © 2014, 2011 Pearson Education, Inc. 30 4M Example 20.1: OPTIMAL PRICING Method In order to determine the optimal price, need to estimate elasticity from a regression of log sales on log price. The chain collected data on sales of orange juice from stores at 50 different locations. The stores sold orange juice at different prices.

Copyright © 2014, 2011 Pearson Education, Inc. 31 4M Example 20.1: OPTIMAL PRICING Method

Copyright © 2014, 2011 Pearson Education, Inc. 32 4M Example 20.1: OPTIMAL PRICING Method

Copyright © 2014, 2011 Pearson Education, Inc. 33 4M Example 20.1: OPTIMAL PRICING Mechanics The least squares regression of log sales on log price is Estimated log e Sales = 4.81 - 1.75 log e Price

Copyright © 2014, 2011 Pearson Education, Inc. 34 4M Example 20.1: OPTIMAL PRICING Mechanics – Check Conditions All conditions satisfied.

Copyright © 2014, 2011 Pearson Education, Inc. 35 4M Example 20.1: OPTIMAL PRICING Mechanics – Optimal Price At \$2.33, each store can expect to sell 28 cartons of orange juice for an estimated profit of \$37.24.

Copyright © 2014, 2011 Pearson Education, Inc. 36 4M Example 20.1: OPTIMAL PRICING Message The chain would make higher profits by decreasing the price of a half-gallon of orange juice from its current price of \$3.00 to \$2.33.

Copyright © 2014, 2011 Pearson Education, Inc. 37 Best Practices  Anticipate whether the association between y and x is linear.  Check that a line summarizes the relationship between the explanatory variable and the response both visually and substantively.  Stick to models you can understand and interpret.

Copyright © 2014, 2011 Pearson Education, Inc. 38 Best Practices (Continued)  Interpret the slope carefully.  Graph your model in the original units.

Copyright © 2014, 2011 Pearson Education, Inc. 39 Pitfalls  Don’t think that regression only fits lines.  Don’t forget to look for curves, even in models with high values of r 2.  Don’t forget lurking variables.  Don’t compare r 2 between models with different responses.