Announcement

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

  • Log-gamma model for panel data (GLM with individual fixed effects)

    Dear all,

    I would like to estimate a log-gamma model for panel data, using individual fixed effects (i.e. a within-estimator).

    My outcome variable is continuous with excess zeros and right-skewed.

    This is what my model would look like for NON-panel data:

    Code:
     glm yvar xvars, link(log) family(gamma) vce(cluster id)
    Here (https://www.statalist.org/forums/for...ith-panel-data) and here (https://www.statalist.org/forums/for...55-xtlogit-or-), xtgee is being discussed, but I am worried that xtgee - since it measures population-averaged effect - is not what I am actually after.

    Ideally, I would like the equivalent to

    Code:
     xtreg yvar xvars, fe vce(cluster id)
    but with an underlying log-gamma distribution.

    I am using Stata 16 on Windows.

    Thank you very much for your time!

    Best wishes,
    Stephanie

  • #2
    The accepted approach these days is to use the fixed effects Poisson estimator because it is fully robust for estimating the conditional mean parameters. So use, with annual data,

    Code:
    xtpoisson y x1 ... xk i.year, fe vce(robust)

    Comment


    • #3
      Dear Jeff,

      Thank you very much for your very quick response.

      I have three follow-up questions:

      (i) To you suggest to use xtpoisson even though my outcome variable is continuous? (I though Poisson-regressions are usually used for count variables.)

      (ii) My time dimension are survey waves (wave) and my individuals are identified via their id (id). Thus, I would have written the following code:

      Code:
      xtset id wave
      
      xtpoisson yvar xvars, fe vce(robust)
      Do I also need to include time dummies (i.e. wave dummies), like you did (i.year)? Applied to my example: Is it necessary to write the code like this:

      Code:
      xtset id wave
      
      xtpoisson yvar xvars i.wave, fe vce(robust)
      (iii) I understand that vce(robust) clusters SEs on the individual level. Would it be possible to cluster SEs on the household level using xtpoisson with individual effects? (Kindly let me know if this last question should go to a new Statalist-topic.)

      Thanks again!
      Stephanie

      Comment


      • #4
        Stephanie: Unfortunately, students are still taught the strict interpretation of Poisson regression. The Poisson quasi-MLE, whether in cross-sectional, time series or panel data applications, is consistent for any kind of nonnegative response variable. It is to exponential models as the usual FE estimator is to linear models. The only requirement is y(i,t) >= 0 (and it should not have a natural upper bound). You can find many threads on it here. My 1999 Journal of Econometrics paper, "Distribution-Free Estimation of Some Nonlinear Panel Data Models," contains the theory. I would correct you on one point: you appear to have a mixed random variable, not a continuous one. If it piles up at zero and then takes on many positive values it is what economists call a "corner solution." It is neither discrete nor continuous. And it doesn't matter for the Poisson FE estimator.

        If you think there are aggregate time effects then I would use i.wave. It's easy and it guards against spurious correlation due to changes over time.

        Regrettably, Stata only allows a vce(robust) option with xtpoisson and that only clusters at the unit level. Fortunately, Tim Simcoe wrote a wrapper many years ago that allows clustering at higher levels, such as the household. Within Stata, use

        Code:
        findit xtpqml
        and then you should be able to install it.

        Comment


        • #5
          Or just type

          Code:
          ssc install xtpqml

          Comment


          • #6
            Dear Jeff,

            Thank you very much for these detailed explanations; they are very helpful.

            Best,
            Stephanie

            Comment


            • #7
              I have a question relating to mixed random variables, which I was hoping Jeff Wooldridge could answer. I am measuring the effect of a treatment on salary, working hours, and government benefits. Salary and working hours are right-skewed, have a good amount of 0's (due to unemployment), and contain only positive values. Working hours range from 0 to approx. 300 hours per month. Given the description of mixed random variables provided above, I suspect that my variables are not continuous but rather mixed random variables. However, I have not figured out what counts as many/a pile of 0's (and many in my field would analyze these variables in with OLS). I would love to run a regular OLS since the results are easily interpreted (in terms of USD or hours), which the reader would also appreciate. I cannot share my data, so I do not expect you to give a clearcut answer, but any tips would be helpful. My sample is big with 9700 panels observed on a monthly basis over a span of 12 years

              When it comes to government benefits, many more 0's are present, so here, I might need to run a poisson regression.

              Comment

              Working...
              X