Procedure features: |
PROC MEANS statement options:
|
statistic keywords |
|
FW= |
|
NONOBS | |
CLASS statement options:
|
TYPES statement |
|
Other features |
FORMAT procedure |
FORMAT statement |
|
Data set: |
CAKE
|
This example
-
computes the statistics for
the specified keywords and displays
them in order
-
specifies the field width of the statistics
-
suppresses the column with the total number of
observations
-
analyzes the data for the one-way combination of cake flavor and
the two-way combination of cake flavor and participant's age
-
assigns user-defined formats to the class variables
-
uses multilabel formats as the levels
of class variables
-
orders the levels of the cake flavors by the descending frequency
count and orders the levels of age by the ascending formatted values.
|
options nodate notsorted pageno=1 linesize=80 pagesize=64; |
|
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; |
|
proc means data=cake fw=6 n min max median nonobs; |
|
class flavor/order=data;
class age /mlf order=fmt; |
|
types flavor flavor*age; |
|
var TasteScore; |
|
format age agefmt. flavor $flvrfmt.; |
|
title 'Taste Score for Cake Flavors and Participant''s Age';
run; |
|
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
---------------------------------------------------------------------
| |
|
|
Copyright © 2010 by SAS Institute Inc., Cary, NC, USA. All rights reserved.