Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.

Similar presentations


Presentation on theme: "1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University."— Presentation transcript:

1 1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University

2 2 2 Slide © 2003 South-Western/Thomson Learning™ Chapter 14 Simple Linear Regression n Simple Linear Regression Model n Least Squares Method n Coefficient of Determination n Model Assumptions n Testing for Significance n Excel’s Regression Tool n Using the Estimated Regression Equation for Estimation and Prediction for Estimation and Prediction n Residual Analysis: Validating Model Assumptions n Outliers and Influential Observations

3 3 3 Slide © 2003 South-Western/Thomson Learning™ The Simple Linear Regression Model n Simple Linear Regression Model y =  0 +  1 x +  n Simple Linear Regression Equation E( y ) =  0 +  1 x n Estimated Simple Linear Regression Equation y = b 0 + b 1 x ^

4 4 4 Slide © 2003 South-Western/Thomson Learning™ Least Squares Method n Least Squares Criterion where: y i = observed value of the dependent variable for the i th observation for the i th observation y i = estimated value of the dependent variable for the i th observation for the i th observation ^

5 5 5 Slide © 2003 South-Western/Thomson Learning™ n Slope for the Estimated Regression Equation n y -Intercept for the Estimated Regression Equation b 0 = y - b 1 x where: x i = value of independent variable for i th observation y i = value of dependent variable for i th observation x = mean value for independent variable x = mean value for independent variable y = mean value for dependent variable y = mean value for dependent variable n = total number of observations n = total number of observations __ __ _ _ The Least Squares Method

6 6 6 Slide © 2003 South-Western/Thomson Learning™ Example: Reed Auto Sales n Simple Linear Regression Reed Auto periodically has a special week-long sale. As part of the advertising campaign Reed runs one or more television commercials during the weekend preceding the sale. Data from a sample of 5 previous sales are shown below. Number of TV Ads Number of Cars Sold Number of TV Ads Number of Cars Sold 114 324 218 117 327

7 7 7 Slide © 2003 South-Western/Thomson Learning™ n Slope for the Estimated Regression Equation b 1 = 220 - (10)(100)/5 = 5 b 1 = 220 - (10)(100)/5 = 5 24 - (10) 2 /5 24 - (10) 2 /5 n y -Intercept for the Estimated Regression Equation b 0 = 20 - 5(2) = 10 b 0 = 20 - 5(2) = 10 n Estimated Regression Equation y = 10 + 5 x ^ Example: Reed Auto Sales

8 8 8 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation n Formula Worksheet (showing data)

9 9 9 Slide © 2003 South-Western/Thomson Learning™ n Producing a Scatter Diagram Step 1 Select cells B1:C6 Step 2 Select the Chart Wizard Step 3 When the Chart Type dialog box appears: Choose XY (Scatter) in the Chart type list Choose XY (Scatter) in the Chart type list Choose Scatter from the Chart sub-type display Choose Scatter from the Chart sub-type display Select Next > Select Next > Step 4 When the Chart Source Data dialog box appears Select Next > Select Next > … continued Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation

10 10 Slide © 2003 South-Western/Thomson Learning™ n Producing a Scatter Diagram Step 5 When the Chart Options dialog box appears: Select the Titles tab and then Select the Titles tab and then Delete Cars Sold in the Chart title box Enter TV Ads in the Value (X) axis box Enter Cars Sold in the Value (Y) axis box Select the Legend tab and then Select the Legend tab and then Remove the check in the Show Legend box Select Next > … continued … continued Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation

11 11 Slide © 2003 South-Western/Thomson Learning™ n Producing a Scatter Diagram Step 6 When the Chart Location dialog box appears: Specify the location for the new chart Specify the location for the new chart Select Finish to display the scatter diagram Select Finish to display the scatter diagram Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation

12 12 Slide © 2003 South-Western/Thomson Learning™ n Adding the Trendline Step 1 Position the mouse pointer over any data point and right click to display the Chart menu point and right click to display the Chart menu Step 2 Select the Add Trendline option Step 3 When the Add Trendline dialog box appears: On the Type tab select Linear On the Type tab select Linear On the Options tab select the Display equation on chart box On the Options tab select the Display equation on chart box Click OK Click OK Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation

13 13 Slide © 2003 South-Western/Thomson Learning™ n Scatter Diagram Using Excel to Develop a Scatter Diagram and Compute the Estimated Regression Equation

14 14 Slide © 2003 South-Western/Thomson Learning™ The Coefficient of Determination n Relationship Among SST, SSR, SSE SST = SSR + SSE n Coefficient of Determination r 2 = SSR/SST where: SST = total sum of squares SST = total sum of squares SSR = sum of squares due to regression SSR = sum of squares due to regression SSE = sum of squares due to error SSE = sum of squares due to error ^^

