Announcement

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

  • Does Poisson Pseudo Maximum Likelihood (PPML) work for trade unit value/price?

    Hi, everyone. I have seen many papers talking about PPML being better at dealing with zero trade data issues. For reghdfe, the trade variable will be log format [reghdfe log(y) x, options], and for ppml, the dependent variable could be simply trade value [ppmlhdfe y x, options]. And comparing with reghdfe's log-scale mean effects, ppml captures "changes in mean".

    My question is, for trade price, or trade unit value, is PPML necessary in terms of zero trade problem?

    For my research, I want to see: by what percentage did the unit value increase as a result of this policy/event? It feels like the estimated coefficient I get from [reghdfe log(y)] explains it. PPML captures changes in the mean, which means that, for trade price/unit value, the estimated coefficients capture the change in the conditional mean of unit values, which is not how people normally explain price changes.

    I have seen some papers working on trade value and quantity using PPML, which argues that REGLDFE was not good for them. But for trade price or trade unit value, I cannot find any papers that explicitly state that their dependent variable is unit value/price and that they choose PPML instead of REGLDFE . Fajgelbaum et.al.(2020) 's paper return to protectionism works on trade unit value, but I have checked their replication code, they used REGLDFE.

    Could you please help me solve my question? And if you know any papers talking about trade price or unit value using ppml or reghdfe, please let me know, thank you!
    Last edited by Ann Chung; 17 Dec 2025, 12:28.

  • #2
    Dear Ann Chung,

    I would say that PPML is generally preferable to a linear model where the dependent variable is in logs, and the interpretation of the parameters is the same. If your dependent variable is the increase in unit value, the PPML estimates identify the effect on the mean of the increase, not the mean of unit values.

    Best wishes,

    Joao

    Comment


    • #3
      Dear @Joao Santos Silva



      Thank you for your reply! My dependent variable for unit value is not the change in unit value, but simply the trade unit value p. I am using monthly HTS10 trade data to calculate: p = [trade value] / [trade quantity].



      My model contains two treatments, the event window size is 3 years before and after, and I bin the window at t = -36 and t= 36:

      Code:
      ppmlhdfe p event_time_dummy_series_of_treatment1 event_time_dummy_series_of_treatment2, absorb(FEs) cluster(hts10*country)



      But the event study figure I get is pretty chaotic, with some extreme values and confidence intervals in some months.

      Click image for larger version

