Announcement

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

  • ppmlhdfe error when no independent variable is included

    Dear STATA community,

    I run into error when I run ppmlhdfe with no independent variable. For example:

    Code:
    use "http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA" if category=="TOTAL", clear
    ppmlhdfe trade , absorb( isoexp isoimp )
    The error is:
    Code:
                      mean():  3301  subscript invalid
                GLM::solve():     -  function returned error
                     <istmt>:     -  function returned error
    r(3301);
    Does anyone else have the same problem? Any advice is much appreciated!

  • #2

    ppmlhdfe is a community-contributed command and requires the reghdfe and ftools packages, so make sure you have the latest versions installed. I am not able to reproduce your error using your code.

    Code:
    . 
    . use "http://fmwww.bc.edu/RePEc/bocode/e/EXAMPLE_TRADE_FTA_DATA" if category=="TOTAL", clear
    (Example gravity data for ppml_panel_sg (35 countries, 1988-2004, every 4 yrs))
    
    . 
    . ppmlhdfe trade , absorb( isoexp isoimp )
    Iteration 1:   deviance = 2.4136e+10  eps = .         iters = 5    tol = 1.0e-04  min(eta) =  -3.80  PS  
    Iteration 2:   deviance = 1.9549e+10  eps = 2.35e-01  iters = 3    tol = 1.0e-04  min(eta) =  -4.98   S  
    Iteration 3:   deviance = 1.9248e+10  eps = 1.56e-02  iters = 3    tol = 1.0e-04  min(eta) =  -5.89   S  
    Iteration 4:   deviance = 1.9242e+10  eps = 3.27e-04  iters = 3    tol = 1.0e-04  min(eta) =  -6.24   S  
    Iteration 5:   deviance = 1.9242e+10  eps = 2.04e-06  iters = 2    tol = 1.0e-04  min(eta) =  -6.28   S  
    Iteration 6:   deviance = 1.9242e+10  eps = 3.25e-10  iters = 2    tol = 1.0e-05  min(eta) =  -6.28   S  
    Iteration 7:   deviance = 1.9242e+10  eps = 1.33e-16  iters = 1    tol = 1.0e-07  min(eta) =  -6.28   S  
    Iteration 8:   deviance = 1.9242e+10  eps = 0.00e+00  iters = 1    tol = 1.0e-09  min(eta) =  -6.28   S O
    ------------------------------------------------------------------------------------------------------------
    (legend: p: exact partial-out   s: exact solver   h: step-halving   o: epsilon below tolerance)
    Converged in 8 iterations and 20 HDFE sub-iterations (tol = 1.0e-08)
    
    HDFE PPML regression                              No. of obs      =      5,950
    Absorbing 2 HDFE groups                           Residual df     =      5,881
                                                      Wald chi2(0)    =          .
    Deviance             =  1.92421e+10               Prob > chi2     =          .
    Log pseudolikelihood =  -9621117926               Pseudo R2       =     0.6861
    ------------------------------------------------------------------------------
                 |               Robust
           trade |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    -------------+----------------------------------------------------------------
           _cons |   16.07992   .0337047   477.08   0.000     16.01386    16.14598
    ------------------------------------------------------------------------------
    
    Absorbed degrees of freedom:
    -----------------------------------------------------+
     Absorbed FE | Categories  - Redundant  = Num. Coefs |
    -------------+---------------------------------------|
          isoexp |        35           0          35     |
          isoimp |        35           1          34     |
    -----------------------------------------------------+
    
    . 
    end of do-file
    
    . which ppmlhdfe 
    /Users/justinniakamal/Library/Application Support/Stata/ado/plus/p/ppmlhdfe.ado
    *! version 2.2.0 02aug2019
    *! Authors: Sergio Correia, Paulo GuimarĂ£es, Thomas Zylkin
    *! URL: https://github.com/sergiocorreia/ppmlhdfe
    Code:
    
    

    Comment


    • #3
      Thanks for letting me know! This is confusing--I upgraded ftools and reghdfe to the latest version, though the problem does not go away. Any idea what procedure I should follow to identify its cause? Thanks!

      Comment


      • #4
        I also have no problem with this. Did you also update Stata and ppmlhdfe?

        Comment


        • #5
          ppmlhdfe is the latest version. I'm using Stata/MP 14.0.

          Comment


          • #6
            Even using version control, I cannot replicate your problem. maybe Sergio Correia can help.

            Comment


            • #7
              I would that since ppmlhdfe depends on reghdfe and ftools, it might help if you update these two to their latest versions from Github (also, latest version of ppmlhdfe on github is 2.3.0 rather than 2.2.0)

              Comment

              Working...
              X