BookmarkSubscribeRSS Feed
jtorourke
Fluorite | Level 6

I am relatively new at SAS and need some help please.  I am using Proc Means in SAS Enterprise Guide (Ver 7.15) and want to substitute specific descriptions of the statistics in column headings and hide the brief headings such as "N" and "Mean."  Is there such an option?  Thanks in advance.  (See the attached example)

4 REPLIES 4
Astounding
PROC Star

There's no simple way.  I suspect that "new at SAS" means this will be of medium difficulty.  Here's the general idea.

 

First, switch from PROC MEANS to PROC SUMMARY so there will be no printed output.

 

Second, add NWAY to the end of the PROC statement,.

 

Finally, add an OUTPUT statement. You should look up some of the details here, but the basic idea is that you can specify the statistics that you want, and what variable names should be used to represent them in the output data set.  For example:

 

output out=my_stats mean=Average_Value  N=Count;

 

This creates a data set named MY_STATS holding variables Average_Value and Count.  Average_Value is the mean of your analysis variable, and Count is the N statistic.  

 

There are additional details to consider (including the AUTONAME option) if you have multiple analysis variables.

 

Finally use PROC PRINT to print the output data set MY_STATS.  That will give you a lot more control over the report that you get.

jtorourke
Fluorite | Level 6
Wow. Thanks much. I will give this a try.
TomKari
Onyx | Level 15

I concur with @Astounding's excellent advice. If you want to do this with the EG tasks instead of code, you can use the Describe | Summary Statistics task. In the Results tab, untick "Show statistics", and tick "Save statistics to dataset". Unfortunately, I can't think of any way to use an EG task to get a listing of the data with custom headings.

 

Tom

jtorourke
Fluorite | Level 6
Thanks, Tom.

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 2629 views
  • 0 likes
  • 3 in conversation