[R-sig-eco] Calculate Prediction Interval for Regression by hand...

Johannes Radinger jradinger at gmx.at
Sun Oct 16 13:45:19 CEST 2011


Hi UseRs,

I calculated with lm(Y~X1+X2) successfully a linear regression.
Based on this linear regression with multiple independent variables
I'd like to calculate manually prediction intervals. Therefore I have a few
questions:

1) I want a prediction interval for Y (like Y+-PI) for a given value
for X1 and X2.
2) I want to calculate the predicition intervall for Y by hand (either
with the mathematical functions of R or with python etc.

So I think I have to extract the prediction interval for the single
regression parameters (intercept and slopes) from the lm model.

I tried to google for a simple solution but wasn't succesfully yet.
I think following link: Prediction interval in Regression analysis explains very well
what I want to do.

There it says: "...one may use the standard error of the estimates for the intercept and slope ( and ) to compute a prediction interval". So is that the right approach?
If yes how can I get the standard error for a and b and which formula
has to used for the calculation?


Thank you very much in advance

Have a nice sunday!

cheers
Johannes



More information about the R-sig-ecology mailing list