[R] R question about prediction from a fitted model

From: Lisa <sangwl_at_gmail.com>
Date: Fri, 25 Apr 2008 16:47:10 -0700


Hi, I have a question about predicting new values from a fitted model in R.

 For example, if i fit a linear model

fit<-lm(y~x)

predict(fit) will give the fitted values for each x.

I am wondering if there is a way to do some prediction of the fitted for some new values of x that are not in the data points?

for example, x=0.5 is not in the original data (not a datapoint), is there a way to predict the fitted value corresponding to x=0.5 easily?

Thank you!

        [[alternative HTML version deleted]]



R-help_at_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. Received on Fri 25 Apr 2008 - 23:55:43 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Sat 26 Apr 2008 - 00:30:31 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.

list of date sections of archive