Announcement

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

  • ppmlhdfe error

    I am currently trying to estimate the following regression specification with the ppmlhdfe command developed by Correia, Guimarães and Zylkin.:

    Code:
    ppmlhdfe trade EMU_INTL non_EMU_cu_INTL RTA_INTL if exporter != importer, ///
    absorb(EXPORTER_TIME_FE* IMPORTER_TIME_FE* PAIR_FE*) cluster(pair_id) ///
    estimates store ppml_11
    Here, trade includes count data on international- and intra-national trade flows, EMU_INTL is a dummy variable indicating common membership in the European Monetary Union, non_EMU_cu is a dummy for common membership in a non-EMU currency union, and RTA_INTL is a dummy, which is set to one for international trade flows among mebers, and is zero otherwise. Additionally, I added a set of exporter-time fixed effects, importer-time fixed effects and dyadic country-pair fixed effects. This is my baseline specification which I want to enhance with more variables in the following.

    However, when I run the model, I receive the following error message:

    Code:
    (warning: absorbing 9120 dimensions of fixed effects; check that you really want that)
    (dropped 239 observations that are either singletons or separated by a fixed effect)
              Factor::sort():  3900  unable to allocate real <tmp>[120790,1]
    FixedEffects::update_sorted_weights():     -  function returned error
    FixedEffects::load_weights():     -  function returned error
             fixed_effects():     -  function returned error
    GLM::init_fixed_effects():     -  function returned error
                     <istmt>:     -  function returned error
    r(3900);
    
    end of do-file
    
    r(3900);
    I have absolutely no clue what could be the reason for this error and would be grateful for any recommendations. In case it is helpful, here is additional information on how I installed the command...

    Code:
    cap ado uninstall ftools
    cap ado uninstall reghdfe
    cap ado uninstall ppmlhdfe
    cap ado uninstall estout
    
    ssc install ftools // necessary for ppmlhdfe
    ssc install reghdfe // necessary for ppmlhdfe  
    ssc install ppmlhdfe // as developed by Correia et al. (2019)
    ssc install estout // export estimates to text format
    
    clear all
    ftools, compile
    reghdfe, compile
    ... how I created the fixed effects ...

    Code:
    egen exp_time = group(exporter year)  
    quietly tabulate exp_time, generate(EXPORTER_TIME_FE)  
      
    egen imp_time = group(importer year)  
    quietly tabulate imp_time, generate(IMPORTER_TIME_FE)
    
    egen pair_id = group(exporter importer)
    quietly tabulate pair_id, generate(PAIR_FE)
    ... and my output after tsset

    Code:
    . tsset pair_id year
    panel variable: pair_id (unbalanced)
    time variable: year, 1993 to 2014, but with gaps
    delta: 1 unit
    ​​​​​​​
    Does the panel maybe need to be balanced for the ppmlhdfe? I though that missing entries are omitted automatically...
    Last edited by Noah Daniel; 27 Apr 2021, 08:43.
    Kind regards,
    Noah
    (Stata 16.1 SE)

  • #2
    Dear Noah Daniel,

    I am sure Tom Zylkin will be able to provide a better answer, but I guess the problem is that you are including in the absorb option dummy variables for the fixed effects, when you should just include the variables identifying the groups. For example, instead of PAIR_FE you should include pair_id.

    Best wishes,

    Joao

    Comment


    • #3
      Hi Noah Daniel ,

      I echo what Joao said. Fixing this should get rid of the warning saying you are absorbing 9120 FE dimensions. Given the problem, what you really want is for there to be 3 FE dimensions: exporter-time, importer-time, and pair. Given your variable definitions, you would put "absorb(exp_time imp_time pair_id)" in place of what you have.

      In answer to your other question, there is no need for the panel to be balanced.

      Hope this helps!

      Regards,
      Tom

      Comment


      • #4
        Dear Joao Santos Silva and Tom Zylkin,

        thank you very much for your help! Changing the code to "absorb(exp_time imp_time pair_id)" worked perfectly.
        Kind regards,
        Noah
        (Stata 16.1 SE)

        Comment

        Working...
        X