Part 5: Regression Algebra and Fit 5-1/34 Econometrics I Professor William Greene Stern School of Business Department of Economics.

Slides:



Advertisements
Similar presentations
Part 3: Least Squares Algebra 3-1/27 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Advertisements

1 Regression as Moment Structure. 2 Regression Equation Y =  X + v Observable Variables Y z = X Moment matrix  YY  YX  =  YX  XX Moment structure.
Managerial Economics in a Global Economy
Classical Linear Regression Model
General Linear Model With correlated error terms  =  2 V ≠  2 I.
The Simple Regression Model
Structural Equation Modeling
The Multiple Regression Model.
Brief introduction on Logistic Regression
Part 17: Nonlinear Regression 17-1/26 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Part 12: Asymptotics for the Regression Model 12-1/39 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Part 7: Estimating the Variance of b 7-1/53 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Simple Regression. Major Questions Given an economic model involving a relationship between two economic variables, how do we go about specifying the.
Regression Analysis Using Excel. Econometrics Econometrics is simply the statistical analysis of economic phenomena Here, we just summarize some of the.
The General Linear Model. The Simple Linear Model Linear Regression.
Lecture 3 Cameron Kaplan
Statistical Inference and Regression Analysis: GB Professor William Greene Stern School of Business IOMS Department Department of Economics.
Linear Methods for Regression Dept. Computer Science & Engineering, Shanghai Jiao Tong University.
Econ 140 Lecture 131 Multiple Regression Models Lecture 13.
1 Chapter 3 Multiple Linear Regression Ray-Bing Chen Institute of Statistics National University of Kaohsiung.
Multiple Regression Models
1 MF-852 Financial Econometrics Lecture 2 Matrix Operations in Econometrics, Optimization with Excel Roy J. Epstein Fall 2003.
So far, we have considered regression models with dummy variables of independent variables. In this lecture, we will study regression models whose dependent.
Chapter 11 Multiple Regression.
Ordinary least squares regression (OLS)
The Simple Regression Model
Part 18: Regression Modeling 18-1/44 Statistics and Data Analysis Professor William Greene Stern School of Business IOMS Department Department of Economics.
1 1 Slide © 2003 South-Western/Thomson Learning™ Slides Prepared by JOHN S. LOUCKS St. Edward’s University.
FIN357 Li1 The Simple Regression Model y =  0 +  1 x + u.
Lecture 19 Simple linear regression (Review, 18.5, 18.8)
Part 7: Multiple Regression Analysis 7-1/54 Regression Models Professor William Greene Stern School of Business IOMS Department Department of Economics.
Linear regression models in matrix terms. The regression function in matrix terms.
Regression Analysis British Biometrician Sir Francis Galton was the one who used the term Regression in the later part of 19 century.
Part 3: Regression and Correlation 3-1/41 Regression Models Professor William Greene Stern School of Business IOMS Department Department of Economics.
Objectives of Multiple Regression
Point set alignment Closed-form solution of absolute orientation using unit quaternions Berthold K. P. Horn Department of Electrical Engineering, University.
Discrete Choice Modeling William Greene Stern School of Business New York University.
Part 17: Regression Residuals 17-1/38 Statistics and Data Analysis Professor William Greene Stern School of Business IOMS Department Department of Economics.
Microeconometric Modeling William Greene Stern School of Business New York University.
GG 313 Geological Data Analysis Lecture 13 Solution of Simultaneous Equations October 4, 2005.
Multiple Regression I 1 Copyright © 2005 Brooks/Cole, a division of Thomson Learning, Inc. Chapter 4 Multiple Regression Analysis (Part 1) Terry Dielman.
Charles University FSV UK STAKAN III Institute of Economic Studies Faculty of Social Sciences Institute of Economic Studies Faculty of Social Sciences.
EXTRA SUMS OF SQUARES  Extra sum squares  Decomposition of SSR  Usage of Extra sum of Squares  Coefficient of partial determination.
Basic Business Statistics, 10e © 2006 Prentice-Hall, Inc. Chap 15-1 Chapter 15 Multiple Regression Model Building Basic Business Statistics 10 th Edition.
1 G Lect 4W Multiple regression in matrix terms Exploring Regression Examples G Multiple Regression Week 4 (Wednesday)
Université d’Ottawa / University of Ottawa 2001 Bio 8100s Applied Multivariate Biostatistics L11.1 Lecture 11: Canonical correlation analysis (CANCOR)
MathematicalMarketing Slide 5.1 OLS Chapter 5: Ordinary Least Square Regression We will be discussing  The Linear Regression Model  Estimation of the.
Econometrics III Evgeniya Anatolievna Kolomak, Professor.
Part 3: Least Squares Algebra 3-1/58 Econometrics I Professor William Greene Stern School of Business Department of Economics.
Lecture XXVII. Orthonormal Bases and Projections Suppose that a set of vectors {x 1,…,x r } for a basis for some space S in R m space such that r  m.
Estimating standard error using bootstrap
The simple linear regression model and parameter estimation
Statistical Inference and Regression Analysis: GB
Perturbation method, lexicographic method
Evgeniya Anatolievna Kolomak, Professor
The Simple Regression Model
Undergraduated Econometrics
Chengyuan Yin School of Mathematics
Some issues in multivariate regression
Statistical Inference and Regression Analysis: GB
Econometrics Chengyaun yin School of Mathematics SHUFE.
Econometrics Analysis
Econometrics Analysis
Econometrics I Professor William Greene Stern School of Business
Chengyuan Yin School of Mathematics
Econometrics I Professor William Greene Stern School of Business
Microeconometric Modeling
Econometrics I Professor William Greene Stern School of Business
Econometrics I Professor William Greene Stern School of Business
Econometrics I Professor William Greene Stern School of Business
Presentation transcript:

