Re: [R] lm: Displaying 95% confidence and prediction intervals on scatterplots

From: hadley wickham <>
Date: Sat 15 Jul 2006 - 19:03:18 EST

> May I know how does one superimpose the 95% confidence and prediction
> intervals on the linear regression line of a scatterplot?

You could use ggplot:

qplot(wt, mpg, data=mtcars, type=c("point","smooth"), method=lm)

(which gives the 95% confidence interval)

Hadley mailing list PLEASE do read the posting guide! Received on Sat Jul 15 19:09:16 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 22:14:36 EST.

Mailing list information is available at Please read the posting guide before posting to the list.