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
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
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
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
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.
Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.
Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.
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.