Chapter 7 Linear Regression Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 1 7 1 and 7 2 Least Squares The Line of Best Fit The Linear Model Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 2 Fat Versus Protein An Example The following is a scatterplot of total fat versus protein for 122 items on the Burger King menu Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 3 Things to Look For in Scatterplots Direction Form Strength Unusual features Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 4 Correlation Conditions Before you use correlation you must check several conditions Quantitative Variables Condition Straight Enough Condition No Outliers Condition Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 5 The Linear Model Remember from Algebra that a straight line can be written as y mx b In Statistics we use a slightly different notation y b0 b1 x Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 6 The Linear Model Cont The linear model that best fits our Burger King data is How well does this model fit our data Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 7 Residuals The difference between the observed value y and its associated predicted value y is called the residual residual observed predicted y y If the model fits the data well these will all be close to zero Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 8 Illustration of a Residual Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 9 Residuals cont The BK Tendercrisp chicken sandwich no mayo has x 31 grams of protein The model says it should have y 36 6 grams of fat In fact it has y 22 grams of fat Calculate the residual for this observation and interpret it Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 10 How Well Does Any Line Fit the Data Let s calculate ALL the residuals Can we add them up and claim if the sum is small the line fits well Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 11 How Well Does Any Line Fit the Data How did we solve this dilemma when calculating a measure of distance from y bar i e when calculating the standard deviation So how can we define the best fitting line Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 12 In Class Activity Regression Using the tape measure provided wrap the tape measure around your head around the middle of your forehead and level all the way around your head Have your partner read the measurement in cm to nearest tenth and write it in the table on a following page Have your partner do the same Example 61 5 cm or maybe 61 6 cm Then hold the zero cm measurement of the tape measure at the edge of your shoulder and run it down your arm to the tip of your longest finger Have your partner read this measurement in cm to nearest tenth and write it in the table Have your partner do the same Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 13 In Class Activity Regression Cont Now take turns using the tape measure to determine the circumference of your own wrists in cm to nearest tenth Wrap the tape snugly but not tight around your wrist as indicated in the image below Again be sure to use the zero cm on the tape to make your measurement not the end of the tape Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 14 In Class Activity Regression Cont Your Initials Your Gender Your Head Circumference Your Arm Length Your Left Wrist Circumference Your Right Wrist Circumference Notes Write these data all 7 columns on a sheet of notebook paper and turn it in to your instructor one sheet per team Your instructor will collect the data put it into a JMP file excluding your initials and email the class s results to you for the next class Please if you have one BRING YOUR LAPTOP TO THE NEXT CLASS Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 15 The Linear Model Revisited Recall our linear model is y b0 b1 x The coefficient b1 is the slope which tells us how rapidly y changes with respect to x The coefficient b0 is the intercept which tells where the line hits intercepts the y axis Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 16 Interpreting the Coefficients Example For our Burger King data our model is The slope is b1 0 91 grams of fat per gram of protein For every additional gram of protein we would expect there to be an additional 0 91 grams of fat on average Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 17 Interpreting the Coefficients Example For our Burger King data our model is The intercept is b0 8 4 grams of fat For an item that has 0 grams of protein we would estimate there to be 8 4 grams of fat Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 18 In Class Activity Meaningless Intercepts For the examples below and on the next page discuss with your teammate cases where it would not make sense to try to interpret the y intercept an estimate of the average value of y when x 0 y average home game attendance each year vs x number of wins each year for a professional baseball team y total of hours spent on the internet per month vs x of Facebook friends for a large collection of individuals Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 19 In Class Activity Meaningless Intercepts Cont y weight in pounds vs x height in inches of a large group of people y gas mileage in mpg vs x amount of a fuel additive used ml per gallon of gas Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 20 7 3 Finding the Least Squares Line Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 21 The Least Squares Line In our model we have a slope b1 The slope is built from the correlation and the standard deviations b1 r sy sx So will the sign or on the slope match the sign on the correlation coefficient Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 22 The Least Squares Line cont In our model we also have an intercept b0 The intercept is built from the means and the slope b0 y b1 x Typically software is used to calculate the slope and intercept Chapter07 Presentation 0117 Copyright 2014 2012 2009 Pearson Education Inc 23 Fat Versus
View Full Document