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

From: Lisa <sangwl_at_gmail.com>
Date: Fri, 25 Apr 2008 22:01:00 -0700

Hi Jorge,

thank you very much for your reply. I checked and have got the prediction of new values for lm or glm or nls, the new question is, is there any prediction for the cox model? I tried predict(Surv(y~x),newdata), it only gave the fitted values. Any clue on this? thanks a lot!

On 4/25/08, Jorge Ivan Velez <jorgeivanvelez_at_gmail.com> wrote:
>
>
> 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<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 Sat 26 Apr 2008 - 05:05:52 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 - 22:30:32 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