| Date: | Fri, 5 Apr 2002 18:33:59 +0100 |
| Reply-To: | Peter Crawford <peter.crawford@DB.COM> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Peter Crawford <peter.crawford@DB.COM> |
| Subject: | Re: sorting in proc tabulate |
|
| Content-type: | text/plain; charset=iso-8859-1 |
so to present in descending order of sum(of analysis var)
(or any other statistic apart from N for which order=freq works)
the data would need to be pre-summarised and
sorted into that statistic order, to use
order=data
Datum: 05/04/2002 17:28
An: SAS-L@LISTSERV.UGA.EDU
Antwort an: "William W. Viergever" <wwvierg@ATTGLOBAL.NET>
Betreff: Re: sorting in proc tabulate
Nachrichtentext:
At 01:11 AM 4/5/2002 +0000, Bobby Kidd wrote:
Does anyone know how to get proc tabulate to order the table by an analysis
variable. I want to order the table by a descending value of a mean. I
would like to put the top performers at (where else) the top.
Check this out; it's an option to the Proc Tab statement proper (i.e., RTFM):
ORDER=DATA | FORMATTED | FREQ | UNFORMATTED
specifies the sort order to create the unique combinations of the values of the class variables, which form the headings of the table, according to the specified order.
DATA
orders values according to their order in the input data set.
Interaction: If you use PRELOADFMT in the CLASS statement, the order for the values of each class variable matches the order that PROC FORMAT uses to store the values of the associated user-defined format. If you use the CLASSDATA= option, PROC TABULATE uses the order of the unique values of each class variable in the CLASSDATA= data set to order the output levels. If you use both options, PROC TABULATE first uses the user-defined formats to order the output. If you omit EXCLUSIVE, PROC TABULATE appends after the user-defined format and the CLASSDATA= values the unique values of the class variables in the
input data set based on the order that they are encountered.
Tip: By default, PROC FORMAT stores a format definition in sorted order. Use the NOTSORTED option to store the values or ranges of a user defined format in the order that you define them.
FORMATTED
orders values by their ascending formatted values. This order depends on your operating environment.
Alias: FMT | EXTERNAL
FREQ
orders values by descending frequency count.
Interaction: Use the ASCENDING option in the CLASS statement to order values by ascending frequency count.
UNFORMATTED
orders values by their unformatted values, which yields the same order as PROC SORT. This order depends on your operating environment. This sort sequence is particularly useful for displaying dates chronologically.
Alias: UNFMT | INTERNAL
Default: UNFORMATTED
Interaction: If you use the PRELOADFMT option in the CLASS statement, PROC TABULATE orders the levels by the order of the values in the user-defined format.
Featured in: Understanding the Order of Headings with ORDER=DATA
------------------------------------------------------------
William W. Viergever Voice : (916) 483-8398
Viergever & Associates Fax : (916) 486-1488
Sacramento, CA 95825 E-mail : wwvierg@attglobal.net
------------------------------------------------------------
--
Diese E-Mail enthält vertrauliche und/oder rechtlich geschützte Informationen. Wenn Sie nicht der richtige Adressat sind oder diese E-Mail irrtümlich erhalten haben, informieren Sie bitte sofort den Absender und vernichten Sie diese Mail. Das unerlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail ist nicht gestattet.
This e-mail may contain confidential and/or privileged information. If you are not the intended recipient (or have received this e-mail in error) please notify the sender immediately and destroy this e-mail. Any unauthorized copying, disclosure or distribution of the material in this e-mail is strictly forbidden.
|