Part 5: Regression Algebra and Fit 5-1/34 Econometrics I Professor William Greene Stern School of Business Department of Economics

Part 5: Regression Algebra and Fit 5-2/34 Econometrics I Part 5 – Regression Algebra and Fit

Part 5: Regression Algebra and Fit 5-3/34 The Sum of Squared Residuals b minimizes ee = (y - Xb)(y - Xb). Algebraic equivalences, at the solution b = (XX) -1 Xy e’e = ye (why? e’ = y’ – b’X’ and X’e=0 ) (This is the F.O.C. for least squares.) ee = yy - y’Xb = yy - bXy = ey as eX = 0 (or e’y = y’e)

Part 5: Regression Algebra and Fit 5-4/34 Minimizing ee Any other coefficient vector has a larger sum of squares. A quick proof: d = the vector, not equal to b u = y – Xd = y – Xb + Xb – Xd = e - X(d - b). Then, uu = (y - Xd)(y-Xd) = [y - Xb - X(d - b)][y - Xb - X(d - b)] = [e - X(d - b)] [e - X(d - b)] Expand to find uu = ee + (d-b)XX(d-b) = e’e + v’v > ee

Part 5: Regression Algebra and Fit 5-5/34 Dropping a Variable An important special case. Suppose b X,z = [b,c] = the regression coefficients in a regression of y on [X,z] b X = [d,0] = is the same, but computed to force the coefficient on z to equal 0. This removes z from the regression. We are comparing the results that we get with and without the variable z in the equation. Results which we can show:  Dropping a variable(s) cannot improve the fit - that is, it cannot reduce the sum of squared residuals.  Adding a variable(s) cannot degrade the fit - that is, it cannot increase the sum of squared residuals.

Part 5: Regression Algebra and Fit 5-6/34 Adding a Variable Never Increases the Sum of Squares Theorem 3.5 on text page 38. u = the residual in the regression of y on [X,z] e = the residual in the regression of y on X alone, uu = ee – c 2 (z*z*)  ee where z* = M X z.

Part 5: Regression Algebra and Fit 5-7/34 The Fit of the Regression  “Variation:” In the context of the “model” we speak of covariation of a variable as movement of the variable, usually associated with (not necessarily caused by) movement of another variable.  Total variation = = yM 0 y.  M 0 = I – i(i’i) -1 i’ = the M matrix for X = a column of ones.

Part 5: Regression Algebra and Fit 5-8/34 Decomposing the Variation Recall the decomposition: Var[y] = Var [E[y|x]] + E[Var [ y | x ]] = Variation of the conditional mean around the overall mean + Variation around the conditional mean function.

Part 5: Regression Algebra and Fit 5-9/34 Decomposing the Variation of Vector y Decomposition: (This all assumes the model contains a constant term. one of the columns in X is i.) y = Xb + e so M 0 y = M 0 Xb + M 0 e = M 0 Xb + e. (Deviations from means. Why is M 0 e = e? ) yM 0 y = b(X’ M 0 )(M 0 X)b + ee = bXM 0 Xb + ee. (M 0 is idempotent and e’ M 0 X = e’X = 0.) Total sum of squares = Regression Sum of Squares (SSR)+ Residual Sum of Squares (SSE)

