[R] Extrapolated regression lines

hadley wickham h.wickham at gmail.com
Thu Oct 12 18:33:56 CEST 2006


> When I create a simple scatterplot with a regression line (se below) the
> line is automatically extrapolated outside the range of data points. Why
> is this and how can I prevent R from extrapolating the regression line?

ggplot does this by default:

install.packages("ggplot")
library(ggplot)
qplot(Para, Herd, type=c("smooth","point"), method=lm)

Regards,

Hadley



More information about the R-help mailing list