Announcement

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

  • reghdfe -> Problem with two absorbed variables. "assert(): 3498 assertion is false"

    Hi everyone,


    I want to run a regression model where I absorb two levels of fixed effects. My real data is very large (around 2 million) but the problem also replicates with Stata smaller, built-in data. I am using Stata 17.0 on a Mac with M1 chip.


    Here is an illustration:
    Code:
     sysuse bplong.dta, clear
    This is my preferred specification and it does not work:
    Code:
     reghdfe bp when, absorb(sex agegrp)
    I get the following error message:
    ------------------------------------------------------------------------------------------
    assert(): 3498 assertion is false
    BipartiteGraph::init_zigzag(): - function returned error
    FixedEffects::estimate_dof(): - function returned error
    <istmt>: - function returned error
    ------------------------------------------------------------------------------------------

    However, all these specifications work (even though they should be practically equivalent)
    Code:
    reghdfe bp i.agegrp when, absorb(sex)
    reghdfe bp i.sex when, absorb(agegrp)
    reghdfe bp i.sex i.agegrp when, noabsorb
    So why don't I just use the specification that works? The version where both variables are "absorb"ed is considerably faster and gives me the desired calculation for the intercept.


    Does anyone have an idea why this error (3498) occurs and how it might solve the issue?

    Thank you very much for your help!


  • #2
    Michael:
    works for me:
    Code:
    . sysuse bplong.dta, clear
    (Fictional blood-pressure data)
    
    . reghdfe bp when, absorb(sex agegrp)
    (MWFE estimator converged in 2 iterations)
    
    HDFE Linear regression                            Number of obs   =        240
    Absorbing 2 HDFE groups                           F(   1,    235) =      12.27
                                                      Prob > F        =     0.0006
                                                      R-squared       =     0.2717
                                                      Adj R-squared   =     0.2593
                                                      Within R-sq.    =     0.0496
                                                      Root MSE        =    11.2606
    
    ------------------------------------------------------------------------------
              bp | Coefficient  Std. err.      t    P>|t|     [95% conf. interval]
    -------------+----------------------------------------------------------------
            when |  -5.091667   1.453733    -3.50   0.001    -7.955681   -2.227652
           _cons |   161.5417   2.298554    70.28   0.000     157.0133    166.0701
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
             sex |         2           0           2     |
          agegrp |         3           1           2     |
    -----------------------------------------------------+
    
    .
    Be sure all the stuff is updated.
    Kind regards,
    Carlo
    (Stata 19.0)

    Comment


    • #3
      Thank you very much, Carlo!!! Now it works.

      Here is what I tried:
      DID NOT WORK:
      - Re-installing reghdfe in Stata ("ssc install reghdfe, replace"); but apparently, that did not really update it, the problem still occured.
      - Un-installing reghdfe in Stata ("ssc uninstall reghdfe") brought the following error message: "criterion matches more than one package"

      DID WORK:
      1. I deleted all the reghdfe* files (reghdfe_accelrations... reghdfe_bipartite, ... there are around 20 subfiles) in the ado-folder (user... /stata/ado/plus/r) by hand
      2. I uninstalled ftools in Stata ("ssc uninstall ftools")
      3. I re-installed reghdfe ("ssc install reghdfe")

      Comment


      • #4
        Hi,

        I was having the same issue as Michael and was able to solve it by following his advice in #3 + the additional step of re-installing ftools ("ssc install ftools") after re-installing reghdfe.

        Comment


        • #5
          i have the same question, and i unstall then restall the command, but these did not work.

          Comment


          • #6
            Hualin:
            as reminded by the FAQ, sentences like "it does not work" (as expected) are not that helpful for those intrested in helping you out. Thanks.
            Kind regards,
            Carlo
            (Stata 19.0)

            Comment

            Working...
            X