15 15 Slide © 2003 South-Western/Thomson Learning™ n Coefficient of Determination r 2 = SSR/SST = 100/114 =.8772 The regression relationship is very strong since 88% of the variation in number of cars sold can be explained by the linear relationship between the number of TV ads and the number of cars sold. Example: Reed Auto Sales

16 16 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Compute the Coefficient of Determination n Producing R 2 Step 1 Position the mouse pointer over any data point in the scatter diagram and right click point in the scatter diagram and right click Step 2 When the Chart menu appears: Select the Add Trendline option Select the Add Trendline option Step 3 When the Add Trendline dialog box appears: On the Options tab, select the Display R- squared value on chart box On the Options tab, select the Display R- squared value on chart box Click OK Click OK

17 17 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Compute the Coefficient of Determination n Value Worksheet (showing R 2 )

18 18 Slide © 2003 South-Western/Thomson Learning™ The Correlation Coefficient n Sample Correlation Coefficient where: b 1 = the slope of the estimated regression b 1 = the slope of the estimated regressionequation

19 19 Slide © 2003 South-Western/Thomson Learning™ Example: Reed Auto Sales n Sample Correlation Coefficient The sign of b 1 in the equation is “+”. r xy = +.9366 r xy = +.9366

20 20 Slide © 2003 South-Western/Thomson Learning™ Model Assumptions Assumptions About the Error Term  Assumptions About the Error Term  The error  is a random variable with mean of zero. The error  is a random variable with mean of zero. The variance of , denoted by  2, is the same for all values of the independent variable. The variance of , denoted by  2, is the same for all values of the independent variable. The values of  are independent. The values of  are independent. The error  is a normally distributed random variable. The error  is a normally distributed random variable.

21 21 Slide © 2003 South-Western/Thomson Learning™ Testing for Significance To test for a significant regression relationship, we must conduct a hypothesis test to determine whether the value of  1 is zero. To test for a significant regression relationship, we must conduct a hypothesis test to determine whether the value of  1 is zero. n Two tests are commonly used t Test t Test F Test F Test Both tests require an estimate of  2, the variance of  in the regression model. Both tests require an estimate of  2, the variance of  in the regression model.

22 22 Slide © 2003 South-Western/Thomson Learning™ Testing for Significance An Estimate of  2 An Estimate of  2 The mean square error (MSE) provides the estimate of  2, and the notation s 2 is also used. s 2 = MSE = SSE/(n-2) s 2 = MSE = SSE/(n-2)where:

23 23 Slide © 2003 South-Western/Thomson Learning™ Testing for Significance An Estimate of  An Estimate of  To estimate  we take the square root of  2. To estimate  we take the square root of  2. The resulting s is called the standard error of the estimate. The resulting s is called the standard error of the estimate.

24 24 Slide © 2003 South-Western/Thomson Learning™ n Hypotheses H 0 :  1 = 0 H 0 :  1 = 0 H a :  1 = 0 H a :  1 = 0 n Test Statistic n Rejection Rule Reject H 0 if t t  where t  is based on a t distribution with where t  is based on a t distribution with n - 2 degrees of freedom. n - 2 degrees of freedom. Testing for Significance: t Test

25 25 Slide © 2003 South-Western/Thomson Learning™ n t Test Hypotheses H 0 :  1 = 0 Hypotheses H 0 :  1 = 0 H a :  1 = 0 H a :  1 = 0 Rejection Rule Rejection Rule For  =.05 and d.f. = 3, t.025 = 3.182 For  =.05 and d.f. = 3, t.025 = 3.182 Reject H 0 if t > 3.182 Reject H 0 if t > 3.182 Test Statistics Test Statistics t = 5/1.08 = 4.63 Conclusions Conclusions Reject H 0 Reject H 0 Example: Reed Auto Sales

26 26 Slide © 2003 South-Western/Thomson Learning™ Confidence Interval for  1 We can use a 95% confidence interval for  1 to test the hypotheses just used in the t test. We can use a 95% confidence interval for  1 to test the hypotheses just used in the t test. H 0 is rejected if the hypothesized value of  1 is not included in the confidence interval for  1. H 0 is rejected if the hypothesized value of  1 is not included in the confidence interval for  1.

27 27 Slide © 2003 South-Western/Thomson Learning™ Confidence Interval for  1 The form of a confidence interval for  1 is: The form of a confidence interval for  1 is: where b 1 is the point estimate is the margin of error is the t value providing an area of  /2 in the upper tail of a t distribution with n - 2 degrees t distribution with n - 2 degrees of freedom

