- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Hello SAS Communities,
I would need to use the MEAN function to to calculate the average daily rainfall.
Suppose I have data on the rainfall in my city, with the variables 'Day1', 'Day2,'...,'Day365' containing the value of rainfall for each day of the year.
How should I write my MEAN function?
Thanks!
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That isn't enough information to answer you question.
SAS processes data differently if it's in rows or columns so what works for one data structure won't work for a different data structure.
Here's a rough idea of how to do By group processing within PROC MEANS which seems to be what you're trying to do....there really isn't a good paper or guide on PROC MEANS that I've seen yet to recommend 😞
https://github.com/statgeek/SAS-Tutorials/blob/master/proc_means_basic.sas
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
First transpose to a long dataset, then use PROC MEANS.
For detailed help, post usable example data in a data step with datalines.