BookmarkSubscribeRSS Feed
Obsidian | Level 7

## Standardized residuals

I am comparing the effects of four treatments, x1,x2,x3,x4 on an outcome, y. I am using proc GLM to run this analysis. I need to calculate the standardized residuals for the model, how can I do that?

Thank You

3 REPLIES 3
Super User

## Re: Standardized residuals

What's your definition of standardized residual?
SAS calculates a studentized residual as residual/ stderr, which appears the same by some definitions:

http://www.r-tutor.com/elementary-statistics/simple-linear-regression/standardized-residual

http://documentation.sas.com/?docsetId=statug&docsetTarget=statug_glm_syntax17.htm&docsetVersion=14....

You can get that using the OUTPUT statement, STUDENT option.

@sasnewbie12 wrote:

I am comparing the effects of four treatments, x1,x2,x3,x4 on an outcome, y. I am using proc GLM to run this analysis. I need to calculate the standardized residuals for the model, how can I do that?

Thank You

Calcite | Level 5

## Re: Standardized residuals

Hello,

I used the OUTPUT statement and STUDENT option, but I'm not sure how to print the standardized residuals. Here is my code:

proc reg data=work.'chp 14 # 50'n;

model y=x

output residual=yresid

predicted=yhat

student=stdres;

run;

Thank you!

-Travis

Diamond | Level 26

## Re: Standardized residuals

You could use the R option in the MODEL statement. Or:

you should probably give the output data set a name

``output OUT=RESIDUALS residual=yresid predicted=yhat student=stdres;``

Then you could use PROC PRINT or VIEWTABLE or many other procedures to see the residuals.

A side question ... why would you want to PRINT residuals or standardized residuals? I see no benefit there ... rather your ought to be PLOTTING residuals, and there are many ways to do that.

--
Paige Miller
Discussion stats
• 3 replies
• 4834 views
• 0 likes
• 4 in conversation