9 Correlation and Regression Elementary Statistics Larson Farber
9 Correlation and Regression Elementary Statistics Larson Farber
Bivariate vs. Univariate * univariate data – data that involves only one variable For example: How many miles per gallon does your car get? {34. 2, 15. 4, 20. 2, 30. 5, 15. 1, 9. 2, 16. 5 } * bivariate data - data that involves two different variables whose values can change.
Example #1 – MPG vs Weight
Example - correlation
Example – “line of best fit”
Section 9. 1 Correlation
Correlation A relationship between two variables Explanatory (Independent) Variable x Hours of Training Shoe Size Cigarettes smoked per day Score on SAT Height Response (Dependent) Variable y Number of Accidents Height Lung Capacity Grade Point Average IQ What type of relationship exists between the two variables and is the correlation significant?
Scatter Plots and Types of Correlation x = hours of training y = number of accidents 60 Accidents 50 40 30 20 10 0 0 2 4 6 8 10 12 14 16 18 20 Hours of Training Negative Correlation–as x increases, y decreases
Scatter Plots and Types of Correlation GPA x = SAT score y = GPA 4. 00 3. 75 3. 50 3. 25 3. 00 2. 75 2. 50 2. 25 2. 00 1. 75 1. 50 300 350 400 450 500 550 600 650 700 750 800 Math SAT Positive Correlation–as x increases, y increases
Scatter Plots and Types of Correlation IQ x = height y = IQ 160 150 140 130 120 110 100 90 80 60 64 68 72 Height No linear correlation 76 80
Correlation Coefficient A measure of the strength and direction of a linear relationship between two variables The range of r is from – 1 to 1. – 1 If r is close to – 1 there is a strong negative correlation. 0 If r is close to 0 there is no linear correlation. 1 If r is close to 1 there is a strong positive correlation.
Correlation Examples
Application Final Grade Final Absences Grade 95 90 85 80 75 70 65 60 55 50 45 40 0 2 4 6 8 10 Absences X 12 14 16 x 8 2 5 12 15 9 6 y 78 92 90 58 43 74 81
Computation of r x 1 2 3 4 5 6 7 78 92 90 58 43 74 81 xy 624 184 450 696 645 666 486 x 2 64 4 25 144 225 81 36 y 2 6084 8464 8100 3364 1849 5476 6561 57 516 3751 579 39898 y 8 2 5 12 15 9 6
Hypothesis Test for Significance r is the correlation coefficient for the sample. The correlation coefficient for the population is (rho). For a two tail test for significance: (The correlation is not significant) (The correlation is significant) For left tail and right tail to test negative or positive significance: The sampling distribution for r is a t-distribution with n – 2 d. f. Standardized test statistic
Test of Significance You found the correlation between the number of times absent and a final grade r = – 0. 975. There were seven pairs of data. Test the significance of this correlation. Use = 0. 01. 1. Write the null and alternative hypothesis. (The correlation is not significant) (The correlation is significant) 2. State the level of significance. = 0. 01 3. Identify the sampling distribution. A t-distribution with 5 degrees of freedom
Rejection Regions Critical Values ± t 0 t – 4. 032 0 4. 032 4. Find the critical value. 5. Find the rejection region. 6. Find the test statistic.
t – 4. 032 0 – 4. 032 7. Make your decision. t = – 9. 811 falls in the rejection region. Reject the null hypothesis. 8. Interpret your decision. There is a significant correlation between the number of times absent and final grades.
Section 9. 2 Linear Regression
The Line of Regression Once you know there is a significant linear correlation, you can write an equation describing the relationship between the x and y variables. This equation is called the line of regression or least squares line. The equation of a line may be written as y = mx + b where m is the slope of the line and b is the y-intercept. The line of regression is: The slope m is: The y-intercept is:
x 1 2 3 4 5 6 7 xy y 8 2 5 12 15 9 6 78 92 90 58 43 74 81 624 184 450 696 645 666 486 57 516 3751 x 2 64 4 25 144 225 81 36 y 2 6084 8464 8100 3364 1849 5476 6561 579 39898 The line of regression is: Write the equation of the line of regression with x = number of absences and y = final grade. Calculate m and b. = – 3. 924 x + 105. 667
The Line of Regression Final Grade m = – 3. 924 and b = 105. 667 The line of regression is: 95 90 85 80 75 70 65 60 55 50 45 40 0 2 4 6 8 10 12 14 16 Absences Note that the point = (8. 143, 73. 714) is on the line.
Predicting y Values The regression line can be used to predict values of y for values of x falling within the range of the data. The regression equation for number of times absent and final grade is: = – 3. 924 x + 105. 667 Use this equation to predict the expected grade for a student with (a) 3 absences (b) 12 absences (a) = – 3. 924(3) + 105. 667 = 93. 895 (b) = – 3. 924(12) + 105. 667 = 58. 579
Example #6 – price and age A study was conducted to investigate the relationship between the resale price (in hundreds of dollars) and the age (in years), of midsize luxury American automobiles. The equation of the least-squares regression line was determined to be y = 185. 7 – 21. 52 (x). (a) (b) Find the resale value of the car when it is 3 yrs old. Find the resale value of the car when it is 6 yrs
Regression Equation y = 50. 729 x + 104. 06 Sales = 50. 729 (Advertising) + 104. 06 What would you predict for Sales if I spend $2, 000 on Advertising (remember that both variables are in units of $1, 000)? What about $6, 000?
1. Determine the type of correlation between the variables. A. Positive linear correlation B. Negative linear correlation C. No linear correlation Copyright © 2007 Pearson Education, Inc. Publishing as Slide 9 -
2. The equation of the regression line for temperature (x) and number of cups of coffee sold per hour (y) is Predict the number of cups of coffee sold per hour when the temperature is 48º. A. 41. 4 B. 30. 7 C. 13. 8 D. 50. 5
Answers 1. (B) negative linear correlation 2. (C) 13. 8
- Slides: 30