Previous Page | Next Page

The MEANS Procedure

Example 5: Using Multilabel Value Formats with Class Variables


Procedure features:

PROC MEANS statement options:

statistic keywords

FW=

NONOBS

CLASS statement options:

MLF

ORDER=

TYPES statement

Other features

FORMAT procedure

FORMAT statement

Data set: CAKE

This example


Program

 Note about code
options nodate notsorted  pageno=1 linesize=80 pagesize=64;
 Note about code
proc format;
   value $flvrfmt
                'Chocolate'='Chocolate'
                'Vanilla'='Vanilla'
                'Rum','Spice'='Other Flavor';
   value agefmt (multilabel)
                  15 - 29='below 30 years'
                  30 - 50='between 30 and 50'
                  51 - high='over 50 years'
                  15 - 19='15 to 19'
                  20 - 25='20 to 25'
                  25 - 39='25 to 39'
                  40 - 55='40 to 55'
                  56 - high='56 and above'; 
run;   
 Note about code
proc means data=cake fw=6 n min max median nonobs;
 Note about code
   class flavor/order=data;
   class  age /mlf order=fmt;
 Note about code
    types flavor flavor*age;
 Note about code
   var TasteScore;
 Note about code
   format age agefmt. flavor $flvrfmt.;
 Note about code
   title 'Taste Score for Cake Flavors and Participant''s Age';
run;

Output

 Note about figure
               Taste Score for Cake Flavors and Participant's Age              1

                              The MEANS Procedure

                        Analysis Variable : TasteScore 
 
                Flavor           N       Min       Max    Median
                ------------------------------------------------
                Chocolate        9     72.00     92.00     83.00

                Vanilla          6     73.00     94.00     82.00

                Other Flavor     4     72.00     91.00     82.00
                ------------------------------------------------


                        Analysis Variable : TasteScore 
 
     Flavor          Age                   N       Min       Max    Median
     ---------------------------------------------------------------------
     Chocolate       below 30 years              5     75.00     85.00     79.00

                     25 to 39              4     75.00     85.00     81.00

                     between 30 and 50              2     83.00     92.00     87.50

                     40 to 55              2     72.00     92.00     82.00

                     20 to 25          1     84.00     84.00     84.00

                     over 50 years        2     72.00     84.00     78.00

                     15 to 19     1     79.00     79.00     79.00

                     56 and above         1     84.00     84.00     84.00

     Vanilla         below 30 years              1     80.00     80.00     80.00

                     25 to 39              2     73.00     80.00     76.50

                     between 30 and 50          2     73.00     75.00     74.00

                     40 to 55        1     75.00     75.00     75.00

                     over 50 years     3     84.00     94.00     87.00

                     56 and above         3     84.00     94.00     87.00

     Other Flavor    below 30 years              1     81.00     81.00     81.00

                     25 to 39             3     72.00     83.00     81.00

                     between 30 and 50        2     72.00     83.00     77.50

                     40 to 55     1     91.00     91.00     91.00

                     over 50 years         1     91.00     91.00     91.00
     ---------------------------------------------------------------------

Previous Page | Next Page | Top of Page