Is the predict function what you are looking for, as in the following example:

Code:`x<-seq(1:10) y<-c(46,46,48.4,49.9,56,57,57,51,54,48.9) a<-lm(y~x) xx<-data.frame(x=seq(1,10,0.2)) cl<-predict(a, newdata=xx, interval="confidence", level=0.9) cl<-as.data.frame(cl) matplot(xx,cl, lty=c(1,2,2), type="l", col=c(1,2,2), ylab="predicted y") points(x, y, pch=22, bg="white") legend("bottomright", legend=c("Data", "Fit","90% Confidence limit"), pch=c(22,-1,-1),lty=c(-1, 1,2), col=c(1,1,2), bg="white")`