Reputation: 4180
I've been trying to figure out a way to output DFBETAS produced in PROC REG to a SAS data object. I know that residuals, internal and external studentized residuals, and leverage can be outputted by using the output option, for example:
proc reg data=dataset;
model y = x1 + x2;
output out=influence_stats r=r student=int_r rstudent=ext_r h=leverage;
run;
but it doesn't seem that PROC REG provides an option to output DFBETAS. Thank you!!
Upvotes: 2
Views: 2629
Reputation: 63434
http://www.ats.ucla.edu/stat/sas/webbooks/reg/chapter2/sasreg2.htm
ODS OUPTUT is your answer (for basically anything like this - if it's not coming out on the output dataset, ODS OUTPUT can get almost anything that goes to the output window). The example in the book isn't very good style - I would not put the ODS OUTPUT statement in the middle of the proc - but it ought to work. (You probably need an ODS OUTPUT CLOSE; statement later on.) How I'd do it:
ods output outputstatistics=outstats;
proc reg data=dataset;
model y = x1 + x2;
output out=influence_stats r=r student=int_r rstudent=ext_r h=leverage;
run;
ods output close;
More on ODS OUTPUT: http://www2.sas.com/proceedings/forum2008/086-2008.pdf - in particular read the part where they show you how to use ODS TRACE to figure out which table to use.
Upvotes: 2