Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: upper quartile selection for multiple groups


From   Maarten Buis <[email protected]>
To   [email protected]
Subject   Re: st: upper quartile selection for multiple groups
Date   Wed, 12 Jun 2013 15:31:14 +0200

On Wed, Jun 12, 2013 at 3:18 PM, Maria Sokolova wrote:
> I have big (very big) panel data, for which I need to create dummies
> representing the belonging to the top 5% (or 10%) per each categorie.
> I have too high number of categories (over 1000) to do it manually.

*------------------ begin example ------------------
sysuse nlsw88, clear
bys race : egen p80 = pctile(wage), p(80)
gen highwage = wage > p80 if wage < .
tab race highwage, row
*------------------- end example -------------------
(For more on examples I sent to the Statalist see:
http://www.maartenbuis.nl/example_faq )

Hope this helps,
Maarten

---------------------------------
Maarten L. Buis
WZB
Reichpietschufer 50
10785 Berlin
Germany

http://www.maartenbuis.nl
---------------------------------
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index