- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Dear Experts,
In sas, using "proc reg" produces RSTUDENT = ri / sigma(i) *sqrt(1-hi) where sigma(i) is the sum of squared residuals divided by its degree of freedom.
However, in https://onlinecourses.science.psu.edu/stat462/node/247. The externally studentized residual is calculated as ti = ei / sqrt(MSE(i) * (1-hi)) where ei is yi - y^(i) and MSE(i) is the mean square error based on the estimated model.
So sigma(i) not equal to MSE(i). Which method is correct or better?
Thank you
LL
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the documentation uses the more general formula, but when the weight is omitted or is set to 1 they are the same. The first section of the doc that I linked to says "Usually, w_ i=1 for all i and thus sigma ^2 is the common, constant variance."
When you read the formulas, mentally replace the weights by 1. The weights drop out and the formulas are equivalent.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
sqrt(MSE(i)) is an estimate of sigma(i).
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Perhaps you meant s[i] instead of sigma[i]? Here is a link to the SAS documentation on the regression formulas. It explicitly says that s^2 "is the estimate of the residual variance (the mean squared error)." So these two sources you quote seem to be using the same formula.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
From your sas document,
STDERR(RESIDi) = sqrt(s^2*(1-hi) /wi),
it is weighted MSE.
The other source I quote is
sqrt(MSE *(1-hi))
. It is not weighted.
Sas used the weight to modify the standard error of residual. After I included the weight, I can get studentized residual in Sas. If I dont, I would get the studentized residual in another software. This is my program.
proc reg data=work.sample1;
model Y1 = X Z/noint;
weight GLSWGT1;
output out=xoutputs p=xpred stdr=xstdr h=xh student=xstudent;
run;
Question: So which is correct or better? Using weighted MSE or not? The readings I came across never show standard error of residual, STDERR, being scaled by weight.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Yes, the documentation uses the more general formula, but when the weight is omitted or is set to 1 they are the same. The first section of the doc that I linked to says "Usually, w_ i=1 for all i and thus sigma ^2 is the common, constant variance."
When you read the formulas, mentally replace the weights by 1. The weights drop out and the formulas are equivalent.