I need to implement the Frisch Waugh-Lovell-theorem in Stata 15 MP (64-bit) in the context of a research project. To illustrate my problem, I would like to abstract from my actual problem and focus on the following MWE. In the example, I'd like to show that the coeffcient on headroom can be obtained in two ways, either through a standard OLS estimation with two regressors in total or through partialling out of the first regressor, trunk.
Code:
sysuse auto2, clear * Multivariate regression reg price trunk headroom * Partialling out reg headroom trunk, vce(robust) predict double resid_x2, res reg price trunk predict double resid_y, res reg resid_y resid_x2
Thank you very much in advance.
0 Response to Standard errors using Frisch-Waugh-Lovell theorem
Post a Comment