BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
CheerfulChu
Obsidian | Level 7

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

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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.

 

View solution in original post

4 REPLIES 4
stat_sas
Ammonite | Level 13

Hi,

 

sqrt(MSE(i)) is an estimate of sigma(i).

Rick_SAS
SAS Super FREQ

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.

CheerfulChu
Obsidian | Level 7

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

Rick_SAS
SAS Super FREQ

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.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 2779 views
  • 2 likes
  • 3 in conversation