You
often want statistics for groups of observations, rather than for
the entire data set. For example, census numbers are more useful when
grouped by region than when viewed as a national total. To produce
separate analyses of grouped observations, add a CLASS statement to
the MEANS procedure.
Syntax, CLASS statement:
variable(s) specifies
category variables for group processing.
|
CLASS variables are
used to categorize data. CLASS variables can be either character or
numeric, but they should contain a limited number of discrete values
that represent meaningful groupings. If a CLASS statement is used,
then the N Obs statistic is calculated. The N Obs statistic is based
on the CLASS variables, as shown in the output below.
The output of the program
shown below is grouped by values of the variables Survive and Sex.
The order of the variables in the CLASS statement determines their
order in the output table.
proc means data=clinic.heart maxdec=1;
var arterial heart cardiac urinary;
class survive sex;
run;