M25- Growth & Transformations 1  Department of ISM, University of Alabama, 1992-2003 Lesson Objectives: Recognize exponential growth or decay. Use log(Y.

Slides:



Advertisements
Similar presentations
 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.
Advertisements

4.1: Linearizing Data.
Polynomial Regression and Transformations STA 671 Summer 2008.
Copyright © 2011 Pearson Education, Inc. Curved Patterns Chapter 20.
Copyright © 2014, 2011 Pearson Education, Inc. 1 Chapter 20 Curved Patterns.
Inference for Regression
Chapter 10 Re-Expressing data: Get it Straight
Chapter Four: More on Two- Variable Data 4.1: Transforming to Achieve Linearity 4.2: Relationships between Categorical Variables 4.3: Establishing Causation.
Chapter 10 Re-expressing the data
Class 16: Thursday, Nov. 4 Note: I will you some info on the final project this weekend and will discuss in class on Tuesday.
1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Summarizing Bivariate Data Introduction to Linear Regression.
Section 4.2 Fitting Curves and Surfaces by Least Squares.
Stat 112: Lecture 13 Notes Finish Chapter 5: –Review Predictions in Log-Log Transformation. –Polynomials and Transformations in Multiple Regression Start.
Basic Business Statistics, 11e © 2009 Prentice-Hall, Inc. Chap 15-1 Chapter 15 Multiple Regression Model Building Basic Business Statistics 11 th Edition.
Stat 112 Notes 11 Today: –Fitting Curvilinear Relationships (Chapter 5) Homework 3 due Friday. I will Homework 4 tonight, but it will not be due.
Class 11: Thurs., Oct. 14 Finish transformations Example Regression Analysis Next Tuesday: Review for Midterm (I will take questions and go over practice.
+ Hw: pg 788: 37, 39, 41, Chapter 12: More About Regression Section 12.2b Transforming using Logarithms.
9 - 1 Intrinsically Linear Regression Chapter Introduction In Chapter 7 we discussed some deviations from the assumptions of the regression model.
M24- Std Error & r-square 1  Department of ISM, University of Alabama, Lesson Objectives  Understand how to calculate and interpret the “r-square”
Transforming to achieve linearity
Chapter 4: More on Two-Variable (Bivariate) Data.
M23- Residuals & Minitab 1  Department of ISM, University of Alabama, ResidualsResiduals A continuation of regression analysis.
Transforming Relationships
© 1998, Geoff Kuenning Linear Regression Models What is a (good) model? Estimating model parameters Allocating variation Confidence intervals for regressions.
Section Copyright © 2014, 2012, 2010 Pearson Education, Inc. Lecture Slides Elementary Statistics Twelfth Edition and the Triola Statistics Series.
M22- Regression & Correlation 1  Department of ISM, University of Alabama, Lesson Objectives  Know what the equation of a straight line is,
Bivariate Data When two variables are measured on a single experimental unit, the resulting data are called bivariate data. You can describe each variable.
1 Chapter 10 Correlation and Regression 10.2 Correlation 10.3 Regression.
1 © 2008 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 5 Summarizing Bivariate Data.
Chapter 10 Correlation and Regression
Summarizing Bivariate Data
Inference for regression - More details about simple linear regression IPS chapter 10.2 © 2006 W.H. Freeman and Company.
1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Summarizing Bivariate Data Non-linear Regression Example.
Time Series Analysis – Chapter 6 Odds and Ends
Relationships If we are doing a study which involves more than one variable, how can we tell if there is a relationship between two (or more) of the.
Chapter 10 Re-expressing the data
Fitting Curves to Data 1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 5: Fitting Curves to Data Terry Dielman Applied Regression.
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.
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.
Bivariate Data Analysis Bivariate Data analysis 4.
Copyright © 2004 by The McGraw-Hill Companies, Inc. All rights reserved.
Inference for regression - More details about simple linear regression IPS chapter 10.2 © 2006 W.H. Freeman and Company.
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.
Copyright © 2010 Pearson Education, Inc. Chapter 10 Re-expressing Data: Get it Straight!
Interaction regression models. What is an additive model? A regression model with p-1 predictor variables contains additive effects if the response function.
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.
Stat 112 Notes 11 Today: –Transformations for fitting Curvilinear Relationships (Chapter 5)
Fixing problems with the model Transforming the data so that the simple linear regression model is okay for the transformed data.
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.
Lecture Slides Elementary Statistics Twelfth Edition
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!
Bell Ringer Make a scatterplot for the following data.
Chapter 10 Re-Expressing data: Get it Straight
Re-expressing Data: Get it Straight!
Lecture Slides Elementary Statistics Thirteenth Edition
Re-expressing the Data: Get It Straight!
Ch. 12 More about regression
Re-expressing the Data: Get It Straight!
CHAPTER 12 More About Regression
Lecture 6 Re-expressing Data: It’s Easier Than You Think
Chapters Important Concepts and Terms
CHAPTER 12 More About Regression
Re-expressing Data: Get it Straight!
Presentation transcript:

M25- Growth & Transformations 1  Department of ISM, University of Alabama, Lesson Objectives: Recognize exponential growth or decay. Use log(Y ) to construct the prediction equation. Reverse the process to get predicted values from log(Y ) models back in terms of Y.

M25- Growth & Transformations 2  Department of ISM, University of Alabama, L w t h n e a r g r o i E x p o n e n t i a l

M25- Growth & Transformations 3  Department of ISM, University of Alabama, Stuff $100 in a mattress each month, then after X months you will have Y = X dollars. This is linear growth; ZERO interest. X Y Example 1

M25- Growth & Transformations 4  Department of ISM, University of Alabama, Stuff $1000 in a savings acct. that pays 10% interest each year, then after X years you will have Y = 1000 ( 1.10 ) dollars. X This is exponential growth. X Y Example 2

M25- Growth & Transformations 5  Department of ISM, University of Alabama, Linear growth increases by a fixed amount in each time period; Exponential growth increases by a fixed percentage of the previous total.

M25- Growth & Transformations 6  Department of ISM, University of Alabama, Y grows exponentially If Y grows exponentially as X increases, X Y log Y grows linearly then log Y grows linearly as X increases. X log Y

M25- Growth & Transformations 7  Department of ISM, University of Alabama, Y log b X = Y Y b Y = X Properties of logarithms: 1. log base 1 = 0 2. log b XY = log b X + log b Y 3. log b X p = p log b X A logarithm is an exponent.

M25- Growth & Transformations 8  Department of ISM, University of Alabama, log b X = Y Review of logarithms: b Y = X log = 35 3 = 125 log = = 1000 ln X = natural log, or log base “e” e = ln 1000 = e = 1000

M25- Growth & Transformations 9  Department of ISM, University of Alabama, Why do we care about logarithms?

Back to the matress. $1000. at 10% per year: ln Y = ln [1000 ( 1.10 ) X ] = ln [1000] + ln( 1.10 ) X = ln [1000] + X ln( 1.10 ) straight line = a + b X i.e., a straight line. Not linear equation! Y = 1000 ( 1.10 ) X This IS a linear equation!

X Y X-axis Y log 10 Y X log Y Example 3

M25- Growth & Transformations 12  Department of ISM, University of Alabama, If X = 6, log 10 Y =  = 1.5 If log 10 Y = 1.5, Y = log 10 Y = X X log Y Example 3

M25- Growth & Transformations 13  Department of ISM, University of Alabama, If X = 10, log 10 Y =  10 = Y = X log Y Example 3

M25 Expon growth & Transforms 14  Department of ISM, University of Alabama, Data Transformations

M25 Expon growth & Transforms 15  Department of ISM, University of Alabama, Ex: Z-scores, inches to cm, o C to o F temperature The basic shape of the data distribution does not change. Linear transformations of Y and/or X  do not affect r.  do not change the pattern of the relationship.

M25 Expon growth & Transforms 16  Department of ISM, University of Alabama,  transform a skewed distribution into a symmetric distribution,  straighten a nonlinear relationship between two variables,  remove non-constant variance, Nonlinear transformations can be used to:

M25- Growth & Transformations 17  Department of ISM, University of Alabama, Lesson Objectives:  Learn how to recognize when a straight line is NOT the best fit the pattern of the data.  Learn how to transform one or both of the variables to create a linear pattern.  Learn to use the transformed model to get estimates back in terms of the original Y variable.

M25 Expon growth & Transforms 18  Department of ISM, University of Alabama, What do we do if the relationship between Y and X is not linear? Always scatterplot the data first! If the relationship is linear, then the model may produce reasonable estimates.

M25- Growth & Transformations 19  Department of ISM, University of Alabama, “Curved lines” can be straightened out by changing the form of a variable: 1. Replace “X” with “square root of X” 2. Replace “X” with “log X” 3. Replace “X” with “1/X”, its inverse. Each step down this list increases the “change in the bend of the line.”

M25- Growth & Transformations 20  Department of ISM, University of Alabama, “ New X ” = X p p = 1 p =.5 p = -1 p = # p = 2 Square root Inverse or reciprocal logarithm Changing the power, changes the bend: Each step down this list increases the “change in the bend of the line.”

M25- Growth & Transformations 21  Department of ISM, University of Alabama, X ln X 1/X X ln X 1/X YY ln Y 1/Y Y ln Y 1/Y X Y Original pattern Y = a + b 1 X + b 2 X 2 Rules of Engagement Original pattern b 2 > 0 b 2 < 0 or

M25- Growth & Transformations 22  Department of ISM, University of Alabama, Y = Federal expenditures on social insurance, in millions. X = Year X Y 14,307 21,807 45,246 99, ,162 a. plot b. fix data if necessary c. get prediction equation d. predict for Example 4

M25- Growth & Transformations 23  Department of ISM, University of Alabama, ‘60 ‘65 ‘70 ‘75 ‘80 Example 4, continued

M25- Growth & Transformations 24  Department of ISM, University of Alabama, X Y 14,307 21,807 45,246 99, ,162 log 10 Y log 10 Y = Example 4, continued

M25- Growth & Transformations 25  Department of ISM, University of Alabama, Y ‘60 ‘65 ‘70 ‘75 ‘ log Y Example 4, continued

M25- Growth & Transformations 26  Department of ISM, University of Alabama, For 2000, log 10 Y = (2000) _____ = _______ log 10 Y = X Y = = This is an exponent.

M25- Growth & Transformations 27  Department of ISM, University of Alabama, Example 4, in Minitab Graph Plot … Title Scatterplot

M25- Growth & Transformations 28  Department of ISM, University of Alabama, Plot shows severe curve. Example 4, in Minitab Scatterplot

M25- Growth & Transformations 29  Department of ISM, University of Alabama, Stat Regression Fitted Line Plot … Y = a + bX Example 4, in Minitab Regression

M25- Growth & Transformations 30  Department of ISM, University of Alabama, Straight line does not fit the data very well. Future years will be severely underestimated! Same plot as before, with regression line overlayed. Example 4, in Minitab Regression

M25- Growth & Transformations 31  Department of ISM, University of Alabama, Stat Regression Fitted Line Plot … log 10 Y = a + bX Example 4, in Minitab This box controls the “scale” of the plot.

M25- Growth & Transformations 32  Department of ISM, University of Alabama, Result from equation must be “un-logged”: y = 10 log(Expend) Advantage: Can see the “new curved line” drawn through the original data. Disadvantage: Hard to tell if the fit is “good enough”. Advantage: Can see the “new curved line” drawn through the original data. Disadvantage: Hard to tell if the fit is “good enough”. Example 4, in Minitab “Logscale” box NOT checked: Axes are still Y and X, but curve is based on the “log Y”.

M25- Growth & Transformations 33  Department of ISM, University of Alabama, Stat Regression Fitted Line Plot … log 10 Y = a + bX Example 4, in Minitab The box IS checked.

M25- Growth & Transformations 34  Department of ISM, University of Alabama, ,000 50,000 Advantage: Easier to see that the curve has been straightened. Disadvantage: Harder to read the scale. Advantage: Easier to see that the curve has been straightened. Disadvantage: Harder to read the scale. Results must be “un-logged”: y = 10 log(Expend) Example 4, in Minitab “Logscale” box IS checked: Axes are “log Y” and X, but values on the “log Y” scale are “un-logged.” Log scale Un-Logged Y scale

M24 Std Error & r-square 35  Department of ISM, University of Alabama, How helpful is “engine size” for estimating “mpg”? Example 5 Continued....

M24 Std Error & r-square 36  Department of ISM, University of Alabama, Analysis Diary Step Y X s r-sqr Comments 1 mpg displace % Slope of “displacement” in not zero; but plot indicates a curved pattern. Transform a variable and re-run. Example 5“mpg_city” versus engine “displacement” 2 to be done in next section. Recall

M24 Std Error & r-square 37  Department of ISM, University of Alabama, How helpful is engine size for estimating mpg? Regression Analysis The regression equation is mpg_city = displace 113 cases used 4 cases contain missing values Predictor Coef StDev T P Constant displace S = R-Sq = 54.6% R-Sq(adj) = 54.2% Analysis of Variance Source DF SS MS F P Regression Error Total displacement in cubic in. mpg_city in ??? Data in Car89 Data P-value: a measure of the likelihood that the true coefficient is “zero.” Example 5

M24 Std Error & r-square 38  Department of ISM, University of Alabama, mpg_city vs. displacement S = 2.88 Is this a good fit? The data pattern appears curved; we can do better! Example 5 Step 1 Y = a + bX

X ln X 1/X X ln X 1/X YY ln Y 1/Y Y ln Y 1/Y X Y Original pattern Y = a + b 1 X + b 2 X 2 Rules of Engagement Original pattern b 2 > 0 b 2 < 0 or

M24 Std Error & r-square 40  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Step 2 log Y X log 10 Y = a + bX “Logscale” box IS checked:

M24 Std Error & r-square 41  Department of ISM, University of Alabama, Analysis Diary Step Y X s r-sqr Comments 1 mpg displace % Slope of “displacement” in not zero; but plot indicates a curved pattern. Transform a variable and re-run. Example 5“mpg_city” versus engine “displacement” 2 log Y X 58.9% Still curved, in same direction.

M24 Std Error & r-square 42  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Step 3 log Y log X log 10 Y = a + b log 10 X Both “Logscale” boxes checked:

M24 Std Error & r-square 43  Department of ISM, University of Alabama, Analysis Diary Step Y X s r-sqr Comments 1 mpg displace % Slope of “displacement” in not zero; but plot indicates a curved pattern. Transform a variable and re-run. Example 5“mpg_city” versus engine “displacement” 2 log Y X 58.9% Still curved, same direction. 3 log Y log X 68.3% Better fit possible on left end?

M24 Std Error & r-square 44  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Step 4 Y X Try: Y = a + b 1 X + b 2 X 2

M24 Std Error & r-square 45  Department of ISM, University of Alabama, Analysis Diary Step Y X s r-sqr Comments 1 mpg displace % Slope of “displacement” in not zero; but plot indicates a curved pattern. Transform a variable and re-run. Example 5“mpg_city” versus engine “displacement” 2 log Y X 58.9% Still curved, same direction. 3 log Y log X 68.3% Better fit possible on left end? 4 Y = a +b 1 X +b 2 X % Better fit; BUT illogical! Try inverse of Y.

M24 Std Error & r-square 46  Department of ISM, University of Alabama, Calc Calculator … Name of “New Y variable.” mpg_city vs. displacement Example 5 “right side of the equation” 1/’mpg_city’ To change the functional form of a variable in Minitab: List of names of functions:

M24 Std Error & r-square 47  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Step 5 Try: 1/ Y = a + b 1 X 1/ Y X Went too far.

M24 Std Error & r-square 48  Department of ISM, University of Alabama, Analysis Diary Step Y X s r-sqr Comments 1 mpg displace % Slope of “displacement” in not zero; but plot indicates a curved pattern. Transform a variable and re-run. Example 5“mpg_city” versus engine “displacement” 2 log Y X 58.9% Still curved, same direction. 3 log Y log X 68.3% Better fit possible on left end? 4 Y = a +b 1 X +b 2 X % Better fit; BUT illogical! Try inverse of Y. 5 1/ Y X 61.3% Too far; bent in other direction; NOT a good fit. etc.

M24 Std Error & r-square 49  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Final model: log(mpg_city) = log(displace) s = R-Sq = 68.3% Estimate “mean mpg_city” for displacement = 150. Log = log(mpg_city) = ( _______ ) = _______ mpg_city = mpg = mpg. ________

M24 Std Error & r-square 50  Department of ISM, University of Alabama, mpg_city vs. displacement Example 5 Back to Step 3 log Y log X log 10 Y = a + b log 10 X Both “Logscale” boxes checked: Recall

M25 Expon growth & Transforms 51  Department of ISM, University of Alabama, Example: MPG vs HP for 32 Car Models Example 6

M25 Expon growth & Transforms 52  Department of ISM, University of Alabama, Non-Linear Relationship Example 6 Step 1 Y X

X ln X 1/X X ln X 1/X YY ln Y 1/Y Y ln Y 1/Y X Y Original pattern Y = a + b 1 X + b 2 X 2 Rules of Engagement Original pattern b 2 > 0 b 2 < 0 or

M25 Expon growth & Transforms 54  Department of ISM, University of Alabama, Example 6 Step 4 Y 1/X

M25 Expon growth & Transforms 55  Department of ISM, University of Alabama, MPG = a + b 1 HP Suggests a model of the form: Example 6

M25 Expon growth & Transforms 56  Department of ISM, University of Alabama, Example: Price vs Weight for 109 Car Models Example 7

M25 Expon growth & Transforms 57  Department of ISM, University of Alabama, Example 7 Step 1 Y X

M25 Expon growth & Transforms 58  Department of ISM, University of Alabama, Nonlinear with Nonconstant Variance Example 7 Step 1 Y X

X ln X 1/X X ln X 1/X YY ln Y 1/Y Y ln Y 1/Y X Y Original pattern Y = a + b 1 X + b 2 X 2 Rules of Engagement Original pattern b 2 > 0 b 2 < 0 or

M25 Expon growth & Transforms 60  Department of ISM, University of Alabama, Non-Constant Variance The variation of the Y values increases as X changes. Generally, transform the Y variable first. “Log Y” is a reasonable start.

M25 Expon growth & Transforms 61  Department of ISM, University of Alabama, Constant Variance, but still nonlinear Transform WEIGHT Example 7 Step 3 1/ Y X

X ln X 1/X X ln X 1/X YY ln Y 1/Y Y ln Y 1/Y X Y Original pattern Y = a + b 1 X + b 2 X 2 Rules of Engagement Original pattern b 2 > 0 b 2 < 0 or

M25 Expon growth & Transforms 63  Department of ISM, University of Alabama, Linear with constant variance! (outliers) Example 7 Step 5 1/ Y 1/X

M25 Expon growth & Transforms 64  Department of ISM, University of Alabama, Suggests a model of the form: 1 Weight = a + b 1 Price or Price = 1 a + b 1 Weight Example 7

M25 Expon growth & Transforms 65  Department of ISM, University of Alabama,

M25 Expon growth & Transforms 66  Department of ISM, University of Alabama,

M25 Expon growth & Transforms 67  Department of ISM, University of Alabama, Example: Sales vs Assets for 80 Fortune 500 Companies in 1986

M25 Expon growth & Transforms 68  Department of ISM, University of Alabama, Example 8 Many small values, few large values; compress both scales. Step 1 Y X

M25 Expon growth & Transforms 69  Department of ISM, University of Alabama, Example 8 Step 2 Use brushing to identify these points. Treat the two groups separately? log Y log X

M25 Expon growth & Transforms 70  Department of ISM, University of Alabama, Suggests a model of the form: log(Sales) = a + b log(Assets) or Sales = 10 a Assets b Example 8

M25 Expon growth & Transforms 71  Department of ISM, University of Alabama, Warnings  Data transformations do NOT work if there is no relationship in the original plot.  The transformations discussed (square root, log, reciprocal, etc.) are one-bend transformations.  Pattern having more than one bend need a different fix.

M25 Expon growth & Transforms 72  Department of ISM, University of Alabama, The End of regression analysis, for now....