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
- /
- SAS Procedures
- /
- how do I use proc means for multiple data sets

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

Highlighted
# how do I use proc means for multiple data sets

Options

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

2 weeks ago

Hi everyone,

I am new to SAS studio (3.4) and having some issues understanding how to use proc means for several data sets or if this is possible.

I have 5 SAS data sets in my library (different years of data for the same variables).

I want to conduct proc means for a few continuous variables for each data set and output it in a way that shows each variable's descriptive stats (N, Mean, Median, 10th and 90th percentile, max, min) by year (each data set).

Any advice would be much appreciated.

Accepted Solutions

Solution

2 weeks ago

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

Posted in reply to kthartma

2 weeks ago

Concatenate the 5 datasets into one, using PROC APPEND, or a datastep.

Then run PROC MEANS using the BY statement to create analyses for each year.

In the future, do not break these data sets up by years, keep them together.

--

Paige Miller

Paige Miller

All Replies

Solution

2 weeks ago

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

Posted in reply to kthartma

2 weeks ago

Concatenate the 5 datasets into one, using PROC APPEND, or a datastep.

Then run PROC MEANS using the BY statement to create analyses for each year.

In the future, do not break these data sets up by years, keep them together.

--

Paige Miller

Paige Miller

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

Posted in reply to PaigeMiller

2 weeks ago

Thank you for the guidance!

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

Posted in reply to kthartma

2 weeks ago

kthartma wrote:

Hi everyone,

I am new to SAS studio (3.4) and having some issues understanding how to use proc means for several data sets or if this is possible.

I have 5 SAS data sets in my library (different years of data for the same variables).

I want to conduct proc means for a few continuous variables for each data set and output it in a way that shows each variable's descriptive stats (N, Mean, Median, 10th and 90th percentile, max, min) by year (each data set).

Any advice would be much appreciated.

It's not good design to keep your data separated like that. The suggestion to combine the data is correct and then you can run PROC MEANS with a CLASS or BY statement to summarize it.

Here are some examples:

https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas

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

Posted in reply to Reeza

2 weeks ago

Thank you for the insight and links!