Presentation is loading. Please wait.

Presentation is loading. Please wait.

1 1 Slide © 2005 Thomson/South-Western AK/ECON 3480 M & N WINTER 2006 n Power Point Presentation n Professor Ying Kong School of Analytic Studies and Information.

Similar presentations


Presentation on theme: "1 1 Slide © 2005 Thomson/South-Western AK/ECON 3480 M & N WINTER 2006 n Power Point Presentation n Professor Ying Kong School of Analytic Studies and Information."— Presentation transcript:

1 1 1 Slide © 2005 Thomson/South-Western AK/ECON 3480 M & N WINTER 2006 n Power Point Presentation n Professor Ying Kong School of Analytic Studies and Information Technology Atkinson Faculty of Liberal and Professional Studies York University

2 2 2 Slide © 2005 Thomson/South-Western Chapter 16 Regression Analysis: Model Building n Multiple Regression Approach to Analysis of Variance and to Analysis of Variance and Experimental Design Experimental Design n General Linear Model n Determining When to Add or Delete Variables n Variable-Selection Procedures n Residual Analysis

3 3 3 Slide © 2005 Thomson/South-Western Models in which the parameters (  0,  1,...,  p ) all Models in which the parameters (  0,  1,...,  p ) all have exponents of one are called linear models. General Linear Model n A general linear model involving p independent variables is n Each of the independent variables z is a function of x 1, x 2,..., x k (the variables for which data have been collected).

4 4 4 Slide © 2005 Thomson/South-Western General Linear Model n The simplest case is when we have collected data for just one variable x 1 and want to estimate y by using a straight-line relationship. In this case z 1 = x 1. n This model is called a simple first-order model with one predictor variable.

5 5 5 Slide © 2005 Thomson/South-Western Modeling Curvilinear Relationships n This model is called a second-order model with one predictor variable. n To account for a curvilinear relationship, we might set z 1 = x 1 and z 2 =.

6 6 6 Slide © 2005 Thomson/South-Western Interaction n This type of effect is called interaction. n In this model, the variable z 5 = x 1 x 2 is added to account for the potential effects of the two variables acting together. n If the original data set consists of observations for y and two independent variables x 1 and x 2 we might develop a second-order model with two predictor variables.

7 7 7 Slide © 2005 Thomson/South-Western Transformations Involving the Dependent Variable n Another approach, called a reciprocal transformation, is to use 1/ y as the dependent variable instead of y. n Often the problem of nonconstant variance can be corrected by transforming the dependent variable to a different scale. n Most statistical packages provide the ability to apply logarithmic transformations using either the base-10 (common log) or the base e = 2.71828... (natural log).

8 8 8 Slide © 2005 Thomson/South-Western n We can transform this nonlinear model to a linear model by taking the logarithm of both sides. Nonlinear Models That Are Intrinsically Linear Models in which the parameters (  0,  1,...,  p ) have exponents other than one are called nonlinear models. Models in which the parameters (  0,  1,...,  p ) have exponents other than one are called nonlinear models. n In some cases we can perform a transformation of variables that will enable us to use regression analysis with the general linear model. n The exponential model involves the regression equation:

9 9 9 Slide © 2005 Thomson/South-Western Determining When to Add or Delete Variables n To test whether the addition of x 2 to a model involving x 1 (or the deletion of x 2 from a model involving x 1 and x 2 ) is statistically significant we can perform an F Test. n The F Test is based on a determination of the amount of reduction in the error sum of squares resulting from adding one or more independent variables to the model.

10 10 Slide © 2005 Thomson/South-Western Determining When to Add or Delete Variables n The p –value criterion can also be used to determine whether it is advantageous to add one or more dependent variables to a multiple regression model. The p –value associated with the computed F statistic can be compared to the level of significance . The p –value associated with the computed F statistic can be compared to the level of significance . It is difficult to determine the p –value directly from the tables of the F distribution, but computer software packages, such as Minitab or Excel, provide the p  value. It is difficult to determine the p –value directly from the tables of the F distribution, but computer software packages, such as Minitab or Excel, provide the p  value.

11 11 Slide © 2005 Thomson/South-Western Variable Selection Procedures n Stepwise Regression n Forward Selection n Backward Elimination Iterative; one independent variable at a time is added or deleted based on the F statistic Different subsets of the independent variables are evaluated n Best-Subsets Regression The first 3 procedures are heuristics. There is no guarantee that the best model will be found.

