Announcement

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

  • Gravity ppml, omitted variables, interaction - deviation

    Dear statalist,

    Hello, Im master student who is writing thesis with Gravity PPML model




    I hope to run regress panel data using PPML method with
    country- pair , import_year , export_year dummy variables( fixed effect)


    I have 7year, about 170 import, 170 export countries


    I tried this stata command~



    egen it=group(i year)
    egen jt=group(j year)
    egen ij=group(i j)

    tab it,gen(it_dum)
    tab jt,gen(jt_dum)
    tab ij,gen(ij_dum)

    set matsize 11000

    ppml value dis_ij ban regionalization language it_dum* jt_dum* ij_dum*


    But I've got 2000 omitted dummy variables, and interaction :deviation -

    also, it takes too long time, so I was failed to get result several times

    I have core i5 laptop, I wonder its not enough to regress big data..



    Could you give me any advice?
    It would be very appreciated!



    Thank you so much

    Sincerely

  • #2
    Hi Kim,
    There is a stata command I have written called -ppml_panel_sg- that complements -ppml- for the particular specification you are trying to run (in particular it runs much faster when you have all of the fixed effects you are trying to estimate.) You can find out more about the command on my website here.

    Just a few other comments which may be important though:
    1. in the presence of the "pair" (ij) dummies you need for your main covariates to vary over time within pairs in order for them to be identified. So if dis_ij is bilateral distance, which does not vary over time, this variable actually cannot be identified here.
    2. the number of omitted dummies probably is not all that concerning, since you would expect to have a lot of collinearity between these.
    Hope this is all helpful!

    Regards,
    Tom

    Comment


    • #3
      Dear Tom!

      Thank you so much for your help,

      1. I tried command

      ppml_panel_sg value ban regionalization language it_dum* jt_dum* ij_dum*,export(j) import(i) year(year)

      --> excluded distance because of colinearity~!

      2. Do you mean I can ignore omitted dummies~?

      Thank you !!



      Comment


      • #4
        Hi Kim,
        1. Please see comment 1 in my previous post. As I suspected, distance cannot be identifed because it only varies by ij. Thus it is absorbed by your ij fixed effects.

        2. It should not be necessary to include "it_dum* jt_dum* ij_dum*" explicitly within your regression syntax. The command includes these fixed effects automatically depending on what options you choose. Please see the help file for more details. (but yes you can ignore omitted fixed effects!)

        Again, hope this is helpful.
        Tom

        Comment


        • #5
          Thank you so much Tom!
          Its so much helpful!

          I will try again~~!!

          Comment


          • #6
            Dear Tom,

            May I ask you another question~?/


            language is also dropped,
            so I got only coefficient of 'ban', 'regionalization' dummy variable


            ppml_panel_sg value ban regionalization, export(j) import(i) year(year) guessI(it) guessO(jt) guessD(ij)
            ppml_panel_sg value ban regionalization, export(j) import(i) year(year)


            I tried these 2 command~ but I got same result,


            I wonder why I have same result~,


            !! thank you

            Sincerley

            Comment


            • #7
              Hi Kim,
              It does look to me like these two syntaxes should lead to the same result. The "guess" options are just for setting initial guess values when solving for the solution. They should not affect the answer.
              Regards,
              Tom

              Comment


              • #8
                Dear,

                Thank you!
                I hope to add time varying fixed effect , country -pair fixed effect,

                According to my regression result,

                Fixed Effects included: j-year, i-year, j-i
                Clustered standard errors, clustered by j-i (default)
                2396 obs. dropped because they belong to groups with all zeros or missing values


                I got this message~

                I think it already include time varying(j-year, i-year), country pair fixed effect (j-i)

                so, now I wonder if I don't need to put any other options~ ?


                Sincerely!

                Comment


                • #9
                  Dear Tom
                  Sorry Tom again,
                  but, I hope to know coefficient of fixed effect dummy variables,
                  Is there a way to know with 'ppml_panel_sg'?

                  Sincerely

                  Comment


                  • #10
                    Dear Professor Zylkin,

                    I am reading all the information available in your website and it is really helping me a lot. But I still don't understand a few things.

                    I am trying to use the methodology of the WTO's Advanced Guide to Trade Policy Analysis to evaluate the impact of a potential RTA between Mercosur and the European Union. I have set a database with more than 200 importers and exporter, for a pulled panel data from 1995 to 2015, with five years intervals (6 periods in total). Therefore, I can't create the pair fixed effects, since the number of variables exceeds the maximum allowed by Stata. For this reason, I intend to use your command (ppml_panel_sg).

                    It works well for calculating the RTA coefficient, that is an important part of my task. Nevertheless, I still need the pair fixed effects to construct the trade costs. In the DO-file of the WTO's guide, the command is:

                    * Construct the trade costs from the pair fixed effects
                    forvalues ijt = 1(1)$NTij_8{
                    qui replace PAIR_FE`ijt' = PAIR_FE`ijt' * _b[PAIR_FE`ijt']
                    }

                    egen gamma_ij = rowtotal(PAIR_FE1-PAIR_FE$NTij )
                    replace gamma_ij = . if gamma_ij == 1 & exporter != importer
                    replace gamma_ij = 0 if gamma_ij == 1 & exporter == importer
                    generate tij_bar = exp(gamma_ij)
                    generate tij_bln = exp(gamma_ij + RTA_est*RTA)

                    So, using ppml_panel_sg command, is it possible to recover the pair fixed effects?

                    Thanks in advance!
                    Best wishes,
                    Paulo

                    Comment

                    Working...
                    X