Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
The SURVEYMEANS Procedure

Create Output Data Set

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 on ODS, see Chapter 15, "Using the Output Delivery System."

For example, to place the "Statistics" table shown in Figure 61.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 Simple Random Sampling Design';
   proc surveymeans data=IceCream total=StudentTotal;
      stratum Grade / list; 
      var Spending Group;
      ods output Statistics=MyStat;
   run;

The statement

   ods output Statistics=MyStat;
requests that the "Statistics" table that appears in Figure 61.4 be placed in a SAS data set named MyStat.

The PRINT procedure displays observations of the data set MyStat:

 
   proc print data=MyStat; 
   run;

Figure 61.4 displays the observations in the data set MyStat.

Analysis of Ice Cream Spending
Stratified Simple Random Sampling Design

Obs Variable_Spending N_For_Spending Mean_For_Spending StdErr_For_Spending LowerCLMean_For_Spending UpperCLMean_For_Spending Level_1_Of_Group N_For_Level_1_Of_Group Mean_For_Level_1_Of_Group StdErr_For_Level_1_Of_Group LowerCLMean_For_Level_1_Of_Group UpperCLMean_For_Level_1_Of_Group Level_2_Of_Group N_For_Level_2_Of_Group Mean_For_Level_2_Of_Group StdErr_For_Level_2_Of_Group LowerCLMean_For_Level_2_Of_Group UpperCLMean_For_Level_2_Of_Group
1 Spending 40 8.750000 0.530531 7.675043 9.824957 Group = less 23 0.575000 0.059299 0.454850 0.695150 Group = more 17 0.425000 0.059299 0.304850 0.545150

Figure 61.5: The Data Set MyStat

Chapter Contents
Chapter Contents
Previous
Previous
Next
Next
Top
Top

Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.