28 28 Slide © 2003 South-Western/Thomson Learning™ Example: Reed Auto Sales n Rejection Rule Reject H 0 if 0 is not included in the confidence interval for  1. 95% Confidence Interval for  1 95% Confidence Interval for  1 = 5 +/- 3.182(1.08) = 5 +/- 3.44 = 5 +/- 3.182(1.08) = 5 +/- 3.44 or 1.56 to 8.44 n Conclusion Reject H 0

29 29 Slide © 2003 South-Western/Thomson Learning™ Testing for Significance: F Test n Hypotheses H 0 :  1 = 0 H 0 :  1 = 0 H a :  1 = 0 H a :  1 = 0 n Test Statistic F = MSR/MSE n Rejection Rule Reject H 0 if F > F  where F  is based on an F distribution with 1 d.f. in the numerator and n - 2 d.f. in the denominator.

30 30 Slide © 2003 South-Western/Thomson Learning™ n F Test Hypotheses H 0 :  1 = 0 Hypotheses H 0 :  1 = 0 H a :  1 = 0 H a :  1 = 0 Rejection Rule Rejection Rule For  =.05 and d.f. = 1, 3: F.05 = 10.13 For  =.05 and d.f. = 1, 3: F.05 = 10.13 Reject H 0 if F > 10.13. Reject H 0 if F > 10.13. Test Statistic Test Statistic F = MSR/MSE = 100/4.667 = 21.43 Conclusion Conclusion We can reject H 0. Example: Reed Auto Sales

31 31 Slide © 2003 South-Western/Thomson Learning™ Some Cautions about the Interpretation of Significance Tests Rejecting H 0 :  1 = 0 and concluding that the relationship between x and y is significant does not enable us to conclude that a cause-and-effect relationship is present between x and y. Rejecting H 0 :  1 = 0 and concluding that the relationship between x and y is significant does not enable us to conclude that a cause-and-effect relationship is present between x and y. Just because we are able to reject H 0 :  1 = 0 and demonstrate statistical significance does not enable us to conclude that there is a linear relationship between x and y. Just because we are able to reject H 0 :  1 = 0 and demonstrate statistical significance does not enable us to conclude that there is a linear relationship between x and y.

32 32 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Up to this point, you have seen how Excel can be used for various parts of a regression analysis. n Excel also has a comprehensive tool in its Data Analysis package called Regression. n The Regression tool can be used to perform a complete regression analysis.

33 33 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Formula Worksheet (showing data)

34 34 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Performing the Regression Analysis Step 1 Select the Tools pull-down menu Step 2 Choose the Data Analysis option Step 3 Choose Regression from the list of Analysis Tools Analysis Tools … continued

35 35 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Performing the Regression Analysis Step 4 When the Regression dialog box appears: Enter C1:C6 in the Input Y Range box Enter C1:C6 in the Input Y Range box Enter B1:B6 in the Input X Range box Enter B1:B6 in the Input X Range box Select Labels Select Labels Select Confidence Level Select Confidence Level Enter 95 in the Confidence Level box Enter 95 in the Confidence Level box Select Output Range Select Output Range Enter A9 (any cell) in the Ouput Range box Enter A9 (any cell) in the Ouput Range box Click OK to begin the regression analysis Click OK to begin the regression analysis

36 36 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Value Worksheet ANOVA Output Regression Statistics Output Data Regression Equation Output

37 37 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Estimated Regression Equation Output (left portion) Note: Columns F-I are not shown.

38 38 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Estimated Regression Equation Output (right portion) Note: Columns C-E are hidden.

39 39 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n ANOVA Output

40 40 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool n Regression Statistics Output

41 41 Slide © 2003 South-Western/Thomson Learning™ n Confidence Interval Estimate of E ( y p ) n Prediction Interval Estimate of y p y p + t  /2 s ind y p + t  /2 s ind where the confidence coefficient is 1 -  and t  /2 is based on a t distribution with n - 2 d.f. Using the Estimated Regression Equation for Estimation and Prediction

42 42 Slide © 2003 South-Western/Thomson Learning™ n Point Estimation If 3 TV ads are run prior to a sale, we expect the mean number of cars sold to be: y = 10 + 5(3) = 25 cars n Confidence Interval for E ( y p ) 95% confidence interval estimate of the mean number of cars sold when 3 TV ads are run is: 25 + 4.61 = 20.39 to 29.61 cars n Prediction Interval for y p 95% prediction interval estimate of the number of cars sold in one particular week when 3 TV ads are run is: 25 + 8.28 = 16.72 to 33.28 cars ^ Example: Reed Auto Sales

43 43 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Develop Confidence and Prediction Interval Estimates n Formula Worksheet (confidence interval portion)

44 44 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Develop Confidence and Prediction Interval Estimates n Value Worksheet (confidence interval portion)

