Announcement

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

  • xtreg fe, drop estimated constant in stored results?

    Hi,

    I have panel data (firmid, timeid) and want a table in latex (using esttab) with two model specifications as described below:

    i) "eststo: xtreg dep ind, fe"
    ii) "collapse dep ind, by(firmid)" followed by "eststo: reg dep ind".

    I want the table in latex to include the constant in (ii) but not in (i). Running "esttab , nocon" looses the constant in both.

    Is there a way to drop the estimated constant for the first specification so I can simply run "esttab"?

    Thanks!


  • #2
    Posting a working example of your code will improve the quality of answers, and -- since your questions concern user generated commands -- it is helpful to point out where you got them.

    It appears that the problem is that when you use esttab, nocon option esttab drops everything called _cons.

    The nocons option in reghdfe (from Correia http://scorreia.com/software/reghdfe/) makes this quite simple (The nocons option is not allowed with xtreg, fe.):
    Code:
    webuse nlswork, clear
    xtset idcode
    
    *Non working example xtreg doesn't allow nocons:
    eststo clear
    eststo: xtreg ln_w age ttl_exp tenure not_smsa south, fe // adding nocons here will give an error
    eststo: reg ln_w age ttl_exp tenure not_smsa south
    esttab , nocon
    esttab , drop(_cons)
    * reghdfe allows nocons
    eststo clear
    eststo: reghdfe ln_wage age ttl_exp tenure not_smsa south, absorb(idcode) nocons 
    eststo: reg ln_w age ttl_exp tenure not_smsa south
    esttab
    An alternative approach may be to use the esttab, rename() option with the esttab, drop() to change the name of the _cons produced by xtreg, fe and then drop that name. Maybe another commenter has experience with this approach.

    Related note: The coefficient _cons reported by xtreg, fe is not the "constant" in the same sense that the coefficient _cons reported by regress is. What xtreg reports is the average of all of the individual constants (the individual fixed effects). See https://www.stata.com/support/faqs/s...effects-model/

    Comment


    • #3
      Hi Arthur ~ a belated thanks for your reply. Both suggestions work great. The reghdfe package is actually perfect for my requirements.

      Ben

      Comment

      Working...
      X