Group Processing Using the CLASS Statement

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:
CLASS variable(s);
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;
Figure 9.7 Output Grouped by Values of Variables
Output Categorized by Values of the Variables Survive and Sex
Last updated: January 10, 2018
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.191.181.252