10
transformations transformations Remember scatterplots from CH3 Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculator Insert data L1(x),L2,(y) in your calculator 8: Linreg(a +bx) L1,L2,Y1 ….(write down 8: Linreg(a +bx) L1,L2,Y1 ….(write down a,b,r,r a,b,r,r 2 ) ) Check the scatterplot Check the scatterplot Check the Residual Plot L1, RESID Check the Residual Plot L1, RESID Curved pattern = not a good fit Curved pattern = not a good fit Random pattern = good fit Random pattern = good fit

Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Embed Size (px)

Citation preview

Page 1: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

transformationstransformations

• Remember scatterplots from CH3Remember scatterplots from CH3

• Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your calculator

• 8: Linreg(a +bx) L1,L2,Y1 ….(write down 8: Linreg(a +bx) L1,L2,Y1 ….(write down a,b,r,ra,b,r,r22))

• Check the scatterplotCheck the scatterplot

• Check the Residual Plot L1, RESIDCheck the Residual Plot L1, RESID

• Curved pattern = not a good fitCurved pattern = not a good fit

• Random pattern = good fitRandom pattern = good fit

Page 2: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

TransformationsTransformations• If your Linear Model x,y is not Appropriate…..If your Linear Model x,y is not Appropriate…..

• There are a few options to try…..There are a few options to try…..

• Exponential Model x ,Log(y)Exponential Model x ,Log(y)

• Power Model Log(x), Log(y)Power Model Log(x), Log(y)

• Try the above options in that order, check rTry the above options in that order, check r22 and the residual plot,……if rand the residual plot,……if r22 is high and the is high and the residual plot looks good then you have found residual plot looks good then you have found a suitable modela suitable model

• CAUTIONCAUTION…Real data may not have a perfect …Real data may not have a perfect model….sometimes you have to settle on model….sometimes you have to settle on “good enough”“good enough”

Page 3: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Baseball SalariesBaseball Salaries

• Ballplayers have been signing very large Ballplayers have been signing very large contracts. The highest salaries (in millions of contracts. The highest salaries (in millions of dollars per season) for some notable players dollars per season) for some notable players are given in the following table.are given in the following table.

Page 4: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Player Year Salary (millions $)

Nolan Ryan 1980 1.0

George Foster 1982 2.0

Kirby Puckett 1990 3.0

Jose Canseco 1990 4.7

Roger Clemens 1991 5.3

Ken Griffey Jr. 1996 8.5

Albert Belle 1997 11.0

Pedro Martinez 1998 12.5

Mike Piazza 1999 12.5

Mo Vaughn 1999 13.3

Kevin Brown 1999 15.0

Carlos Delgado 2001 17.0

Alex Rodriguez 2001 22.0

Manny Ramirez 2004 22.5

Alex Rodriguez 2005 26.0

Page 5: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Year VS SALARYYear VS SALARY

R2 is high, however the scatterplot appears to have a curved pattern. A linear model may not be appropriate.

Page 6: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Year vs Log(salary)Year vs Log(salary)

This is an exponential model. R2 is very high and the scatterplot shows no curvature. This appears to be a good fit for this data. Make sure to check the residual plot to make sure.

Page 7: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Residual PlotResidual Plot

This residual plot shows no curved pattern and the residuals are randomly scattered above and below the axis…this shows that your model is a good fit.

Page 8: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Exponential modelExponential model

• Log(salary) = -109.133 + 0.05516YEARLog(salary) = -109.133 + 0.05516YEAR

• Make a prediction using your model for a Make a prediction using your model for a salary in 2006.salary in 2006.

• About 33 million a yearAbout 33 million a year

Page 9: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Life expectancyLife expectancy

• The following data is The following data is Life ExpectancyLife Expectancy for white for white males in the United States every decade during males in the United States every decade during the last century (1 = 1900 to 1910, 2 = 1911 to the last century (1 = 1900 to 1910, 2 = 1911 to 1920, etc.). Create a model to predict future 1920, etc.). Create a model to predict future increases in life expectancy.increases in life expectancy.

Decade 1 2 3 4 5 6 7 8 9 10

Life Exp.

48.6 54.4

59.7 62.1 66.5 67.4 68 70.7 72.7 74.9

Log(life) = 1.685 + 0.18497Log(Decade)

Make a prediction using the above model for the life expectancy of the decade we are currently in.

Power Model

Page 10: Transformations Remember scatterplots from CH3Remember scatterplots from CH3 Insert data L1(x),L2,(y) in your calculatorInsert data L1(x),L2,(y) in your

Use log inverse Use log inverse

• 76.6683567676.66835676

• About 76 to 77 yearsAbout 76 to 77 years