[R] predictive interval in nlme

From: Cunningham Kerry <kerryrekky_at_yahoo.com>
Date: Wed 19 Oct 2005 - 03:45:50 EST


Suppose I have the following data:

y x id
44 0 104
48 58 104
48 55 204
47 105 204
41 275 206
18 67 209
.......

I fit the model

>fit=lme(y~x+I(x^2),random=~1|id)

Now I want to make a prediction plot:

>time=seq(0,300,len=100)
>plot(predict(fit,data.frame(x=time),level=0))

Very fine. It gives me the prediction curve based on the model. My further request is to make a confidence bands around the curve. I guess I can derive its mathematical form analytically and implement it myself. But I just hope some experts can point out one simple way in R to avoid my redundant work.

Thanks!



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Oct 19 03:52:49 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:40:45 EST