Announcement

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

  • parentheses unbalanced for reghdfe

    Hi all,
    I want to do instrumental variable analysis using reghdfe. My syntax perfectly worked with Stata 17 but now with Stata 18 it gives me the parentheses unbalanced error. I could not find any online resources to fix the issue. Any help would appreciated. Here is my syntax

    reghdfe profit firm_age firm size i.year (ab =instrument), absorb(firmid) vce (cluster firmid) old stage (first)

  • #2
    I'm not sure there was ever a version of reghdfe that supported IV regression. Are you perhaps thinking of ivreghdfe? If you don't have it, you can install it from https://github.com/sergiocorreia/ivreghdfe.

    Comment


    • #3
      Under 7.4, the website states:
      The IV functionality of reghdfe has been moved into ivreghdfe.
      https://scorreia.com/help/reghdfe.html

      So I guess maybe you have used quite old syntax. Switching to ivreghdfe will resolve the issue.
      Best wishes

      Stata 18.0 MP | ORCID | Google Scholar

      Comment


      • #4
        Originally posted by Felix Bittmann View Post
        Under 7.4, the website states:

        The IV functionality of reghdfe has been moved into ivreghdfe.
        That being the case, one could use the -version()- option of reghdfe to run an IV regression. However, I still recommend using ivreghdfe, as the old version may contain bugs that were fixed in later updates. The following works for me:

        Code:
        webuse nlswork, clear
        reghdfe ln_w age c.age#c.age not_smsa (tenure = union south), absorb(id) version(3)
        Res.:

        Code:
        . reghdfe ln_w age c.age#c.age not_smsa (tenure = union south), absorb(id) version(3)
        (running historical version of reghdfe: 3)
        (dropped 673 singleton observations)
        (converged in 1 iterations)
        
        HDFE IV (2SLS) estimation
        -------------------------
        
        Estimates efficient for homoskedasticity only
        Statistics consistent for homoskedasticity only
        
                                                              Number of obs =    18334
                                                              F(  4, 14869) =    74.14
                                                              Prob > F      =   0.0000
        Total (centered) SS     =  1119.473248                Centered R2   =  -0.4975
        Total (uncentered) SS   =  1119.473248                Uncentered R2 =        .
        Residual SS             =  5907.007821                Root MSE      =    .6303
        
        ------------------------------------------------------------------------------
             ln_wage | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
        -------------+----------------------------------------------------------------
              tenure |   .2403531   .0373419     6.44   0.000     .1671583    .3135478
                 age |   .0118437   .0090032     1.32   0.188    -.0058037    .0294912
                     |
         c.age#c.age |  -.0012145   .0001968    -6.17   0.000    -.0016003   -.0008286
                     |
            not_smsa |  -.0167178   .0339236    -0.49   0.622    -.0832123    .0497767
        ------------------------------------------------------------------------------
        Underidentification test (Anderson canon. corr. LM statistic):          52.345
                                                           Chi-sq(2) P-val =    0.0000
        ------------------------------------------------------------------------------
        Weak identification test (Cragg-Donald Wald F statistic):               21.286
        Stock-Yogo weak ID test critical values: 10% maximal IV size             19.93
                                                 15% maximal IV size             11.59
                                                 20% maximal IV size              8.75
                                                 25% maximal IV size              7.25
        Source: Stock-Yogo (2005).  Reproduced by permission.
        ------------------------------------------------------------------------------
        Sargan statistic (overidentification test of all instruments):           1.691
                                                           Chi-sq(1) P-val =    0.1935
        ------------------------------------------------------------------------------
        Instrumented:         tenure
        Included instruments: age c.age#c.age not_smsa
        Excluded instruments: union south
        ------------------------------------------------------------------------------
        
        Absorbed degrees of freedom:
        ---------------------------------------------------------------+
         Absorbed FE |  Num. Coefs.  =   Categories  -   Redundant     | 
        -------------+-------------------------------------------------|
              idcode |         3461            3461              0     | 
        ---------------------------------------------------------------+
        
        .

        Comment

        Working...
        X