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

st: Re: RE: percentiles


From   "Don Spady" <[email protected]>
To   <[email protected]>
Subject   st: Re: RE: percentiles
Date   Fri, 11 Oct 2002 11:10:45 -0600

Many thanks
Don Spady
----- Original Message ----- 
From: "Steichen, Thomas" <[email protected]>
To: <[email protected]>
Sent: Friday, October 11, 2002 10:06
Subject: st: RE: percentiles


Don Spady writes:
> I am trying to use the command "pctile" to get percentiles 
> of the values in a variable.  The values are individual ages.
> I have used the commands:
> pctile  pct=age
> pctile pct=age, genp(pctAge)
> but when I run it and then list the first 10 instances I get
> 
> . list pct age in 1/10
> 
>            pct       age
>   1.         9        14
>   2.         .        17
>   3.         .         1
>   4.         .        14
>   5.         .         5
>   6.         .        12
>   7.         .        14
>   8.         .         7
>   9.         .         9
>  10.         .         0
> 
> The ages run from 0 to 17 and are fairly evenly distributed.
> ?? Why don't I get any values in the pct column and what does 
> the '9' mean.

9 is the median.

-pctile- splits the data into k=2 groups unless you specify the 
-nquantiles()- option and reports the cutpoints for k-1 groups
in the new variable (pct - in your case). With two groups, the 
cutpoint is the median.  -genp()- specifies the variable that 
contains the percentages in the two groups.

Tom


*
*   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