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
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.
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;
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;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.
Ready to level-up your skills? Choose your own adventure.