BookmarkSubscribeRSS Feed
sasnewbie12
Obsidian | Level 7

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
Reeza
Super User

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


 

 

 

 

travis945
Calcite | Level 5

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

PaigeMiller
Diamond | Level 26

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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3 replies
  • 4609 views
  • 0 likes
  • 4 in conversation