Announcement

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

  • #31
    Dear Joao,

    I am a PhD-student in Hungary and I am focusing on estimating border effects and Vinerian trade effects of EU accession in the Visegrad countries.

    I would like to run a gravity regression in Stata11 with the ppml estimator using three fixed effects: one for the importer country, one for the exporter country and one for the year. The following error message appears after I write the command:
    ppml xij lngdpi lngdpj lnpopi lnpopj lndistance adjij i.i i.j i.year
    factor variables and time-series operators not allowed

    Can you please give me some recommendation?

    Regards
    Adam Markus

    Comment


    • #32
      Dear Adam,

      Unfortunately, -ppml- is not compatible with factor variables. What you have to do is to create all the dummies yourself (for example using the -xi- command) and then run the model including the variables you created.

      Hope this helps,

      Joao

      Comment


      • #33
        Dear Joao,

        thank you very much. I will try it.

        Have a nice day

        Adam

        Comment


        • #34
          Hi everyone
          I try to set data panel for my gravity model with this command :
          sort $id $t
          xtset $id $t
          xtdescribe
          xtsum $id $t $ylist $xlist

          but what I got is:
          xtset $id $t
          repeated time values within panel

          How to set data panel for gravity model? Thanks before.

          Comment


          • #35
            Dear Joao,

            thank you for the advise, it works. Although, I have another question, I would be grateful, if you would answer it.
            How can I get RMSE when using the ppml estimator?

            Regards
            Adam

            Comment


            • #36
              Hi Adam,

              I assume you want something like this:
              Code:
              clear all
              sysuse auto
              ppml price mpg rep78
              predict double y_hat
              g double se=(price-y_hat)^2
              su se
              di "RMSE = " sqrt(r(mean))
              All the best,

              Joao

              Comment


              • #37
                Dear Joao,

                thank you very much, I think I could succesfully do it.
                Although I also checked it with OLS. There I get result for RMSE, and I also claculated it following your suggested procedure, but the two RMSE are not exactly the same. There is some minor difference between them (less than one hundredth). Is this a problem or I made something wrong?

                Kind regards
                Adam

                Comment


                • #38
                  Hi Adam,

                  That must be just due to numerical problems (rounding at different stages), so nothing to worry about. Notice that the RMSE for a model in logs is not comparable to the RMSE of a model in levels.

                  All the best.

                  Joao

                  Comment


                  • #39
                    (repeated below)
                    Last edited by Said Jafar; 21 May 2016, 08:45. Reason: the same post posted two times

                    Comment


                    • #40
                      Dear Joao,

                      I did not know that it is possible to include fixed effects as in #27 until very recently. I could never do my former regression with importer-time, exporter-time fixed effects (26 hours of estimation, no result). I will try to this style, with lots of hope. Just would like to confirm, the code above is correct for crossectional data, is not it? Like, for panel data, we need to cluster by our panel variable (or distance), as below;

                      Code:
                      ppml trade fta1 fta2 fta3 F_*, cluster(id_ij)
                      Thanks for your consideration.

                      Kind Regards,
                      Dias

                      Comment


                      • #41
                        Dear Dias,

                        You are right; I should have used clustered standard errors. Thanks for pointing it out.

                        All best wishes,

                        Joao

                        Comment


                        • #42
                          Dear Joao,

                          Thank you for your response.

                          I follows the methodology and tried to create pair fixed effects. But i am afraid what i got might not be correct. Please, would you comment, does this results look correct?

                          Code:
                          .
                          
                          . sum F_ijid_Xid__166_147, det
                          
                                              id_i==166 & id_j==147
                          -------------------------------------------------------------
                                Percentiles      Smallest
                           1%            0              0
                           5%            0              0
                          10%            0              0       Obs              547800
                          25%            0              0       Sum of Wgt.      547800
                          
                          50%            0                      Mean           .0000365
                                                  Largest       Std. Dev.      .0060422
                          75%            0              1
                          90%            0              1       Variance       .0000365
                          95%            0              1       Skewness       165.4902
                          99%            0              1       Kurtosis          27388
                          Best Regards,
                          Dias

                          Comment


                          • #43
                            The result means that you have less than 1% of ones; does not look that strange to me.

                            All the best,

                            Joao

                            Comment


                            • #44
                              Dear Joao,

                              thank you, yes I thought so about comparing them.

                              Regards

                              Adam

                              Comment


                              • #45
                                Dear Joao,
                                I'm Flóra Panna Biró a master's student, and I'm working on a research about the impact of the Worldwide Governance Indicators(WGI) on inward FDI in Latin-America. My data is for 2001-2012, 18 target and 29 source countries (60% zeros of FDI-not missing just zero). I use gravity model, ppml with year and pair fixed effects. I performed the model and it gave me consistent results, according to the RESET test there are no misspecifications.

                                I still got one concern, cause I have been told, that not every model can be used if one of my variables can only take a value between a minimum and a maximum.
                                WGI is continous as it can take any value between 0 and 5, but it has a maximum. Can it be a problem for ppml?

                                Thank you!

                                Regards,
                                Flóra
                                Last edited by Flora Panna Biro; 27 Oct 2016, 02:16.

                                Comment

                                Working...
                                X