Announcement

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

  • _regress, absorb() and other options?

    I am trying to reap the benefits of _regress, absorb() being faster than areg, as mentioned here and here. However, I can't figure out which options _regress allows. From the source file of areg, _regress seems to allow weights, if qualifiers and the absorb() option:

    Code:
    * from viewsource areg.ado
    Code:
      _regress `varlist' [`weight'`exp'] if `touse', absorb(`absorb')  noheader notable `mse1'


    However, I have noted that different combinations of options work, while others don't. Here's an example:

    Code:
    sysuse auto, clear
    gen w=uniform()
    egen cluster=cut(price), group(3)
    * Options absorb, cluster pw and aw
    
    * 1. Separately 
    * 1.1 Works
    _regress price weight, absorb(foreign)
    * 1.2 Works
    _regress price weight, cluster(cluster)
    * 1.3 Works
    _regress price weight [aw=w]
    * 1.4 Works
    _regress price weight [pw=w]
    
    * 2. Absorb and others
    
    * 2.1 Doesn't work
    cap nois _regress price weight, absorb(foreign) cluster(cluster)
    * 2.2 Works
    _regress price weight [aw=w], absorb(foreign)
    * 2.3 Doesn't work
    cap nois _regress price weight [pw=w], absorb(foreign)
    
    * 3. Cluster and others
    * Works
     _regress price weight [aw=w], cluster(cluster)
    * Works
     _regress price weight [pw=w], cluster(cluster)
    
    * 4. All together
    * Doesn't work
    cap nois _regress price weight [aw=w], absorb(foreign) cluster(cluster)
    * Doesn't work
    cap nois _regress price weight [pw=w], absorb(foreign) cluster(cluster)
    
    * areg works
    areg price weight [pw=w], absorb(foreign) cluster(cluster)


    So apparently _regress, absorb() does not work in conjuction with pweights or cluster(). The error message is uninformative. I have confirmed this behavior in both Stata 12.1 and 13.1. areg allows all the options and works correctly.

    Does anyone know why some combinations of options work and others don't? My application requires fixed effects, pweights and clustering. Does anyone have a suggestion on how can I use
    _regress, absorb in this case?

    Thank you,


    Jorge Eduardo Pérez Pérez
    www.jorgeperezperez.com

  • #2
    Hi Jorge,

    As far as I can tell, and as you pointed out, -_regress- does not support clusters with the absorb option (you can see the details with "viewsource areg.ado").
    Now, with Stata 13 there are some inefficiencies in the areg/xtreg code with clusters that have been fixed with Stata 14, so if you have the newer version then running -areg- would be enough for you.

    If -areg- is too slow or you are doing something more complex (two-way clustering, multiple fixed effects, etc.) then I would advice for -reghdfe-

    Best,
    Sergio

    Comment

    Working...
    X