Announcement

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

  • Gravity model with PPML

    Dear all.

    I am a completely new user of Stata.

    I am currently working in a international trade research to Colombia.

    I read many post in statalist to understand how can I run stata with PPML.

    I read that xtpoisson and ppml should give us the same results but I have tried many times and the results are not the same.

    These are the commands and results:

    xtpoisson x log_gdp_o log_gdp_d log_distw

    ------------------------------------------------------------------------------
    x | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    log_gdp_o | .4846562 .0003929 1233.53 0.000 .4838861 .4854262
    log_gdp_d | .4180332 .0003394 1231.63 0.000 .417368 .4186985
    log_distw | -.7425596 .0186989 -39.71 0.000 -.7792087 -.7059105
    _cons | -11.35575 .1625527 -69.86 0.000 -11.67435 -11.03716
    -------------+----------------------------------------------------------------
    /lnalpha | 1.438664 .0090369 1.420952 1.456377
    -------------+----------------------------------------------------------------
    alpha | 4.215063 .0380912 4.141063 4.290385

    ppml x log_gdp_o log_gdp_d log_distw

    ------------------------------------------------------------------------------
    | Robust
    x | Coef. Std. Err. z P>|z| [95% Conf. Interval]
    -------------+----------------------------------------------------------------
    log_gdp_o | .8283028 .0092983 89.08 0.000 .8100785 .8465271
    log_gdp_d | .7096657 .009622 73.75 0.000 .6908069 .7285244
    log_distw | -.761988 .0122063 -62.43 0.000 -.7859119 -.7380641
    _cons | -27.64312 .3506973 -78.82 0.000 -28.33047 -26.95577
    ------------------------------------------------------------------------------

    As I said before, I am new in Stata and my question could be very simple but I would be so grateful to receive your help.

    Best wishes.

  • #2
    Dear CARLOS ABREO,

    In the xtpoisson command, you need the option fe, in the ppml command, you need to include the fixed effects as regressors. Alternatively, you may want to use ppmlhdfe, available form ssc. Also, please use clustered standard errors.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Professor Santos.

      Thanks for your replay. Also your paper is helping me with the research.

      As I said, I am new in Stata.

      1. If I use FE with xtpoisson distw variable will be drop by stata (distw) ¿no? then I am not going to get results in this variable.
      2. I have read on Statalist forum that xtpoisson and ppml give us the same result but with the commands I wrote in #1 I did not get it.

      I wrote the following commands according to what I understood in your post.

      xtpoisson x log_gdp_d log_gdp_o log_distw, fe

      ------------------------------------------------------------------------------
      x | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      log_gdp_d | .4183462 .00034 1230.47 0.000 .4176798 .4190126
      log_gdp_o | .4838999 .0003934 1230.09 0.000 .4831289 .4846709


      ppml x log_gdp_o log_gdp_d log_distw exp_TIFE imp_TIFE exp_TVFE imp_TVFE TFE

      Excluded regressors: exp_TIFE imp_TIFE
      ------------------------------------------------------------------------------
      | Robust
      x | Coef. Std. Err. z P>|z| [95% Conf. Interval]
      -------------+----------------------------------------------------------------
      log_gdp_o | .8277124 .0086096 96.14 0.000 .8108378 .844587
      log_gdp_d | .7137941 .0096931 73.64 0.000 .6947959 .7327922
      log_distw | -.7743573 .0123535 -62.68 0.000 -.7985698 -.7501448
      exp_TVFE | .0001507 .000026 5.80 0.000 .0000998 .0002016
      imp_TVFE | .0000244 .0000248 0.98 0.326 -.0000243 .000073
      TFE | -.0150876 .0036182 -4.17 0.000 -.022179 -.0079961
      _cons | -27.67905 .3371764 -82.09 0.000 -28.33991 -27.0182
      ------------------------------------------------------------------------------

      I am so confused. I apologyze for my question.

      Bye

      Comment


      • #4
        Dear CARLOS ABREO,

        1) Indeed, if you use pair-fixed effects, distance will be dropped.

        2) Your second command appears to be including origin and destination fixed effects rather than pair fixed effects, which is what xtpoisson does. If that is the case, you are not including the fixed effects correctly.

        The following code should help you to understand the use of these commands:
        Code:
        clear all
        cls
        sysuse auto
        xtset rep78
        xtpoisson price mpg weight, fe robust
        xi: ppml price mpg weight i.rep78, cluster(rep78)
        Best wishes,

        Joao

        Comment


        • #5
          Dear Professor Santos.

          Thanks for your answer.

          In my panel data I have variables for 133 countries from 2005 to 2018. Then I cannot run the following command because Stata says: Up to 5000 variables.
          xi: ppml price mpg weight i.rep78, cluster(rep78) But with the example you proposed I could understand.
          I am going to run the Gravity Equation with PPML and I want to include some fixed effects.

          Model 1: Time Invariant fixed effects for exporter and importer, Time variant fixed effects for exporter and importer and Time Fixed Effects.
          Model 2: Time Invariant fixed effects for exporter and importer and Time Fixed Effects.
          Model 3: Country pair fixed effects and Time Fixed Effects.

          With this model should I use the xtpoisson or ppml command?

          Good bye.



          Comment


          • #6
            Dear CARLOS ABREO,

            To estimate by ppml with multiple fixed effects, I recommend the command ppmlhdfe, available from SSC.

            Best wishes,

            Joao

            Comment


            • #7
              Dear Professor Santos.

              Do you have an example (as you gave in #4) of how to use the ppmlhdfe command.

              It would be so useful to me.

              Again thank you.

              Comment


              • #8
                Dear CARLOS ABREO,

                Please check the help file for the command.

                Best wishes,

                Joao

                Comment


                • #9
                  Thank you Professor Santos for helping me. You are very kind.
                  Best wishes.

                  Comment


                  • #10
                    Dear Professor Santos.
                    I have recently studied the ppml with the gravity model.the fixed effect of the importer country, the fixed effect of the exporter country, and the year fixed effect. The dependent variable of the data is the country pair. I want to ask you how to use the ppml stata command to check the fixed effect coefficient of each importer country ?In order to find the importer country with the largest fixed effect coefficient.
                    Can I display the fixed effect coefficient of each importer country in stata with xi: ppml Y i.countrypair i.year X1 X2 X3 command? The result of my attempt is shown in the screenshot. Does the result of coef. in the figure represent the fixed effect coefficient of the importer country?
                    And when i use the command xi: ppml Y i.countrypair i.year X1 X2 X3 command? the countrypair6、countrypair10 and so on will be omitted,and i do not know how to deal with it?
                    I am so confused. I hope to get the teacher's answer.

                    Click image for larger version

Name:	result.png
Views:	2
Size:	20.2 KB
ID:	1505495
                    Click image for larger version

Name:	warning.png
Views:	1
Size:	13.4 KB
ID:	1505497


                    Attached Files

                    Comment


                    • #11
                      It looks as if you are showing us the estimates of the pair fixed effects, not the estimates of the importer FE.

                      Best wishes,

                      Joao

                      Comment


                      • #12

                        Thank you Professor Santos for helping me.And i am so confused that i do not know how to estimate of the importer FE,because in the gravity model , the dependent variable of the data is the country pair.
                        I want to ask you how to use the ppml stata command to check the fixed effect coefficient of each importer country ?I hope to get the teacher's answer.Thank you!

                        Comment


                        • #13
                          Dear Professor Santos.
                          I am doing the ppml regression of the structural gravity model. The explanatory variable is the countrypair for the bilateral service trade volume of the 41 importer countries and the 40 exporter countries. The year is 4 years, the balanced panel. I want to control the three fixed effects of the importer country, the exporter country and the year, and i want to see the fixed effect coefficient of the importer country from the stata results. I would like to ask the teacher's what is the stata's ppml regression command to see the coefficient of the importer country?
                          Many thanks!

                          Comment


                          • #14
                            Dear Professor Santos.
                            I am doing the ppml regression of the structural gravity model. The explanatory variable is the countrypair for the bilateral service trade volume of the 41 importer countries and the 40 exporter countries. The year is 4 years, the balanced panel. I want to control the three fixed effects of the importer country, the exporter country and the year, and i want to see the fixed effect coefficient of the importer country from the stata results. I would like to ask the teacher's what is the stata's ppml regression command to see the coefficient of the importer country?
                            Many thanks!


                            Comment


                            • #15
                              I would use ppmlhdfe but include the dummies for the importer country explicitly as a regressor.

                              Best wishes,

                              Joao

                              Comment

                              Working...
                              X