Copyright 2007 Pearson Education Inc Publishing as Pearson
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 1
Chapter 10 Re-expressing Data: It’s Easier Than You Think Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley
Straightening Relationships n n n We cannot use a linear model unless the relationship between the two variables is linear. Often re-expression can save the day, straightening bent relationships so that we can fit and use a simple linear model. Two simple ways to re-express data are with logarithms and reciprocals. Re-expressions can be seen in everyday life—everybody does it. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 3
Straightening Relationships (cont. ) n The relationship between fuel efficiency (in miles per gallon) and weight (in pounds) for late model cars looks fairly linear at first: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 4
Straightening Relationships (cont. ) n A look at the residuals plot shows a problem: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 5
Straightening Relationships (cont. ) n We can re-express fuel efficiency as gallons per hundred miles (a reciprocal) and eliminate the bend in the original scatterplot: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 6
Straightening Relationships (cont. ) n A look at the residuals plot for the new model seems more reasonable: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 7
Goals of Re-expression n Goal 1: Make the distribution of a variable (as seen in its histogram, for example) more symmetric. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 8
Goals of Re-expression (cont. ) n Goal 2: Make the spread of several groups (as seen in side-by-side boxplots) more alike, even if their centers differ. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 9
Goals of Re-expression (cont. ) n Goal 3: Make the form of a scatterplot more nearly linear. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 10
Goals of Re-expression (cont. ) n Goal 4: Make the scatter in a scatterplot spread out evenly rather than following a fan shape. n This can be seen in the two scatterplots we just saw with Goal 3: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 11
The Ladder of Powers n n There is a family of simple re-expressions that move data toward our goals in a consistent way. This collection of re-expressions is called the Ladder of Powers. The Ladder of Powers orders the effects that the re-expressions have on data. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 12
The Ladder of Powers Power Name Comment Square of data values Try with unimodal distributions that are skewed to the left. 1 Raw data Data with positive and negative values and no bounds are less likely to benefit from reexpression. ½ Square root of data values Counts often benefit from a square root reexpression. “ 0” We’ll use logarithms here Measurements that cannot be negative often benefit from a log re-expression. -1/2 Reciprocal square root An uncommon re-expression, but sometimes useful. 2 -1 The reciprocal of Ratios of two quantities (e. g. , mph) often benefit the data from a reciprocal. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 13
Plan B: Attack of the Logarithms n n n When none of the data values is zero or negative, logarithms can be a helpful ally in the search for a useful model. Try taking the logs of both the x- and y-variable. Then re-express the data using some combination of x or log(x) vs. y or log(y). Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 14
Plan B: Attack of the Logarithms (cont. ) Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 15
Multiple Benefits n n We often choose a re-expression for one reason and then discover that it has helped other aspects of an analysis. For example, a re-expression that makes a histogram more symmetric might also straighten a scatterplot or stabilize variance. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 16
Why Not Just a Curve? n If there’s a curve in the scatterplot, why not just fit a curve to the data? Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 17
Why Not Just a Curve? (cont. ) n n The mathematics and calculations for “curves of best fit” are considerably more difficult than “lines of best fit. ” Besides, straight lines are easy to understand. n We know how to think about the slope and the y-intercept. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 18
What Can Go Wrong? n n Don’t expect your model to be perfect. Don’t choose a model based on R 2 alone: Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 19
What Can Go Wrong? (cont. ) n n Beware of multiple modes. n Re-expression cannot pull separate modes together. Watch out for scatterplots that turn around. n Re-expression can straighten many bent relationships, but not those that go up and down. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 20
What Can Go Wrong? (cont. ) n n n Watch out for negative data values. n It’s impossible to re-express negative values by any non-positive power on the Ladder of Powers or to reexpress values that are zero for powers between 0 and -1. Watch for data far from 1. n Data values that are all very far from 1 may not be much affected by re-expression unless the range is very large. If all the data values are large (e. g. , years), consider subtracting a constant to bring them back near 1. Don’t stray too far from the ladder. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 21
What have we learned? n n When the conditions for regression are not met, a simple re-expression of the data may help. A re-expression may make the: n Distribution of a variable more symmetric. n Spread across different groups more similar. n Form of a scatterplot straighter. n Scatter around the line in a scatterplot more consistent. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 22
What have we learned? (cont. ) n n Taking logs is often a good, simple starting point. n To search further, the Ladder of Powers or the log-log approach can help us find a good reexpression. Our models won’t be perfect, but re-expression can lead us to a useful model. Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 23
Example: Using Models pg. 238 #2 For each of the models listed below, predict y when x = 2. a) b) c) d) e) Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 24
Example: Zurich Zoo The following data are the shoulder-hip length and the vertical thickness of the bodies of some quadrupeds at the zoo in Zurich, Switzerland. Predict the vertical thickness of a giraffe if the shoulder-hip length is 145 cm. Animal Ermine Dachshund Indian Tiger Llama Indian elephant length (cm) 12 35 90 122 153 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Height (cm) 4 12 45 73 135 25
Example: Pressure and Volume We attempt to find how the volume of a gas depends on the temperature and pressure of the gas. If temperature is held constant at 300 K, the following results are obtained. Predict the volume if the pressure is 325. Pressure Volume 200 250 300 350 400 625 500 417 357 313 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 26
Example: Soil Erosion The problem of soil erosion is faced by farmers all over the world. The following data was from a study in western India. Predict the amount of erosion is the wind velocity is 24 km/hr. Velocity 13. 5 22 (km/hr) 13. 5 23 14 25 15 25 17. 5 26 19 27 20 21 Erosion 15 125 35 190 25 300 25 240 70 315 80 140 5 75 (kg/day) Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 27
Example: Female Heights and Weights Consider the data on x = height (in. ) and y = average weight (lb. ) for American females aged 30 -39. Predict the weight of a female that is 64. 5 inches tall. X 58 Y 113 59 67 115 141 60 68 118 145 61 69 121 150 62 70 124 153 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 63 71 128 159 64 72 131 164 65 66 134 137 28
Example: Shoes! Cyrus Tist was trying to determine how the pressure exerted on the floor by the heel of a shoe depends on the width of the heel and the weight of the person wearing the shoe. He started by measuring the pressure (in psi) exerted by several people wearing a shoe with a heel width of 3. 5 inches. The data are summarized below. Predict the pressure exerted on the heel with a width of 3. 5 inches if the person weighs 175 pounds. Wt (lb) Pressure 62 5. 7 85 7. 8 Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley 100 9. 1 128 11. 7 154 14. 1 180 16. 5 29
- Slides: 29