Announcement

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

  • ppml with high fixed effects

    Hi, everyone! I am an undergraduate student who is researching for his thesis about international trade. I am estimating a gravity model about non-tariff measures. I am using ppml estimator for this purpose, but I have some problems with it. I'm estimating a cross-sectional gravity equation for a sample of 50 countries and 21 HS sectors (260 000 observations) with fixed effects for each of them (country-specific and sector), but when I'm running my regression, the PPML method doesn't give me a result table (it doesn't find a max. valor after 100 iterations). I was wondering if the problem is the high level of fixed effects, so maybe i should tried the ppmlhdfe estimator, but i'm no sure. Any idea about what is happening with my model?
    I attach my regression code.

    ppml exportaciones lnPBI_partner lnPBI_reporter lnDistancia frontera lenguaje colonia ALC mediterraneo arancel_NMF MNA_dummy exp_dum_* imp_dum_* seccion_dum_*, cluster(distancia)

  • #2
    There are two questions here.
    1. Why doesn't the model converge?
    2. Will ppmlhdfe help with the fixed effect?
    This discussion will likely help you as well: Non-Convergence in PPML Gravity Model
    Last edited by Arthur Morris; 04 May 2020, 23:29. Reason: punctuation

    Comment


    • #3
      Hi, Arthur! Thanks for your answer! Here I show my dataset and code which I'm working. As can you see, my dataset has a very large number of zeros and dummy variables (common in gravity models). The fixed effects cannot be shown because they are too large (77 dummy variables for fixed effects).
      On the other hand, the Non-convergence in PPML Gravity Model is not an available discussion.
      Do you have any idea about what is happening with my model?

      Code:
      * Example generated by -dataex-. To install: ssc install dataex
      clear
      input float(exportaciones lnPBI_partner lnPBI_reporter lnDistancia) byte(frontera lenguaje colonia) float(ALC mediterraneo) double arancel_NMF float MNA_dummy
          0 25.98022  26.60113 9.599132 0 0 0 0 0  0 1
      14500 25.98022 27.046785 8.050041 0 1 1 1 0  0 1
          0 25.98022  27.82069 9.461967 0 0 0 0 0  0 1
          0 25.98022 26.888803 9.255773 0 0 0 1 0  0 1
          0 25.98022 24.698093 9.373185 0 0 0 1 0  0 1
          0 25.98022  24.24789 7.302307 1 1 1 1 1  5 1
          0 25.98022 28.216736 8.062002 1 0 0 1 0  0 1
          0 25.98022  28.05413 8.764576 0 0 0 1 0  0 1
          0 25.98022 27.232494 9.267222 0 0 0 1 1  . 1
          0 25.98022 26.246086 7.811424 1 1 1 1 0  6 1
          0 25.98022  30.04138 9.721144 0 0 0 1 0  0 1
          0 25.98022 26.368093 7.536521 1 1 1 1 0  5 1
          0 25.98022 24.769085 7.854549 0 1 1 1 0  0 0
          0 25.98022  28.87425 9.315981 0 0 0 1 0  0 1
          0 25.98022  26.46984 9.315016 0 0 0 1 0  0 1
          0 25.98022 25.050106 8.159926 0 1 1 0 0  0 0
       8800 25.98022  25.32781 7.193254 1 1 1 1 0 15 0
          0 25.98022  27.83972 9.161314 0 1 1 1 0  0 1
          0 25.98022  26.20628 9.380038 0 0 0 1 0  0 1
          0 25.98022  28.53576 9.236798 0 0 0 1 0  0 1
      end

      Code:
       ppml exportaciones lnPBI_partner lnPBI_reporter lnDistancia frontera lenguaje colonia ALC mediterraneo arancel_NMF MNA_dummy exp_dum_* imp_dum_*, cluster(distancia)

      Comment


      • #4
        Hi Juan,
        It takes a long time to compute estimates for dummy variables if you have a lot of them. Try ppmlhdfe:

        HTML Code:
        ppmlhdfe exportaciones lnPBI_partner lnPBI_reporter lnDistancia frontera lenguaje colonia ALC mediterraneo arancel_NMF MNA_dummy, a(exp_id imp_id) cluster(distancia)
        This assumes you have a variable called "exp_id" that uniquely identifies the exporter and another called "imp_id" that uniquely identifies the importer. Also, does your data span multiple years? If so, at a minimum, you should also include a time fixed effect.

        Regards,
        Tom

        Comment


        • #5
          Thanks for your reply, Tom!
          I run the code that you recommend and I got results. However, the results that I got with the ppmlhdfe are not satisfactory: multiples variables of my cross-sectional gravity model have been eliminated because of collinearity. I only have 2 variables (arancel_NMF and MNA_dummy) out of 10. Do you have any idea about what is happening?

          Comment


          • #6
            Hi Juan,
            I would need to know a bit more about your data to answer. How many exporters and importers do you have? If you have at least 2 exporters and at least 2 importers, you should be able to identify the effect of log distance at the very least.
            Regards,
            Tom

            Comment


            • #7
              Hi Tom,

              I have 50 importer countries from Peruvian exports (so, I have only one exporter). I could solve my problem using only ppml command with dummies for fixed effects (ppmlhdfe is for multiple fixed effects such as more than 1000). However, I have other problems with ppml estimation. When I applied the RESET test for robustness check with OLS estimations, the Null Hypothesis is rejected which is a mistake because, as Santos Silva & Tenreyro (2006) shows, only the PPML estimation should reject this one.
              I attach my results using OLS and PPML estimations on augmented gravity model.

              This is the outcome using OLS estimations and RESET test using its results.

              Code:
               reg lnExportaciones lnDistancia frontera lenguaje colonia ALC mediterraneo ln_arancel MNA_dummy exp_dum_* imp_dum_* seccion_dum_*, ro
              > bust cluster(distancia)
              note: lenguaje omitted because of collinearity
              note: exp_dum_1 omitted because of collinearity
              note: imp_dum_5 omitted because of collinearity
              note: imp_dum_6 omitted because of collinearity
              note: imp_dum_7 omitted because of collinearity
              note: imp_dum_9 omitted because of collinearity
              note: imp_dum_25 omitted because of collinearity
              note: imp_dum_39 omitted because of collinearity
              note: seccion_dum_15 omitted because of collinearity
              
              Linear regression                               Number of obs     =     22,968
                                                              F(21, 49)         =          .
                                                              Prob > F          =          .
                                                              R-squared         =     0.1083
                                                              Root MSE          =     3.1238
              
                                             (Std. Err. adjusted for 50 clusters in distancia)
              --------------------------------------------------------------------------------
                             |               Robust
              lnExportacio~s |      Coef.   Std. Err.      t    P>|t|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
                 lnDistancia |  -.2998416   .0685826    -4.37   0.000    -.4376635   -.1620197
                    frontera |   .6653672   .1170468     5.68   0.000     .4301529    .9005815
                    lenguaje |          0  (omitted)
                     colonia |   2.121283   .0539995    39.28   0.000     2.012767    2.229799
                         ALC |   1.440475   .0598281    24.08   0.000     1.320246    1.560704
                mediterraneo |  -1.996203   .0786285   -25.39   0.000    -2.154212   -1.838193
                  ln_arancel |  -.0855022    .043193    -1.98   0.053    -.1723018    .0012975
                   MNA_dummy |   .0311182   .1154152     0.27   0.789    -.2008173    .2630536
                   exp_dum_1 |          0  (omitted)
                   imp_dum_1 |   .6857985   .0435804    15.74   0.000     .5982204    .7733766
                   imp_dum_2 |  -1.615787   .1637222    -9.87   0.000    -1.944799   -1.286775
                   imp_dum_3 |   1.043826   .0463143    22.54   0.000     .9507542    1.136898
                   imp_dum_4 |   .2572804   .0682895     3.77   0.000     .1200474    .3945133
                   imp_dum_5 |          0  (omitted)
                   imp_dum_6 |          0  (omitted)
                   imp_dum_7 |          0  (omitted)
                   imp_dum_8 |   -.659314   .0683305    -9.65   0.000    -.7966293   -.5219986
                   imp_dum_9 |          0  (omitted)
                  imp_dum_10 |  -2.074721   .0758223   -27.36   0.000    -2.227092    -1.92235
                  imp_dum_11 |   1.419923   .0729906    19.45   0.000     1.273243    1.566603
                  imp_dum_12 |   -2.10325   .1012643   -20.77   0.000    -2.306749   -1.899752
                  imp_dum_13 |  -2.478621    .091669   -27.04   0.000    -2.662837   -2.294405
                  imp_dum_14 |   -.127389   .0653746    -1.95   0.057    -.2587642    .0039862
                  imp_dum_15 |   .0927774   .0639727     1.45   0.153    -.0357806    .2213353
                  imp_dum_16 |  -.5920855   .0589754   -10.04   0.000     -.710601   -.4735701
                  imp_dum_17 |  -1.848416   .0980064   -18.86   0.000    -2.045368   -1.651465
                  imp_dum_18 |  -2.307547    .094996   -24.29   0.000    -2.498448   -2.116645
                  imp_dum_19 |  -1.446503   .0709078   -20.40   0.000    -1.588997   -1.304008
                  imp_dum_20 |  -.8376343   .0534267   -15.68   0.000    -.9449993   -.7302693
                  imp_dum_21 |   .1184033   .0528089     2.24   0.030     .0122799    .2245267
                  imp_dum_22 |  -.7777943   .0674378   -11.53   0.000    -.9133156   -.6422731
                  imp_dum_23 |   1.969916   .0995804    19.78   0.000     1.769802    2.170031
                  imp_dum_24 |  -.9649846   .0676121   -14.27   0.000    -1.100856   -.8291129
                  imp_dum_25 |          0  (omitted)
                  imp_dum_26 |   1.961194   .0752227    26.07   0.000     1.810028    2.112359
                  imp_dum_27 |   2.315353   .0947973    24.42   0.000     2.124851    2.505855
                  imp_dum_28 |  -.0137991   .0524735    -0.26   0.794    -.1192486    .0916504
                  imp_dum_29 |  -.3083044   .0402962    -7.65   0.000    -.3892826   -.2273262
                  imp_dum_30 |   .6142792    .066835     9.19   0.000     .4799692    .7485892
                  imp_dum_31 |  -1.346248   .0815976   -16.50   0.000    -1.510225   -1.182272
                  imp_dum_32 |    1.30673    .082259    15.89   0.000     1.141424    1.472035
                  imp_dum_33 |   7.536008   .2247036    33.54   0.000      7.08445    7.987567
                  imp_dum_34 |  -1.113641   .0923868   -12.05   0.000    -1.299299    -.927983
                  imp_dum_35 |  -.0711428   .0618066    -1.15   0.255    -.1953478    .0530622
                  imp_dum_36 |  -.4017771   .0925707    -4.34   0.000    -.5878049   -.2157494
                  imp_dum_37 |   1.337569   .0606326    22.06   0.000     1.215723    1.459415
                  imp_dum_38 |  -2.224083   .1017227   -21.86   0.000    -2.428502   -2.019663
                  imp_dum_39 |          0  (omitted)
                  imp_dum_40 |   2.123605   .0233982    90.76   0.000     2.076585    2.170626
                  imp_dum_41 |  -.7301875   .0789125    -9.25   0.000     -.888768    -.571607
                  imp_dum_42 |  -1.345195    .065103   -20.66   0.000    -1.476025   -1.214366
                  imp_dum_43 |  -.8963577   .0734018   -12.21   0.000    -1.043864   -.7488513
                  imp_dum_44 |   .8043817   .0740803    10.86   0.000     .6555118    .9532517
                  imp_dum_45 |   1.121185   .0400836    27.97   0.000     1.040634    1.201736
                  imp_dum_46 |  -2.700035   .1230584   -21.94   0.000     -2.94733    -2.45274
                  imp_dum_47 |   1.082689   .0567908    19.06   0.000     .9685633    1.196814
                  imp_dum_48 |  -1.841087   .0966188   -19.06   0.000    -2.035249   -1.646924
                  imp_dum_49 |   3.217984   .0720305    44.68   0.000     3.073233    3.362734
                  imp_dum_50 |   1.728445   .0854262    20.23   0.000     1.556775    1.900115
               seccion_dum_1 |   .6094123   .9347438     0.65   0.517    -1.269026     2.48785
               seccion_dum_2 |   .5144564   .8542967     0.60   0.550    -1.202317     2.23123
               seccion_dum_3 |   .7990357   .9916706     0.81   0.424    -1.193801    2.791873
               seccion_dum_4 |   .5795956   .8440886     0.69   0.496    -1.116664    2.275855
               seccion_dum_5 |  -1.204721   .8828119    -1.36   0.179    -2.978798     .569356
               seccion_dum_6 |   .9570452   .9967685     0.96   0.342    -1.046036    2.960126
               seccion_dum_7 |  -.5086988   .8826663    -0.58   0.567    -2.282483    1.265085
               seccion_dum_8 |  -1.020494   .8730824    -1.17   0.248    -2.775018    .7340312
               seccion_dum_9 |  -1.436218   .7945794    -1.81   0.077    -3.032985    .1605495
              seccion_dum_10 |  -2.331401   .9006834    -2.59   0.013    -4.141392   -.5214097
              seccion_dum_11 |  -1.002241   .8314073    -1.21   0.234    -2.673016    .6685346
              seccion_dum_12 |  -1.703868   .8221108    -2.07   0.043    -3.355961   -.0517743
              seccion_dum_13 |   -1.59006   .8393409    -1.89   0.064    -3.276779    .0966586
              seccion_dum_14 |   .0822513   .7290053     0.11   0.911     -1.38274    1.547242
              seccion_dum_15 |          0  (omitted)
              seccion_dum_16 |  -1.538568   .8492565    -1.81   0.076    -3.245212    .1680773
              seccion_dum_17 |  -1.754125   .7792247    -2.25   0.029    -3.320036   -.1882145
              seccion_dum_18 |  -1.153806   .7881399    -1.46   0.150    -2.737632    .4300206
              seccion_dum_19 |  -2.248167   .7731533    -2.91   0.005    -3.801876    -.694457
              seccion_dum_20 |  -1.666725   .8304987    -2.01   0.050    -3.335674    .0022248
              seccion_dum_21 |   -1.14414   .9493878    -1.21   0.234    -3.052006    .7637259
                       _cons |  -3.025892   .9701796    -3.12   0.003    -4.975541   -1.076243
              --------------------------------------------------------------------------------
              
              . 
              end of do-file
              
              
              . predict fit, xb
              (8,855 missing values generated)
              
              . gen fit2=fit^2
              (8,855 missing values generated)
              
              . qui reg lnExportaciones lnDistancia frontera lenguaje colonia ALC mediterraneo ln_arancel MNA_dummy fit2 exp_dum_* imp_dum_* seccion_
              > dum_*, robust cluster(distancia)
              
              . test fit2=0
              
               ( 1)  fit2 = 0
              
                     F(  1,    49) =    4.10
                          Prob > F =    0.0484
              And this one is using the PPML estimator and its RESET Test.

              Code:
              ppml exports lnDistancia frontera lenguaje colonia ALC mediterraneo ln_arancel MNA_dummy exp_dum_* imp_dum_* seccion_dum_*, cluster(d
              > istancia) nocons
              
              note: checking the existence of the estimates
              
              Number of regressors excluded to ensure that the estimates exist: 1
              Excluded regressors:  exp_dum_1
              Number of observations excluded: 0
              
              note: lenguaje omitted because of collinearity
              note: imp_dum_2 omitted because of collinearity
              note: imp_dum_6 omitted because of collinearity
              note: imp_dum_7 omitted because of collinearity
              note: imp_dum_9 omitted because of collinearity
              note: imp_dum_39 omitted because of collinearity
              note: seccion_dum_21 omitted because of collinearity
              
              note: starting ppml estimation
              note: exports has noninteger values
              
              Iteration 1:   deviance =   4593500
              Iteration 2:   deviance =   1780699
              Iteration 3:   deviance =  784224.2
              Iteration 4:   deviance =  448619.8
              Iteration 5:   deviance =  345239.1
              Iteration 6:   deviance =  317970.5
              Iteration 7:   deviance =  313196.8
              Iteration 8:   deviance =  312894.9
              Iteration 9:   deviance =  312892.9
              Iteration 10:  deviance =  312892.9
              Iteration 11:  deviance =  312892.9
              
              Number of parameters: 72
              Number of observations: 251391
              Pseudo log-likelihood: -161567.16
              R-squared: .01332209
              Option strict is: off
                                             (Std. Err. adjusted for 50 clusters in distancia)
              --------------------------------------------------------------------------------
                             |               Robust
                     exports |      Coef.   Std. Err.      z    P>|z|     [95% Conf. Interval]
              ---------------+----------------------------------------------------------------
                 lnDistancia |  -.4314336   .0913318    -4.72   0.000    -.6104405   -.2524266
                    frontera |   .0536002   .4740994     0.11   0.910    -.8756175     .982818
                     colonia |  -2.148252   .5473999    -3.92   0.000    -3.221136   -1.075368
                         ALC |  -.6642191     .21579    -3.08   0.002     -1.08716   -.2412786
                mediterraneo |   1.386913   .2031351     6.83   0.000     .9887759    1.785051
                  ln_arancel |  -.5273742   .4726209    -1.12   0.264    -1.453694    .3989458
                   MNA_dummy |    .327095   .5174765     0.63   0.527    -.6871404     1.34133
                   imp_dum_1 |  -1.114786   .7385051    -1.51   0.131    -2.562229    .3326577
                   imp_dum_3 |  -2.287402   .1831118   -12.49   0.000    -2.646294   -1.928509
                   imp_dum_4 |  -.7043209   .0894402    -7.87   0.000    -.8796204   -.5290213
                   imp_dum_5 |  -1.966358   .0901732   -21.81   0.000    -2.143094   -1.789621
                   imp_dum_8 |  -.1922745   .2714673    -0.71   0.479    -.7243406    .3397917
                  imp_dum_10 |   2.030261   .2649003     7.66   0.000     1.511066    2.549456
                  imp_dum_11 |   2.589501     .48576     5.33   0.000     1.637428    3.541573
                  imp_dum_12 |   .8760401   1.019772     0.86   0.390    -1.122677    2.874757
                  imp_dum_13 |  -1.116519   .2784217    -4.01   0.000    -1.662215   -.5708223
                  imp_dum_14 |  -.3284742   .0896567    -3.66   0.000    -.5041981   -.1527503
                  imp_dum_15 |  -2.638665   .0896506   -29.43   0.000    -2.814377   -2.462953
                  imp_dum_16 |  -1.240777   .2715198    -4.57   0.000    -1.772946   -.7086077
                  imp_dum_17 |   .7759496   .9283841     0.84   0.403     -1.04365    2.595549
                  imp_dum_18 |   2.059247   .5389441     3.82   0.000     1.002936    3.115558
                  imp_dum_19 |  -2.749813   .0902551   -30.47   0.000     -2.92671   -2.572917
                  imp_dum_20 |  -1.674184   .0894419   -18.72   0.000    -1.849487   -1.498881
                  imp_dum_21 |  -.7085908   .0894534    -7.92   0.000    -.8839162   -.5332653
                  imp_dum_22 |   -1.69295   .2719001    -6.23   0.000    -2.225865   -1.160036
                  imp_dum_23 |  -2.964382   .2365645   -12.53   0.000     -3.42804   -2.500724
                  imp_dum_24 |  -2.105445   .2730055    -7.71   0.000    -2.640526   -1.570364
                  imp_dum_25 |  -3.820418   .6337192    -6.03   0.000    -5.062484   -2.578351
                  imp_dum_26 |  -3.283073   .7815935    -4.20   0.000    -4.814968   -1.751178
                  imp_dum_27 |    .208122   1.181887     0.18   0.860    -2.108334    2.524578
                  imp_dum_28 |  -1.003474   .0895397   -11.21   0.000    -1.178969   -.8279792
                  imp_dum_29 |   .1850982   .1439038     1.29   0.198    -.0969482    .4671445
                  imp_dum_30 |   .7520112   .4614294     1.63   0.103    -.1523739    1.656396
                  imp_dum_31 |   .9273767   .4205746     2.21   0.027     .1030656    1.751688
                  imp_dum_32 |  -2.878425   .3426314    -8.40   0.000     -3.54997    -2.20688
                  imp_dum_33 |  -3.682623   .5347607    -6.89   0.000    -4.730735   -2.634511
                  imp_dum_34 |   -2.57902   .2934571    -8.79   0.000    -3.154186   -2.003855
                  imp_dum_35 |  -.3156104   .0894486    -3.53   0.000    -.4909264   -.1402944
                  imp_dum_36 |  -3.769253   .2506863   -15.04   0.000    -4.260589   -3.277917
                  imp_dum_37 |   -4.74559   .2039107   -23.27   0.000    -5.145248   -4.345932
                  imp_dum_38 |   1.193222   .1915438     6.23   0.000     .8178035    1.568641
                  imp_dum_40 |  -2.579854   .7342528    -3.51   0.000    -4.018963   -1.140745
                  imp_dum_41 |  -3.460296   .0948384   -36.49   0.000    -3.646176   -3.274416
                  imp_dum_42 |  -2.019692   .2721201    -7.42   0.000    -2.553038   -1.486346
                  imp_dum_43 |  -3.035312   .0898989   -33.76   0.000     -3.21151   -2.859113
                  imp_dum_44 |  -2.977139   .1058087   -28.14   0.000     -3.18452   -2.769758
                  imp_dum_45 |  -4.105837   .3306784   -12.42   0.000    -4.753955   -3.457719
                  imp_dum_46 |  -1.394045   .0322961   -43.16   0.000    -1.457345   -1.330746
                  imp_dum_47 |   1.218534   .2017521     6.04   0.000     .8231075    1.613961
                  imp_dum_48 |  -.4187494    .132765    -3.15   0.002    -.6789641   -.1585348
                  imp_dum_49 |  -2.626287   .5964335    -4.40   0.000    -3.795275   -1.457299
                  imp_dum_50 |  -2.920057   .5411621    -5.40   0.000    -3.980715   -1.859399
               seccion_dum_1 |   2.454451   .5466919     4.49   0.000     1.382954    3.525947
               seccion_dum_2 |   4.030944   .5201629     7.75   0.000     3.011444    5.050444
               seccion_dum_3 |   3.471219   .7475501     4.64   0.000     2.006047     4.93639
               seccion_dum_4 |   4.332082   .9034854     4.79   0.000     2.561284    6.102881
               seccion_dum_5 |   1.653574     .69767     2.37   0.018     .2861657    3.020982
               seccion_dum_6 |   5.801144   .7624295     7.61   0.000     4.306809    7.295478
               seccion_dum_7 |   1.339814   .7187279     1.86   0.062    -.0688673    2.748494
               seccion_dum_8 |   2.553449   .8186998     3.12   0.002     .9488271    4.158071
               seccion_dum_9 |   1.397105   .8936823     1.56   0.118    -.3544798     3.14869
              seccion_dum_10 |   1.251831    .753649     1.66   0.097    -.2252937    2.728956
              seccion_dum_11 |   2.309953   .6252397     3.69   0.000     1.084506    3.535401
              seccion_dum_12 |   1.270458   .9277279     1.37   0.171    -.5478556    3.088771
              seccion_dum_13 |   2.330507   .7416038     3.14   0.002     .8769899    3.784023
              seccion_dum_14 |   6.331289   .7285506     8.69   0.000     4.903356    7.759222
              seccion_dum_15 |   1.002838    .614894     1.63   0.103    -.2023323    2.208008
              seccion_dum_16 |   3.172186   .7711696     4.11   0.000     1.660721     4.68365
              seccion_dum_17 |   .5115352   .5719157     0.89   0.371    -.6093991    1.632469
              seccion_dum_18 |   .8632077   .7256116     1.19   0.234    -.5589649     2.28538
              seccion_dum_19 |  -.8254245    .549203    -1.50   0.133    -1.901843    .2509937
              seccion_dum_20 |   1.710909   .7958455     2.15   0.032     .1510808    3.270738
              --------------------------------------------------------------------------------
              
              predict fitt, xb
              (8,855 missing values generated)
              
              . gen fitt2=fitt^2
              (8,855 missing values generated)
              
              . qui ppml exports lnDistancia frontera lenguaje colonia ALC mediterraneo ln_arancel MNA_dummy fitt2 exp_dum_* imp_dum_* seccion_dum_*,
              >  cluster(distancia) nocons
              WARNING: fitt2 has very large values, consider rescaling  or recentering
              Number of regressors excluded to ensure that the estimates exist: 1
              Number of observations excluded: 0
              
              . test fitt2=0
              
               ( 1)  fitt2 = 0
              
                         chi2(  1) =    4.94
                       Prob > chi2 =    0.0263
              Is there any problem with my code? Is it any problem with my model specification?

              I'll be waiting for your reply.

              Comment


              • #8
                Hi Juan,
                If you only have one exporter, then your "pairwise" variables (such as the log of distance) instead become importer-specific variables. As such, they should be completely explained by your importer fixed effects, which is what ppmlhdfe is telling you. The reason why ppml and reg are giving you a different result is because Stata regrettably drops collinear variables from right to left without regard to which of your variables are fixed effects versus not. You should trust the ppmlhdfe results and think about how to modify your data or your design accordingly if you want to obtain estimates of the effects of distance. Either include data for additional exporters, or, if that's not possible, you will need to relax your importer fixed effect.

                Btw, you also do not need the exporter fixed effect if there is only the one exporter. The fixed effect dummy for this exporter is equal to 1 for all observations, so the the assumed regression constant effectively already effectively serves as an "exporter fixed effect" in this case.

                I would not worry too much about using RESET to distinguish between OLS and PPML. If you are already worried about OLS potentially being misspecified, then you should use PPML. OLS would only be consistent in a very special case, and the "MaMu" (Manning-Mullahy) test is a better way of testing for it.

                Regards,
                Tom
                Last edited by Tom Zylkin; 06 May 2020, 07:41.

                Comment


                • #9
                  Hi Tom,

                  Thanks for your reply.
                  Using ppmlhdfe, the RESET test performed well in any specification. However, the elimination of geographical variables, such as distance, is still concerning me. Do you think that if I include other exporters the problem could be solved? Also, I don't understand what you mean with "relax your importer fixed effect", could you explain it better?

                  Gratefully,
                  Juan

                  Comment


                  • #10
                    Hi Juan,
                    If you want to obtain estimates for the effects of your geographic variables, then you cannot include an importer fixed effect in your case. However, if you were to have more than one exporter--such that every importer in your data trades with at least two exporters and vice versa--then you could have both exporter and importer fixed effects and also being able to identify these variables.
                    Hope that helps,
                    Tom

                    Comment


                    • #11
                      Hi Tom,
                      Thanks for your quick reply

                      I attach my code with I'm running my model, including fixed effects for importer country (imp_dum*) and 2-digit fixed effects (seccionhs2_dum_*). Also, I absorb the "partner" (exporter country), the "reporter" (importer countries) and the "hs2" (2-digit HS sector).

                      Code:
                      ppmlhdfe exports lndistancia frontera mediterraneo lenguaje colonia ALC arancel_NMF indice_de_prevalencia_TOT indice_de_prevalencia_TOT_ALC imp_dum_* seccionhs2_dum_*, a(reporter partner hs2) cluster(distancia)
                      If I relax my importer country fixed effects, how should it be my code? If I relax the importer fixed effects, do I need to include PIB data?

                      Gratefully,
                      Juan

                      Comment


                      • #12
                        Hi Juan,
                        It looks to me like you should not be including "imp_dum_*" and "seccionhs2_dum_*" in your syntax. Please check the help file regarding the use of the "absorb" option. It looks like you are using it correctly, but it is important to recognize how fixed effects are coded using programs such as reghdfe and ppmlhdfe. To try to clear up any confusion, the implications of "absorbing" these fixed effects are the same as those of including the dummies.

                        When I say "relax" the importer fixed effects, all that means is not to include them. I don't know what PIB data is, though, so unfortunately I can't answer your second question.

                        Regards,
                        Tom

                        Comment


                        • #13
                          Thanks for your replies Tom. I will consider to add new exporters to my dataset.

                          Best wishes,
                          Juan

                          Comment


                          • #14
                            Dear Tom Zylkin,

                            I have a question about ppmlhdfe. Is it possible to obtain the R2 in ppmlhdfe regressions? Or, is there any way to get that information about?

                            Best wishes,
                            Juan

                            Comment


                            • #15
                              Hi Juan,
                              You can do this by using the "predict" function after estimation to get the conditional mean. Then use the "corr" command to get the correlation between your y variable and the conditional mean and take its square. I hope that makes sense.
                              Regards,
                              Tom

                              Comment

                              Working...
                              X