Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to...

25
Slide 10 - 1 Copyright © 2010 Pearson Education, Inc. A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a group of many young children. The equation of the line is Where is the predicted weight and t is the age of the child. A 20-month-old child in this group has an actual weight of 25 pounds. Which of the following is the residual weight, in pounds, for this child? a. -7.85 b. -4.60 c. 4.60 d. 5.00 e. 7.85 ˆ 16.6 0.65 y t y

Transcript of Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to...

Page 1: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 1Copyright © 2010 Pearson Education, Inc.

A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a group of many young children. The equation of the line is

Where is the predicted weight and t is the age of the child. A 20-month-old child in this group has an actual weight of 25 pounds. Which of the following is the residual weight, in pounds, for this child?

a. -7.85

b. -4.60

c. 4.60

d. 5.00

e. 7.85

ˆ 16.6 0.65y t y

Page 2: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 2Copyright © 2010 Pearson Education, Inc.

A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a group of many young children. The equation of the line is

Where is the predicted weight and t is the age of the child. A 20-month-old child in this group has an actual weight of 25 pounds. Which of the following is the residual weight, in pounds, for this child?

a. -7.85

b. -4.60

c. 4.60

d. 5.00

e. 7.85

ˆ 16.6 0.65y t y

Page 3: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Copyright © 2010 Pearson Education, Inc.

Chapter 10Re-expressing Data:

Get it Straight!

Page 4: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 4Copyright © 2010 Pearson Education, Inc.

Straight to the Point

We cannot use a linear model unless the relationship between the two variables is linear. If the data is not linear, you may need to re-expression the data, straightening bent relationships so that we can fit and use a simple linear model.

Simple ways to re-express data are with logarithms, square roots and reciprocals.

Re-expressions can be seen in everyday life: The Richter scale of earthquake strength is expressed

in logs. Decibel scale for sound intensity is measured in logs. Gauges of shotguns are measured in square roots.

Page 5: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 5Copyright © 2010 Pearson Education, Inc.

Straight to the Point (cont.)

The relationship between fuel efficiency (in miles per gallon) and weight (in pounds) for late model cars looks fairly linear at first:

Page 6: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 6Copyright © 2010 Pearson Education, Inc.

Straight to the Point (cont.)

A look at the residuals plot shows a problem:

Page 7: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 7Copyright © 2010 Pearson Education, Inc.

Straight to the Point (cont.)

We can re-express fuel efficiency as gallons per hundred miles (a reciprocal) and eliminate the bend in the original scatterplot:

Page 8: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 8Copyright © 2010 Pearson Education, Inc.

Straight to the Point (cont.)

A look at the residuals plot for the new model seems more reasonable:

Page 9: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 9Copyright © 2010 Pearson Education, Inc.

The Goals of Re-expression are:

Goal 1: Make the distribution of a variable (as seen in its histogram, for example) more symmetric.

Page 10: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 10Copyright © 2010 Pearson Education, Inc.

Goals of Re-expression (cont.)

Goal 2: Make the spread of several groups (as seen in side-by-side boxplots) more alike, even if their centers differ.

Page 11: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 11Copyright © 2010 Pearson Education, Inc.

Goals of Re-expression (cont.)

Goal 3: Make the form of a scatterplot more nearly linear.

Page 12: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 12Copyright © 2010 Pearson Education, Inc.

Goals of Re-expression (cont.)

Goal 4: Make the scatter in a scatterplot spread out evenly rather than thickening at one end. This can be seen in the two scatterplots we

just saw with Goal 3:

Page 13: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 13Copyright © 2010 Pearson Education, Inc.

The Ladder of Powers

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.

Page 14: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 14Copyright © 2010 Pearson Education, Inc.

The Ladder of Powers

Ratios of two quantities (e.g., mph) often benefit from a reciprocal.

The reciprocal of the data

–1

An uncommon re-expression, but sometimes useful.

Reciprocal square root

–1/2

Measurements that cannot be negative often benefit from a log re-expression.

We’ll use logarithms here

“0”

Counts often benefit from a square root re-expression.

Square root of data values

½

Data with positive and negative values and no bounds are less likely to benefit from re-expression.

Raw data1

Try with unimodal distributions that are skewed to the left.

Square of data values

2

CommentNamePower

Page 15: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 15Copyright © 2010 Pearson Education, Inc.

Plan B: Attack of the Logarithms

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).

Page 16: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 16Copyright © 2010 Pearson Education, Inc.

Plan B: Attack of the Logarithms (cont.)

Page 17: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 17Copyright © 2010 Pearson Education, Inc.

Multiple Benefits

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.

Page 18: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 18Copyright © 2010 Pearson Education, Inc.

Why Not Just Use a Curve?

If there’s a curve in the scatterplot, why not just fit a curve to the data?

Page 19: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 19Copyright © 2010 Pearson Education, Inc.

Why Not Just Use a Curve? (cont.)

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. We know how to think about the slope and the

y-intercept.

Page 20: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 20Copyright © 2010 Pearson Education, Inc.

Example: For each of the models listed below, predict y when x = 3:

a.

b.

c.

d.

e.

xy 9.2.1ˆln xy 9.02.1ˆ

xy

9.2.1ˆ1

xy ln9.2.1ˆ xy log9.02.1ˆlog

Page 21: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 21Copyright © 2010 Pearson Education, Inc.

TI – Tips Re-expressing data

Check the scatterplot of Yr and TUIT. Then check the residual plot. Don’t forget to calculate the regression line so it fills the RESID list. Remember RESID is your “y” when plotting the residual plot.

You decide because of the curve you need to do some re-expressing. But you don’t know which one to do. Let’s start by using the square root. Fill L1 with the square root of TUIT. Look at the scatterplot and residual plot (recalculate the regression line to fill the RESID list.)

Still not good enough … change fill L1 with the log of TUIT. Scatterplot and residual plot again. Better?!

Now, write the model of the re-expressed data. (it should have a log in it!)

Page 22: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 22Copyright © 2010 Pearson Education, Inc.

What Can Go Wrong?

Don’t expect your model to be perfect.

Don’t stray too far from the ladder.

Don’t choose a model based on R2 alone:

Page 23: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 23Copyright © 2010 Pearson Education, Inc.

What Can Go Wrong? (cont.) Beware of multiple modes.

Re-expression cannot pull separate modes together. Watch out for scatterplots that turn around.

Re-expression can straighten many bent relationships, but not those that go up then down, or down then up.

Page 24: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 24Copyright © 2010 Pearson Education, Inc.

What Can Go Wrong? (cont.)

Watch out for negative data values. It’s impossible to re-express negative values

by any power that is not a whole number on the Ladder of Powers or to re-express values that are zero for negative powers.

Page 25: Copyright © 2010 Pearson Education, Inc. Slide 10 - 1 A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.

Slide 10 - 25Copyright © 2010 Pearson Education, Inc.

Homework: 1-17 odd (skip 3)