Re: [R] R question about prediction from a fitted model

From: Jorge Ivan Velez <jorgeivanvelez_at_gmail.com>
Date: Fri, 25 Apr 2008 19:50:58 -0400

Hi Lisa,

See examples in ?predict.lm

HTH, Jorge

On Fri, Apr 25, 2008 at 7:47 PM, Lisa <sangwl_at_gmail.com> wrote:

> 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.
>

        [[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:57:48 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 - 07: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