Example 3: Using the BY Statement with Class Variables
Features:PROC MEANS statement option
statistic keywords
BY statement
CLASS statement
Other features:SORT procedure
Data set:GRADE
Details
This example does the following:
•separates the analysis for the combination of class variables within BY values
•shows the sort order requirement for the BY statement
•calculates the minimum, maximum, and median
Program
options nodate pageno=1 linesize=80 pagesize=60;
proc sort data=Grade out=GradeBySection;
by section;
run;
proc means data=GradeBySection min max median;
1046Chapter 34•MEANS Procedure
by Section;
var Score;
class ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month, and much more.