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

st: RE: How to use r(p)


From   "Jann Ben" <ben.jann@soz.gess.ethz.ch>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: How to use r(p)
Date   Mon, 12 Sep 2005 10:26:47 +0200

FUKUGAWA Nobuya wrote:
> Suppose we want to limit observations where one variable 
> records a larger value
> than its top quartile, we can write as follows.
> 
> sum d,detail
> reg y a b c if d>r(p75)
> 
> However, this program allows only fixed thresholds such as 1, 
> 10, and 75 percent.
> How can I use other thresholds such as r(p33) in the program?

 . _pctile d, percent(33)
 . reg y a b c if d>r(r1)

or maybe

 . _pctile d if y<. & a<. & b<. & c<., percent(33)
 . reg y a b c if d>r(r1)

ben

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