# How to recover estimates on original scale in log-linear model?

If fitting a linear model to a untransformed and log-transformed y variable, can anyone explain why the coefficients are different from the log-transformed model even after exponentiating the coefficients?

Here's a simple R example

library(tidyverse)

# Set seed
set.seed(1)

# Make data
x <- rnorm(100, 5, 1)
y <- x + rnorm(100, 5, 1)
data <- cbind.data.frame(y, x)

# Fit on original scale
summary(lm(y ~ x))

# Fit on log scale
summary(lm(log(y) ~ x))


I was expecting the exponentiated coefficients from the second model to exactly align with the coefficients from the first model and this isn't the case.

• Why? Your first model is of the form $\hat y=a+bx$ while your second is closer to $\hat y=c x^d$ if you exponentiate the coefficients. These are very different models – Henry 2 days ago
• Shouldn't it be easy to transform the parameters between models? I'm confused about why I can't log transform a variable and then use an exponent to get results back on the original scale. – andy_d 2 days ago
• Are you presuming that if $y = a + bx$ is fitted by your first lm() call, then $\ln y = \ln a + (\ln b) x$ is fitted by second call? Logarithms don't work like that. In addition, your first simulation makes negative or zero y\$ unlikely but not impossible, which is not compatible with taking logarithms, and if errors are normal on the original scale, the second call applies an inappropriate estimation method. – Nick Cox 2 days ago