12 12 Slide © 2005 Thomson/South-Western Variable Selection: Stepwise Regression n If no variable can be removed and no variable can be added, the procedure stops. n At each iteration, the first consideration is to see whether the least significant variable currently in the model can be removed because its F value is less than the user-specified or default Alpha to remove. n If no variable can be removed, the procedure checks to see whether the most significant variable not in the model can be added because its F value is greater than the user-specified or default Alpha to enter.

13 13 Slide © 2005 Thomson/South-Western Variable Selection: Stepwise Regression Compute F stat. and p -value for each indep. variable not in model Start with no indep. variables in model variables in model Any p -value > alpha to remove ? Stop Indep. variable with largest p -value is removed from model Compute F stat. and p -value for each indep. variable in model Any p -value < alpha to enter ? Indep. variable with smallest p -value is entered into model No No Yes Yesnextiteration

14 14 Slide © 2005 Thomson/South-Western Variable Selection: Forward Selection n This procedure is similar to stepwise regression, but does not permit a variable to be deleted. n This forward-selection procedure starts with no independent variables. n It adds variables one at a time as long as a significant reduction in the error sum of squares (SSE) can be achieved.

15 15 Slide © 2005 Thomson/South-Western Start with no indep. variables in model Stop Compute F stat. and p -value for each indep. variable not in model Any p -value < alpha to enter ? Indep. variable with smallest p -value is entered into model No Yes Variable Selection: Forward Selection

16 16 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n This procedure begins with a model that includes all the independent variables the modeler wants considered. n It then attempts to delete one variable at a time by determining whether the least significant variable currently in the model can be removed because its p - value is less than the user-specified or default value. n Once a variable has been removed from the model it cannot reenter at a subsequent step.

17 17 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination Stop Compute F stat. and p -value for each indep. variable in model Any p -value > alpha to remove ? Indep. variable with largest p -value is removed from model No Yes Start with all indep. variables in model

18 18 Slide © 2005 Thomson/South-Western Tony Zamora, a real estate investor, has just moved to Clarksville and wants to learn about the city’s residential real estate market. Tony has ran- domly selected 25 house-for-sale listings from the Sunday news- paper and collected the data partially listed on an upcoming slide. Variable Selection: Backward Elimination n Example: Clarksville Homes

19 19 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n Example: Clarksville Homes Develop, using the backward elimination Develop, using the backward elimination procedure, a multiple regression model to predict the selling price of a house in Clarksville.

20 20 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n n Partial Data Note: Rows 10-26 are not shown.

21 21 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n n Regression Output Greatest p -value >.05 Variable to be removed

22 22 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n Cars (garage size) is the independent variable with the highest p -value (.697) >.05. n Cars variable is removed from the model. n Multiple regression is performed again on the remaining independent variables.

23 23 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n n Regression Output Greatest p -value >.05 Variable to be removed

24 24 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n Bedrooms is the independent variable with the highest p -value (.281) >.05. n Bedrooms variable is removed from the model. n Multiple regression is performed again on the remaining independent variables.

25 25 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n n Regression Output Greatest p -value >.05 Variable to be removed

26 26 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n Bathrooms is the independent variable with the highest p -value (.110) >.05. n Bathrooms variable is removed from the model. n Multiple regression is performed again on the remaining independent variable.

27 27 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n n Regression Output Greatest p -value is <.05

28 28 Slide © 2005 Thomson/South-Western Variable Selection: Backward Elimination n House size is the only independent variable remaining in the model. n The estimated regression equation is:

29 29 Slide © 2005 Thomson/South-Western n Minitab output identifies the two best one-variable estimated regression equations, the two best two- variable equation, and so on. Variable Selection: Best-Subsets Regression n The three preceding procedures are one-variable-at- a-time methods offering no guarantee that the best model for a given number of variables will be found. n Some software packages include best-subsets regression that enables the user to find, given a specified number of independent variables, the best regression model.

30 30 Slide © 2005 Thomson/South-Western The Professional Golfers Association keeps a The Professional Golfers Association keeps a variety of statistics regarding performance measures. Data include the average driving distance, percentage of drives that land in the fairway, percent- age of greens hit in regulation, average number of putts, percentage of sand saves, and average score. n Example: PGA Tour Data Variable Selection: Best-Subsets Regression

