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

Re: st: percentile


From   Philip Ryan <philip.ryan@adelaide.edu.au>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: percentile
Date   Mon, 07 Feb 2005 13:57:19 +1030

centile var, cent(97)
drop if var > `r(c_1)' & var < .

Be careful, Stata will do exactly what you ask: this will drop any observations *on all variables* when for those observations var exceeds its 97th percentile.

You might prefer to tag those observations meeting/not meeting your criterion and use the indicator variable thereafter as a command qualifier:

centile var, cent(97)
gen byte useme = var <= `r(c_1)'

<<..subsequent stata comand>> if useme


Phil




At 08:06 PM 6/02/2005 -0600, you wrote:

hello
i will appreciate if someone can help me.
how can i do if i want to drop all observations higher than some
percentile (for example higher than 97th percentile).
thanks
*
*   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/
Philip Ryan
Associate Professor,
Department of Public Health
Associate Dean (Information Technology)
Faculty of Health Sciences
University of Adelaide 5005
South Australia
tel 61 8 8303 3570
fax 61 8 8223 4075
http://www.public-health.adelaide.edu.au/
CRICOS Provider Number 00123M
-----------------------------------------------------------
This email message is intended only for the addressee(s)
and contains information that may be confidential and/or
copyright. If you are not the intended recipient please
notify the sender by reply email and immediately delete
this email. Use, disclosure or reproduction of this email
by anyone other than the intended recipient(s) is strictly
prohibited. No representation is made that this email or
any attachments are free of viruses. Virus scanning is
recommended and is the responsibility of the recipient.

*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index