Announcement

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

  • Fixed-effects coefficients in areg, absorb(fe)

    How do I store the coefficients of the fixed-effects variables in the specification below?

    Code:
    areg depvar indepvar1 indepvar2, absorb(fe_var)
    And, if it's okay to ask aother question, what is the practical difference between "dresiduals" and "residuals" for this command?

  • #2
    The coefficients of indepvar1 and indepvar2 can be found in _b[indepvar1] and _b[indepvar2] respectively. You can store them in scalars or local macros. Or, if appropriate, you can create variables with these values. E.g.:
    Code:
    local coef1 = _b[indepvar1]
    scalar coef1 = _b[indepvar1]
    gen coef1_var = _b[indepvar1]
    As for the coefficients of fe_var, which you have absorbed, those are not calculated by -areg- and consequently cannot be accessed or stored.

    As for your second question. If you think of your linear regression equation y = xb + u + e, where u is the fixed effect, and e is the residual, the d_residual = y - xb, which is the same as u + e. After -areg-, you cannot separately get u and e, only their sum d_residual = u+e. So one of the differences between dresiduals and residuals for -areg- is that the former can be calculated and the latter cannot.

    N.B. If you need the residuals or the fixed effects themselves, don't use -areg-, use -xtreg, fe- instead.

    Comment

    Working...
    X