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 <[EMAIL PROTECTED]> wrote:
>
>
> Hi Lisa,
>
> See examples in ?predict.lm
>
> HTH,
>
> Jorge
>
>
>  On Fri, Apr 25, 2008 at 7:47 PM, Lisa <[EMAIL PROTECTED]> 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@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@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