Re: [R] Extrapolated regression lines

From: hadley wickham <h.wickham_at_gmail.com>
Date: Thu 12 Oct 2006 - 16:33:56 GMT

> 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



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Fri Oct 13 02:41:46 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Thu 12 Oct 2006 - 17:30:09 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.