45 45 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Develop Confidence and Prediction Interval Estimates n Formula Worksheet (prediction interval portion)

46 46 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Develop Confidence and Prediction Interval Estimates n Value Worksheet (prediction interval portion)

47 47 Slide © 2003 South-Western/Thomson Learning™ If the assumptions about the error term  appear questionable, the hypothesis tests about the significance of the regression relationship and the interval estimation results may not be valid. If the assumptions about the error term  appear questionable, the hypothesis tests about the significance of the regression relationship and the interval estimation results may not be valid. The residuals provide the best information about . The residuals provide the best information about . n Much of the residual analysis is based on an examination of graphical plots. Residual Analysis

48 48 Slide © 2003 South-Western/Thomson Learning™ Residual Plot Against x If the assumption that the variance of  is the same for all values of x is valid, and the assumed regression model is an adequate representation of the relationship between the variables: If the assumption that the variance of  is the same for all values of x is valid, and the assumed regression model is an adequate representation of the relationship between the variables: The residual plot should give an overall The residual plot should give an overall impression of a horizontal band of points impression of a horizontal band of points

49 49 Slide © 2003 South-Western/Thomson Learning™ Example: Reed Auto Sales n Residuals

50 50 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool to Construct a Residual Plot n Producing a Residual Plot The steps outlined earlier to obtain the regression output are performed with one change. The steps outlined earlier to obtain the regression output are performed with one change. When the Regression dialog box appears, we must also select the Residual Plot option. When the Regression dialog box appears, we must also select the Residual Plot option. The output will include two new items: The output will include two new items: A plot of the residuals against the independent variable, andA plot of the residuals against the independent variable, and A list of predicted values of y and the corresponding residual values.A list of predicted values of y and the corresponding residual values.

51 51 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool to Construct a Residual Plot n Value Worksheet (showing Residual Plot)

52 52 Slide © 2003 South-Western/Thomson Learning™ Using Excel’s Regression Tool to Construct a Residual Plot n Value Worksheet (Residual Output portion)

53 53 Slide © 2003 South-Western/Thomson Learning™ n Standardized Residual for Observation i where: Standardized Residuals

54 54 Slide © 2003 South-Western/Thomson Learning™ Standardized Residual Plot The standardized residual plot can provide insight about the assumption that the error term  has a normal distribution. The standardized residual plot can provide insight about the assumption that the error term  has a normal distribution. n If this assumption is satisfied, the distribution of the standardized residuals should appear to come from a standard normal probability distribution.

55 55 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Construct a Standardized Residual Plot n Excel’s Regression tool be used to obtain the standardized residuals. n The steps described earlier in order to conduct a regression analysis are performed with one change: When the Regression dialog box appears, we must select the Standardized Residuals option When the Regression dialog box appears, we must select the Standardized Residuals option n The Standardized Residuals option does not automatically produce a standardized residual plot.

56 56 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Construct a Standardized Residual Plot n Value Worksheet

57 57 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Construct a Standardized Residual Plot n Excel’s Chart Wizard can be used to construct the standardized residual plot. n A scatter diagram is developed in which: The values of the independent variable are placed on the horizontal axis The values of the independent variable are placed on the horizontal axis The values of the standardized residuals are placed on the vertical axis The values of the standardized residuals are placed on the vertical axis

58 58 Slide © 2003 South-Western/Thomson Learning™ Using Excel to Construct a Standardized Residual Plot n Standardized Residual Plot

59 59 Slide © 2003 South-Western/Thomson Learning™ Standardized Residual Plot All of the standardized residuals are between –1.5 and +1.5 indicating that there is no reason to question the assumption that  has a normal distribution. All of the standardized residuals are between –1.5 and +1.5 indicating that there is no reason to question the assumption that  has a normal distribution.

60 60 Slide © 2003 South-Western/Thomson Learning™ Outliers and Influential Observations n Detecting Outliers An outlier is an observation that is unusual in comparison with the other data. An outlier is an observation that is unusual in comparison with the other data. Minitab classifies an observation as an outlier if its standardized residual value is +2. Minitab classifies an observation as an outlier if its standardized residual value is +2. This standardized residual rule sometimes fails to identify an unusually large observation as being an outlier. This standardized residual rule sometimes fails to identify an unusually large observation as being an outlier. This rule’s shortcoming can be circumvented by using studentized deleted residuals. This rule’s shortcoming can be circumvented by using studentized deleted residuals. The | i th studentized deleted residual| will be larger than the | i th standardized residual|. The | i th studentized deleted residual| will be larger than the | i th standardized residual|.

61 61 Slide © 2003 South-Western/Thomson Learning™ End of Chapter 14


Download ppt "1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University."

Similar presentations


Ads by Google