Help using Base SAS procedures

Proc Means & Proc Summary

Reply
Contributor
Posts: 69

Proc Means & Proc Summary

Can anyone help me out in getting the differences of Proc Means & Proc Summary other than the output difference?
SAS Super FREQ
Posts: 8,744

Re: Proc Means & Proc Summary

Hi:
In earlier versions of SAS (SAS 5 and 6) PROC MEANS and PROC SUMMARY were separate procedures. Over time, by version 8, the code for the 2 procedures was standardized and "melded" together. There are essentially no differences except that MEANS creates output in the LISTING window or other open destinations, while SUMMARY creates an output dataset by default.

If you are interested in summarizing data, these papers may be of interest:
http://www2.sas.com/proceedings/sugi28/165-28.pdf
http://www2.sas.com/proceedings/forum2007/236-2007.pdf

cynthia
Contributor
Posts: 61

Re: Proc Means & Proc Summary

Hi Siddartha....

Proc Means and Proc Summary both are similar except two cases
They are.....

for Proc Means...... default proc print and var statement.
for Proc Summary........proc print and var statement required.


Thanks...
Contributor
Posts: 35

Re: Proc Means & Proc Summary

Some more differences
- If you don't mention the VAR statement, PROC SUMMARY produces a simple count of observations. But PROC MEANS analyzes all the numeric variables that are not listed in the other statements.
- If you print the data created by PROC SUMMARY, you'll get _TYPE_ column along with the other descriptive statistics.
- In PROC MEANS, number of records is N whereas it is denoted by _FREQ_ in PROC SUMMARY

This is a very common interview question here in India :-)
Frequent Contributor
Posts: 100

Re: Proc Means & Proc Summary

Thank you for pointing out the first item. Would not have expected it just by reading SAS Help. (Did not notice the next two differences in my test runs though. Could be due to SAS version updates).
Super User
Posts: 10,538

Re: Proc Means & Proc Summary

The output can differe when using multiple CLASS variables as well. The output dataset for PROC SUMMARY will resemble the "printed" output for PROC MEANS only when the NWAY option is used. Otherwise you get all of those values for each level of _TYPE_ which is not the default behavior of MEANS.
N/A
Posts: 0

Re: Proc Means & Proc Summary

I was also wondering about your question and I received the reply as below,

PROC SUMMARY and PROC MEANS are the same underneath, but MEANS defaults to print output and SUMMARY does not.
Ask a Question
Discussion stats
  • 6 replies
  • 233 views
  • 0 likes
  • 7 in conversation