Announcement

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

  • #76
    Thanks a lot for your reply Joao. I tried

    xi : ppml tradescaled fta i.it i.jt lndist contiguous com_language same_country common_colony, cluster (ijt)

    where tradescaled = trade/1000 ( level form and not log)

    and got a warning :variance matrix is nonsymmetric or highly singular. There were no standard errors or z values displayed in the result.


    For the code you suggested :
    xtset ij xtpoisson trade fta i.it i.jt , fe cluster (ijt)
    Stata gives an error saying "cluster() not allowed"

    I therefore tried :

    xtset ij xtpoisson trade fta i.it i.jt , fe


    This code has been running for more than 3 hours now with around 27 iterations complete. From the 1st iteration itself the log likelihoods are "non-concave".

    Is that okay? Or is it something erroneous? Please suggest.



    Regards
    Kalpana

    Comment


    • #77
      Dear Kalpana,

      The "non-concave" message is not a problem unless it is present in the final iteration.

      If you cannot get clustered standard errors with -xtpoisson- you can try -xtpqml-

      The problem you are having is possibly caused be the presence of "singletons"; that is, dummies with just one observation equal to 1. Alternatively, it can be that Stata is not excluding a variable that is perfectly collinear with others.

      Best regards,

      Joao

      Comment


      • #78
        Dear Joao,

        Thanks for writing back.

        Yes -xtpoisson- is not clustering the errors. I let it run till about 117 iterations, before stopping it as I did not know how further would it go and which would be the final iteration.

        I tried using -xtpqml-

        xi: xtpqml tradescaled fta i.it i.jt , fe cluster(ijt)

        But got a warning : group variable (i) must be nested within clusters.

        Any thoughts/suggestions on this?

        Thankns & Regards
        Kalpana

        Comment


        • #79
          Dear Kalpana,

          It appears that the way you are clustering the standard errors is incompatible with the way you are defining your panel. Please check the help file.

          Best wishes,

          Joao

          Comment


          • #80
            Hi Kolpana,

            Two things that may be helpful for you here:

            1. Just so you know, xtpoisson does not work very well with the specification you are using (pair fixed effects plus country-time fixed effects). I would recommend you check out an ssc command I created specifically for this reason.

            Try the following:

            ssc install ppml_panel_sg, replace

            ppml_panel_sg tradescaled fta, ex(i) im(j) y(t)

            where I assume you have variables in your data "i", "j", and "t" corresponding to exporter, importer, and time. It will cluster your ses by pair by default, but you can adjust this by adding a "cluster()" option if you prefer.


            2. Note that because you have pair fixed effects in your specification, these should always absorb ln_dist, colony, contig (etc) since these are pair-specific variables which do not vary over time. When you have pair fixed effects in your specification you will only be able to compute estimates for time-varying bilateral variables (such as the presence of an FTA).

            To see this, type

            ppml_panel_sg tradescaled fta lndist contiguous com_language same_country common_colony, ex(i) im(j) y(t)

            You will see that all variables aside from fta drop because they are collinear with your fixed effects.

            Hope this helps!

            Tom
            Last edited by Tom Zylkin; 29 Dec 2016, 07:32.

            Comment


            • #81
              Dear Mr. Joao,

              I need clarifications on a few things concerning gravity model of trade.
              Say I am dealing with bilateral trade (specifically exports) between 1 exporting country and 5 importing countries. since there are 5 importing countries and I need to create dummy variables for the importer fixed country effects, Should I create, 4 dummy variables or 5 dummy variables for the importer specific countries?

              Also, as there is only 1 exporter, do I have to create an exporter dummy variable as well.

              I appreciate your thoughts on this.

              Kind regards

              Comment


              • #82
                Hi there,

                Since you only have 1 exporter, you do not need a dummy for that. For importers, it is true that you only need 4 dummies, but I always recommend including all the dummies in the model and let Stata choose which one to drop at the estimation stage.

                Best wishes,

                Joao

                Comment


                • #83
                  Thank you very much Mr. Joao for your response.

                  Another thing that I would like to understand is that, because the fixed effects model drops the time - invariant variables which requires another regression of the individual effects on the distance and other dummy variables, suppose I use the PPML, should I do separate regressions for time-variant and time- invariant variables, (or) include all variables in one regression?



                  Comment


                  • #84
                    Hello again,

                    To be able to give you reliable advice I would need to know much more about what you are doing and why you are doing it, but I would not do the second regression you mention. I would just estimate the model that you are interested in and interpret the parameters of the variables that are not dropped.

                    Best wishes,

                    Joao

                    Comment


                    • #85
                      I am trying to estimate a gravity model for Vanuatu beef export as part of my MSc research.

                      The scenario is: I would like to estimate the impact of several variables specific for Vanuatu Beef export to 5 partner countries for the period 2006 -2015. The explanatory variables selected are:average export price, partner country domestic beef consumption, partner country GDP per capita, volume of exporter beef production, Exchange rate, import tariff level and distance. I also included dummies for common language, common colony, and the regional trade agreement (RTA). the dependent variable is volume of beef export.

                      So far, I did data transformation (logs) of the explanatory variables except the dependent variable and I have chosen to use PPML because there are observable Zero export values. From the previous posts on PPML and gravity model, I've seen a post where the specification for the PPML estimation included cluster(ldis). May I ask why cluster(ldis)?


                      Thank you once again for your valuable suggestions

                      Comment


                      • #86
                        Thank you for the additional information.

                        The fist think I note is that your sample is rather small (50 observations?) and therefore you should keep your model as simple as possible, or try to find more data. I this scenario I suggest that you just to -xtpoisson- with FE and interpret the estimates you get; forget about doing the second regression you mentioned before.

                        Clustering the standard errors by distance will make the estimated standard errors robust to possible serial correlation and heteroskedasticity. You should do this but keep in mind that these standard errors are only reliable if you have a large number of clusters and therefore you need to be cautious because you only have 5.

                        Best wishes,

                        Joao

                        Comment


                        • #87
                          Thank you so much for your timely response and helpful suggestions.

                          So by using xtpoisson fe, so similar to the previous suggestion, I will include all variables and let stata drop the time invariant variables?

                          Also, what is the difference between xtreg and xtpoisson?

                          Comment


                          • #88
                            I've figured out when to use xtreg and xtpoisson from previous threads.

                            Comment


                            • #89
                              Great; sorry for the slow reply.

                              Joao

                              Comment


                              • #90
                                No worries. Happy to have figure it out. Another thing is,

                                According to

                                Originally posted by Clyde Schechter View Post
                                -xtset country year- will automatically include country fixed effects in any -xt- regression command. But it will not incorporate time effects in any way.

                                So in your model, if you want to model a linear time trend, you need to include year as one of the predictor variables in your model. Just add it to the list of predictor variables in the regression command, e.g. -xtreg outcome predictor1 predictor2 year, fe-.
                                Does this mean that once I specified the panel data as xtset "country, year', I do not have to include the country dummies as a predictor variable in the command for xtpoisson....fe?

                                Comment

                                Working...
                                X