I am wondering if the function lm()
from the stats package is the same as the one used in geom_smoot(method = lm)
in ggplot2.
If so, are the parameters calculated by them the same everytime for the same data.
So would...
lm(response ~ variable, data = dat)
calculate the same parameters as...
ggplot(dat, aes(variable, response)) +
geom_smooth(method = lm)