Previous Page | Next Page

The MEANS Procedure

Example 6: Using Preloaded Formats with Class Variables


Procedure features:

PROC MEANS statement options:

COMPLETETYPES

FW=

MISSING

NONOBS

CLASS statement options:

EXCLUSIVE

ORDER=

PRELOADFMT

WAYS statement

Other features

FORMAT procedure

FORMAT statement

Data set: CAKE

This example


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=64;
 Note about code
proc format;
   value layerfmt 1='single layer'
                  2-3='multi-layer'
                  .='unknown';
   value $flvrfmt (notsorted)
                  'Vanilla'='Vanilla'
                  'Orange','Lemon'='Citrus'
                  'Spice'='Spice'
                  'Rum','Mint','Almond'='Other Flavor';
run;
 Note about code
proc means data=cake fw=7 completetypes missing nonobs;
 Note about code
   class flavor layers/preloadfmt exclusive order=data;
 Note about code
   ways 1 2;
 Note about code
   var TasteScore;
 Note about code
   format layers layerfmt. flavor $flvrfmt.;
 Note about code
   title 'Taste Score For Number of Layers and Cake Flavors';
run;

Output

 Note about figure
               Taste Score For Number of Layers and Cake Flavors               1

                              The MEANS Procedure

                        Analysis Variable : TasteScore 
 
         Layers           N       Mean    Std Dev    Minimum    Maximum
         --------------------------------------------------------------
         unknown          1     84.000          .     84.000     84.000

         single layer     3     83.000      9.849     75.000     94.000

         multi-layer      6     81.167      7.548     72.000     91.000
         --------------------------------------------------------------


                        Analysis Variable : TasteScore 
 
         Flavor           N       Mean    Std Dev    Minimum    Maximum
         --------------------------------------------------------------
         Vanilla          6     82.167      7.834     73.000     94.000

         Citrus           0          .          .          .          .

         Spice            3     85.000      5.292     81.000     91.000

         Other Flavor     1     72.000          .     72.000     72.000
         --------------------------------------------------------------


                        Analysis Variable : TasteScore 
 
 Flavor          Layers           N       Mean    Std Dev    Minimum    Maximum
 ------------------------------------------------------------------------------
 Vanilla         unknown          1     84.000          .     84.000     84.000

                 single layer     3     83.000      9.849     75.000     94.000

                 multi-layer      2     80.000      9.899     73.000     87.000

 Citrus          unknown          0          .          .          .          .

                 single layer     0          .          .          .          .

                 multi-layer      0          .          .          .          .

 Spice           unknown          0          .          .          .          .

                 single layer     0          .          .          .          .

                 multi-layer      3     85.000      5.292     81.000     91.000

 Other Flavor    unknown          0          .          .          .          .

                 single layer     0          .          .          .          .

                 multi-layer      1     72.000          .     72.000     72.000
 ------------------------------------------------------------------------------

Previous Page | Next Page | Top of Page