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

- 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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-06-2018 01:10 PM

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

02-06-2018
01:50 PM

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

Posted in reply to kthartma

02-06-2018 01:13 PM

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

02-06-2018
01:50 PM

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

Posted in reply to kthartma

02-06-2018 01:13 PM

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to PaigeMiller

02-06-2018 01:50 PM

Thank you for the guidance!

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

Posted in reply to kthartma

02-06-2018 01:21 PM

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
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

02-06-2018 01:50 PM

Thank you for the insight and links!