09-26-2017 09:44 PM
I was wondering if there was a way to change the order in the variable analysis. Proc means automatically displays the variable analysis in alphabetical order, but is it possible to display the variable from highest to lowest mean or to only display the highest mean.
09-26-2017 10:38 PM
Use the OUTPUT option of PROC MEANS to get the results in a sas dataset,
then use PROC PRINT or PROC REPORT to get the report with any desired order of variables.
09-26-2017 11:06 PM
proc means has a STACKODSOUTPUT, that works in combination with the ODS OUTPUT statement. The output statement would ordinarily generate extra columns in the output dataset when you add vars to be analyzed. But you actually want rows added for each analysis variable. That what the STACKODSOUTPUT paramenter does:
ods listing close; proc means data=sashelp.class stackodsoutput; var height weight; ods output summary=mydata; run; ods listing; proc sort data=mydata; by descending mean; run; proc print data=mydata;run;