In the regression y = X1*b1 + X2*b2 + u, prove that b2 from the full fit equals the slope from regressing the residuals of y on X1 against the residuals of X2 on X1, and say what that buys you in a panel carrying 3,000 stock fixed effects.

In the regression y = X1*b1 + X2*b2 + u, prove that b2 from the full fit equals the slope from regressing the residuals of y on X1 against the residuals of X2 on X1, and say what that buys you in a panel carrying 3,000 stock fixed effects.

Approach: Apply the annihilator matrix of X1 to the full regression equation and use idempotence together with the orthogonality of the OLS residual to both blocks of regressors.

This is the Frisch-Waugh-Lovell theorem: b2 is the slope of M1*y on M1*X2, where M1 = I - X1*(X1'X1)^{-1}*X1' projects onto the orthogonal complement of the columns of X1. The normal equations give X1'u_hat = 0 and X2'u_hat = 0 for the full fit. Applying M1 to y = X1*b1 + X2*b2 + u_hat, and using M1*X1 = 0, leaves M1*y = M1*X2*b2 + M1*u_hat. Since M1 is symmetric and idempotent, regressing M1*y on M1*X2 has slope (X2'M1*X2)^{-1}*X2'M1*y, and the u_hat term drops because it is already orthogonal to both blocks, so the slope is exactly b2. Geometrically b2 is the coefficient on the part of X2 orthogonal to X1, so controlling for a variable means removing its span. With 3,000 stock fixed effects the payoff is that you never form the dummy matrix: demeaning y and X2 within each stock is precisely M1. Correct the degrees of freedom back down by the 3,000 absorbed parameters when computing standard errors.

Follow-up: You demean within stock and within day separately and iterate. Why does that converge to the two-way fixed effects estimator, and when does one pass fail?

Key concepts: Frisch-Waugh-Lovell theorem, projection matrix, orthogonal complement, fixed effects.