Chapter Correlation and Regression 1 of 84 9 © 2012 Pearson Education, Inc. All rights reserved.
Section 9.1 Correlation © 2012 Pearson Education, Inc. All rights reserved. 2 of 84
Correlation A relationship between two variables. The data can be represented by ordered pairs (x, y) x is the independent (or explanatory) variable y is the dependent (or response) variable © 2012 Pearson Education, Inc. All rights reserved. 3 of 84
Correlation x12345 y– 4– 2– 102 A scatter plot can be used to determine whether a linear (straight line) correlation exists between two variables. x 24 –2–2 – 4 y 2 6 Example: © 2012 Pearson Education, Inc. All rights reserved. 4 of 84
Types of Correlation x y Negative Linear Correlation x y No Correlation x y Positive Linear Correlation x y Nonlinear Correlation As x increases, y tends to decrease. As x increases, y tends to increase. © 2012 Pearson Education, Inc. All rights reserved. 5 of 84
Example: Constructing a Scatter Plot An economist wants to determine whether there is a linear relationship between a country’s gross domestic product (GDP) and carbon dioxide (CO 2 ) emissions. The data are shown in the table. Display the data in a scatter plot and determine whether there appears to be a positive or negative linear correlation or no linear correlation. (Source: World Bank and U.S. Energy Information Administration) GDP (trillions of $), x CO 2 emission (millions of metric tons), y © 2012 Pearson Education, Inc. All rights reserved. 6 of 84
Solution: Constructing a Scatter Plot Appears to be a positive linear correlation. As the gross domestic products increase, the carbon dioxide emissions tend to increase. © 2012 Pearson Education, Inc. All rights reserved. 7 of 84
Example: Constructing a Scatter Plot Using Technology Old Faithful, located in Yellowstone National Park, is the world’s most famous geyser. The duration (in minutes) of several of Old Faithful’s eruptions and the times (in minutes) until the next eruption are shown in the table. Using a TI-83/84, display the data in a scatter plot. Determine the type of correlation. Duration x Time, y Duration x Time, y © 2012 Pearson Education, Inc. All rights reserved. 8 of 84
Solution: Constructing a Scatter Plot Using Technology Enter the x-values into list L 1 and the y-values into list L 2. Use Stat Plot to construct the scatter plot. STAT > Edit…STATPLOT From the scatter plot, it appears that the variables have a positive linear correlation © 2012 Pearson Education, Inc. All rights reserved. 9 of 84
Correlation Coefficient Correlation coefficient A measure of the strength and the direction of a linear relationship between two variables. The symbol r represents the sample correlation coefficient. A formula for r is The population correlation coefficient is represented by ρ (rho). n is the number of data pairs © 2012 Pearson Education, Inc. All rights reserved. 10 of 84
Correlation Coefficient The range of the correlation coefficient is –1 to If r = –1 there is a perfect negative correlation If r = 1 there is a perfect positive correlation If r is close to 0 there is no linear correlation © 2012 Pearson Education, Inc. All rights reserved. 11 of 84
Linear Correlation Strong negative correlation Weak positive correlation Strong positive correlation Nonlinear Correlation x y x y x y x y r = –0.91r = 0.88 r = 0.42r = 0.07 © 2012 Pearson Education, Inc. All rights reserved. 12 of 84
Calculating a Correlation Coefficient 1.Find the sum of the x- values. 2.Find the sum of the y- values. 3.Multiply each x-value by its corresponding y-value and find the sum. In WordsIn Symbols © 2012 Pearson Education, Inc. All rights reserved. 13 of 84
Calculating a Correlation Coefficient 4.Square each x-value and find the sum. 5.Square each y-value and find the sum. 6.Use these five sums to calculate the correlation coefficient. In WordsIn Symbols © 2012 Pearson Education, Inc. All rights reserved. 14 of 84
Example: Finding the Correlation Coefficient Calculate the correlation coefficient for the gross domestic products and carbon dioxide emissions data. What can you conclude? GDP (trillions of $), x CO 2 emission (millions of metric tons), y © 2012 Pearson Education, Inc. All rights reserved. 15 of 84
Solution: Finding the Correlation Coefficient xyxyx2x2 y2y , , ,474, , , , , , , , Σx = 23.1Σy = 5554Σxy = 15,573.71Σx 2 = 67.35Σy 2 = 3,775, © 2012 Pearson Education, Inc. All rights reserved. 16 of 84
Solution: Finding the Correlation Coefficient Σx = 23.1Σy = 5554Σxy = 15,573.71Σx 2 = Σy 2 = 3,775, r ≈ suggests a strong positive linear correlation. As the gross domestic product increases, the carbon dioxide emissions also increase. © 2012 Pearson Education, Inc. All rights reserved. 17 of 84
Using a Table to Test a Population Correlation Coefficient ρ Once the sample correlation coefficient r has been calculated, we need to determine whether there is enough evidence to decide that the population correlation coefficient ρ is significant at a specified level of significance. Use Table 11 in Appendix B. If |r| is greater than the critical value, there is enough evidence to decide that the correlation coefficient ρ is significant. © 2012 Pearson Education, Inc. All rights reserved. 18 of 84
Using a Table to Test a Population Correlation Coefficient ρ Determine whether ρ is significant for five pairs of data (n = 5) at a level of significance of α = If |r| > 0.959, the correlation is significant. Otherwise, there is not enough evidence to conclude that the correlation is significant. Number of pairs of data in sample level of significance © 2012 Pearson Education, Inc. All rights reserved. 19 of 84
Using a Table to Test a Population Correlation Coefficient ρ 1.Determine the number of pairs of data in the sample. 2.Specify the level of significance. 3.Find the critical value. Determine n. Identify α. Use Table 11 in Appendix B. In WordsIn Symbols © 2012 Pearson Education, Inc. All rights reserved. 20 of 84
Using a Table to Test a Population Correlation Coefficient ρ In WordsIn Symbols 4.Decide if the correlation is significant. 5.Interpret the decision in the context of the original claim. If |r| > critical value, the correlation is significant. Otherwise, there is not enough evidence to support that the correlation is significant. © 2012 Pearson Education, Inc. All rights reserved. 21 of 84
Section 9.2 Linear Regression © 2012 Pearson Education, Inc. All rights reserved. 22 of 84
Regression lines After verifying that the linear correlation between two variables is significant, next we determine the equation of the line that best models the data (regression line). Can be used to predict the value of y for a given value of x. x y © 2012 Pearson Education, Inc. All rights reserved. 23 of 84
Residuals Residual The difference between the observed y-value and the predicted y-value for a given x-value on the line. For a given x-value, d i = (observed y-value) – (predicted y-value) x y }d1}d1 }d2}d2 d3{d3{ d4{d4{ }d5}d5 d6{d6{ Predicted y-value Observed y-value © 2012 Pearson Education, Inc. All rights reserved. 24 of 84
Regression line (line of best fit) The line for which the sum of the squares of the residuals is a minimum. The equation of a regression line for an independent variable x and a dependent variable y is ŷ = mx + b Regression Line Predicted y-value for a given x- value Slope y-intercept © 2012 Pearson Education, Inc. All rights reserved. 25 of 84
The Equation of a Regression Line ŷ = mx + b where is the mean of the y-values in the data is the mean of the x-values in the data The regression line always passes through the point © 2012 Pearson Education, Inc. All rights reserved. 26 of 84
Example: Finding the Equation of a Regression Line Find the equation of the regression line for the gross domestic products and carbon dioxide emissions data. GDP (trillions of $), x CO 2 emission (millions of metric tons), y © 2012 Pearson Education, Inc. All rights reserved. 27 of 84
Solution: Finding the Equation of a Regression Line xyxyx2x2 y2y , , ,474, , , , , , , , Σx = 23.1Σy = 5554Σxy = 15,573.71Σx 2 = Σy 2 = 3,775, Recall from section 9.1: © 2012 Pearson Education, Inc. All rights reserved. 28 of 84
Solution: Finding the Equation of a Regression Line Σx = 23.1Σy = 5554 Σxy = 15, Σx 2 = 67.35Σy 2 = 3,775, Equation of the regression line © 2012 Pearson Education, Inc. All rights reserved. 29 of 84
Solution: Finding the Equation of a Regression Line To sketch the regression line, use any two x-values within the range of the data and calculate the corresponding y-values from the regression line. © 2012 Pearson Education, Inc. All rights reserved. 30 of 84
Section 9.3 Measures of Regression and Prediction Intervals © 2012 Pearson Education, Inc. All rights reserved. 31 of 84
Section 9.3 Objectives Interpret the three types of variation about a regression line Find and interpret the coefficient of determination Find and interpret the standard error of the estimate for a regression line Construct and interpret a prediction interval for y © 2012 Pearson Education, Inc. All rights reserved. 32 of 84
Variation About a Regression Line Three types of variation about a regression line Total variation Explained variation Unexplained variation To find the total variation, you must first calculate The total deviation The explained deviation The unexplained deviation © 2012 Pearson Education, Inc. All rights reserved. 33 of 84
Variation About a Regression Line (x i, ŷ i ) x y (x i, y i ) Unexplained deviation Total deviation Explained deviation Total Deviation = Explained Deviation = Unexplained Deviation = © 2012 Pearson Education, Inc. All rights reserved. 34 of 84
Total variation The sum of the squares of the differences between the y-value of each ordered pair and the mean of y. Explained variation The sum of the squares of the differences between each predicted y-value and the mean of y. Variation About a Regression Line Total variation = Explained variation = © 2012 Pearson Education, Inc. All rights reserved. 35 of 84
Unexplained variation The sum of the squares of the differences between the y-value of each ordered pair and each corresponding predicted y-value. Variation About a Regression Line Unexplained variation = The sum of the explained and unexplained variation is equal to the total variation. Total variation = Explained variation + Unexplained variation © 2012 Pearson Education, Inc. All rights reserved. 36 of 84
Coefficient of Determination Coefficient of determination The ratio of the explained variation to the total variation. Denoted by r 2 © 2012 Pearson Education, Inc. All rights reserved. 37 of 84
Example: Coefficient of Determination About 77.8% of the variation in the carbon emissions can be explained by the variation in the gross domestic products. About 22.2% of the variation is unexplained. The correlation coefficient for the gross domestic products and carbon dioxide emissions data as calculated in Section 9.1 is r ≈ Find the coefficient of determination. What does this tell you about the explained variation of the data about the regression line? About the unexplained variation? Solution: © 2012 Pearson Education, Inc. All rights reserved. 38 of 84
Section 9.4 Multiple Regression © 2012 Pearson Education, Inc. All rights reserved. 39 of 84
Section 9.4 Objectives Use technology to find a multiple regression equation, the standard error of estimate and the coefficient of determination Use a multiple regression equation to predict y-values © 2012 Pearson Education, Inc. All rights reserved. 40 of 84
Multiple Regression Equation In many instances, a better prediction can be found for a dependent (response) variable by using more than one independent (explanatory) variable. For example, a more accurate prediction for the carbon dioxide emissions discussed in previous sections might be made by considering the number of cars as well as the gross domestic product. © 2012 Pearson Education, Inc. All rights reserved. 41 of 84
Multiple Regression Equation Multiple regression equation ŷ = b + m 1 x 1 + m 2 x 2 + m 3 x 3 + … + m k x k x 1, x 2, x 3,…, x k are independent variables b is the y-intercept y is the dependent variable * Because the mathematics associated with this concept is complicated, technology is generally used to calculate the multiple regression equation. © 2012 Pearson Education, Inc. All rights reserved. 42 of 84
Example: Finding a Multiple Regression Equation A researcher wants to determine how employee salaries at a certain company are related to the length of employment, previous experience, and education. The researcher selects eight employees from the company and obtains the data shown on the next slide. Use MINITAB to find a multiple regression equation that models the data. © 2012 Pearson Education, Inc. All rights reserved. 43 of 84
Example: Finding a Multiple Regression Equation EmployeeSalary, y Employment (yrs), x 1 Experience (yrs), x 2 Education (yrs), x 3 A57, B57, C54, D56, E58, F60, G59, H60, © 2012 Pearson Education, Inc. All rights reserved. 44 of 84
Solution: Finding a Multiple Regression Equation Enter the y-values in C1 and the x 1 -, x 2 -, and x 3 - values in C2, C3 and C4 respectively. Select “Regression > Regression…” from the Stat menu. Use the salaries as the response variable and the remaining data as the predictors. © 2012 Pearson Education, Inc. All rights reserved. 45 of 84
Solution: Finding a Multiple Regression Equation The regression equation is ŷ = 49, x x x 3 © 2012 Pearson Education, Inc. All rights reserved. 46 of 84
Predicting y - Values After finding the equation of the multiple regression line, you can use the equation to predict y-values over the range of the data. To predict y-values, substitute the given value for each independent variable into the equation, then calculate ŷ. © 2012 Pearson Education, Inc. All rights reserved. 47 of 84
Example: Predicting y-Values Use the regression equation ŷ = 49, x x x 3 to predict an employee’s salary given 12 years of current employment, 5 years of experience, and 16 years of education. Solution: ŷ = 49, (12) + 228(5) + 267(16) = 59,544 The employee’s predicted salary is $59,544. © 2012 Pearson Education, Inc. All rights reserved. 48 of 84
Section 9.4 Summary Used technology to find a multiple regression equation, the standard error of estimate and the coefficient of determination Used a multiple regression equation to predict y- values © 2012 Pearson Education, Inc. All rights reserved. 49 of 84