Announcement

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

  • predicting linear change when dependent variable is log transformed

    Im working with a surgical dataset and trying to predict whether a particular technique (doing the operation under local anesthesia rather than general anesthesia) is faster in terms of the total operative time. As expected, the dependent variable (time) is quite skewed and this is fixed nicely when I use the natural ln transformation of the total time. I run a linear regression as follows:

    variables
    lntor = ln of the operative time
    i.local = whether the surgery was done under local or general anesthesia
    age = patient age
    i.comorbid = a comorbidity score

    reg lntor i.local age i.comorbid

    the beta coefficient for i.local is -0.12 which I interpret as a semi-elasticity indicating that doing the surgery under local anesthesia reduces total operative time by 12%

    I'd like to then know what the actual change in minutes for operative time is when the surgery is done under local anesthesia. I've tried using the margins command:

    margins, at(age=(18(5)100)) dydx(local)

    but this doesn't really seem to work. How can I get the unit change in y for a unit change in x (change in operating time for having surgery under local vs general) when the dependent variable is ln transformed for the regression?

  • #2
    The dummy coefficient is the difference in the predicted dependent variable for the specified group and the reference group after controlling for other independent variables in the model. Because you log transformed your dependent variable, you just need to apply the opposite transformation, i.e., take the exponential. So I think you want

    Code:
     margins, dydx(local) expression(exp(xb()))
    Last edited by Andrew Musau; 30 Oct 2019, 09:43.

    Comment


    • #3
      Use Poisson regression for the level of operating time. This will give you the semi-elasticity and also allow you to get the average estimated effects on minutes when you use margins. Poisson regression is fully robust, but you need to use the vce(robust) option.

      Generally, you have to make assumptions to estimate the effect on y on that for log(y). At a minimum, there is a scale factor that needs to be computed. I discuss this in Chapter 6 of my introductory econometrics book.

      JW

      Comment


      • #4
        Thank you both for the help

        Comment

        Working...
        X