31 31 Slide © 2005 Thomson/South-Western n Variable Names and Definitions Variable-Selection Procedures Score : average score for an 18-hole round Sand : percentage of sand saves (landing in a sand trap and still scoring par or better) Putt : average number of putts for greens that have been hit in regulation been hit in regulation Green : percentage of greens hit in regulation (a par-3 green is “hit in regulation” if the player’s first shot lands on the green) shot lands on the green) Fair : percentage of drives that land in the fairway Drive : average length of a drive in yards

32 32 Slide © 2005 Thomson/South-Western 272.9.615.6671.780.47670.19 Variable-Selection Procedures Drive Fair Green Putt Sand Score Drive Fair Green Putt Sand Score 277.6.681.6671.768.55069.10 259.6.691.6651.810.53671.09 269.1.657.6491.747.47270.12 267.0.689.6731.763.67269.88 267.3.581.6371.781.52170.71 255.6.778.6741.791.45569.76 n Sample Data (Part 1) 265.4.718.699 1.790.551 69.73 265.4.718.699 1.790.551 69.73

33 33 Slide © 2005 Thomson/South-Western 261.3.740.7021.813.52969.88 261.3.740.7021.813.52969.88 Variable-Selection Procedures Drive Fair Green Putt Sand Score Drive Fair Green Putt Sand Score 272.6.660.6721.803.43169.97 272.6.660.6721.803.43169.97 263.9.668.6691.774.49370.33 263.9.668.6691.774.49370.33 267.0.686.6871.809.49270.32 267.0.686.6871.809.49270.32 266.0.681.6701.765.59970.09 266.0.681.6701.765.59970.09 258.1.695.6411.784.50070.46 258.1.695.6411.784.50070.46 255.6.792.6721.752.60369.49 255.6.792.6721.752.60369.49 n Sample Data (Part 2) 262.2.721.6621.754.57670.27 262.2.721.6621.754.57670.27

34 34 Slide © 2005 Thomson/South-Western 263.0.639.6471.760.37470.81 263.0.639.6471.760.37470.81 Variable-Selection Procedures Drive Fair Green Putt Sand Score Drive Fair Green Putt Sand Score 260.5.703.6231.782.56770.72 260.5.703.6231.782.56770.72 271.3.671.6661.783.49270.30 271.3.671.6661.783.49270.30 263.3.714.6871.796.46869.91 263.3.714.6871.796.46869.91 276.6.634.6431.776.54170.69 276.6.634.6431.776.54170.69 252.1.726.6391.788.49370.59 252.1.726.6391.788.49370.59 263.0.687.6751.786.48670.20 263.0.687.6751.786.48670.20 n Sample Data (Part 3) 253.5.732.6931.797.51870.26 253.5.732.6931.797.51870.26 266.2.681.6571.812.47270.96 266.2.681.6571.812.47270.96

35 35 Slide © 2005 Thomson/South-Western n Sample Correlation Coefficients Variable-Selection Procedures Sand Putt Green Fair Drive Score Drive Fair Green Putt -.154 -.427 -.679 -.427 -.679 -.556 -.045.421.258 -.139.101.354 -.278 -.024.265.083 -.296

36 36 Slide © 2005 Thomson/South-Western n Best Subsets Regression of SCORE Variable-Selection Procedures Vars R-sq R-sq(a) C-p s D F G P S 130.927.926.9.39685X 130.927.926.9.39685X 118.214.635.7.43183X 254.750.512.4.32872XX 254.650.512.5.32891XX 360.755.110.2.31318XXX 359.153.311.4.31957XXX 472.266.84.2.26913XXXX 460.953.112.1.32011XXXX 572.665.46.0.27499XXXXX

37 37 Slide © 2005 Thomson/South-Western Variable-Selection Procedures s =.2691 R-sq = 72.4% R-sq(adj) = 66.8% n Minitab Output Putt9.8583.1803.10.006 Green-10.3423.561-2.90.009 The regression equation Score = 74.678 -.0398(Drive) - 6.686(Fair) - 10.342(Green) + 9.858(Putt) - 10.342(Green) + 9.858(Putt) Fair-6.6861.939-3.45.003 Predictor Coef Stdev t-ratio p Drive-.0398.01235-3.22.004 Constant74.6786.95210.74.000

38 38 Slide © 2005 Thomson/South-Western Variable-Selection Procedures n Minitab Output Total 24 5.24334 Error 20 1.44865.07243 Regression 4 3.79469.94867 13.10.000 SOURCE DF SS MS F P Analysis of Variance

