turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- Base SAS Programming
- /
- ODS Table Output for PROC Means

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-15-2016 01:17 PM

I wish to use ODS Table Name Output within Proc Means to construct an output data set that contains

( For Example ) the following columns:

Variable_Name, Var_Min, Var_Median, Var_Max, Var_Mean

Var_01 Var_01_Min Var_01_Median Var_01_Max Var_01_Mean

Var_02 Var_02_Min Var_02_Median Var_02_Max Var_02_Mean

Var_60 Var_60_Min Var_60_Median Var_60_Max Var_60_Mean

Ultimately I wish to merge several such SAS Data Sets generated by Proc Means to construct the following Data Set:

Variable_Name Y_Variable, Var_X1_Median, Var_X2_Median, Var_X3_Median

where the Y-Variable may be dependent on one or more of the X variables

I constructed the base data set as follows:

PROC FREQ

DATA = WORK.DATA2SS NLEVELS ;

TABLES SQ01 - SQ59 / NOCOL ;

ODS OUTPUT NLEVELS = WORK.QUESTLEVELS_1 ;

RUN;

So my Data set should contain:

SQ01 Y01=NLEVELS01 X101 X201 X301

SQ02 Y02=NLEVELS02 X102 X202 X302

SQ59 Y59=NLEVELS59 X159 X259 X359

Accepted Solutions

Solution

05-15-2016
03:41 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-15-2016 01:44 PM

RTM.

Use STACKODS option and ODS OUTPUT.

```
proc means data=sashelp.class stackods;
ods output summary=want;
run;
proc print data=want;
run;
```

All Replies

Solution

05-15-2016
03:41 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-15-2016 01:44 PM

RTM.

Use STACKODS option and ODS OUTPUT.

```
proc means data=sashelp.class stackods;
ods output summary=want;
run;
proc print data=want;
run;
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-15-2016 02:43 PM

OK, thanks for that, I will give it a try and see if it solves my problem

##- Please type your reply above this line. Simple formatting, no

attachments. -##

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-16-2016 10:05 AM

In addition to PROC MEANS, you might want to look at the OUTTABLE= option in PROC UNIVARIATE. See the article

"Save descriptive statistics for multiple variables in a SAS data set"

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-16-2016 04:23 PM

Thanks Rick.

The DO LOOP is my first port of call.

You are right, no matter how long one has been using SAS, when solving a

new problem there is always the opportunity to learn something new and

where possible to share this knowledge with others.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

The DO LOOP is my first port of call.

You are right, no matter how long one has been using SAS, when solving a

new problem there is always the opportunity to learn something new and

where possible to share this knowledge with others.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-16-2016 04:33 PM

What a positive philosophy! Thanks for the inspiring thought.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-16-2016 05:00 PM

Initially, it was interesting mathematically because of the matrix based

analysis in IML but difficult to apply as I did not have access to IML at

work.

However, now that I have started using SAS University Edition at home, I

can experiment with IML and will probably revisit many of the DO LOOP

Articles in order to work through.

I have made good use of those articles on Scatterplots and Predictive /

Confidence Ellipses in EDA.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

analysis in IML but difficult to apply as I did not have access to IML at

work.

However, now that I have started using SAS University Edition at home, I

can experiment with IML and will probably revisit many of the DO LOOP

Articles in order to work through.

I have made good use of those articles on Scatterplots and Predictive /

Confidence Ellipses in EDA.

##- Please type your reply above this line. Simple formatting, no

attachments. -##

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-17-2016 09:04 AM

Thanks for reading. There are many articles on *The DO Loop* that do not involve matrix computations. In addition to serving SAS/IML programmers, I try to create content that appeals to Base SAS programmers, SAS/STAT analysts, and analysts who create statistical graphics.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content

05-17-2016 10:12 AM

Yes, I have found your DO LOOP articles generally very useful.

BTW I have purchased both your books. ( IML and Simulation )

Very few of my Financial Service Clients have ever licensed IML.

Perhaps SAS should include IML within the SAS "Analytics" Product Bundle

which most banks seem happy to license.

Especially given the migration to R which is vector / matrix based.

Cheers

##- Please type your reply above this line. Simple formatting, no

attachments. -##

BTW I have purchased both your books. ( IML and Simulation )

Very few of my Financial Service Clients have ever licensed IML.

Perhaps SAS should include IML within the SAS "Analytics" Product Bundle

which most banks seem happy to license.

Especially given the migration to R which is vector / matrix based.

Cheers

##- Please type your reply above this line. Simple formatting, no

attachments. -##