Part 5: Regression Algebra and Fit 5-10/34 A Fit Measure R 2 = bXM 0 Xb/yM 0 y (Very Important Result.) R 2 is bounded by zero and one only if: (a) There is a constant term in X and (b) The line is computed by linear least squares.

Part 5: Regression Algebra and Fit 5-11/34 Adding Variables  R 2 never falls when a z is added to the regression.  A useful general result

Part 5: Regression Algebra and Fit 5-12/34 Adding Variables to a Model What is the effect of adding PN, PD, PS,

Part 5: Regression Algebra and Fit 5-13/34 A Useful Result Squared partial correlation of an x in X with y is We will define the 't-ratio' and 'degrees of freedom' later. Note how it enters:

Part 5: Regression Algebra and Fit 5-14/34 Partial Correlation Partial correlation is a difference in R 2 s. For PS in the example above, R 2 without PS =.9861, R 2 with PS =.9907 ( ) / ( ) = / ( (36-5)) =.3314 (rounding)

Part 5: Regression Algebra and Fit 5-15/34 Comparing fits of regressions Make sure the denominator in R 2 is the same - i.e., same left hand side variable. Example, linear vs. loglinear. Loglinear will almost always appear to fit better because taking logs reduces variation.

Part 5: Regression Algebra and Fit 5-16/34

Part 5: Regression Algebra and Fit 5-17/34 (Linearly) Transformed Data  How does linear transformation affect the results of least squares? Z = XP for KxK nonsingular P  Based on X, b = (XX) -1 X’y.  You can show (just multiply it out), the coefficients when y is regressed on Z are c = P -1 b  “Fitted value” is Zc = XPP -1 b = Xb. The same!!  Residuals from using Z are y - Zc = y - Xb (we just proved this.). The same!!  Sum of squared residuals must be identical, as y-Xb = e = y-Zc.  R 2 must also be identical, as R 2 = 1 - ee/y’M 0 y (!!).

Part 5: Regression Algebra and Fit 5-18/34 Linear Transformation  Xb is the projection of y into the column space of X. Zc is the projection of y into the column space of Z. But, since the columns of Z are just linear combinations of those of X, the column space of Z must be identical to that of X. Therefore, the projection of y into the former must be the same as the latter, which now produces the other results.)  What are the practical implications of this result? Transformation does not affect the fit of a model to a body of data. Transformation does affect the “estimates.” If b is an estimate of something (  ), then c cannot be an estimate of  - it must be an estimate of P -1 , which might have no meaning at all.

Part 5: Regression Algebra and Fit 5-19/34 Principal Components  Z = XC Fewer columns than X Includes as much ‘variation’ of X as possible Columns of Z are orthogonal  Why do we do this? Collinearity Combine variables of ambiguous identity such as test scores as measures of ‘ability’  How do we do this? Later in the course. Requires some further results from matrix algebra.

Part 5: Regression Algebra and Fit 5-20/34 What is a Principal Component?  X = a data matrix (deviations from means)  z = Xp = linear combination of the columns of X.  Choose p to maximize the variation of z.  How? p = eigenvector that corresponds to the largest eigenvalue of X’X

Part 5: Regression Algebra and Fit 5-21/ | Movie Regression. Opening Week Box for 62 Films | | Ordinary least squares regression | | LHS=LOGBOX Mean = | | Standard deviation = | | Number of observs. = 62 | | Residuals Sum of squares = | | Standard error of e = | | Fit R-squared = | | Adjusted R-squared = | |Variable| Coefficient | Standard Error |t-ratio |P[|T|>t]| Mean of X| |Constant| *** | |LOGBUDGT| | |STARPOWR| | |SEQUEL | | |MPRATING| * | |ACTION | *** | |COMEDY | | |ANIMATED| ** | |HORROR | | 4 INTERNET BUZZ VARIABLES |LOGADCT |.29451** | |LOGCMSON| | |LOGFNDGO| | |CNTWAIT3| *** |

Part 5: Regression Algebra and Fit 5-22/ | Ordinary least squares regression | | LHS=LOGBOX Mean = | | Standard deviation = | | Number of observs. = 62 | | Residuals Sum of squares = | | Standard error of e = | | Fit R-squared = | | Adjusted R-squared = | |Variable| Coefficient | Standard Error |t-ratio |P[|T|>t]| Mean of X| |Constant| *** | |LOGBUDGT|.38159** | |STARPOWR| | |SEQUEL | | |MPRATING| | |ACTION | ** | |COMEDY | | |ANIMATED| * | |HORROR | | |PCBUZZ |.39704*** |

