Announcement

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

  • Areg dummy coefficient interpretation

    I recently switched from Stata to Python for one project.
    However, I found that the areg function was much faster than just adding dummies in a Python regression. After a bit of research, I found that areg is not actually using dummies, but subtracting group means (this is why it is so fast also with many groups). You can test this by the following code:

    sysuse auto, clear
    drop if missing(rep78)
    foreach var of varlist price weight length foreign {
    bys rep78: egen group_mean = mean(`var')
    qui sum `var'
    gen double `var'_star = `var' - group_mean + r(mean)
    drop group_mean
    }
    reg price_star weight_star length_star foreign_star


    It will lead to the same result as

    areg price weight length foreign , absorb(rep78)

    My question is now:
    When I manually transform dummy variables, they will not be binary anymore! (foreign vs. foreign_star)
    Can I then still interpret their coefficients as I am used to in a "normal" regression without transformation?

    Thank you

  • #2
    This was a "hot" topic in the 1930's... not so much today! You will find the following paper an interesting read

    http://www.sv.uio.no/econ/om/tall-og...ks/rf1933f.pdf

    Comment


    • #3
      Thank you Andrew!
      I just started reading, but it seems that the paper deals with a slightly different topic, no?

      Comment


      • #4
        It may look different but it is the same. What you are running is a fixed effects regression where in Python, you were estimating the model using least squares dummy variables (LSDV). In Stata, you can also do this as follows

        Code:
        regress price weight length foreign i.rep78

        If you write it algebraically, you can show that the estimated betas of the time-varying regressors in the first model (including time-varying dummies) are the same as those of the model using demeaned variables. So what is different is the estimation method but the interpretation of the coefficients remains the same.

        .
        Last edited by Andrew Musau; 21 Jun 2018, 07:30.

        Comment

        Working...
        X