The SURVEYMEANS Procedure

Output Data Sets

PROC SURVEYMEANS uses the Output Delivery System (ODS) to create output data sets. This is a departure from older SAS procedures that provide OUTPUT statements for similar functionality. For more information about ODS, see Chapter 20: Using the Output Delivery System.

For example, to save the Statistics table shown in Figure 92.4 in the previous section in an output data set, you use the ODS OUTPUT statement as follows:

title1 'Analysis of Ice Cream Spending';
title2 'Stratified Sample Design';
proc surveymeans data=IceCream total=StudentTotals;
   stratum Grade / list; 
   var Spending Group;
   weight Weight;
   ods output Statistics=MyStat;
run;

The statement

ods output Statistics=MyStat;

requests that the Statistics table that appears in Figure 92.4 be placed in a SAS data set MyStat.

The PRINT procedure displays observations of the data set MyStat:

 
proc print data=MyStat; 
run;

Figure 92.5 displays the data set MyStat. The section ODS Table Names gives the complete list of tables produced by PROC SURVEYMEANS.

Figure 92.5: Output Data Set MyStat

Analysis of Ice Cream Spending
Stratified Sample Design

Obs VarName VarLevel N Mean StdErr LowerCLMean UpperCLMean
1 Spending   40 9.141298 0.531799 8.06377052 10.2188254
2 Group less 23 0.544555 0.058424 0.42617678 0.6629323
3 Group more 17 0.455445 0.058424 0.33706769 0.5738232