SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
Joa14
Obsidian | Level 7

I was wondering if there is a way to get Cook's Distance values on the REG Procedure output statistics table when doing regression? Or a way to get the Cook's D values tabulated.

 

Thank you!

 

Joanna

3 REPLIES 3
ballardw
Super User

An ODS OUTPUT statement can direct the data used for plots into a data set.

 

Generic syntax is Ods output plotname=yourdatasetname;

 

Possible plot names from Proc reg are CooksDChart  CooksDPlot StudResCooksDChart (studentized residuals) depending on requested plots.

 

Rick_SAS
SAS Super FREQ

Read about two ways to obtain the Cook's D statistics for each observation in a regression model by using PROC REG:

1. On the OUTPUT statement, use the COOKD= option

2. Create the Cook's D plot (PLOTS=(CooksD)) and use ODS output to write the data to a data set: 

ods output CooksDPlot=CookOut;

 

Ksharp
Super User
If you pay some time to flip the doc of PROC REG, you would find the answer.


proc reg data=sashelp.class;
model weight=height / influence;
output out=want cookd=cookd;
quit;

sas-innovate-white.png

Our biggest data and AI event of the year.

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.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 2527 views
  • 4 likes
  • 4 in conversation