I have a similar situation to the question asked here. However, I don't want to list my 300 variable names in the var
statement since they are all unique. Is there a way to use proc means
or proc summary
to output summary statistics for all the numeric variables in one data set?
I've tried:
proc means data=my_data min median max;
output out=summary_data min=min median=median max=max;
run;
But this only outputs the summary statistics for the first variable. I have also tried with the help of ods trace
:
proc means data=my_data min median max;
ods output Summary=summary_data;
run;
Which gives me the summary statistics for all the variables, but still in one row:
VName_VAR1 VAR1_Minimum VAR1_Median VAR1_Maximum VName_VAR2 VAR2_Minimum etc...
VAR1 3 3 3 VAR2 3
Where my VAR names are all unique. Is there some other way to use proc means
or proc summary
to output summary statistics for all the numeric variables in one data set?
UPDATE:
When I removed min=min median=median max=max
:
proc means data=my_data min median max;
output out=summary_data;
run;
The code then produces the output:
Obs _TYPE_ _FREQ_ _STAT_ VAR_1 VAR_2 ... etc
1 0 91 N 91.00 91 ... etc
2 0 91 MIN 2005.00 13 .
3 0 91 MAX 2014.00 13 .
4 0 91 MEAN 2009.34 13 .
5 0 91 STD 3.02 0
However, it still doesn't give me the MEDIAN.