Announcement

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

  • Differences between -xtpqml and -poi2hdfe and questions on post-estimation analysis for poi2hdfe

    Hello,

    I'm trying to run a PPML gravity model with country-pair and time fixed effects on a 10 year panel. The number of countries I am using (175/190) prevents me from using the -ppml command with my manually created dummies (matsize is limited to 11,000).

    I discovered -poi2hdfe which I believe should function the same as -ppml if identically specified. I likewise thought -xtpqml should return identical results if the regression converges.

    However I'm getting some strange results with -poi2hdfe which I can't figure out My code is the following. PT* are dummy variables. My "pairid" is my exporter*importer pairs. I am limiting my regression to just China (exporter == CHN)

    Code:
    poi2hdfe exports lgdp_exporter lgdp_importer PTgood_gov_exp PTgood_gov_imp PTbad_gov_exp PTbad_gov_imp if exporter == "CHN" , id1(pairid) id2(year)
    In my mind, this should return a value for lgdp_exporter, as China's gdp fluctuated within my 10 year panel. However I get the following:
    Code:
    Dropping 1 groups for pairid with a single observation
    
    Total Number of observations used in the regression -> 1855
    
    Starting Estimation of coefficients
    
    1 dif is -> 6244061
    2 dif is -> 1.6021985
    3 dif is -> 1.1138891
    4 dif is -> 1.3918957
    5 dif is -> .42605837
    6 dif is -> .23716472
    7 dif is -> .13974912
    8 dif is -> .0732805
    9 dif is -> .02254347
    10 dif is -> .01082417
    11 dif is -> .04080683
    12 dif is -> .00028351
    13 dif is -> 1.106e-06
    14 dif is -> 2.070e-11
    
    Coefficients converged after 14 reghdfe calls
    
    
     ******* Poisson Regression with Two High-Dimensional Fixed Effects **********
    
                                                      Number of obs   =       1855
    --------------------------------------------------------------------------------
                   |               Robust
           exports |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
    ---------------+----------------------------------------------------------------
     lgdp_exporter |          0  (omitted)
     lgdp_importer |   .6324759   .0501047    12.62   0.000     .5342725    .7306793
    PTgood_gov_exp |          0  (omitted)
    PTgood_gov_imp |    .068497   .0281072     2.44   0.015      .013408    .1235861
     PTbad_gov_exp |          0  (omitted)
     PTbad_gov_imp |  -.2380663   .0470217    -5.06   0.000    -.3302272   -.1459055
    --------------------------------------------------------------------------------




    Why is lgdp_exporter omitted? This is the log gdp of my exporter, China in this case, but it IS time varying. I don't get this result when I use -xtpqml though the other regression coefficients are nearly identical. I can post the output of that command if it interests anyone.

    Lastly,
    Code:
    estat
    doesn't appear to work for poi2hdfe. Is there any way to save residuals etc. in order to do a RESET, or Hausman test?

    Edit: Solved picture issue below
    SOLVED-PS: I checked the guide to see the best way to post output and couldn't find a better way than posting a picture. Am I missing something or is this standard?
    Attached Files
    Last edited by Cezary Baraniecki; 27 Jun 2018, 12:26.

  • #2
    Dear Cezary Baraniecki

    I believe that the variables for China are dropped because they are collinear with the time FE; the puzzle is why xtpqml does not drop it. Can you please post those results?

    Best wishes,

    Joao

    Comment


    • #3
      Hmm... it seems that I may have just forgotten to add time dummies to xtpqml as gdpexporter now drops (i've edited original post to add the output at the very bottom) . But the problem still exists for other runs done, with what I believe, should be the same specification of -xtpqml and -poi2hdfe.

      Consider the following, done on the same database but with other dependent variables (note i've only left robust results for clarity/space. I can post the full regression if it helps):

      Again, this is done on the same database. China's ("CHN") gdp is time-varying. "gov_imp" / "gov_exp" are governance scores (a component made from World Governance Indicators) which are also time-varying and country specific. My econometrics knowledge is not terribly advanced, but I don't think have a time dummy and a country-pair dummy should make time-varying country specific data to be perfectly colinear. But here "gov_exp" drops whereas lgdp_exporter stays. The only other odd thing I can note is that two (2) time dummies are dropped due to collinearity. In my mind, only one (1) should drop.

      Code:
      xtpqml exports lgdp_exporter lgdp_importer gov_imp gov_exp year_* if exporter == "CHN"  , fe i(pairid) cluster(pairid)
      Code:
      .
      note: you are responsible for interpretation of non-count dep. variable
      note: 1 group (1 obs) dropped because of only one obs per group
      note: gov_exp dropped because of collinearity
      note: year_1 dropped because of collinearity
      note: year_10 dropped because of collinearity
      
      Conditional fixed-effects Poisson regression    Number of obs      =      1842
      Group variable: pairid                          Number of groups   =       188
      
                                                      Obs per group: min =         4
                                                                     avg =       9.8
                                                                     max =        10
      
                                                      Wald chi2(11)      =  9.94e+08
      Log likelihood  = -1.402e+08                    Prob > chi2        =    0.0000
      
      -------------------------------------------------------------------------------
      
      -------------------------------------------------------------------------------
      Calculating Robust Standard Errors...
      -------------------------------------------------------------------------------
            exports |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      exports       |
      lgdp_exporter |   .3134428   .0323356     9.69   0.000     .2500662    .3768195
      lgdp_importer |   .6606657   .1001429     6.60   0.000     .4643892    .8569421
            gov_imp |   .1052808   .0468818     2.25   0.025     .0133941    .1971675
             year_2 |   .0272476   .0193626     1.41   0.159    -.0107024    .0651976
             year_3 |  -.1355452   .0155219    -8.73   0.000    -.1659676   -.1051228
             year_4 |   .0119779   .0162285     0.74   0.460    -.0198293    .0437852
             year_5 |   .0628282   .0231184     2.72   0.007     .0175171    .1081394
             year_6 |   .0784617   .0358336     2.19   0.029     .0082291    .1486943
             year_7 |   .1027708   .0526216     1.95   0.051    -.0003656    .2059073
             year_8 |   .1083588    .030498     3.55   0.000     .0485838    .1681337
             year_9 |   .0927698   .0099916     9.28   0.000     .0731865    .1123531
      -------------------------------------------------------------------------------
      Wald chi2(11) =  2046.44                                Prob > chi2 =   0.0000
      Now the poi2hdfe run that I thought should be the same. Note both lgdp_exporter and gov_exp drop:

      Code:
      poi2hdfe exports lgdp_exporter lgdp_importer gov_exp gov_imp if exporter == "CHN", id1(pairid) id2(year)  cluster(pairid)
      Code:
      Dropping 1 groups for pairid with a single observation
      
      Total Number of observations used in the regression -> 1842
      
      Starting Estimation of coefficients
      
      1 dif is -> 6308359.1
      2 dif is -> 1.4168923
      3 dif is -> 2.129642
      4 dif is -> 1.0574683
      5 dif is -> .44567978
      6 dif is -> .29660272
      7 dif is -> .12546297
      8 dif is -> .0521958
      9 dif is -> .0184021
      10 dif is -> .01087103
      11 dif is -> .00908004
      12 dif is -> .00072241
      13 dif is -> 4.953e-06
      14 dif is -> 6.201e-10
      
      Coefficients converged after 14 reghdfe calls
      
      
       ******* Poisson Regression with Two High-Dimensional Fixed Effects **********
      
                                                        Number of obs   =       1842
                                      (Std. Err. adjusted for 188 clusters in pairid)
      -------------------------------------------------------------------------------
                    |               Robust
            exports |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      --------------+----------------------------------------------------------------
      lgdp_exporter |          0  (omitted)
      lgdp_importer |   .6606657   .1004376     6.58   0.000     .4638116    .8575198
            gov_exp |          0  (omitted)
            gov_imp |   .1052808   .0470198     2.24   0.025     .0131237    .1974379
      -------------------------------------------------------------------------------
      
      .



      These are the results of xtpqml from the original post. Note that though lgdp_exporter drops, PTbad_gov_exp does not. This is a dummy that equal 1 if an exporter's governance score is 0.5 Standard deviations above the mean for the particular year. Therefore it is time varying. For the 10 year panel, China had 7 year of PT_bad_gov =1, and 3 with the score = 0. :

      Code:
       tab year if exporter == "CHN" & PTbad_gov_exp == 0
      
         Year |      Freq.     Percent        Cum.
      ------------+-----------------------------------
             2014 |        194       33.33       33.33
             2015 |        194       33.33       66.67
             2016 |        194       33.33      100.00
      ------------+-----------------------------------
            Total |        582      100.00


      Code:
       xtpqml exports lgdp_exporter lgdp_importer PTgood_gov_imp PTgood_gov_exp PTbad_gov_imp PTbad_gov_exp year_* if exporter == "CHN"  , fe i(pairid) cluster(pairid)
      where year_* are my 10 manually created time dummies.

      Code:
      note: you are responsible for interpretation of non-count dep. variable
      note: 1 group (1 obs) dropped because of only one obs per group
      note: lgdp_exporter dropped because of collinearity
      note: PTgood_gov_exp dropped because of collinearity
      note: year_7 dropped because of collinearity
      note: year_10 dropped because of collinearity
      
      Iteration 0:   log likelihood = -6.730e+08  
      Iteration 1:   log likelihood = -1.415e+08  
      Iteration 2:   log likelihood = -1.366e+08  
      Iteration 3:   log likelihood = -1.366e+08  
      Iteration 4:   log likelihood = -1.366e+08  
      
      Conditional fixed-effects Poisson regression    Number of obs      =      1855
      Group variable: pairid                          Number of groups   =       189
      
                                                      Obs per group: min =         4
                                                                     avg =       9.8
                                                                     max =        10
      
                                                      Wald chi2(12)      =  9.99e+08
      Log likelihood  = -1.366e+08                    Prob > chi2        =    0.0000
      
      
      --------------------------------------------------------------------------------
      Calculating Robust Standard Errors...
      --------------------------------------------------------------------------------
             exports |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
      ---------------+----------------------------------------------------------------
      exports        |
       lgdp_importer |   .6324759   .0822836     7.69   0.000     .4712031    .7937487
      PTgood_gov_imp |    .068497    .022149     3.09   0.002     .0250857    .1119083
       PTbad_gov_imp |  -.2380663   .0930333    -2.56   0.010    -.4204082   -.0557244
       PTbad_gov_exp |   .0589282   .0546755     1.08   0.281    -.0482338    .1660902
              year_1 |  -.4184588    .045753    -9.15   0.000    -.5081331   -.3287845
              year_2 |  -.3075528   .0530627    -5.80   0.000    -.4115538   -.2035517
              year_3 |  -.4483256   .0528852    -8.48   0.000    -.5519787   -.3446725
              year_4 |    -.23516   .0462987    -5.08   0.000    -.3259037   -.1444162
              year_5 |  -.1189985   .0357842    -3.33   0.001    -.1891342   -.0488628
              year_6 |  -.0596375   .0193573    -3.08   0.002    -.0975772   -.0216979
              year_8 |   .0923141   .0343583     2.69   0.007     .0249731    .1596552
              year_9 |   .0928407   .0123281     7.53   0.000      .068678    .1170034
      --------------------------------------------------------------------------------
      Wald chi2(12) =  2989.31                                Prob > chi2 =   0.0000
      Last edited by Cezary Baraniecki; 28 Jun 2018, 01:53.

      Comment


      • #4
        If there is any easier way I can post this information to make it legible or easier to compare, please let me know. I can post a picture of my out2feg file comparing the regressions. It's odd that the coefficients and standard errors are nearly identical save for the different in poi2hdfe dropping more variables than xtpqml. I suspect that is based on the random collinear time and country pair dummies that are dropped but that is outside of my econometrics knowledge.

        Comment


        • #5
          Dear Cezary Baraniecki,

          With just one exporter, the variables from the exporter are collinear with the time dummies and you can either drop them (as poi2hdfe does) or the equivalent number of time dummies (as in xtpqml). In any case, the coefficients on the exporter are not interpretable.

          Best wishes,

          Joao

          Comment

          Working...
          X