Name:	ppml.jpg
Views:	1
Size:	69.5 KB
ID:	1783849








      My event study results using reghdfe log(p), instead, look way better; at least there are no extreme estimates.



      So I am not sure what is going on with my PPML model. I checked my p variable in my dataset; among 16 million total panel dataset observations, 82% of my p values are missing. I guess the reason is that I used the most disaggregated trade data at the monthly level from the Census to construct a panel dataset spanning 20+ years, and in many months, there are no trade activities.



      I also compute the 99th percentile of unit values within each event-time window and count the number of observations above this threshold, in order to assess whether a small number of extreme observations affect the estimates.



      event time variable event_win looks like: ..... -36 -36 -36 -35 -34 ....... -1 0 1 2 3 .... 35 36 36 36 36 ......

      Code:
      bysort event_win: egen p99_uv = pctile(p), p(99)
      bysort event_win: count if p > p99_uv



      And here are my results:


      Code:
      -> event_win = -36
        83,295
      -> event_win = -35
        993
      -> event_win = -34
        996
      -> event_win = -33
        981
      -> event_win = -32
        975
      -> event_win = -31
        970
      -> event_win = -30
        971
      -> event_win = -29
        962
      -> event_win = -28
        1,002
      -> event_win = -27
        962
      -> event_win = -26
        961
      -> event_win = -25
        968
      -> event_win = -24
        974
      -> event_win = -23
        958
      -> event_win = -22
        977
      -> event_win = -21
        972
      -> event_win = -20
        975
      -> event_win = -19
        950
      -> event_win = -18
        964
      -> event_win = -17
        973
      -> event_win = -16
        955
      -> event_win = -15
        967
      -> event_win = -14
        966
      -> event_win = -13
        958
      -> event_win = -12
        979
      -> event_win = -11
        981
      -> event_win = -10
        987
      -> event_win = -9
        974
      -> event_win = -8
        981
      -> event_win = -7
        968
      -> event_win = -6
        989
      -> event_win = -5
        995
      -> event_win = -4
        989
      -> event_win = -3
        976
      -> event_win = -2
        977
      -> event_win = -1
        967
      -> event_win = 0
        957
      -> event_win = 1
        992
      -> event_win = 2
        964
      -> event_win = 3
        969
      -> event_win = 4
        971
      -> event_win = 5
        990
      -> event_win = 6
        961
      -> event_win = 7
        956
      -> event_win = 8
        950
      -> event_win = 9
        959
      -> event_win = 10
        949
      -> event_win = 11
        1,005
      -> event_win = 12
        948
      -> event_win = 13
        943
      -> event_win = 14
        974
      -> event_win = 15
        953
      -> event_win = 16
        926
      -> event_win = 17
        921
      -> event_win = 18
        925
      -> event_win = 19
        959
      -> event_win = 20
        927
      -> event_win = 21
        933
      -> event_win = 22
        928
      -> event_win = 23
        934
      -> event_win = 24
        922
      -> event_win = 25
        915
      -> event_win = 26
        938
      -> event_win = 27
        924
      -> event_win = 28
        927
      -> event_win = 29
        917
      -> event_win = 30
        923
      -> event_win = 31
        925
      -> event_win = 32
        928
      -> event_win = 33
        942
      -> event_win = 34
        917
      -> event_win = 35
        890
      -> event_win = 36
        153,607
      -> event_win = .
        12,624,247



      event_win = . is because I only have event-time variable for the treated country and product. Those products and countries that are not treated, their event_win == .



      From the reported p99 outcomes, I find that the number of extreme unit values is way too large in t = 36 and t = -36. I do not know whether this is the reason that leads my event study estimates to be chaotic. If I drop when event_win == 36 or -36, it violates my setting of binning my event window at t == -36 and 36.




      Could you please provide any guidance or comments on what I get? I shouldn't drop all missing observations and run ppmlhdfe to avoid the results shown above, should I?


      Thank you!

      Ann

      Comment


      • #4
        Dear Ann Chung,

        Thanks for the additional information. You say that 82% of your p values are missing; are they really missing or are they zero? Do you treat these observations differently when using OLS and PPML? Anyway, if it is true that you have 82% missing values, I would worry about the validity of your results.

        I do not understand what you do to detect extreme observations. If you are computing the number of the observations in the top centile, isn't this always 1% of the number of the observations in the group? If so, your results only provide information about the size of the groups.

        Best wishes,

        Joao

        Comment


        • #5
          Dear @Joao Santos Silva,

          Thank you for your reply again! Here is more info about my data.

          My balanced panel dataset contains 324 continuous months of HTS10*country pairs between 1995 and 2022. Of the 16,150,000 total observations, 13,310,000 (82%) of my trade unit value variable are ".". This is because 13,260,000 of these observations have a trade value of zero. The remaining 50,000 observations with missing trade unit values are trade quantities that were not reported for safety reasons and were set to 0 by the US Census. When I calculate unit value variable using the formula
          gen p = tradevalue / tradequantity
          , Stata sets these outcomes as "." . This is what I meant by "missing" in my previous post.


          My treatment groups contain around 705,510 monthly observations of HTS10*country pairs. Among these observations, 72% of the observations for the unit value variable are "." (508,780). I summed the unit value variable specific to my treatment group:

          Code:
          sum p if treatment == 1, detail
          Code:
                                        p
          -------------------------------------------------------------
                Percentiles      Smallest
           1%     .1913642        .020184
           5%     .4667143       .0215408
          10%     .7114797       .0240877       Obs             196,730
          25%     1.472542       .0245225       Sum of wgt.     196,730
          
          50%      3.27243                      Mean           7.036419
                                  Largest       Std. dev.      58.59387
          75%     7.055085           4725
          90%     11.30877           4910       Variance       3433.242
          95%     15.31301           5120       Skewness       63.56485
          99%     41.22414           8973       Kurtosis       5593.207



          I also summed the unit value variable for my full dataset:

          Code:
          sum p, detail
          Code:
                                       p
          -------------------------------------------------------------
                Percentiles      Smallest
           1%     .1647943       .0022467
           5%     .4399854       .0036249
          10%     .6779413       .0037501       Obs           2,830,605
          25%     1.349979           .004       Sum of wgt.   2,830,605
          
          50%      2.98693                      Mean           215.2161
                                  Largest       Std. dev.      11611.82
          75%     6.885246        3995200
          90%     18.63395        4307734       Variance       1.35e+08
          95%         62.5        5040000       Skewness        504.964
          99%       1777.5       1.19e+07       Kurtosis       431048.5






          As for regressions:

          When I conducted reghdfe and ppmlhdfe regressions, I used this same p variable. The only difference was that I generated a log format of p:
          gen lp = log(p)
          .



          My models are:

          Code:
          reghdfe lp event_time_dummy_series_of_treatment1 event_time_dummy_series_of_treatment2, absorb(FEs) cluster(hts10*country)
          
          
          ppmlhdfe p event_time_dummy_series_of_treatment1 event_time_dummy_series_of_treatment2, absorb(FEs) cluster(hts10*country)



          The figure below is my reghdfe event study outcome using the same sets of fixed effects as ppmlhdfe. Compared to the event study figure using ppmlhdfe I attached in the previous post, this reghdfe event study figure looks reasonable and less fluctuated. So I would like to ask what happened to my ppmlhdfe results and what scholars usually do to address this issue (any reference papers?). Thank you!




          Click image for larger version

Name:	reghdfe log(p).jpg
Views:	1
Size:	110.5 KB
ID:	1783869








          Comment


          • #6
            Dear Ann Chung,

            Let me start by saying that in principle the PPML results are more reliable than the OLS ones, which do not provide a valid benchmark.

            About the data, for observations where trade value is zero, I would replace the missing unit values with zero. I am not sure how best to proceed when the data is not reported for safety reasons, so I suggest you ask an expert how best to deal with this issue. Having done that, I would use PPML to estimate the effects; the number of observations should now be much larger because you include the zeros that you were leaving out before.

            Best wishes,

            Joao

            Comment


            • #7
              Dear Dr.@Joao Santos Silva,

              Thank you so much for your clarification. I tried replacing p with 0, but the results are still fluctuating and random. I am concerned that the reason might be that my treatment group observations are insufficient compared with those of the untreated groups. Currently, of the 46,013 agricultural product-country pairs in my dataset, my first treatment group contains 65 pairs and my second treatment group contains 1,945 pairs. This means that 44,000 country-product pairs are untreated, accounting for 95% of the total observations.

              For example, the extreme estimator in t = -10 in the figure below might be due to insufficient treatment observation. That's probably the reason why my REGHDFE event study outcome looks better than PPMLHDGE. So I would like to ask: how do you comment on this scenario, where the data does not contain enough treatment observations? Is ppmlhdfe still better to be used under this scenario? Thank you!



              Comment


              • #8
                N/A

                Comment

                Working...
                X