It appears the answer to your goal after a discursive exploration of "interpolation", which was really extrapolation, is that you need to look at the predict methods for linear (and other sorts as well) models.

?predict
?predict.lm

> y <- c(16,45,77,101,125)
> x <- c(0,5,10,15,20)
>
> lmmod <- lm(y ~ x)

> plot(x,y, ylim = c(0,125), xlim =c(-4,22)) #defaults would not allow estimates from plot

> lines(x=seq(-4,22, by=.5),
y=predict(lm(y ~ x), newdata = data.frame(x = seq(-4,22, by=. 5) ) ) )


--
David Winsemius


On Jan 15, 2009, at 11:31 AM, e-letter wrote:


snipped preceding excursion

______________________________________________
R-help@r-project.org 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.

Reply via email to