Re: [R] need 95% confidence interval bands on cubic extrapolation

From: Liaw, Andy <andy_liaw_at_merck.com>
Date: Wed 21 Dec 2005 - 08:48:33 EST


Look at the "interval" option in ?predict.lm.

Andy

From: James Salsman
>
> Dear R experts:
>
> I need to get this plot, but also with 95% confidence interval bands:
>
> hour <- c(1, 2, 3, 4, 5, 6)
> millivolts <- c(3.5, 5, 7.5, 13, 40, 58)
>
> plot(hour, millivolts, xlim=c(1,10), ylim=c(0,1000))
>
> pm <- lm(millivolts ~ poly(hour, 3))
>
> curve(predict(pm, data.frame(hour=x)), add=TRUE)
>
> How can the 95% confidence interval band curves be plotted too?
>
> Sincerely,
> James Salsman
>
> P.S. I know I should be using data frames instead of parallel lists.
> This is just a simple example.
>
> ______________________________________________
> 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
>
>



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 Dec 21 09:15:15 2005

This archive was generated by hypermail 2.1.8 : Wed 21 Dec 2005 - 14:29:54 EST