Announcement

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

  • Discrepancy between xtpoisson and ppmlhdfe commands

    Hello,
    It is my first post on the platform, thus I hope to be as clear as possible and compliant with the rules as well. I tried to find a clear answer in many other posts but did not quite manage.

    I'm working with a large (unbalanced) panel dataset (45,000 firms in a time-span of 23 years). The panel contains information on firm's financial indicators and performance variables (e.g., liabilities, assets, debt, dummy for quoted firms, and others) and firm-level innovation variables (e.g., patent filed for each year, patent stock, green patents, technology-specific patents, and others).

    Since my dependent variables are non-negative count variables, I am trying to estimate the effect of the following variables on the number of green patents using a fixed effects poisson model using the -xtpoisson, fe - command as indicated next:

    Code:
    xtpoisson green_pat tot_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales i.year i.GICS_code if year>=2010, fe
    Now, for other specifications of the same model (e.g., I am using winsorized variables, or I am adding some new controls, or I am clustering SE on different variables), -xtpoisson, fe- does not converge and returns no output. I know that this can be due to the large dataset. I encountered the -ppmlhdfe- command as a substitute to xtpoisson for those cases in which this latter does not properly returns output. I also came to know that, provided the same model specification, both commands deliver the same model with the same output coefficients. Here I give you an example of the same specification with the new command (here I call for robust standard errors, but this should not affect the coefficients, rather only their significance):

    Code:
    ppmlhdfe green_pat tot_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales i.year i.GICS_code if year>=2010, vce(robust) nolog
    My question arises here: some groups (i.e., firms) in my panel have all dependent variable (green_pat, in this case) featuring 0 values for the entire period. As you already know, -xtpoisson- leaves out these observations for reasons of convergence, considering also the fact that they would not add any information to the estimation process. In particular , this is the STATA note when the command is called:

    note: 592 groups (5486 obs) dropped because of all zero outcomes
    This is not done by the -ppmlhdfe- command leading to different results. What I naturally thought to do was to create a count variable that specified for each panel unit the number of green patents as a total for all the period. Then I ran the -ppmlhdfe- command with the same previous specification adding an -if- statement excluding groups with 0 green patents in the period. I expected that this solved the issue, but only 252 groups were dropped. In fact, by running -xtpoisson, fe- command with the same specification and -if- statement excluding all 0 groups, a note again appeared saying:

    note: 340 groups (2850 obs) dropped because of all zero outcomes
    At this point, I am not sure of 1) which observations does -xtpoisson- command leave out of the estimation; 2) why does ppmlhdfe not bother doing the same thing; 3) how can I reach the same results employing both commands.

    I hope I have been clear enough. Any help is highly appreciated.
    I thank you all for availability in advance.

  • #2
    Dear Antonio Barchi,

    You are not using ppmlhdfe correctly, you should use the absorb option to wipe out the fixed effects; not only the pair fixed effects but also year and GICS_code. If you do that, the results should be exactly the same. Please check the help file for examples and details.

    Best wishes,

    Joao

    Comment


    • #3
      Originally posted by Joao Santos Silva View Post
      Dear Antonio Barchi,

      You are not using ppmlhdfe correctly, you should use the absorb option to wipe out the fixed effects; not only the pair fixed effects but also year and GICS_code. If you do that, the results should be exactly the same. Please check the help file for examples and details.

      Best wishes,

      Joao
      Dear Joao Santos Silva,

      thank you very much for your prompt response! I get that I was misusing the command, and maybe there is something that I can't quite grasp. I thought that inputing -i.var- among the regressors was equal to place it in the absorb option. However I did not include pairwise interaction, which I did now:

      Code:
      ppmlhdfe ccs_pat_tot green_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales if year>=2010, abs(i.year i.GICS_code i.year#i.GICS_code) vce(robust) nolog
      The problem notwithstanding remains. I'll show the output of the analysis in both cases:

      xtpoisson, fe
      Click image for larger version

Name:	xtpoisson.png
Views:	1
Size:	67.3 KB
ID:	1722159

      ppmlhdfe
      Click image for larger version

Name:	ppmlhdfe.png
Views:	1
Size:	53.6 KB
ID:	1722160


      1) Is it now the correct implementation of the command or am I still missing something?; 2) why is number of observations different? is it because of my misusage of the command, or are there differences I don't get?

      thank you very much,
      Antonio

      Comment


      • #4
        Dear Antonio Barchi,

        You are including different sets of fixed effects in the two commands.

        Best wishes,

        Joao

        Comment


        • #5
          Originally posted by Joao Santos Silva View Post
          Dear Antonio Barchi,

          You are including different sets of fixed effects in the two commands.

          Best wishes,

          Joao
          Dear Joao Santos Silva

          I am sorry to bother you, but I just can't get what's the issue here. I adapted the -ship- dataset provided in the help file of -ppmlhdfe- command by replacing dependent variable's values with 0 for an entire unit of the panel. Here's the code:
          Code:
          use "https://www.stata-press.com/data/r16/ships", clear
          replace accident=0 if ship==5
          ppmlhdfe accident op_75_79 co_65_69 co_70_74 co_75_79, absorb(ship) vce(robust)
          poisson accident op_75_79 co_65_69 co_70_74 co_75_79 i.ship, vce(robust)
          xtpoisson accident op_75_79 co_65_69 co_70_74 co_75_79 i.ship, fe vce(robust)
          Both in -ppmlhdfe- and -xtpoisson- cases, the observations with only 0 values were dropped and coefficients are the very same. Regular -poisson- model has slightly different results. You can see it by yourself.

          Now, getting back to my models, I simplified the code only to see how the computation worked and adapted each specification to the one above:
          Code:
          ppmlhdfe ccs_pat_tot green_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales if year>=2010, abs(i.year i.GICS_code) vce(robust)
          poisson ccs_pat_tot green_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales i.year i.GICS_code if year>=2010, vce(robust)
          xtpoisson ccs_pat_tot green_pat pat_stock tobinsQ_ ln_tot_liab_ leverage roa_ebitda rev_growth RD_sales i.year i.GICS_code if year>=2010, fe vce(robust)
          Now I have opposite results: -ppmlhdfe- gives the same output in terms of coefficients and standard errors of the -poisson- model, while the -xtpoisson- command gives different results and drops many observations as outlined before. The codes are specular to my eyes. I can't really make up my mind on this. I'm sure the answer is easier than it looks to me. If you could elaborate a bit it would be greatly appreciated.

          Thank you very much again for your time,
          Antonio

          Comment


          • #6
            How are you defining your panel with xtset?

            Comment


            • #7
              Dear Joao Santos Silva
              I am defining the panel with "firm_id" as panel unit and "year" as time variable using -xtset- command.
              I'll show you the output of the xtset command and xtdes:
              Click image for larger version

Name:	xtdes.png
Views:	1
Size:	32.5 KB
ID:	1722179

              Comment


              • #8
                Antonio: Since you're using xtset firm_id year, the xtpoisson with the fe option is accounting for firm fixed effects. The other two commands only include fixed effects at the GICS level. So the xtpoisson results will differ (and i.GICS are dropped, I presume).

                Comment


                • #9
                  Dear Jeff Wooldridge ,

                  thank you very much for your hint: that was it! I added firm fixed effects to the -ppmlhdfe- and the output was the same as -xtpoisson-.

                  Thanks also to Joao Santos Silva for the hints on the command syntax.

                  Comment

                  Working...
                  X