I’m plotting some log-scaled data with an overlain linear fit line, like so:
d <- data.frame(x=1:10, y=10^(1:10 + rnorm(10)))
ggplot(d, aes(x=x, y=y)) + geom_point() +
geom_smooth(method="lm", se=FALSE) +
scale_y_log10()

It looks like the linear regression line is being calculated on the transformed data, or else it would go directly through the last point. Is that true?
I seem to remember that this is addressed in the ggplot2 text, but I can’t find it now.
When
ggplotrenders a plot, it does so in the following order:scale_functions, typically)lmfit, in this case — this is wherestat_functions come in, which are typically called throughgeom_functions)So, scaling happens before the model is fit, and hence yes, the fit is being calculated on the transformed data.