For the example given below, how could I paint the area between the dashed lines?
Here is the code:
X <- rnorm(100)
Y<- X + rnorm(100)
reg<-lm(Y~X)
CI <- predict(reg,interval="confidence")
F <- CI[,1]
L <- CI[,2]
U <- CI[,3]
plot(X,F)
abline(reg, col="red")
reg2<-lm(L~X)
abline(reg2, col="red", lty="dashed")
reg3<-lm(U~X)
abline(reg3, col="red", lty="dashed")
here is the output

Seems like it should be a duplicate but I couldn’t find it in an SO search. I know it’s appeared many times on rhelp. But there’s a fortune for that: