Announcement

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

  • How to back-transform log+1 transformed dependent variable in order to predict values

    Hello everyone,

    I am struggling with the back-transformation of a log-transformed dependent variable. I am analyzing the utilization of a certain policy in hours per month. As there are only a few users and thus many 0, I log-transformed it by adding 1 as a constant and then calculated the log of it for my OLS regression model.

    Now I would like to predict the 'real' utilization in hours per month for some combinations of independent variables by calculating margins based on this model.
    My question: When I apply the margins command after the regression, how do I need to treat the resulting log+1 values in order to get the real utilization in hours?

    My approach to get the total amount of utilization per month (and not just the slope of the independent variable):
    - Take the log+1-value from the margins table and exponentiate it: display exp(loghours+1)
    - Then subtract 1
    - Add the value of the constant (and also back-transform it before)

    Am I on the right track here?

    I am highly grateful for anyone who can assist me.
    Thanks a lot in advance,
    Hanna






  • #2
    No. The easiest solution would be to use poisson, as that is the model made for dependent variables like that. After that you can just use margins and it will give you predictions in counts
    ---------------------------------
    Maarten L. Buis
    University of Konstanz
    Department of history and sociology
    box 40
    78457 Konstanz
    Germany
    http://www.maartenbuis.nl
    ---------------------------------

    Comment


    • #3
      Thank you Maarten for that important piece of advice!
      The utilization is captured in continuous values, meaning 14,2; 16,5; 230,6 (about the maximum value) .. would that still be an application for the poisson model? Also, it is a random effects panel model with clustered standard errors, Would that be the rpoisson command then?

      Comment


      • #4
        No. It's a myth that Poisson regression requires a counted response. What is mret central to Poisson regression is the use of a logarithmic link, not any assumption (ideal condition) of a Poisson distribution. See e.g. https://blog.stata.com/2011/08/22/us...tell-a-friend/

        Comment


        • #5
          Hanna: In the same spirit, but more general than Poisson, is to consider a GLM approach with a log link. Chapters 5-8 (esp. ch. 5) in this Stata Press book offer a nice overview of such strategies. https://www.stata.com/bookstore/heal...s-using-stata/

          Poisson and GLM (using a log link) will generally yield quite similar point estimates. But GLM offers the advantage of being able to specify alternative familly assumptions that can accommodate various second-moment properties that might depart from the Poisson model's, and can thus improve estimator precision (even with GLM, specifying a robust covariance estimator can be important for getting the inferences correct).

          Comment

          Working...
          X