Statalist


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

Re: st: How to calculate 75 percentile of other individuals on thesame group


From   Joseph Coveney <[email protected]>
To   Statalist <[email protected]>
Subject   Re: st: How to calculate 75 percentile of other individuals on thesame group
Date   Sat, 29 Sep 2007 16:15:46 -0700

Although my suggestion was centered around -egen-, which is very often a
convenience, you can usually do things more efficiently.  For example, in
this case, -_pctile if . . ., percentiles(75)- and then -replace p75 = r()
in . . . - would avoid redundancy of -by . . .: egen . . . pctile()- where
all of the other groups' results are calculated and discarded each time.
There are other ways to polish the suggestion, too, and difference would be
noticeable with large datasets and many groups.

Joseph Coveney


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