Help using Base SAS procedures

how do I use proc means for multiple data sets

Accepted Solution Solved
Reply
Highlighted
New Contributor
Posts: 3
Accepted Solution

how do I use proc means for multiple data sets

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
Respected Advisor
Posts: 2,174

Re: how do I use proc means for multiple data sets

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

View solution in original post


All Replies
Solution
2 weeks ago
Respected Advisor
Posts: 2,174

Re: how do I use proc means for multiple data sets

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
New Contributor
Posts: 3

Re: how do I use proc means for multiple data sets

Posted in reply to PaigeMiller
Thank you for the guidance!
Super User
Posts: 21,564

Re: how do I use proc means for multiple data sets


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

 

http://video.sas.com/detail/videos/sas-analytics-u/video/3306906230001/summary-statistics-using-sas-...

New Contributor
Posts: 3

Re: how do I use proc means for multiple data sets

Thank you for the insight and links!
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 105 views
  • 2 likes
  • 3 in conversation