Announcement

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

  • How to Combine IV, PPML, and HDFE for Gravity Model Estimation?

    Hi everyone,

    I am conducting a study on the effects of RTAs on trade. To address endogeneity concerns, I have identified a suitable instrument for RTA. However, I am encountering several challenges that I hope someone here can help me navigate:
    1. Gravity model literature strongly recommends using PPML estimators due to their ability to handle zero trade flows and heteroskedasticity. However, PPML does not naturally integrate IV, which are based on linear models. Does this mean that gravity models can never use IV to address endogeneity?
    2. I came across the Stata package ivpoisson gmm, which allows for IV estimation within a PPML framework. However, this package cannot handle high-dimensional fixed effects (HDFE) due to the incidental parameter problem. Since the gravity literature also recommends the inclusion of HDFE, this limitation renders ivpoisson gmm unusable also?

    So my question is: Is there a method or package in Stata that allows combining IV, PPML, and HDFE for gravity models? If not, are there any workarounds to ensure valid IV estimates while adhering to the best practices of gravity model estimation?

    I would greatly appreciate any advice, references, or suggestions for dealing with this issue.

    Thanks in advance for your help!

  • #2
    Poisson is different from other non-linear models in that its likelihood function is separable in the fixed effects, meaning they can be eliminated via conditional likelihood without biasing the estimation of \(\beta\). This is why Poisson fixed effects estimated via conditional likelihood yield the same \(\beta\) as Poisson with dummies. Unlike logit, where fixed effects introduce bias in short panels, Poisson’s multiplicative structure ensures that both approaches avoid the incidental parameters problem for \(\beta\).

    Code:
    webuse ships, clear
    *CONDITIONAL FE POISSON
    xtset ship
    xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, fe
    
    *POISSON WITH DUMMIES
    poisson accident op_75_79 co_65_69 co_70_74 co_75_79 i.ship
    Res.:

    Code:
    . *CONDITIONAL FE POISSON
    
    . 
    . xtset ship
    
    Panel variable: ship (balanced)
    
    . 
    . xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79, fe
    
    Iteration 0:  Log likelihood = -120.64946  
    Iteration 1:  Log likelihood = -104.89768  
    Iteration 2:  Log likelihood = -104.83697  
    Iteration 3:  Log likelihood = -104.83697  
    
    Conditional fixed-effects Poisson regression         Number of obs    =     34
    Group variable: ship                                 Number of groups =      5
    
                                                         Obs per group:
                                                                      min =      6
                                                                      avg =    6.8
                                                                      max =      7
    
                                                         Wald chi2(4)     =  30.48
    Log likelihood = -104.83697                          Prob > chi2      = 0.0000
    
    ------------------------------------------------------------------------------
        accident | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        op_75_79 |   .2928003   .1127466     2.60   0.009      .071821    .5137796
        co_65_69 |   .5824489   .1480547     3.93   0.000     .2922671    .8726308
        co_70_74 |   .4627844    .151248     3.06   0.002     .1663437    .7592251
        co_75_79 |  -.1951267   .2135749    -0.91   0.361    -.6137258    .2234724
    ------------------------------------------------------------------------------
    
    . 
    . 
    . 
    . *POISSON WITH DUMMIES
    
    . 
    . poisson accident op_75_79 co_65_69 co_70_74 co_75_79 i.ship
    
    Iteration 0:  Log likelihood = -131.31515  
    Iteration 1:  Log likelihood = -118.52901  
    Iteration 2:  Log likelihood =  -118.4759  
    Iteration 3:  Log likelihood = -118.47588  
    Iteration 4:  Log likelihood = -118.47588  
    
    Poisson regression                                      Number of obs =     34
                                                            LR chi2(8)    = 475.45
                                                            Prob > chi2   = 0.0000
    Log likelihood = -118.47588                             Pseudo R2     = 0.6674
    
    ------------------------------------------------------------------------------
        accident | Coefficient  Std. err.      z    P>|z|     [95% conf. interval]
    -------------+----------------------------------------------------------------
        op_75_79 |   .2928003   .1127466     2.60   0.009      .071821    .5137796
        co_65_69 |   .5824489   .1480547     3.93   0.000     .2922671    .8726308
        co_70_74 |   .4627844    .151248     3.06   0.002     .1663437    .7592251
        co_75_79 |  -.1951267   .2135749    -0.91   0.361    -.6137258    .2234724
                 |
            ship |
              2  |    1.79572   .1666196    10.78   0.000     1.469151    2.122288
              3  |  -1.252763   .3273268    -3.83   0.000    -1.894312   -.6112142
              4  |  -.9044563   .2874597    -3.15   0.002    -1.467867   -.3410457
              5  |  -.1462833   .2351762    -0.62   0.534    -.6072202    .3146537
                 |
           _cons |   1.308451   .1972718     6.63   0.000     .9218049    1.695096
    ------------------------------------------------------------------------------
    Last edited by Andrew Musau; 06 Feb 2025, 13:30.

    Comment


    • #3
      @Andrew Thank you for the prompt and detailed explanation! I now better understand how Poisson’s conditional likelihood eliminates fixed effects without biasing β\beta. However, my concern is specific to combining IV, PPML, and HDFE in a single framework.

      From what I’ve seen, the ivpoisson gmm package doesn’t seem to support high-dimensional fixed effects (HDFE) because it lacks support for the absorb() option, which is crucial in gravity models to control for exporter-time, importer-time, and pair fixed effects.

      I’m still wondering:
      1. Is there any method or package in Stata that supports combining IV, PPML, and HDFE for gravity models?
      2. If not, are there any feasible workarounds, such as control-function approaches or splitting the estimation into multiple steps, that allow valid IV estimation while still adhering to the best practices of gravity model estimation?

      Thanks again for your insights! Looking forward to further guidance on this.

      Comment


      • #4
        If the endogenous explanatory variable is roughly continuous then you can use the FE Poisson estimator combined with the control function approach. See Wei Lin and J. Wooldridge, 2019 book chapter.

        Comment


        • #5
          Thank you, Prof. Jeff Wooldridge for your early response. Unfortunately, my endogenous explanatory variable is a dummy (RTA), and the instrument I am considering is also binary. Given this setup, I understand that the control function approach might not be appropriate here, and it seems like combining IV, PPML, and HDFE for gravity models is not feasible in this case. Am I interpreting this correctly?
          To summarize my dilemma: Gravity model literature strongly recommends using PPML estimators due to their ability to handle zero trade flows and heteroskedasticity. However, it appears that no existing Stata package supports combining IV, PPML, andHDFE simultaneously. ie. The ivpoisson gmm package allows for IV estimation in a PPML framework but cannot handle HDFE due to the incidental parameter problem. On the other hand, linear models like ivreghdfe handle IV and HDFE well but fail to address zero trade flows and heteroskedasticity. Is it theoretically or practically possible to combine IV, PPML, and HDFE? Or does this limitation mean that gravity models can never fully address endogeneity with IV under these constraints? Given the lack of tools to handle all three aspects: Would it be acceptable to rely on ivreghdfe while acknowledging the limitations in handling zero trade flows? Alternatively,is it valid to apply IV in a linear framework and then compare or combine it with results from a PPML model (e.g., using predicted RTA from an IV stage in a PPML)?

          I am aware that this combination is theoretically and computationally challenging, but any guidance, references, or insights you could provide would be invaluable.

          Thank you for your time and help!

          Comment


          • #6
            Hello Zhixiao Yao , I am currently facing the same dilemma. How did you manage to use IV? Did you use country pair fixed effects to control for endogeneity?

            Comment

            Working...
            X