Part 5: Regression Algebra and Fit 5-23/34 Adjusted R Squared  Adjusted R 2 (for degrees of freedom?) = 1 - [(n-1)/(n-K)](1 - R 2 )  Degrees of freedom” adjustment suggests something about “unbiasedness.” The ratio is not unbiased.  includes a penalty for variables that don’t add much fit. Can fall when a variable is added to the equation.

Part 5: Regression Algebra and Fit 5-24/34 Adjusted R 2 What is being adjusted? The penalty for using up degrees of freedom. = 1 - [ee/(n – K)]/[yM 0 y/(n-1)] uses the ratio of two ‘unbiased’ estimators. Is the ratio unbiased? = 1 – [(n-1)/(n-K)(1 – R 2 )] Will rise when a variable is added to the regression? is higher with z than without z if and only if the t ratio on z is in the regression when it is added is larger than one in absolute value.

Part 5: Regression Algebra and Fit 5-25/34 Full Regression (Without PD) Ordinary least squares regression LHS=G Mean = Standard deviation = Number of observs. = 36 Model size Parameters = 9 Degrees of freedom = 27 Residuals Sum of squares = Standard error of e = Fit R-squared = <********** Adjusted R-squared = <********** Info criter. LogAmemiya Prd. Crt. = <********** Akaike Info. Criter. = <********** Model test F[ 8, 27] (prob) = 503.3(.0000) Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X Constant| ** PG| *** Y|.02214*** PNC| PUC| PPT| PN| * PS| *** YEAR| **

Part 5: Regression Algebra and Fit 5-26/34 PD added to the model. R 2 rises, Adj. R 2 falls Ordinary least squares regression LHS=G Mean = Standard deviation = Number of observs. = 36 Model size Parameters = 10 Degrees of freedom = 26 Residuals Sum of squares = Standard error of e = Fit R-squared = Was Adjusted R-squared = Was Variable| Coefficient Standard Error t-ratio P[|T|>t] Mean of X Constant| ** PG| *** Y|.02231*** PNC| PUC| PPT| PD| (NOTE LOW t ratio) PN| PS| ** YEAR| *

Part 5: Regression Algebra and Fit 5-27/34 Linear Least Squares Subject to Restrictions Restrictions: Theory imposes certain restrictions on parameters. Some common applications  Dropping variables from the equation = certain coefficients in b forced to equal 0. (Probably the most common testing situation. “Is a certain variable significant?”)  Adding up conditions: Sums of certain coefficients must equal fixed values. Adding up conditions in demand systems. Constant returns to scale in production functions.  Equality restrictions: Certain coefficients must equal other coefficients. Using real vs. nominal variables in equations. General formulation for linear restrictions: Minimize the sum of squares, ee, subject to the linear constraint Rb = q.

Part 5: Regression Algebra and Fit 5-28/34 Restricted Least Squares

Part 5: Regression Algebra and Fit 5-29/34 Restricted Least Squares Solution  General Approach: Programming Problem Minimize for  L = (y - X  )(y - X  ) subject to R  = q Each row of R is the K coefficients in a restriction. There are J restrictions: J rows   3 = 0: R = [0,0,1,0,…] q = (0).   2 =  3 : R = [0,1,-1,0,…]q = (0)   2 = 0,  3 = 0: R = 0,1,0,0,…q = 0 0,0,1,0,… 0

Part 5: Regression Algebra and Fit 5-30/34 Solution Strategy  Quadratic program: Minimize quadratic criterion subject to linear restrictions  All restrictions are binding  Solve using Lagrangean formulation  Minimize over ( , ) L* = (y - X  )(y - X  ) + 2(R  -q) (The 2 is for convenience – see below.)

Part 5: Regression Algebra and Fit 5-31/34 Restricted LS Solution

Part 5: Regression Algebra and Fit 5-32/34 Restricted Least Squares

Part 5: Regression Algebra and Fit 5-33/34 Aspects of Restricted LS 1. b* = b - Cm where m = the “discrepancy vector” Rb - q. Note what happens if m = 0. What does m = 0 mean? 2. =[R(XX) -1 R] -1 (Rb - q) = [R(XX) -1 R] -1 m. When does = 0. What does this mean? 3. Combining results: b* = b - (XX) -1 R. How could b* = b?

Part 5: Regression Algebra and Fit 5-34/34