# Can we calculate the standard error of prediction just based on simple linear regression output?

The standard error of prediction in simple linear regression is $\hat\sigma\sqrt{1/n+(x_j-\bar{x})^2/\Sigma{(x_i-\bar{x})^2}}$.

My question is to calculate the standard error of prediction for $pop=1029$ just based on the following regression output. I can get all except $\bar{x}$. And I also know how to calculate the approximate standard error of prediction based on the standard errors of intercept and coefficient of $pop$, ignoring their correlation. • How would the regression output change if you were, say, to add $10^6$ to each pop value and add $-0.0116584\times 10^6$ to each fuel value? Intuitively, that shifts the data far from pop=1029 without altering the regression line and therefore should result in a much wider prediction interval. That means you can focus your research on those elements of the output that change. (Even if you don't have the actual data you can make some up and run both regressions to see what happens.) – whuber Jul 11 '13 at 19:32
• Thanks very much! Only the standard error of the intercept (therefore t, p-value and CI) changes. This inspired me to figure out that $Var(\hat{\beta}_0)=\sigma^2(1/n+\bar{x}^2/SXX)$, then I can get $\bar{x}$ to calculate the standard error of prediction. – Randel Jul 11 '13 at 20:39
• The standard error of a predicted value isn't what you said. What you have there is the standard error for the mean at a given $x$. – Glen_b Jul 12 '13 at 2:41
• Sorry I just followed the description of the option stdp in Stata. It can be thought of as the standard error of the predicted expected value, mean or the fitted value. – Randel Jul 12 '13 at 13:22

$$s.e.(\hat\mu|x_j)=\hat\sigma\sqrt{1/n+(x_j-\bar{x})^2/\Sigma{(x_i-\bar{x})^2}}.$$
• get $\hat\sigma$ from $\hat\sigma^2=SS_{Residual}/(n-p-1)$, where $p=1$;
• $n$ and $x_j$ are known;
• obtain $\bar{x}$ from $\hat{Var}(β_{cons})=\hatσ^2(1/n+\bar{x}^2/\Sigma{(x_i-\bar{x})^2})$;
• $\Sigma{(x_i-\bar{x})^2}=SS_{Model}/\hat{\beta}_{pop}^2$.