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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 2024 views
  • 4 likes
  • 4 in conversation