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

Re: st: quartiles


From   "Clive Nicholas" <[email protected]>
To   [email protected]
Subject   Re: st: quartiles
Date   Sat, 8 May 2004 00:04:51 +0100 (BST)

Peter Harper wrote:

> Can tell me the commands to obtain a bottom and top quartile.

To which Thomas Trikalinos replied:

> tabstat variableName, stat(q)
> returns the p25, p50, p75 percentiles.

Another, and perhaps (slightly) simpler, solution is

. sum <var>, detail

which gives you all sorts of other sexy stuff about <var>. Thus:

. sysuse auto
(1978 Automobile Data)

. sum mpg, detail

                        Mileage (mpg)
-------------------------------------------------------------
      Percentiles      Smallest
 1%           12             12
 5%           14             12
10%           14             14       Obs                  74
25%           18             14       Sum of Wgt.          74

50%           20                      Mean            21.2973
                        Largest       Std. Dev.      5.785503
75%           25             34
90%           29             35       Variance       33.47205
95%           34             35       Skewness       .9487176
99%           41             41       Kurtosis       3.975005

CLIVE NICHOLAS        |t: 0(044)191 222 5969
Politics              |e: [email protected]
Newcastle University  |http://www.ncl.ac.uk/geps
*
*   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