Announcement

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

  • ppmlhdfe for poisson panel-time fixed effects

    Dear all,

    I'm working on a project in which I run a fixed-effects Poisson regression with dummy variables for panel and time. I came across the -ppmlhdfe- command, and I wonder if it's what i'm looking for. I have two questions:

    1. What is the difference between running:

    Code:
    ppmlhdfe depvar indepvar1... , absorb(i.panel#i.time) vce(robust)
    and running:

    Code:
    egen panel_time = group (panel time)
    xtset panel_time
    xtpoisson depvar indepvar1... , fe vce(robust)
    (besides the fact that -ppmlhdfe- is much faster?)

    2. For the time variable I have 2 options: year or month.
    Sholud I use just month for the fixed-effects (i.e. absorb(i.panel#i.month)), or should I use both year and month (i.e. absorb?(i.panel#i.year#.i.month))?

    Thanks!
    Eran


  • #2
    Dear Eran Itskovich,

    I do not think you are using these commands correctly; if you do, they should produce the same result. For example, for xtpoisson with panel and time fixed effects you need something like

    Code:
    xtset panel time
    xtpoisson depvar indepvar1... i.time , fe vce(robust)
    Please check the help files of these commands for examples.

    Best wishes,

    Joao

    Comment


    • #3
      Dear Joao Santos Silva,

      Thank you for your reply.
      Actually, I do get the same results when running -xtpoisson- and -ppmlhdfe-, just like you suggested. I wonder, however, when I should use one of them and not the other. In other words - what is the differences between these approaches?

      Eran

      Comment


      • #4
        It seems to me that you're not separately including time and panel fixed effects but panel x time fixed effects. If you didn't have monthly data -- so your time variable was annual -- this would eliminate all variation in your data and you'd get no estimates. You can only do it because your have monthly data. But I doubt that's what you mean. By generating the group dummies the way you did, the same thing happens with xtpoisson.

        If you absorb by i.panel#i.year#.i.month then you will have nothing left to explain. How many total time periods do you have? How big is N?

        Comment


        • #5
          Dear Jeff Wooldridge ,

          I have a total of 190 locations, across 13 years. Each observation is a day in a specific location, which means I have a total of 902,120 obsevations (190*4,748). I first tried to run the -ppmlhdfe- using absorb(i.location#i.day), but it drops a lot of singletons so the model can't run properly.
          That's why I tried to use month as the time fixed-effect. Does it make sense?
          Anyway, I ran the following command:

          Code:
          ppmlhdfe depvar indepvar1..., absorb(i.location#i.year#i.month) vce(robust)
          and it produced the results I expected. The question is whether I got the fixed-effects right.
          Can you please advice me on this?

          Thanks!
          Eran

          Comment


          • #6
            Hi all,

            Hopefully this is the best place where to post my question but please feel free to direct me if otherwise.
            I have a slightly different issue than Eran, as when I run ppmlhdfe and xtpoisson I get different results, which makes me think that I am doing something wrong with the fixed effects.
            My panel comprises 1,646,910 unique observations, nested within 29 countries,1,893 diseases and across 30 years. My dependent variable is a nonengative count with a large share of 0s (90%) that indicates whether a clinical trial took place in a certain country-disease-year.

            I set my panel as follows:
            Code:
            egen country_disease= group(country disease), label
            xtset country_disease year
            Then, I run my FE Poisson model:
            Code:
            xtpoisson depvar i.x1, fe eform nolog
            However, when I run ppmlhdfe as follows, I get considerably different results:
            Code:
             ppmlhdfe depvar i.x1, a(year country_disease) eform nolog
            On a related note, when I try interacting the FE - as I noticed earlier in this thread, I get the following result:
            Code:
            ppmlhdfe depvar i.x1, a(i.year#i.country_disease) eform nolog
            (dropped 1646910 observations that are either singletons or separated by a fixed effect)
            insufficient observations
            Any help would be tremendously appreciated,

            Thanks!

            Comment


            • #7
              Dear Arianna Gentilini,

              Your xtpoisson regression does not include the fixed effects that you include when using ppmlhdfe. On the interaction, I do not think you need the prefix i., but check the help file.

              Best wishes,

              Joao

              Comment


              • #8
                Thanks Joao Santos Silva for the promt reply.
                In the helpfile is says I should use i.var1#i.var2 to absorb pairwise combinations of two or more categorical variables (e.g. country-time fixed effects), which is what I would like to do.
                However, I get an error message as below:
                Code:
                ppmlhdfe depvar i.x1, a(i.year#i.country_disease) eform nolog
                (dropped 1646910 observations that are either singletons or separated by a fixed effect)
                insufficient observations
                I am unsure what insufficient observations means as I should have enough observations for the analysis (xtpoisson runs without problems).
                Have you ever came across such issue? I have observations for 54,897 country-disease pairs across 30 years.

                Best wishes,
                Arianna

                Comment


                • #9
                  Dear Arianna Gentilini,

                  The following command is from the help file
                  Code:
                   ppmlhdfe trade fta, a(imp#year exp#year imp#exp) cluster(imp#exp)
                  As you see, they do not use the i. prefix.

                  Best wishes,

                  Joao

                  Comment


                  • #10
                    Thanks Joao.
                    Unfortunately, even without the i., i.e. by using the following code, I still get the same result of insufficient observations.
                    Code:
                    ppmlhfe depvar i.x1, a( year#country_disease) eform nolog
                    I was wondering if you ever came across such message and if you knew how I could address it.

                    Many thanks,
                    Arianna

                    Comment


                    • #11
                      I suggest you contact the authors of the command.

                      Best wishes,

                      Joao
                      Last edited by Joao Santos Silva; 02 Nov 2022, 12:54.

                      Comment

                      Working...
                      X