Announcement

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

  • fixed effects and constant estimates

    Dear All, Does anyone know the relationship among the following commands? I mean how can we adjust the regressions so that they provide the same "constants", and "fixed effect estimates".
    Code:
    webuse grunfeld, clear
    xtset company year
    // 1
    xtreg invest mvalue kstock, fe
    // 2 (install reghdfe)
    reghdfe invest mvalue kstock, a(company)
    // 3
    areg invest mvalue kstock, a(company)
    // 4
    reg invest mvalue kstock i.company
    Ho-Chuan (River) Huang
    Stata 19.0, MP(4)

  • #2
    I discuss in #2 the relationship between dummy coefficients from LSDV (regress) and predicted fixed effects from the within estimator (xtreg): https://www.statalist.org/forums/for...cts-with-xtreg

    Comment


    • #3
      Dear Andrew, Thanks a lot, and wish to see more on this topic.
      Ho-Chuan (River) Huang
      Stata 19.0, MP(4)

      Comment


      • #4
        This is not a very interesting topic, because in fixed effects regressions the within transformation wipes out the constant. So there is no constant in fixed effects regressions.

        The constants that you see in different commands are just fabrications, and it is no good use of your time to dig into how different authors have decided to fabricate something that does not in principle exist.

        Comment


        • #5
          Dear Joro, I agree with your comments. My question (actually from someone else) is of no practical use (I am also aware of that). In the old days (say, twenty years ago), there is no constant term in the panel data model. However (I don't know since when), Stata reports constant term, and there are many students bothered by this knid of question. My purpose is to show them that the results (from reg, areg, reghdfe, and xtreg) are basically equivalent, depending on how to extract the constant and probably how to drop the fixed effects dummies.
          Ho-Chuan (River) Huang
          Stata 19.0, MP(4)

          Comment


          • #6
            I don’t have a compute at hand , but, areg and reghdfe implicitly impose the restriction that all fixed effects add up to zero , and the constant does not represent any base group
            for regression and dummies the constant is a specific group constant

            Comment


            • #7
              River, as Fernando said in #6, -xtreg, fe-, -reghdfe-, and -areg- all assume zero-mean fixed effects, and there must be a constant term to complete the linear model. You may derive an equivalent constant estimate from model 4 as below.

              Code:
              reg invest mvalue kstock i.company
              margins, at(mvalue=0 kstock=0)
              ADD: It's a bit odd, but you may technically obtain the same constant estimate in model 4 after demeaning the company dummies.

              Code:
              forvalues i = 1/10 {
                  egen m_company_`i' = mean(`i'.company)
                  gen dm_company_`i' = `i'.company - m_company_`i'
              }
              reg invest mvalue kstock dm_company_*
              Last edited by Fei Wang; 17 Jul 2022, 08:13.

              Comment


              • #8
                Dear Fei, Many thanks for this extra explanation. It is helpful.
                Ho-Chuan (River) Huang
                Stata 19.0, MP(4)

                Comment

                Working...
                X