Announcement

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

  • What are the stata commands for Poisson pseudo-maximum likelihood (PPML) in gravity model?

    Hey,
    I am estimating the gravity model to obtain residuals at the sectoral level. My goal is to calculate tariff equivalent(AVEs) using the residuals of the gravity equation.
    I am using Stata 16.0 and data for the year 2014, 191 countries.
    I run the OLS model using the command: reg Intrade lndist x2 x3 x4.. where Intrade is the dependant variable (value of export in sector a), lndist is the log of distance, and x2, x3, x4 are other gravity variables. As the recent literature suggests, I want to use Poisson pseudo-maximum likelihood (PPML) to treat the zero values in the gravity regression.
    I would really appreciate it if you share the Stata commands for PPML.
    Many thanks in advance.

    Regards,
    Bushra
    Last edited by Bushra Faizi; 18 Oct 2021, 06:44.

  • #2
    ssc describe ppml

    Welcome to Statalist! (Please read the Forum FAQ -- there's lots of useful information there that will help you post efficiently here and find resources.) See the black bar at the top of the page

    Comment


    • #3
      Thank you, Jankins. I searched before posting and found useful commands for a panel data gravity model. My data is not panel data and I think the commands will be different in this case.

      Comment


      • #4
        Dear Bushra Faizi,

        Adding to Stephen's helpful suggestion, I would say that if you do not have panel data, you can use either ppml or ppmlhdfe; the results should be the same, but one may be faster than the other in your application.

        Best wishes,

        Joao

        Comment


        • #5
          Thank you Silva,
          I appreciate that. I tried both commands. The command ppmlhdfe TRD lpopd lpopo ldist CONTIG COMLANG_OFF did nor work, says "command ppmlhdfe is unrecognized"

          The command ppml TRD lpopd lpopo ldist CONTIG COMLANG_OFF gives the following results:

          ppml TRD lpopd lpopo ldist CONTIG COMLANG_OFF

          note: checking the existence of the estimates
          WARNING: lpopd has very large values, consider rescaling or recentering
          WARNING: lpopo has very large values, consider rescaling or recentering

          Number of regressors excluded to ensure that the estimates exist: 0
          Number of observations excluded: 0


          note: starting ppml estimation
          note: TRD has noninteger values

          Iteration 1: deviance = 2590484
          Iteration 2: deviance = 1725934
          Iteration 3: deviance = 1554894
          Iteration 4: deviance = 1536740
          Iteration 5: deviance = 1536277
          Iteration 6: deviance = 1536277
          Iteration 7: deviance = 1536277

          Number of parameters: 6
          Number of observations: 14161
          Pseudo log-likelihood: -782189.18
          R-squared: .03816635
          Option strict is: off

          Robust
          TRD Coef. Std. Err. z P>z [95% Conf. Interval]
          lpopd .6353113 .0669883 9.48 0.000 .5040166 .7666059
          lpopo .2914555 .0639008 4.56 0.000 .1662123 .4166988
          ldist -.4061753 .0740682 -5.48 0.000 -.5513464 -.2610043
          CONTIG .6675087 .4415891 1.51 0.131 -.1979901 1.533008
          COMLANG_OFF .5800144 .271396 2.14 0.033 .0480881 1.111941
          _cons -3.021472 .7582795 -3.98 0.000 -4.507672 -1.535271

          1) I am afraid the R square is very low
          2) says in red that the population values are too large, I have no idea how to address that.
          Kindly advise.
          Thanks again


          Comment


          • #6
            Dear Bushra Faizi,

            You need to install ppmlhdfe from SSC, like you probably did for ppml.

            1) the R2 is low compared to what?
            2) if you get convergence, you can ignore those warnings.

            I do not know the purpose of your work but maybe you want to account for mulitlateral resistance using the so-called fixed effects.

            Best wishes,

            Joao

            Comment


            • #7
              Dear Jaoa,
              Thank you for the valuable comments. Yes, I totally missed the MRT earlier, thank you for pointing that out. As you rightly said, I generated the dummies for importers and exporters to be used for Multilateral Resistance.
              Now I run the ppml regression (using bilatetal data for 119 countries and year 2014, which makes 14161 observations) using the commands as:

              ppml Trade ldist lgdp_e lgdp_m lpopm lpope COMLANG_OFF comrelig comcol exporter_* importer_*
              I am getting a high value of R square compared to linealized OLS.
              My question to you is, Is the command given above correct for cross section data? Can I use importer FE and exporter FE in cross section data like the one I have?

              Comment


              • #8
                You can, but note that you are including as regressors characteristics of the origin and destination and you cannot identify the effect of these variables. If you are unsure about this, suggest you use ppmlhdfe instead of ppml.

                Joao

                Comment


                • #9
                  Dear Joao,
                  The PPML regression in cross-section data that I explained omits some of the coefficients due to collinearity.
                  Alternatively, If I switch to panel data, I have panel data, three years( 2007,2011, and 2014), and the same 119 countries, BUT the problem is this regression is giving me co-efficient for 119 exporters and 119 importers, without specifying the year.
                  Can you help me with commands to get all the three years coefficients please? Currently I am using the regression command: xtreg Trade i.N_Destination i.N_origin DIST CONTIG pop_o pop_d

                  I also generated dummies, N=1 for 2007, 2 for 2011, and 3 for 2014, and at the end of the above regression command, I add if N=1, but it gives me error.
                  I have a problem with both the estimations, i.e cross-section, and panel, kindly advise.

                  I appreciate.

                  Comment


                  • #10
                    Please use the ppmlhdfe command and check out this free book

                    https://www.wto.org/english/res_e/pu...uide2016_e.htm

                    Comment


                    • #11
                      Dear Joao,
                      Thank you very much for sharing the book.

                      Comment


                      • #12
                        Hi all,

                        What is the difference between Poison QLME and PPML? I have been so far using 'xtpoisson' and 'ppmlhdfe' to estimate a Poisson fixed-effect model in a DiD setting, where the dependent variable is real income, but I came across this paper by Chen and Roth (2023) who recommend using Poisson QLME in DiD settings. I'm currently confused about the difference between the two and the commands that I would need to estimate QLME.

                        Any help in this regard is much appreciated.

                        Many thanks,
                        Ashani

                        Comment


                        • #13
                          You mean Poisson QMLE; it is the same thing.

                          Comment

                          Working...
                          X