Hello Team,
How to get all numeric fields stats details by using PROC MEANS and output should be in SAS dataset (no need report).
Input:
Num1 | New_Ques | New_Status_1 | new_ Interval | New_Status_2 | new_ address |
234 | 13 | 8 | 7 | 14 | 24 |
431 | 20 | 8 | 6 | 14 | 28 |
755 | 36 | 8 | 6 | 13 | 27 |
753 | 28 | 14 | 9 | 13 | 17 |
941 | 28 | 8 | 6 | 14 | 15 |
526 | 33 | 8 | 6 | 14 | 20 |
621 | 46 | 14 | 7 | 13 | 14 |
834 | 29 | 8 | 6 | 14 | 22 |
Output:
Var | Mean | Std | Min | Max | P5 | P25 | P50 | P75 |
Num1 | 636.875 | 231.7717 | 234 | 941 | 234 | 478.5 | 234 | 794.5 |
New_Ques | 29.125 | 9.948977 | 13 | 46 | 13 | 24 | 13 | 34.5 |
New_Status_1 | 9.5 | 2.77746 | 8 | 14 | 8 | 8 | 8 | 11 |
new_ Interval | 6.625 | 1.06066 | 6 | 9 | 6 | 6 | 6 | 7 |
New_Status_2 | 13.625 | 0.517549 | 13 | 14 | 13 | 13 | 13 | 14 |
new_ address | 20.875 | 5.303301 | 14 | 28 | 14 | 16 | 14 | 25.5 |
PROC SUMMARY or PROC MEANS will do this. There are examples in the documentation
Is there any specific reason you're using multiple ID's here?
Or is this a homework question of sorts?
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.