Chapter 10 Re-expressing the data

Slides:



Advertisements
Similar presentations
Copyright © 2010 Pearson Education, Inc. Slide A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.
Advertisements

Re-Expressing Data Get it Straight!. Page 192, #2, 4, 15, 19, 22 Residuals Pg 193, # 11, 23, 27, 33, 45 Pg 195, 16, 22, 23,25,37 Regression Wisdom Pg.
 Objective: To determine whether or not a curved relationship can be salvaged and re-expressed into a linear relationship. If so, complete the re-expression.
Chapter 10: Re-expressing data –Get it straight!
Statistical Methods Lecture 28
Copyright © 2011 Pearson Education, Inc. Curved Patterns Chapter 20.
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 20 Curved Patterns.
Chapter 10: Re-Expressing Data: Get it Straight
Linear Regression Copyright © 2010, 2007, 2004 Pearson Education, Inc.
Copyright © 2009 Pearson Education, Inc. Chapter 29 Multiple Regression.
Copyright © 2010 Pearson Education, Inc. Chapter 8 Linear Regression.
Extrapolation: Reaching Beyond the Data
Chapter 10 Re-Expressing data: Get it Straight
Get it Straight!! Chapter 10
Copyright © 2009 Pearson Education, Inc. Chapter 8 Linear Regression.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 10 Re-expressing Data: Get it Straight!
Re-expressing data CH. 10.
Re-expressing the Data: Get It Straight!
Chapter 10 Re-expressing Data: Get it Straight!!
17.2 Extrapolation and Prediction
Chapter 17 Understanding Residuals © 2010 Pearson Education 1.
1 Re-expressing Data  Chapter 6 – Normal Model –What if data do not follow a Normal model?  Chapters 8 & 9 – Linear Model –What if a relationship between.
8/7/2015Slide 1 Simple linear regression is an appropriate model of the relationship between two quantitative variables provided: the data satisfies the.
Inference for regression - Simple linear regression
Transforming to achieve linearity
Statistics Review Chapter 10. Important Ideas In this chapter, we have leaned how to re- express the data and why it is needed.
Chapter 10: Re-Expressing Data: Get it Straight AP Statistics.
Chapter 10: Re-expressing Data It’s easier than you think!
Copyright © 2008 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 8 Linear Regression.
DO NOW Read Pages 222 – 224 Read Pages 222 – 224 Stop before “Goals of Re-expression” Stop before “Goals of Re-expression” Answer the following questions:
Chapter 10 Re-expressing the data
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
Chapter 10 Re-expressing Data: Get It Straight!. Slide Straight to the Point We cannot use a linear model unless the relationship between the two.
Chapter 10: Re- expressing Data by: Sai Machineni, Hang Ha AP STATISTICS.
Lecture 6 Re-expressing Data: It’s Easier Than You Think.
Copyright © 2010 Pearson Education, Inc. Slide A least squares regression line was fitted to the weights (in pounds) versus age (in months) of a.
Chapter 8 Linear Regression. Slide 8- 2 Fat Versus Protein: An Example The following is a scatterplot of total fat versus protein for 30 items on the.
Bivariate Data Analysis Bivariate Data analysis 4.
Chapter 8 Linear Regression HOW CAN A MODEL BE CREATED WHICH REPRESENTS THE LINEAR RELATIONSHIP BETWEEN TWO QUANTITATIVE VARIABLES?
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide 8- 1.
Reexpressing Data. Re-express data – is that cheating? Not at all. Sometimes data that may look linear at first is actually not linear at all. Straight.
If the scatter is curved, we can straighten it Then use a linear model Types of transformations for x, y, or both: 1.Square 2.Square root 3.Log 4.Negative.
Linear Regression Chapter 8. Fat Versus Protein: An Example The following is a scatterplot of total fat versus protein for 30 items on the Burger King.
Chapter 5 Lesson 5.4 Summarizing Bivariate Data 5.4: Nonlinear Relationships and Transformations.
Re-Expressing Data. Scatter Plot of: Weight of Vehicle vs. Fuel Efficiency Residual Plot of: Weight of Vehicle vs. Fuel Efficiency.
Chapter 9 Regression Wisdom
Copyright © 2010 Pearson Education, Inc. Chapter 10 Re-expressing Data: Get it Straight!
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 10 Re-expressing Data: Get it Straight!
Chapter 10 Notes AP Statistics. Re-expressing Data We cannot use a linear model unless the relationship between the two variables is linear. If the relationship.
Statistics 8 Linear Regression. Fat Versus Protein: An Example The following is a scatterplot of total fat versus protein for 30 items on the Burger King.
Chapter 4 More on Two-Variable Data. Four Corners Play a game of four corners, selecting the corner each time by rolling a die Collect the data in a table.
Statistics 10 Re-Expressing Data Get it Straight.
Copyright © 2010, 2007, 2004 Pearson Education, Inc. Chapter 10 Re-expressing Data: Get it Straight!
Copyright © 2007 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Slide
 Understand why re-expressing data is useful  Recognize when the pattern of the data indicates that no re- expression will improve it  Be able to reverse.
