Announcement

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

  • #46
    Dear Mr Silva:
    Thanks a lot! And when I want to use the PPML regression method in the gravity model and add time and country-pair fixed effects, I use the command: ppml Y X1 X2 X3 .... i.countrypair i.year, cluster(countrypair) .Stata prompt error : factor-variable and time-series operators not allowed, I don't know why this error occurred and how to slove it? The second problem is that when I see some of the literature is also using the ppml regression and adding the individual and country fixed effect, display of the ppml regression results table below the comment "The results of the time dummy variable and the country dummy variable are not listed here", what does it mean? If it is necessary to perform this step, what is the stata command?
    Thanks a million,
    Alice

    Comment


    • #47
      Dear John Alice

      Please use the prefix xi before ppml; that is, write "xi: ppml Y X1..."
      The comment means exactly that: the estimates of the dummies are typically not reported in the tables of results.

      Best wishes,

      Joao

      Comment


      • #48
        Hi John,
        If I may add another suggestion on top of Joao's reply, you should change your syntax to

        Code:
        xi: ppml Y i.countrypair i.year X1 X2 X3
        so that the fixed effects are always placed before any non-fixed effect regressors. The reason for this is that stata commands typically drop perfectly predicted variables from right to left. That way, if, eg, X1 is perfectly collinear with your fixed effects, stata will not compute an estimate for X1. However, if the X's are placed before the fixed effects, Stata will drop one of the fixed effects to resolve the perfectly collinearity problem, and you will wind up with a normal-looking estimate for X1 that is actually spurious.

        Regards,
        Tom

        Comment


        • #49
          Dear Mr Tom:
          Thank you very much for teacher's answer. Does it means that this command can be used to handle the "factor-variable and time-series operators not allowed" error displayed by stata?When I use this command, stata shows "matsize too small"?
          Thanks a million,
          Alice

          Comment


          • #50
            Dear Mr Silva:
            The problem that I discussed with you is the stata command of the country-pair and year fixed effect. Now I want to ask when the panel effect data individual is the export--importcountry group and the fixed-effect regression of OLS based on the gravity model is used. To get the Year fixed effect,the Export country fixed effect, and the Year-- export country fixed effect at the same time , what is the Stata command?
            Thanks a milloin,
            Alice

            Comment


            • #51

              I have a dataset of different countries ranging from 2005 to 2016. It looks at the alcohol consumption abundance as a population percentage in each country for every year. I am looking at the effect of policy implementation on alcohol consumption and have put in columns with dummy variables for 'introduction of policy 1' and 'introduction of policy 2'. e.g. I have created a new column and for every year that policy 1 is in place i have put in '1' and '0' otherwise.

              I have then created the following model in Stata:
              xtset country_code xtreg difference i.year policy1 policy2, fe robust
              This is a fixed effect model with country and year fixed effects. I have done the year fixed effects by including 'i.year'. Is this correct?

              My issue is that the output had no significant results. What does the i.year command do to my data? What would it look like algebraically? Does i.year remove the explanatory power of my dummy variables? Would you suggest that I remove i.year and only do a country fixed effect model or are there any alternative/better ways to go about this?

              My original data looks a bit like this:

              Data on Alcohol Consumption

              Comment


              • #52
                Originally posted by John Alice View Post
                Dear Mr Tom:
                Thank you very much for teacher's answer. Does it means that this command can be used to handle the "factor-variable and time-series operators not allowed" error displayed by stata?When I use this command, stata shows "matsize too small"?
                Thanks a million,
                Alice
                Hello John,

                Yes, as Joao explained above, if you use the "xi" prefix, it will allow you to use factor variables.

                For the "matsize too small" error, there are two considerations. First, the maximum number of regressors allowed by Stata is 11000. To make sure your Stata is configured to allow you to utilize this maximum, you should input

                Code:
                set matsize 11000
                That said, there are also other commands available that enable you to get around this matsize restriction. This is actually a nice opportunity to advertise a new command I have worked on called ppmlhdfe (a joint work by myself, Sergio Correia, and Paulo Guimaraes). Using ppmlhdfe, you would type

                Code:
                ppmlhdfe Y X1 X2 X3, a(countrypair year)
                which should give you a ppml regression of Y on X1, X2, X3, and fixed effects for countrypair and year. You can think of this as like a generalization of xtpoisson. Whereas xtpoisson allows you to "absorb" one fixed effect (in this case, countrypair), ppmlhdfe will allow you to absorb any number of fixed effects. It also has added checks to verify the correctness of your results, similar to ppml.

                Regards,
                Tom
                Last edited by Tom Zylkin; 25 Mar 2019, 07:38.

                Comment


                • #53
                  dear Joao

                  I also hope to add time-varying fixed effect to xtpoisson

                  could you let me know how to?
                  if you have any suggestion~~ thank you

                  Comment


                  • #54
                    The easier way is perhaps to use the command ppml_panel_sg.

                    Best wishes,

                    Joao

                    Comment


                    • #55
                      Dear Joao,
                      I wonder why Mtr is not dropped in xtpoisson
                      isnt it dropped with pair fixed effect normally?

                      Thank you

                      Comment


                      • #56
                        Sorry, what is Mtr?

                        Comment


                        • #57
                          sorry its multilateral resistance term

                          Comment


                          • #58
                            Dear Joao,
                            is there command to add fixed effect with ppml? such as ',fe'
                            or should i make dummy variables??


                            thank you!!

                            Comment


                            • #59
                              With ppml you would have to create dummies, but that is not practical. Consider using xtpoisson with fe, ppml_panel_sg, or ppmlhdfe; all of these commands deal with fixed effects.

                              Best wishes,

                              Joao

                              Comment


                              • #60
                                Dear Joao Santos Silva,

                                I have a question of the xtqpml. Previously, I ran a model with just country fixed effects and year fixed effects. I am trying to run a PPML with pair-country fixed effects.

                                Code:
                                ppml export lndist contig comlang_off comcol fta_wto Brexit EUtrade BrexitEU year_* pair_*, cluster(distw)
                                How can I run a similar one to this one, but by the inclusion of country-pair fixed effects? If I were to drop a number of countries in order to run this model with inclusion of pair-country dummies then it takes a long time to run. I tried the following model

                                Code:
                                xtpqml export lndist contig comcol fta_wto Brexit EUtrade BrexitEU year_*, fe i(pairid) cluster(distw)
                                that code gets rid of a few variables such as lndist, contig etc. What am i doing wrong? should I cluster by pairid instead?

                                I generated pairid through

                                Code:
                                egen pairid = group(ReporterName PartnerName)
                                tab pairid, gen(pair_)
                                I would really appreciate your input!

                                Thanks in advance,
                                John

                                Comment

                                Working...
                                X