Procedure features: |
PROC MEANS statement option:
|
CLASS statement |
OUTPUT statement options
| statistic
keywords |
| IDGROUP |
| LEVELS |
| WAYS | |
|
Other features: |
|
Data set: |
GRADE
|
This example
- suppresses the display of default statistics
- outputs the average final grade to a new
variable
- output the name of the student with the two final
exam score to a new variable
- outputs how many class variables are combined
to the _WAY_ variable
- outputs the value of the class level to the _LEVEL_
variable
- displays the output data set.
options nodate pageno=1 linesize=80 pagesize=60;
| proc means data=Grade noprint; |
| class Status Year; |
| var finalgrade; |
| output out=sumstat mean=AverageGrade
idgroup (max(score) obs out (name)=BestScore)
/ways levels;
run; |
| proc print data=sumstat noobs;
title1 'Average Undergraduate and Graduate Course Grades';
title2 'For Two Years';
run; |
The first observation contains the average course grade
and the name of the student with the highest exam score over the two-year
period. The next four observations contain values for each class variable
value. The remaining four observations contain values for the Year and Status
combination. The variables _WAY_, _TYPE_, and _LEVEL_ show how PROC MEANS
created the class variable combinations. The variable _OBS_ contains the observation
number in the GRADE data set that contained the highest exam score.
|
|
|
Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.