# How to obtain the equation of a predictive interval around the regression line in R? [duplicate]

I have a some data set on which I fit a linear regression model using the lm function in R. I can also visually obtain the prediction Interval around that regression line using predict. My question is how is that prediction interval line computed?? Can I obtain the equation of that line in R?

• Note that the ${S^2}_{error}$ can be found as the 'residual standard error' in the regression output in $R$. – Vishal Apr 8 '16 at 17:42
• What does that value represents? From that those values, can we derived the equation of both the upper and lower bounds? – user3841581 Apr 8 '16 at 17:53
• I am actually looking not for the equation of a single point prediction interval, but the equation for that whole curve. Is there a way to obtain the equation of that curve? – user3841581 Apr 8 '16 at 18:36
• Hmm, that's a good question. I don't think there's an equation for the entire curve. Prediction Interval would have to be calculated for each point (observation), and then all values can be combined together to construct the curves. – Vishal Apr 8 '16 at 19:41
• @Vishal, so there is not method to actually approximate that curve? – user3841581 Apr 25 '16 at 13:22