Hi,
New SAS user here. In my linear regression class we are learning about outlier/high leverage point detection using studentized residuals and cook's distances. I know how to show these values on a plot:
proc reg data= data plots (only label) = RstudentByLeverage;
model y=x
run;
and
proc reg data= data plots (only label) = CooksD;
model y=x
run;
My question is simply how do I show these values in a table rather than on a graph/plot? I want to know the exact cook's distance and studentized residual of an observation but I can only approximate by looking at the plot.
Thank you!
Welcome to the SAS community. As suggested by the PROC REG Documentation, you can specify r in the model statement options as in this small example
proc reg data=sashelp.class;
model weight=height / r;
run;quit;
This gives you the table
Welcome to the SAS community. As suggested by the PROC REG Documentation, you can specify r in the model statement options as in this small example
proc reg data=sashelp.class;
model weight=height / r;
run;quit;
This gives you the table
Worked perfect, so simple.
Thank you!!!
Anytime, glad to help 🙂
How do I do the same procedure in logistic regression?
@mintbit wrote:
How do I do the same procedure in logistic regression?
What do you mean by "same procedure"? There are no studentized residuals or Cook's distance in logistic regression.
Oh, They are listed in my power point from school, only it is written in spss? There you can choose all these options.
Wich statistic should I look at to isolate points that
1: for wich the model fits poorly
2:that exert an undue influence on the model.
I do not recognice the terms in sas compared to spss. In my power point it says to check that studenized, standardized and deviance should be 99%below 2.58 and 95% below 1.96.
The options I have found are plots for deviance and standardized deviance, is this sufficient?
Any
So, I don't know what you see in your Powerpoint from school.
There are different types of residuals available from PROC LOGISTIC, including some of the ones you mentioned. There is no such thing (as far as I know) as Cook's D for Logistic regression.
There are many goodness-of-fit statistics computed by PROC LOGISTIC, including Akaike's Information criterion (AIC), the Gini statistic and the C statistic. You can compute high leverage points by creating fake (continuous) Y values and then running the data through PROC REG.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.
Find more tutorials on the SAS Users YouTube channel.