Unit 7: - Linear Regression and Coefficient of Determination Guided Exercise 4: Least Squares Line: The quick Sell car dealership has been using 1-minute spot ads on local tv station. The ads always occur during the evening hours and advertise different models and price ranges of cars on the lot that week. Table 4.8 x y 6 15 20 31 0 10 14 16 25 28 16 20 28 40 18 25 10 12 8 15 a) Draw a scatter diagram Scatter diagram and Least-squares line for table 4-8. 45 40 CARS SOLD 35 30 25 20 15 10 5 0 0 5 10 15 ADS 20 25 30 b) Looking at the equations (3) and (5) pertaining to the least squares line (pages 161 – 162). Two of the quantities that we need to find b are (∑x) and (∑xy). List the others. Solution: We also need n, (∑y), (∑x2) and (∑x)2. c) Completion of table 4.9 (a) on the next page Solution: Table 4-9(a) x y x2 xy 6 20 0 14 25 16 28 18 10 8 ∑x = 145 15 31 10 16 28 20 40 25 12 15 ∑y = 212 36 400 0 196 625 256 784 324 100 64 ∑x2 = 2785 90 620 0 224 700 320 1120 450 120 120 ∑xy = 3764 d) Computing the sample means x̄ and ȳ Solution: x̄ = ∑x = 145 n 10 = 14.5 ȳ = ∑ȳ = 212 n = 21.2 10 e) Compute a and b for the equation ȳ = a + bx of the least-squares line Solution: b = n∑xy – (∑x)(∑y) n∑x2 – (∑x)2 b = 10(3764) – (145)(212) = 6900 10(2785) – (145)2 6825 = 1.01 a = ȳ - bx a = 21.2 – 1.01(14.5) a = 6.56 f) What is the equation of the least-squares a = ȳ - bx Solution: Using the values of a and b computed in part (e) or values of and b obtained directly from a calculator ȳ = 6.56 + 1.01x g) Plot the least-squares line on your scatter diagram Solution: The least squares line goes through the point (x̄ , ȳ) = (14.5, 21.2). To get another point on the line, then we select a value of x and compute the corresponding ȳ = 6.56 + 1.01x. For x = 20; we get ȳ = 6.56 + 1.01(20) = 26.8; so the point 920, 26.8) is also on the line. The leastsquares line is shown on the below figure. Scatter diagram and Least-squares line for table 4-8. 45 40 CARS SOLD 35 30 25 20 15 10 5 0 0 5 10 15 20 25 30 ADS h) Read the ȳ value for x = 12 from your graph. Then use the equation of the least squares line to calculate ȳ when x = 12. How many cars can the manager expect to sel if 12 ads per week are aired on TV? Solution: The graph gives ȳ = 19. From the equation, we get: ȳ = 6.56 + 1.01x ȳ = 6.56 +1.01(12) ȳ = 6.56 + 12.12 = 18.68 i) Interpretation: How reliable do you think the prediction is? Explain (Guided Exercise 5 will show that r = 0.919) Solution: The prediction should be fairly reliable. The prediction involves interpolation, and the scatter diagram shows that the data points are clustered around the least-squares line. From the next Guided Exercise, we have the information that r is close to 1. Other variables might affect the value of y for x = 12. Guided Exercise 5: Coefficient of determination r2 In Guided Exercise 4, we looked at the relationship between x = number of 1-minute spot ads on TV advertising different models of cars and y = number of cars sold each week by the sponsoring car dealership. a) Using the sums found in Guided Exercise 4, compute the sample correlation coefficient r. n = 10, ∑x = 145, ∑y = 212, ∑x2 = 2785 and ∑xy = 3764. You also need ∑y2 = 5320 r = n ∑xy – (∑x)(∑y) √n∑x2 – (∑x)2 √n∑y2 – (∑y)2 Solution: r = 10(3764) – (145)(212) √10(2785) – (145)2 √10(5320) – (212)2 r = 6900 (82.61)(90.86) r = 0.919 b) Compute the coefficient of determination r2. Solution: r2 = 0.9192 r2 = 0.845 c) Interpretation: What percentage of the variation in the number of car sales can be explained by the ads and the least-squares line? Solution: 84.5% d) Interpretation: What percentage of the variation in the number of car sales is not explained by the ads and least-squares line? Solution: 100% - 84.5% = 15.5% Section 4.2 Problems #7: Economics: Entry-Level jobs