Too much CLASS for the MEANS procedure

0

Have you used the MEANS procedure to calculate frequencies:

  • for several variables in the same step?
  • without sorting the data first?
  • without checking for missing values?
  • using the TYPE statement and the CLASS statement together?

At the recent SouthEastern SAS Users Group conference, Janet Willis shared what can go wrong in each of these circumstances and why. Her paper and poster (which was awarded Best Poster) provide three possible coding methods that help ensure the correct results for your frequency counts:

• PROC MEANS with CLASS and TYPES statements
• PROC MEANS with CLASS and TYPES statements and MISSING option
• PROC MEANS with CLASS and VAR statements

In conclusion, Willis suggests the following practices when using the MEANS procedure:

• include the MISSING option when using CLASS and TYPES statements
• reduce the number of CLASS variables when using the NWAY option
• use the VAR statement to reduce the number of variables in the CLASS statement

You can find the code and sample output for each of these solutions in Willis’s SESUG 2012 paper - Do You Have Too Much Class? (PO-04).

Share

About Author

Christina Harvey

Principal Marketing Specialist

Christina Harvey is an editor for SAS External Communications. She has more than 20 years experience as a technical writer and communications specialist for SAS.

Leave A Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to Top