Announcement

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

  • Error on running ppmlhdfe command

    Hi Statalists!

    I am trying to run a Poisson pseudo-likelihood regression to understand the impact of an intervention on the occurrence of juvenile crime. My initial investigation used the reghdfe command as follows:

    reghdfe youthcrime intervention, absorb(date) cluster(region)

    This produced output without any issue, but when I substitute the reghdfe command for the ppmlhdfe command, I get the following error message:
    always_run_lsmr_preconditioner not found in class FixedEffects
    (278 lines skipped)
    (error occurred while loading ppmlhdfe.ado)
    r(3000);

    I've done a bit of searching on Google and found that someone had older package dependencies that may have caused an issue. I have the following versions loaded:
    • ftools: version 2.48.0
    • reghdfe: version 6.12.1
    • ppmlhdfe: version 2.2.0
    Has anyone else had a similar issue that can advise on how they solved it?

    Thank you!

  • #2
    ppmlhdfe is from SSC (FAQ Advice #12). First test whether the command works on a publicly accessible dataset.

    Code:
    use "http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA" if category=="TOTAL", clear
    egen imp = group(isoimp)
    egen exp = group(isoexp)
    ppmlhdfe trade fta, a(imp#year exp#year imp#exp) cluster(imp#exp)
    Res.:

    Code:
    . ppmlhdfe trade fta, a(imp#year exp#year imp#exp) cluster(imp#exp)
    Iteration 1:   deviance = 3.3342e+09  eps = .         iters = 5    tol = 1.0e-04  min(eta) =  -3.58  P   
    Iteration 2:   deviance = 8.4785e+08  eps = 2.93e+00  iters = 5    tol = 1.0e-04  min(eta) =  -4.93      
    Iteration 3:   deviance = 4.4486e+08  eps = 9.06e-01  iters = 5    tol = 1.0e-04  min(eta) =  -6.27      
    Iteration 4:   deviance = 3.8460e+08  eps = 1.57e-01  iters = 4    tol = 1.0e-04  min(eta) =  -7.32      
    Iteration 5:   deviance = 3.7800e+08  eps = 1.74e-02  iters = 4    tol = 1.0e-04  min(eta) =  -8.38      
    Iteration 6:   deviance = 3.7738e+08  eps = 1.65e-03  iters = 3    tol = 1.0e-04  min(eta) =  -9.01      
    Iteration 7:   deviance = 3.7733e+08  eps = 1.29e-04  iters = 2    tol = 1.0e-04  min(eta) =  -9.30      
    Iteration 8:   deviance = 3.7733e+08  eps = 4.91e-06  iters = 2    tol = 1.0e-04  min(eta) =  -9.37      
    Iteration 9:   deviance = 3.7733e+08  eps = 3.03e-08  iters = 2    tol = 1.0e-05  min(eta) =  -9.39   S  
    Iteration 10:  deviance = 3.7733e+08  eps = 3.10e-12  iters = 2    tol = 1.0e-07  min(eta) =  -9.39   S  
    Iteration 11:  deviance = 3.7733e+08  eps = 0.00e+00  iters = 1    tol = 1.0e-09  min(eta) =  -9.39   S O
    ------------------------------------------------------------------------------------------------------------
    (legend: p: exact partial-out   s: exact solver   h: step-halving   o: epsilon below tolerance)
    Converged in 11 iterations and 35 HDFE sub-iterations (tol = 1.0e-08)
    
    HDFE PPML regression                              No. of obs      =      5,950
    Absorbing 3 HDFE groups                           Residual df     =      1,189
    Statistics robust to heteroskedasticity           Wald chi2(1)    =      21.04
    Deviance             =  377332502.3               Prob > chi2     =     0.0000
    Log pseudolikelihood = -188710931.7               Pseudo R2       =     0.9938
    
    Number of clusters (imp#exp)=      1,190
                                (Std. Err. adjusted for 1,190 clusters in imp#exp)
    ------------------------------------------------------------------------------
                 |               Robust
           trade |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
             fta |   .1924455   .0419527     4.59   0.000     .1102197    .2746713
           _cons |   16.45706   .0217308   757.32   0.000     16.41447    16.49965
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
        imp#year |       175           0         175     |
        exp#year |       175           5         170     |
         imp#exp |      1190        1190           0    *|
    -----------------------------------------------------+
    * = FE nested within cluster; treated as redundant for DoF computation
    
    .
    If so, then check what is peculiar with your dataset. If not, uninstall the command and all of its dependencies and then reinstall.

    Comment


    • #3
      Hi Andrew,

      Thank you for your message. I followed your advice to uninstall and reinstall the package and its dependencies, but this appears to be an environment-specific issue. I used the auto.dta dataset preloaded into Stata on both my personal computer and my office-based computer. I tested the following command in both environments:

      ppmlhdfe price mpg, a(rep78) cluster(weight)

      When running the ppmlhdfe command on my personal computer, it produces output as it should. When I replicate the command in Stata on my office computer, I get the error message mentioned above
      always_run_lsmr_preconditioner not found in class FixedEffects
      (278 lines skipped)
      (error occurred while loading ppmlhdfe.ado)
      r(3000);

      The versions of the package and its dependencies are as follows:
      1. On my personal computer:
        • ftools: version 2.37.0 16aug2019
        • reghdfe: version 5.7.3 13nov2019
        • ppmlhdfe: version 2.2.0 02aug2019
      2. On my office computer:
        • ftools: version 2.49.0 06may2022
        • reghdfe: version 6.12.2 02nov2021
        • ppmlhdfe: version 2.2.0 02aug2019
      If you have any further advice, I would be very grateful.

      Comment


      • #4
        Dear Janine Boshoff,

        Following up on Andrew's helpful advice, I suggest that you make sure you have an up-to-date version of Stata.

        Best wishes,

        Joao

        Comment

        Working...
        X