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.
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.
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.
@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
How would you use a class statement for two datasets? Please could you include a short example. I looked at the links but there were only examples with the by statement.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.