Creating a Summarized Data Set Using PROC SUMMARY

You can also create a summarized output data set with PROC SUMMARY. When you use PROC SUMMARY, you use the same code to produce the output data set that you would use with PROC MEANS. The difference between the two procedures is that PROC MEANS produces a report by default. By contrast, to produce a report in PROC SUMMARY, you must include a PRINT option in the PROC SUMMARY statement.

Example: Creating an Output Data Set

The following example creates an output data set but does not create a report:
proc summary data=clinic.diabetes; 
   var age height weight; 
   class sex; 
   output out=work.sum_gender 
      mean=AvgAge AvgHeight AvgWeight; 
run;
If you placed a PRINT option in the PROC SUMMARY statement above, this program would produce the same report as though you replaced the word SUMMARY with MEANS.
proc summary data=clinic.diabetes print; 
   var age height weight; 
   class sex; 
   output out=work.sum_gender 
      mean=AvgAge AvgHeight AvgWeight; 
run;
Figure 9.11 Output Created by the SUMMARY Procedure with the PRINT Option
Output Created by the SUMMARY Procedure with the PRINT Option Specified
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.173.199