Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

RE: st: is there a syntax that inverts what -centile- does?


From   "Nick Cox" <[email protected]>
To   <[email protected]>
Subject   RE: st: is there a syntax that inverts what -centile- does?
Date   Mon, 14 Jan 2008 15:48:49 -0000

Strictly, the range referred to here is a range of probabilities, 
not that of the corresponding quantiles (values). 

Nick
[email protected] 

Austin Nichols replied to Yang Lu

If you read the FAQ at
http://www.stata.com/support/faqs/stat/pcrank.html you would see that
this trick imposes symmetry on the extremes of the data.  Alternatives

by mi: g r=(srank-srank[1])/srank[_N] if mi==0
by mi: g r=(srank)/srank[_N] if mi==0

would have quantiles in a range [0,1-a] or [a,1] rather than
[a/2,1-a/2].

On Jan 11, 2008 6:11 PM, Yang Lu <[email protected]> wrote:
> Thank you, Austin, the code is very helpful.
>
> One more question (though trivial):
> When calculating the rank, you wrote
> > by mi: g r=(srank-srank[1]/2)/srank[_N] if mi==0
> I noticed that you divided the first srank value by 2 so that the
> percentile for the first obs (with lowest bmi) won't be zero. I'm
> wondering if this is a standard formula, and if not, why can't we just
> write
> by mi: g r=srank/srank[_N] if mi==0
*
*   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/

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