Announcement

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

  • xtpoisson vs ppml

    Dear statalist
    Here is Sujin Kim

    I hope to know what is difference between xtpoisson and ppml command

    and also which fixed effect -fe- means after xtpoisson command


    thank you


  • #2
    xtpoisson is the same as ppml with dummies for each unit in the panel. The way the estimates are obtained is different (xtpoisson is much faster) but the results are the same.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Pro Joao Silva.


      Thank you so much for the information,

      I hope to know which -fe- fixed effect included.


      Because I normally used time-varying fixed effect and country pair fixed the effect
      However, I do not know which fixed effect is automatically used in this case


      Thank you

      Comment


      • #4
        It is country pair fixed the effect.

        Joao

        Comment


        • #5
          Thank you so much!!

          Comment


          • #6
            Originally posted by Joao Santos Silva View Post
            It is country pair fixed the effect.

            Joao
            Dear Prof Santos Silva,
            Dear Statalists,

            I am new to Stata and would have a question regarding usage of the command xtpoisson and ppml.
            I hope this is not totally off-topic now, but I do hard to understand how to properly prepare my data for these tests.

            In this forum I´ve read, that the panel data first needs to be prepared with the
            - global id ...
            - global t ...
            commands.

            And afterwards needs to be defined as panel data for Stata, with
            - xtset "var_id" "var_t"

            In a last step we can apply the commands xtpoisson or ppml.

            My question would be regarding the definition of the id:
            Do I need to generate a group of country pairs and define them as id, or do I just pick one country (for example the exportercountry)?

            Sorry for borthering the forum with such basic questions, but I couldn´t find any document that guids from the scratch, how to exactly prepare data with bilateral effects. I would also appreciate such documents for beginners.
            FYI: My objective is to test the influence of Migration on financial flow. I have migration and financial data of more than 5 years, and OECD countries as host and origin countries (also some more as origin).

            Thank you for your help in advance guys!
            I really appreciate this platform and the members in it.

            Best

            Comment


            • #7
              Dear Onur Taskin,

              I believe you have to create your id based on pairs, but others will know more about this.

              Best wishes,

              Joao

              Comment


              • #8
                Dear Prof Joao Santos Silva,

                thank for the fast reply and opinion!

                Ok perfect.
                This made sense before aswell, but I couldnt find any page to be sure.

                But I am thankful for every other recommendation and opinion aswell.

                Best,
                Onur

                Comment


                • #9
                  Dear Joao,

                  I'm estimating a bilateral gravity model for migration for a given country. My understanding is that PPML with fe (included below as dum_country) is equivalent to xtpoisson, fe (as in the second line of code below)

                  Code:
                  ppml EMI EMI_LAG DUM_COUNTRY*
                  Code:
                  xtpoisson EMI EMI_LAG,fe
                  The estimates look almost the same. However, for prediction, the values predicted differ notoriously, with ppml being the one with reasonable values. I was wondering if the "xtpoisson" model required anything specific option to be added to -predict- (mu, xb...). For ppml, I tried leaving just -predict- and also adding ,mu and it gave the same results.

                  Many thanks for your valuable help.

                  Ainhoa

                  Comment


                  • #10
                    Dear Ainhoa,

                    xtpoisson simply cannot be used for prediction because it does not estimate the fixed effects. To make predictions after xtpoisson you would need to obtain the fixed effects manually and then use them in the predictions.

                    Best wishes,

                    Joao

                    Comment


                    • #11
                      Dear Joao,

                      That's really clear! Thanks a million for your reply and all the great work you do in clarifying all these doubts.


                      Ainhoa

                      Comment


                      • #12
                        Dear Joao,

                        Would PPML and GLM Poisson Link: Log Family be equivalent? The code below is shown for @crossid fixed effects (Dummyid*):
                        Code:
                        ppml Y X DummyId*
                        Code:
                        glm Y X DummyId*, family(poisson) link(log)
                        I get the same predictions, but I wanted to make sure. Thanks again,

                        AInhoa

                        Comment


                        • #13
                          Dear AInhoa,

                          When the ML estimator exists, both commands are equivalent. ppml has the advantage of dealing with cases where the ML estimator does not exist.

                          Best wishes,

                          Joao

                          Comment


                          • #14
                            Excellent, thanks so much!

                            Best,

                            Ainhoa

                            Comment


                            • #15
                              Dear Joao,

                              One last question: how can I include country-pair fixed effects in the ppml command from post #9? The dummy I showed there referred only to country fixed effects, but not country-pair fixed effects.

                              It should be noted that I want to use this model for forecasting at a later stage, so I want the dummy coefficients to be there in order to use them for my forecast.

                              Thanks a lot,

                              A.
                              Last edited by Ainhoa Oses; 07 Feb 2019, 11:37.

                              Comment

                              Working...
                              X