06-17-2013 03:52 AM
I am having some issues with formatting the output of a PROC MEANS.
1) I would like to control the displayed values for the computed statistics, applying formats such as COMMAX32. and best4.0 to some of the statistics. In the below code, the FORMAT statement seems to have no effect? What am I missing?
2) I was hoping to be able to suppress the column in the output table displaying the variable names, leaving only the variable labels. Is this possible, and if so how?
Thanks for your kind assistance
PROC MEANS DATA=WORK.SORTTempTableSorted
VAR M_Kundelengde Alder Aktive_Konti_N Totalpakke_Bol Avtalegiro_Ant Bank_Id_Ant Debetkort_Ant
Lonns_Brukskonto_Ant Nettbank_Ant Reservekort_Ant Spareavtale_Ant Saldo_MNOK;
FORMAT Alder BEST4.
LABEL Totalpakke_Bol="Totalpakke (1 = Har totalpakke)"
06-17-2013 04:37 AM
Afaik proc means has no option to control the number of decimal places for individual variables/statistics. The options "maxdec" sets the number of decimal places for all generated statistics.
06-17-2013 04:41 AM
If you want to have better control over the formatting then your best options are to use PROC TABULATE or PROC REPORT, you can replicate all the calculations with these.
06-17-2013 06:05 AM
Thanks guys - won't spend more time on PROC MEANS then but rather look at the TABULATE and REPORT procs! Thanks. Will update post once I find sort this out!
06-17-2013 11:24 AM
The basic idea with Proc Tabulate is you can specify the display format with the selected statistic.
Part of an example:
table classvar,var1*(mean*f=comma6.1 std*f=f6.4 min*f=mycustomformat.);