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

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!

1 ACCEPTED SOLUTION

Accepted Solutions
PeterClemmensen
Tourmaline | Level 20

Welcome to the SAS community. As suggested by the PROC REG Documentation, you can specify 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

 

Capture.PNG 

View solution in original post

7 REPLIES 7
PeterClemmensen
Tourmaline | Level 20

Welcome to the SAS community. As suggested by the PROC REG Documentation, you can specify 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

 

Capture.PNG 

DoctorShemp
Fluorite | Level 6

Worked perfect, so simple.

 

Thank you!!!

mintbit
Obsidian | Level 7

How do I do the same procedure in logistic regression?

PaigeMiller
Diamond | Level 26

@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. 

--
Paige Miller
mintbit
Obsidian | Level 7

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 

PaigeMiller
Diamond | Level 26

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.

--
Paige Miller

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Mastering the WHERE Clause in PROC SQL

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.

Discussion stats
  • 7 replies
  • 7005 views
  • 1 like
  • 4 in conversation