Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, is already up and running.

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

Re: st: upper quartile selection for multiple groups

From   Maarten Buis <>
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: )

Hope this helps,

Maarten L. Buis
Reichpietschufer 50
10785 Berlin
*   For searches and help try:

© Copyright 1996–2016 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index