0

A linear regression on dependent and predictor variable was run on simulated data after log transformation.

set.seed(12345) 
x <- rnorm(423, mean = 55, sd = 12)
y <- rnorm(423, mean = 1.44, sd = 0.3)
dat <- as.data.frame(cbind(x,y))
mod <- lm (log(y)~log (x), data = dat)
summary(mod)

summary output

Question:

Is the x intercept in this summary log 0.186 or 0.186? The slope estimate I think is 0.0424. Can this model written as follows::

logy = log 0.186 + 0.0424 logx

Rabin KC
  • 47
  • 7
  • This doesn't appear to be a specific programming question that's appropriate for Stack Overflow. If you have general questions about interpreting results from statistical models, then you should ask such questions over at [stats.se] instead. You are more likely to get better answers there. – MrFlick Mar 03 '22 at 03:00

1 Answers1

0

when you log() an object/vector in R, it is in fact a natural log.

also note that the intercept is not transformed

so the resultant formula is actually:

ln(y) = 0.186 + 0.0424 * ln(x)

Hong
  • 62
  • 6
  • Thank you so much Hong for the reply. Somehow for the original dataset that I am working on, the intercept from the lm summary is positive (2.238), but when I plot the regression line using geom_smooth with method="lm", the line passes from x= -1.34. Is there a reason do you think? Souldnt the line pass the x axis at 2.238? – Rabin KC Mar 03 '22 at 03:07
  • linear regression produces a model with the formula y = c + mx, the intercept output "c" is the y-intercept, not the x-intercept – Hong Mar 03 '22 at 17:12
  • Hi Hong, apologies, I did mean the y intercept. The line doesnt pass the y axis at 2.238.But I found the solution to this here:https://stackoverflow.com/questions/14465275/plot-and-report-x-intercept-from-linear-regression-r – Rabin KC Mar 04 '22 at 03:08