Statalist


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

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


From   "Quang Nguyen" <quangn@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: How to calculate 75 percentile of other individuals on the same group
Date   Sat, 29 Sep 2007 12:19:11 -1000

Dear Joseph,

That's truly wonderful. Your solution works nicely. Thanks so much for
taking your time to help me. I have learnt a great deal from your code
which is great.
I am very fortunate!
With much gratitude!

Quang

On 9/29/07, Joseph Coveney <jcoveney@bigplanet.com> wrote:
> 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/
>


-- 
"My father gave me the greatest gift anyone could give another person,
he believed in me." - Jim Valvano
*
*   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