Announcement

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

  • Dear Joao,
    Thank you for all the answers!
    Can the reason be that the first model does not pass the RESET test that the panel is unbalanced?

    Best,

    Olivia

    Comment


    • That is unlikely to be the case.

      Best wishes,

      Joao

      Comment


      • Hi Joao, having read many of the forums on this website, i feel that you may have the expertise to help me with my issues with stata.


        I am currently using stata for my final thesis (so i am quite new to the way it works). For my thesis i am trying to estimate a gravity model, with my variable of interest being an emu dummy variable. I have an extremely large data set, covering the period 1950 to 2013, for bilateral trade for 200 countries. Formally i want to build on a basic gravity model similar to that of Magees 2008 paper on RTA. Therefore i first want to regress the gravity model with just time effects, then time effects and dyadic effecs, then time effects and importer and exporter year effects, then time effects, dyadic effects and importer/exporter year fixed effects. The commands i have to get these models are as follows

        TFE (1)
        reg ln_trade ln_gdp1 ln_gdp2 ldist border comlang colony emu dyear*, vce(cluster pairid)

        TFE and dyadic fixed effects (2)
        areg ln_trade ln_gdp1 ln_gdp2 emu dyear*, absorb(pairid) vce(cluster pairid)

        TFE and Importer year FE and exporter year FE (3)
        reghdfe ln_trade emu, absorb(i.cty1#i.year i.cty2#i.year) vce(cluster pairid)

        TFE/ dyadic fixed effets/ importer year and exporter year fixed effects (4)
        reghdfe ln_trade emu, absorb(i.pairid##c.year i.year) vce(cluster pairid)

        cty1=IFS country code 1
        cty2= IFS country code 2

        I am relatively confident that the first two models are correctly done. However i am less so confident for specifications (3) and (4).
        This is because when i run the regressions but also include variables such as border, ln_gdp1 ect., they are not excluded in the model (which i think they should be). Are the commands correct for the last two models i am intending to regress?
        Any help, will be much appreciated
        Kind regards, Harry

        Comment


        • please ignore my last post, as I have just, realised the title of this thread. apologies

          Comment


          • Hello Joao
            im a new user of stata
            i would like to apply the gravity model to estimate the impact of logistics on export of morocco , i work on this subject for my memoire of master
            I am doing the research on the volume of trade between Morocco and 30 partner countries using the average bilateral exports over (20014-2015-2016)

            in general my model is like this: lnExporttion(Morocco and partner x) = LnD(Morocco and partner x) + lnGDP(Morocco) + lnGDPj(partner x) + lnPopulationMorocco + lnPopulation(partner) + Lnlogsitc inedx (Morocco) + LnLogisticindex(Parnetx) + Dummy Variables

            i would realy appreciate some help with the method that i should adopte and the good method of estimation that i should apply
            and what command shoud i use

            Thank you in advance for all help

            Comment


            • Hello Mr Joao
              im a new user of stata
              i would like to apply the gravity model to estimate the impact of logistics on export of morocco , i work on this subject for my memoire of master
              I am doing the research on the volume of trade between Morocco and 30 partner countries using the average bilateral exports over (20014-2015-2016)

              in general my model is like this: lnExporttion(Morocco and partner x) = LnD(Morocco and partner x) + lnGDP(Morocco) + lnGDPj(partner x) + lnPopulationMorocco + lnPopulation(partner) + Lnlogsitc inedx (Morocco) + LnLogisticindex(Parnetx) + Dummy Variables

              i would realy appreciate some help with the method that i should adopte and the good method of estimation that i should apply
              and what command shoud i use

              Thank you in advance for all help

              Comment



              • Originally posted by Joao Santos Silva View Post
                Dear Joseph,

                If you do not believe that your dependent variable really follows a Poisson distribution and you use robust standard errors, then indeed you can say you are using PPML with FE. Furthermore, if your dependent variable is not a count as in the gravity equation, then you can also say you are using the approach we proposed (Santos Silva and Tenreyro, 2006).

                Best wishes and thanks,

                Joao
                Dear Joao,
                First of all thank you for all the advice you have given in this forum. I read many of your posts but still cannot figure out a solution to my problem, please excuse that I am bothering you with this (probably) trivial problem:
                For a paper on intellectual property rights and trade I am looking at the impact of patent stocks on trade in the ICT sector. I have a panel covering 17 years and 22 countries and want to estimate a gravity model using ppml:
                1. As I cannot use importer-time and exporter-time fixed effects (they would absorb my variable of interest, i.e. “patent stock in one country at one point in time”) I can only use country pair and time fixed effects.When using them, other variables like “distance” are not omitted while they should be because of perfect collinearity. The command I use is “ppml depvar indepvar country-pair-dummies time-dummies, cluster(pair_id)”
                2. When I include importer-time and exporter-time fixed effects (as a check), other gravity regressors like the GDP are not omitted either, even though they should be, due to perfect collinearity.Is this hinting towards a flawed implementation?
                3. When I use xtpoisson, the problem disappears, i.e. variables are dropped if they are collinear. Should this ot also happen when using ppml?
                Any help or suggestion is much appreciated. Thanks in advance,
                max

                Comment


                • Dear Max,

                  If a model has 2 variables that are collinear, we can choose which one to drop and which one to keep. I do not know if Stata has precise rules for this, in my experience Stata typically keeps the first one in the model. So, what is happening is that in your models Stata is dropping a fixed effect and keeping distance when you wanted it to do the opposite. I believe that is what you will get if you in your command the dummies appear immediately after the dependent variable. This also explains 2 & 3.

                  In short, When we run these models we need to think carefully about what regressors can be meaningfully included in the model and we should make sure we understand why each dummy is being dropped. Otherwise we may end up interpreting the coefficients that are meaningless.

                  Best wishes,

                  Joao

                  Comment


                  • Dear Joao,
                    Thank you very much for your reply! Interestingly no FE-dummy is dropped in my regression and changing the order of regressors in my command does not make a difference to the results. For my work I can just leave out the regressors of which I know that they are collinear but I am still curious how this can be.
                    Should I rather use “xtpoisson….., fe robust” instead of "ppml...., cluster(pair_id)" in my case as I cannot use country-time fixed effects?
                    Thank you again so much for your advice!
                    Best,
                    max

                    Comment


                    • Dear Max Mueller,

                      That is interesting. Would you be able to send me your data by email so that I can check what is going on?

                      Best wishes,

                      Joao

                      Comment


                      • Dear Joao,
                        I just emailed my dataset to the email address I found on your website as the upload and private message did not work here in statalist. I hope this reaches you.
                        Thanks again,
                        max

                        Comment


                        • Dear Max Mueller,

                          Thanks for sharing the data. The problem is with the way you crate and drop the dummies. If you want to explicitly drop the country dummies you need to use the noomit option when creating the dummies. Otherwise, simply do not manually drop the country dummies.

                          The general advice is that we always need to be very careful to make sure we understand what dummies and what variables are in and out, and why. Never expect thinks to be as you think their are and always check and double check!

                          Best wishes,

                          Joao

                          Comment


                          • Dear Joao,
                            Thank you so much for your help, I appreciate it a lot and would not have known whom else to turn to.
                            Best regards,
                            max

                            Comment


                            • Dear all,


                              I am writing here since I found this thread very interesting for my research and I hope you can help me to clarify some doubts I have.

                              If I understand correctly, count data have to be fitted with poisson/negative binomial regression ( these are the most common distributions applied to these data) but poisson/negative binomial distributions can be applied also to continuous non-negative values.

                              I am asking this since I need to fit some continous non-negatative data for which the negative binomial distribution seems to be most appropriate but I am struggling to find littérature that supports this usage. Wooldrige (2002) states that the Poisson panel fixed effect models can also be applied to continous variables but the discussion does not address the issue with negative binomial distribution.

                              If my understanding is correct, negative binomial models are commonly applied in trade & gravity models where the dependent variable is fractional ( it has decimal number). Am i right ? If so, can I use the stata command xtnbreg on a dependent variable with continous (fractional) non-negative values ?

                              Thanks a lot and my apologies for this somewhat long post.

                              Comment


                              • Dear Mario,

                                Using negative binomial for non-negative data is not standard in any area that I am familiar with (including gravity equations) and it is not recommended. Poisson regression, however, should be fine. The reference for that is this paper.

                                Best wishes,

                                Joao

                                Comment

                                Working...
                                X