Chapter Contents

Previous

Next
The MEANS Procedure

Example 4: Using a CLASSDATA= Data Set with Class Variables


Procedure features:
PROC MEANS statement options:
CLASSDATA=
EXCLUSIVE
FW=
MAXDEC=
PRINTALLTYPES
CLASS statement
Data set: CAKE

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
data caketype;
   input Flavor $ 1-10  Layers 12;
   datalines;
Vanilla    1
Vanilla    2
Vanilla    3
Chocolate  1
Chocolate  2
Chocolate  3
;
 Note about code
proc means data=cake range median min max fw=7 maxdec=0
           classdata=caketype exclusive printalltypes ;
 Note about code
   class flavor layers;
 Note about code
   var TasteScore;
   Title 'Taste Score For Number of Layers and Cake Flavor';
run;


Output
PROC MEANS calculates statistics for the 13 chocolate and vanilla cakes. Because the CLASSDATA= data set contains 3 as the value of Layers, PROC MEANS uses 3 as a class value even though the frequency is zero. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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