Announcement

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

  • Exponentiate results from margins

    Hi!

    I want to run a regression on the log-scale and exponentiate the results. How do i do that?

    Example:
    regress Blood_log BMI i.city
    margins i.city, expression(???)

  • #2
    Maybe like the following.
    Code:
    sysuse auto
    
    generate double ln_mpg = ln(mpg)
    regress ln_mpg c.weight i.foreign
    margins foreign, expression(exp(predict(xb)))
    
    // Consider also
    glm mpg c.weight i.foreign, family(gaussian) link(log) nolog
    margins foreign
    
    // Or even
    poisson mpg c.weight i.foreign, vce(robust) nolog
    margins foreign

    Comment

    Working...
    X