BookmarkSubscribeRSS Feed

Distinguishing PROC MEANS, SUMMARY, TABULATE

Started ‎09-02-2022 by
Modified ‎09-02-2022 by
Views 5,417

PROC MEANS computes descriptive statistics

  • for variables across all observations and within groups of observations
  • estimates quantiles, which includes the median
  • calculates confidence limits for the mean
  • identifies extreme values and performs a t test
  • places its result into your output window

PROC SUMMARY is the same as PROC MEANS, howeverits results are written to an output dataset.

 

PROC TABULATE elaborates on PROC MEANS/SUMMARY - displays descriptive statistics in tabular format.

  • places its result into your output window and/or output dataset
  • use some or all of the variables in a data set
  • flexibility in classifying the values of variables and establishing hierarchical relationships between them
  • label and format variables and procedure-generated statistics
  • On SAS Viya, all 3 procedures use CAS actions when processing CAS tables

Where are PROC MEANS, SUMMARY, TABULATE tasks in SAS Enterprise Guide?

megak8_0-1661968503079.png

PROC MEANS (and PROC SORT & UNIVARIATE)

View -> Tasks -> Describe -> Summary Statistics / Summary Statistics Wizard

PROC SUMMARY is not generated by SAS Enterprise Guide - use code

 

PROC TABULATE 

View -> Tasks -> Describe -> Summary Tables / Summary Tables Wizard

 

Where are PROC MEANS, SUMMARY, TABULATE tasks in SAS Studio?

 

PROC MEANS

Tasks -> Statistics -> Summary Statistics

 megak8_0-1661969394589.png

 

PROC SUMMARY & PROC TABULATE

Not generated by SAS Studio at this time of this article's publication - use code

 

Examples

Here is some code that you can run using fictitious data included with all SAS installations:

proc means data=sashelp.cars;
  var msrp invoice;
run;
proc summary data=sashelp.cars;
  var msrp invoice;
  OUTPUT out=WORK.summaryout 
(LABEL="PROC SUMMARY Output Table for SASHELP.CARS"); run;
PROC TABULATE
	DATA=SASHELP.CARS
	OUT=WORK.tabulateout 
(LABEL="PROC TABULATE Output Table for SASHELP.CARS") FORMAT=comma10.2; VAR Weight Wheelbase; CLASS Type / ORDER=freq MISSING; TABLE /* Row Dimension */ Type, /* Column Dimension */ N Weight * Range Wheelbase * Mean; ; RUN; QUIT;
 

Adding PROC FORMAT can enhance your PROC TABULATE results; here color is emphasized:

PROC FORMAT;
	VALUE watchit
		0 - 20000 = 'Green'
		20001 - 30000 = 'Orange'
		30001 - 50000 = 'Blue'
		50001 - 60000 = 'Purple'
		60001 - high = 'Red';
RUN;

PROC TABULATE data=sashelp.cars S=[foreground=watchit.]
	FORMAT=dollar10.2
	OUT=WORK.tabulatecolor 
	(LABEL="PROC TABULATE Output Table for SASHELP.CARS");
	CLASS type cylinders / MISSING;
	VAR invoice;

	TABLE type ALL,
		Invoice * mean;
RUN;

Conclusion

PROC MEANS, SUMMARY, TABULATE are similar in terms of the descriptive statistics that they generate, yet they are also different because of their outputs. Because PROC TABULATE gives you the most control, its versatility may be the best fit for most scenarios. 

Version history
Last update:
‎09-02-2022 12:51 PM
Updated by:
Contributors

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

SAS AI and Machine Learning Courses

The rapid growth of AI technologies is driving an AI skills gap and demand for AI talent. Ready to grow your AI literacy? SAS offers free ways to get started for beginners, business leaders, and analytics professionals of all skill levels. Your future self will thank you.

Get started

Article Tags