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.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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