Chapter 10: Re-expressing Data (Get it Straight)
WARM UP: Use the Reciprocal Model to predict the y for an x = 8
Let’s Get It Straight! Re-expressing Data Curvilinear Regression
Chapter 10: Re-Expression of Curved Relationships
Re-expressing the Data: Get It Straight!
Chapter 10 Re-Expressing data: Get it Straight
Re-expressing Data: Get it Straight!
Re-expressing the Data: Get It Straight!
Re-expressing the Data: Get It Straight!
So how do we know what type of re-expression to use?
Re-expressing Data:Get it Straight!
Undergraduated Econometrics
Lecture 6 Re-expressing Data: It’s Easier Than You Think
Re-expressing Data: Get it Straight!
Presentation transcript:

Chapter 10 Re-expressing the data math2200

If the relationship is nonlinear We may re-express the data to straighten the bent relationship. Common ways to re-express data Logarithms of the response variable or the explanatory variable, or both. Square root of the response variable. Reciprocals of the response variable.

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 Using the linear model, we get the intercept 40.65, slope -0.0057 and R-squared 82%.

Straight to the Point (cont.) The residual plot shows a problem:

Straight to the Point (cont.) We can re-express fuel efficiency as gallons per mile (a reciprocal): scatter plots: before and after re-expression

Straight to the Point (cont.) Improved the residuals plot. R-squared = 88% (was 82%) 7,200 lbs Lincoln Navigator (mpg) has predicted 9.8 mpg (reported 11.0) c.f. -0.32 mpg before the re-expression.

When do we need to re-express data? To make skewed distributions more symmetric Why? Easier to summarize symmetric distributions We can use mean and sd We can use a normal model

Assets of 77 large companies After log transformation

When do we need to re-express data? 2. Make the spread of several groups more alike Why? Easier to compare groups that share a common spread Some statistical methods require the assumption that all groups have a common sd

Assets by market sectors After log transformation

When do we need to re-expressing data? 3. Make the relationship more linear Why? To apply linear regression 4. Make the points in a scatterplot spread out evenly rather than thicken at one end. Make the dataset easier to model.

Assets vs. Sales After log transformation

The Ladder of Powers There is a family of simple re-expressions that move data toward our goals in a consistent way. We call this collection of re-expressions the Ladder of Powers. The Ladder of Powers orders the effects that the re-expressions have on data.

The Ladder of Powers -1 -1/2 “0” ½ 1 2 Comment Name Power 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. For counted data, start here. Square root of data values ½ Data with positive and negative values and no bounds are less likely to benefit from re-expression. Raw data 1 Try with unimodal distributions that are skewed to the left. Square of data values 2 Comment Name Power

Straighten the scatterplot Raw Data Logarithm Square Root -reciprocal - 1/square root

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

Plan B: Attack of the Logarithms (cont.)

More generally We can transform both x and y model X-axis Y-axis Y = exp(a+bx) x Log(y) Y = a+b log(x) Log(x) y Y = a xb

Plan B: Attack of the Logarithms (cont.) Scatterplots : GDP and log(GDP) vs. Year

Logarithms: Fishing Line Length and Strength 1/sqrt(length) vs. strength length vs. strength log (length) vs. log (strength) 1/length vs. strength

Multiple Benefits We often choose a re-expression for one reason and then discover that it has helped other aspects of the analysis. For example, a re-expression that makes a histogram more symmetric might also straighten a scatterplot or stabilize variance.

Why Not Just a Curve? If there’s a curve in the scatterplot, why not just fit a curve to the data? Computationally more difficult Straight lines are easy to understand and interpret

A general principle Occam’s Razor entia non sunt multiplicanda praeter necessitatem entities should not be multiplied beyond necessity. When multiple competing theories are equal in other respects, the principle recommends selecting the theory that introduces the fewest assumptions and postulates the fewest hypothetical entities

What Can Go Wrong? Don’t expect your model to be perfect. Don’t choose a model based on R2 alone: Example: large R2, but residual plot shows curvature

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 and down.

What Can Go Wrong? (cont.) Watch out for negative data values. Can NOT use log or square root transformations Watch for data far from 1. 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 Too difficult to interpret

What have we learned? When the conditions for linear regression are not met, a simple re-expression of the data may help. A re-expression may make the: Distribution of a variable more symmetric. Spread across different groups more similar. Form of a scatterplot straighter. Scatter around the line in a scatterplot more consistent.

What have we learned? (cont.) Taking logs is often a good and simple starting point. To search further, the Ladder of Powers or the log-log approach can help us find a good re-expression. Our models won’t be perfect, but re-expression can lead us to a useful model.