I would like to get the standard error on a prediction. Using R glm
, I can get the SE of the fit for a specific prediction:
mod <- glm(y~wa_WSI, data=mydata, family=gaussian(link="identity"))
predict.glm(mod,newdata=newdata, type="response", se.fit=T)
But when I compare the predictions with the actual values, this number seems way too small. I found a formula for "standard error of the estimate" which is $\sqrt{s/(n-p)}$ where $s$ is the sum of the squared residuals, $n$ is the number of data points, and $p$ is the number of terms in the regression. This gives me a much larger result, but is not for a single prediction.
My question is, is the SE formula above the formula I should use and is there some way to get it from the value R gives me for se.fit
so that it is specific for a particular prediction?