Derivation of the Mean and Variance of a Linear Function
Total Page:16
File Type:pdf, Size:1020Kb
APPENDIX A Derivation of the Mean and Variance of a Linear Function Regression analysis is based on the use of linear functions. Indeed, the predicted value of the dependent variable in a regression model is a linear function of the values of the independent variables. As a result, it is possible to compute the mean and variance of the predicted value of the dependent variable directly from the means and variances of the independent variables in a regression equation. In vector nota- tion, the equation for the predicted value of the dependent variable, in the case of a multiple regression equation with two independent vari- ables, is given by: ~, = ua + Xlb I + x2b 2 Using this equation, it is a relatively simple matter to derive the mean of the predicted values of the dependent variable from the means of the independent variables, the regression coefficients for these vari- ables, and the intercept. To begin with, it will be recalled that the mean of a variable, using vector algebra, is given by: 1 Mean(~,) = -~- (u':~) The product of these two vectors in this equation can be simplified as follows: 192 APPENDtXA u'~ = u'(ua + xlb I + x2b 2) = u'ua + U'Xlb I + u'x2b 2 = Na + ~xub I + ~x2ib 2 = Na + bl~Xli + b2~x2i = Na + blN~ 1 + b2N~ 2 This quantity can be substituted into the equation for the mean of a variable such that: 1 1 Mean(~)) = ~-(u'~)= ~ (Na + blN~ 1 + b2Nx2) = a + bl~ 1 + b2~ 2 Therefore, the mean of the predicted value of the dependent variable is a function of the means of the independent variables, their regres- sion coefficients, and the intercept. The variance of the predicted value of the dependent variable can be derived in a similar manner. However, we can greatly simplify this derivation by introducing the assumption that both the dependent variable and the independent variables have means that are equal to zero. This simplifying assumption is of no real consequence because the variance of a variable, which is the average squared deviation from the mean, is unaffected by the value of the mean itself. Moreover, because of the manner in which the intercept is computed, the mean of the predicted value of the dependent variable will be equal to zero whenever the mean of the dependent variable is equal to zero. Consequently, the sum of squares of the predicted values of the dependent variable is given by: ss(y) = - - y) = = (Xlb I + x2b2)'(xlb I + x2b 2) = blX~(Xlb I + x2b 2) + b2x~(Xlb I + x2b 2) THE MEAN AND VARIANCE OF A LINEAR FUNCHON 193 = blX]Xlb 1 + blX~X2b 2 + b2x~xlb I + b2x~x2b 2 This equation can be simplified even further by noting the following equivalencies: b,x;xlb, = b x;xl = b2x[x2b x = b2x[x2 = b2y.x2 i blxlx2b 2 = b2X[Xlb I = bib2xlx 2 = blb2Y.xlix2i As a result, the sum of squares of the predicted values of the depen- dent variable is given by: SS(~) = b 2 Y~x2 + b 2y.x2i + 2bib 2 ~XliX2i Therefore, we can derive the variance of the predicted value of the dependent variable as follows: 1 2 2 Var(~) = (b2y.x 2) + ~(b2~'.x2i ) + 1 ~" 2(bib2 EXliX2i) -- 2i + 2 bl b21 E Xli x2i Of course, this equation can be reduced to a series of more familiar quantities as follows: Var(~) = b2Var(xl) + b2Var(x2) + 2blb2Cov(xl,x2) In other words, the variance of the predicted value of the dependent variable is a function of the regression coefficients of the independent variables, the variances of the independent variables, and the covari- 19 4 APPENDIXA ance between these independent variables. This equation can readily be expanded to obtain the variance of the predicted value of the dependent variable whenever there are more than two independent variables. For example, in the case of three independent variables, there are three terms involving the variances and regression coeffi- cients of each of these independent variables and three terms involv- ing the regression coefficients of these independent variables and the covariances between each pair of independent variables. Finally, it must be noted that this equation has a special interpreta- tion whenever all of the variables are expressed in standard form such that both the dependent and independent variables have variances that are equal to one. Specifically, in this case, the variance of the predicted values of the dependent variable is given by: Var(~y) = b~ 2 Var(zl) + b2 2 Var(z 2) + 2b~ b~Cov(zl,z2) = b~ 2 + b2 2 + 2b~b2r12 Moreover, it will be recalled that the coefficient of determination is equal to the ratio of the variance of the predicted value of the depen- dent variable to the variance of the observed value of that variable such that: R2.12 _ Var(~) _ Var(~.y) = Var(~y) Var(y) Var(Zy) = 2 + 2 + 2blb2 2 In short, the coefficient of determination can be computed directly from the standardized regression coefficients of the independent vari- ables and the correlations among these independent variables. APPENDIX B Derivation of the Least-Squares Regression Coefficient The derivation of the least-squares regression coefficient requires some familiarity with calculus. From a mathematical point of view, the main problem posed by regression analysis involves the estimation of a regression coefficient and an intercept that minimize some func- tion of the errors of prediction. The least-squares estimation proce- dure adopts a solution to this problem that is based on minimizing the sum of the squared errors of prediction. This criterion can be stated algebraically as follows: Minimize SS(e) = Ee~ = ~-~(Yi- ~i)2 where Yi = a + b x i Obviously, the values of the predicted scores and, therefore, the values of the errors of prediction are determined by the choice of a particu- lar intercept and regression coefficient. If we substitute this linear function for the predicted value of the dependent variable, the problem becomes one of finding the regres- sion coefficient, b, and the intercept, a, that minimize the following function: S(a,b) = ~(Yi - a - bxi) 2 19 6 APPENDIXB In order to minimize this function, we calculate the partial derivatives of both b and a using the chain rule of differentiation and the rule that the derivative of a sum is equal to the sum of the derivatives as follows: 3S o~---b = ~ 2 (Yi - a - bx i ) (-x i ) ~9S o3"-a = ~2(Yi- a - bxi)(-1) Performing the indicated multiplication, dividing both partial deriva- tives by -2, and setting them both equal to zero, we obtain: ~(--xiY i + bx? + axi) = 0 ~(-yi+bxi +a) = 0 Rearranging the terms in these equations, we obtain: b ~,x? - X~xiYi + a ~,x i = 0 aN - ~-.dYi + b ~,xi = 0 These equations can be greatly simplified if we assume, for the sake of simplicity and without loss of generality, that the independent variable, x, is expressed in mean deviation form such that: ~,x i = 0 Specifically, under this assumption, these equations reduce to: ~, xi Yi b= Xx? a = = N THE LEAST-SQUARESREGRESSION COEFFICIENT 19 7 If we divide both the numerator and the denominator of the equa- tion for b by N, we obtain the more familiar equation for the least- squares regression coefficient as the covariance of two variables divided by the variance of the independent variable: Cov(x,y) b = Var(x) Moreover, the equation for a, whenever the independent variable is expressed in mean deviation form, is simply a special case of the more general equation for the intercept such that: a=y-b~ where ~=0 This result obtains because the mean of any variable expressed in mean deviation form is zero. The least-squares intercept insures that the predicted value of the dependent variable is equal to the mean of the dependent variable whenever the independent variable is equal to its mean. This result is obvious if we simply rearrange the equation for the intercept as follows: y = a+ b~ These results were obtained using the simplifying assumption that the independent variable is expressed in mean deviation form. However, it can be demonstrated that this assumption is not necessary to obtain these equations. Indeed, the covariance between two variables and the variance of the independent variable are the same whether or not the independent variable is expressed in mean deviation form. APPENDIX C Derivation of the Standard Error of the Simple Regression Coefficient In order to test for the significance of a regression coefficient, we must be able to estimate its standard error. We begin with the generic equation for the simple regression coefficient as a ratio of the covari- ance between two variables to the variance of the independent variable such that: Cov(x,y) b - Var(x) For the sake of simplicity and without loss of generality, we shall assume that both the dependent variable, y, and the independent vari- able, x, are expressed in mean deviation form. First, we multiply both the numerator and the denominator of this equation by N, the number of cases, and simplify as follows: N C xy X xi Yi b = N s 2x Xx? This equation can be expressed somewhat differently such that: THE STANDARD ERROR OF THE SIMPLE REGRESSION COEFFICIENT 199 Consequently, the regression coefficient can be expressed as a sum of the weighted values of the dependent variable, y, as follows: b= Ewiy where xi w/= In other words, the simple regression coefficient is equal to a linear function of the values of the dependent variable in which each value of the dependent variable, y, is multiplied by the ratio of the value of the corresponding independent variable, x, to its sum of squares.