39 39 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation n Often, the data used for regression studies in business and economics are collected over time. n It is not uncommon for the value of y at one time period to be related to the value of y at previous time periods. n In this case, we say autocorrelation (or serial correlation) is present in the data.

40 40 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation n With positive autocorrelation, we expect a positive residual in one period to be followed by a positive residual in the next period. n With positive autocorrelation, we expect a negative residual in one period to be followed by a negative residual in the next period. n With negative autocorrelation, we expect a positive residual in one period to be followed by a negative residual in the next period, then a positive residual, and so on.

41 41 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation n When autocorrelation is present, one of the regression assumptions is violated: the error terms are not independent. n When autocorrelation is present, serious errors can be made in performing tests of significance based upon the assumed regression model. n The Durbin-Watson statistic can be used to detect first-order autocorrelation.

42 42 Slide © 2005 Thomson/South-Western n Durbin-Watson Test Statistic Residual Analysis: Autocorrelation The i th residual is denoted

43 43 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation n Durbin-Watson Test Statistic A value of two indicates no autocorrelation. A value of two indicates no autocorrelation. If successive values of the residuals are close If successive values of the residuals are close together (positive autocorrelation is present), together (positive autocorrelation is present), the statistic will be small. the statistic will be small. The statistic ranges in value from zero to four. The statistic ranges in value from zero to four. If successive values are far apart (negative If successive values are far apart (negative autocorrelation is present), the statistic will autocorrelation is present), the statistic will be large. be large.

44 44 Slide © 2005 Thomson/South-Western Suppose the values of  (residuals) are not independent but are related in the following manner: Suppose the values of  (residuals) are not independent but are related in the following manner: where  is a parameter with an absolute value less than one and z t is a normally and independently distributed random variable with a mean of zero and variance of  2. We see that if  = 0, the error terms are not related. We see that if  = 0, the error terms are not related. Residual Analysis: Autocorrelation  t =  t -1 + z t The Durbin-Watson test uses the residuals to determine whether  = 0. The Durbin-Watson test uses the residuals to determine whether  = 0.

45 45 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation n The null hypothesis always is: n The alternative hypothesis is: to test for positive autocorrelation to test for negative autocorrelation to test for pos. or neg. autocorrelation there is no autocorrelation

46 46 Slide © 2005 Thomson/South-Western Residual Analysis: Autocorrelation A Sample Of Critical Values For The Durbin-Watson Test For Autocorrelation Significance Points of d L and d U :  =.05 Number of Independent Variables 12345 n dLdLdLdL dUdUdUdU dLdLdLdL dUdUdUdU dLdLdLdL dUdUdUdU dUdUdUdU dUdUdUdU dUdUdUdU dUdUdUdU 151.081.360.951.540.821.750.691.970.562.21 161.101.370.981.540.861.730.741.930.622.15 171.131.381.021.540.901.710.781.900.672.10 181.161.391.051.530.931.690.821.870.712.06

47 47 Slide © 2005 Thomson/South-Western Positiveautocor-relation Incon-clusive No evidence of positive autocorrelation Residual Analysis: Autocorrelation 0 dLdLdLdL dUdUdUdU 24 4- d L 4- d U Negativeautocor-relation Incon-clusive No evidence of negative autocorrelation 0 dLdLdLdL dUdUdUdU 24 4- d L 4- d U Incon-clusive No evidence of autocorrelation 0 dLdLdLdL dUdUdUdU 24 4- d L 4- d U Incon-clusive Negativeautocor-relation Positiveautocor-relation

48 48 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n We will use the results of multiple regression to perform the ANOVA test on the difference in the means of three populations. n The use of dummy variables in a multiple regression equation can provide another approach to solving analysis of variance and experimental design problems.

49 49 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n Example: Reed Manufacturing Janet Reed would like to know if Janet Reed would like to know if there is any significant difference in the mean number of hours worked per week for the department managers at her three manufacturing plants (in Buffalo, Pittsburgh, and Detroit).

50 50 Slide © 2005 Thomson/South-Western n Example: Reed Manufacturing A simple random sample of five A simple random sample of five managers from each of the three plants was taken and the number of hours worked by each manager for the previous week is shown on the next slide. Multiple Regression Approach to Analysis of Variance and Experimental Design

