Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Tabulating extreme values


From   "R. Allan Reese" <[email protected]>
To   Stata distribution list <[email protected]>
Subject   Re: st: Tabulating extreme values
Date   Tue, 13 May 2003 10:03:46 +0100 (BST)

> On Mon, May 12, 2003 at 10:04:15PM +0100, SJ Friederich, Economics wrote:
> > Say I have a variable taking on a large number of values and I am only
> > interested in finding out how much each of the top five or ten values
> > represent in terms of frequencies.
>
On Mon, 12 May 2003, Michael Hills wrote:

> . tab X if X > x
>
> might work after a few stabs at different values of x.

Nearly there, but in one step you can use ranks.  As the rank function
changes the sort order of the data, it may be advisable to save the
current order:

gen corder = _n
egen rankx = rank(x)
tab x if rankx < 5

However, I often advise clients that a very powerful analysis tool is to
sort and inspect the data editor, since you can see what other variables
are odd values on the same case.


R. Allan Reese                       Email: [email protected]
Associate Manager GRI                Direct voice:   +44 1482 466845
Graduate School                      Voice messages: +44 1482 466844
Hull University, Hull HU6 7RX, UK.   Fax:            +44 1482 466436
====================================================================
The management here were SO impressed with W Edward Deming's "Out of
the crisis" that they are working flat out to create THE BEST crisis;
then they can start implementing the 13 obligations.

*
*   For searches and help try:
*   http://www.stata.com/support/faqs/res/findit.html
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index