Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Standard errors using Frisch-Waugh-Lovell theorem

    Hi,
    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
    ​​​​​​
    My trivial question is: Why are the standard errors of the variable headroom from the multiple regression and the standard error of the partialled out coeffcient on headroom not exactly equal? The coeffcients themselves correspond (which I wanted to see), however, I seem to not understand this procedure properly, since actually also the standard errros should correspond, right? Where am I not seeing the mistake?

    Thank you very much in advance.

  • #2
    Hi Carlo
    The simple answer its "Degrees of freedom". In the original regression "reg price trunk headroom" you have 3 degrees of freedom (constant plus to slope coefficients). In the second regression "reg resid_y resid_x2" you should have also 3 degrees of freedom, but Stata counts only what it sees (2 degrees of Freedom).
    Detrending or partialling out a variable "absorbs" its effect in preliminary steps, which means you are already using some degrees of freedom. In other words you need to take into count how many degree of freedom were lost when estimating the second step standard errors.
    HTH
    Fernando

    Comment


    • #3
      Almost everything is the same in the full length, and in the partial out regression: , the parameter estimates, the residuals, the residual sum of squares, the corresponding element in the X'X inverted matrix.

      There is difference in the degrees of freedom. FWL regression counts incorrectly N-1 degrees of freedom, while the long regression correctly counts the degrees of freedom as N-3.

      The difference in the standard errors comes from this degrees of freedom difference.

      Comment


      • #4
        Of course,.. Thanks guy. Now the question is: Can I circumvent this manually somehow so that I obtain exactly the same SEs through the FWL regression? Thanks in advance.

        Comment


        • #5
          The circumvention is explicit in the explanation of the issue.

          If you want to get the same standard errors in the partialled out regression as in the long regression, in the partialled out regression you use the formula for the variance
          [(Sum Squared Residuals)/(N-3)]*inverted(X'X).

          Comment


          • #6
            Here is the calculation. Note that in your original partialling out, the partialled out regression strictly speaking has to be without a constant, because you are partialling out the constant too by what you are doing.

            Code:
            . reg price trunk headroom, noheader
            ------------------------------------------------------------------------------
                   price |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                   trunk |   292.7992   102.7519     2.85   0.006     87.91765    497.6808
                headroom |  -580.8342   519.5205    -1.12   0.267    -1616.729    455.0602
                   _cons |   3875.867    1270.02     3.05   0.003     1343.519    6408.215
            ------------------------------------------------------------------------------
            
            . reg resid_y resid_x2, nocons noheader
            ------------------------------------------------------------------------------
                 resid_y |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
            -------------+----------------------------------------------------------------
                resid_x2 |  -580.8342   512.3543    -1.13   0.261    -1601.955    440.2865
            ------------------------------------------------------------------------------
            
            . dis sqrt(73/71)*_se[resid_x2]
            519.52047
            
            .

            Comment


            • #7
              Very helpful, thank you very much!

              Comment

              Working...
              X