51 51 Slide © 2005 Thomson/South-Western 1 2 3 4 5 48 54 57 54 62 73 63 66 64 74 51 63 61 54 56 Plant 1 Buffalo Plant 2 Pittsburgh Plant 3 Detroit Observation Sample Mean Sample Variance 55 68 57 26.0 26.5 24.5 Multiple Regression Approach to Analysis of Variance and Experimental Design

52 52 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n We begin by defining two dummy variables, x 1 and x 2, that will indicate the plant from which each sample observation was selected. x 1 = 0, x 2 = 1 if observation is from Detroit plant x 1 = 1, x 2 = 0 if observation is from Pittsburgh plant x 1 = 0, x 2 = 0 if observation is from Buffalo plant n In general, if there are k populations, we need to define k – 1 dummy variables.

53 53 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design 48 54 57 54 62 73 63 66 64 74 51 63 61 54 56 Plant 1 Buffalo Plant 2 Pittsburgh Plant 3 Detroit 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 0 0 0 0 0 0 0 0 0 0 1 1 1 1 1 x 1 x 2 y n Input Data

54 54 Slide © 2005 Thomson/South-Western E ( y ) = expected number of hours worked E ( y ) = expected number of hours worked =  0 +  1 x 1 +  2 x 2 =  0 +  1 x 1 +  2 x 2 Multiple Regression Approach to Analysis of Variance and Experimental Design For Detroit: E ( y ) =  0 +  1 (0) +  2 (1) =  0 +  2 For Pittsburgh: E ( y ) =  0 +  1 (1) +  2 (0) =  0 +  1 For Buffalo: E ( y ) =  0 +  1 (0) +  2 (0) =  0

55 55 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design Excel produced the regression equation: Plant Estimate of E ( y ) Buffalo Pittsburgh Detroit b0 b0 b0 b0 = 55 b0 b0 b0 b0 + b1 b1 b1 b1 = 55 + 13 = 68 b0 b0 b0 b0 + b2 b2 b2 b2 = 55 + 2 = 57 y = 55 +13 x 1 + 2 x 2

56 56 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n Next, we observe that if there is no difference in the means: E ( y ) for the Pittsburgh plant – E ( y ) for the Buffalo plant = 0 E ( y ) for the Detroit plant – E ( y ) for the Buffalo plant = 0

57 57 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design Because  0 equals E ( y ) for the Buffalo plant and  0 +  1 equals E ( y ) for the Pittsburgh plant, the first difference is equal to (  0 +  1 ) -  0 =  1. Because  0 equals E ( y ) for the Buffalo plant and  0 +  1 equals E ( y ) for the Pittsburgh plant, the first difference is equal to (  0 +  1 ) -  0 =  1. Because  0 +  2 equals E ( y ) for the Detroit plant, the second difference is equal to (  0 +  2 ) -  0 =  2. Because  0 +  2 equals E ( y ) for the Detroit plant, the second difference is equal to (  0 +  2 ) -  0 =  2. We would conclude that there is no difference in the three means if  1 = 0 and  2 = 0. We would conclude that there is no difference in the three means if  1 = 0 and  2 = 0.

58 58 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n The null hypothesis for a test of the difference of means is H 0 :  1 =  2 = 0 n To test this null hypothesis, we must compare the value of MSR/MSE to the critical value from an F distribution with the appropriate numerator and denominator degrees of freedom.

59 59 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design Regression Error Total 490 308 798 2 12 14 245 25.667 Source of Variation Sum of Squares Degrees of Freedom MeanSquares 9.55 F ANOVA Table Produced by Excel ANOVA Table Produced by Excel p.003

60 60 Slide © 2005 Thomson/South-Western Multiple Regression Approach to Analysis of Variance and Experimental Design n At a.05 level of significance, the critical value of F with k – 1 = 3 – 1 = 2 numerator d.f. and n T – k = 15 – 3 = 12 denominator d.f. is 3.89. n Because the observed value of F (9.55) is greater than the critical value of 3.89, we reject the null hypothesis. Alternatively, we reject the null hypothesis because the p -value of.003 <  =.05. Alternatively, we reject the null hypothesis because the p -value of.003 <  =.05.

61 61 Slide © 2005 Thomson/South-Western End of Chapter 16


Download ppt "1 1 Slide © 2005 Thomson/South-Western AK/ECON 3480 M & N WINTER 2006 n Power Point Presentation n Professor Ying Kong School of Analytic Studies and Information."

Similar presentations


Ads by Google