05.31.06

Saving PROC REG output in SAS dataset

Posted in SAS, SAS programming at 1:15 pm by Sneha

PROC REG does not provide an option of saving F statistics and p-values in an output data set. Although in real life, we often encounter scenarios where we need to do so. For example, we might want to perform some action only if a particular independent variable is turning out to be significant. Manual processing becomes impossible when you have hundreds of regression models being run.

The output delivery system(ODS) in SAS provides great flexibility in handling output. Here’s the code to save the p values produced by PROC REG into a SAS dataset.

ods listing close;
ods output "Parameter Estimates"=<output dataset name>;
proc reg data=<input dataset name>;
model <dependent var> = <independent variables>;
run;
quit;
ods output close;
ods listing;

Just make sure you dont specify the NOPRINT option in PROC REG as the ODS needs an output object.

6 Comments »

  1. Anonymous said,

    Google

    Google news and reviews

  2. damn all these beautiful gir. Corrina Eudora.

  3. they’ll have you suicidal suicida. Liesbeth Kiki.

  4. Idetrorce said,

    very interesting, but I don’t agree with you
    Idetrorce

  5. apurv said,

    Thank you for posting this. It saved me time and having to write a macro!

  6. Gab said,

    Thanks, very usefull


Leave a Comment