multisummary | Calculate Summary statistics for multiple variables | multisummary |
The MULTISUMMARY macro produces an output data set containg any of the statistics calculated by PROC SUMMARY for any number of numeric variables.
The MULTISUMMARY macro is defined with keyword parameters. The arguments may be listed within parentheses in any order, separated by commas. For example:
%multisummary(var=x1-x3, stats=n mean std);
DATA=_LAST_
]
VAR=_NUMERIC_
]
Name(s)
of 0 or more class variables
STATS=
option.
%include macros(multisummary); *-- or include in an autocall library; %include data(guerry); %multisummary(data=guerry, class=region, var=Suicides Infants Crime_prop Crime_pers, stats=Q1 median Q3, options=missing nway, out=gstats); proc print data=gstats;
Obs _statistic_ Region _TYPE_ _FREQ_ Suicides Infants prop pers 1 Q1 1 1 37016 24743 4589 2199 2 median 1 1 37016 24743 4589 2199 3 Q3 1 1 37016 24743 4589 2199 4 Q1 C 1 17 15272 14475 6516 17722 5 median C 1 17 29381 17044 8236 21292 6 Q3 C 1 17 77823 20046 12141 26747 7 Q1 E 1 17 16171 12512 5914 13396 8 median E 1 17 21233 15599 7770 18835 9 Q3 E 1 17 34476 20384 9044 26231 10 Q1 N 1 17 8334 10575 4500 15602 11 median N 1 17 13463 14281 5521 23101 12 Q3 N 1 17 25572 16303 7144 28180 13 Q1 S 1 17 19024 15250 6731 8236 14 median S 1 17 48783 20383 8680 13019 15 Q3 S 1 17 66498 23771 9797 13576 16 Q1 W 1 17 25143 17681 6842 18712 17 median W 1 17 33358 21375 7566 22138 18 Q3 W 1 17 38501 31754 8943 24964