Statalist


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

Re: st: Deleting Only Particular Observations


From   Maarten buis <[email protected]>
To   [email protected]
Subject   Re: st: Deleting Only Particular Observations
Date   Wed, 1 Jul 2009 20:41:26 +0000 (GMT)

--- On Wed, 1/7/09, Christian Weiß wrote:
> Variable size contains the marketcap of about 2000 firms
> from 11 countries (grouping var country).
> 
> I would like to keep only the 100 biggest firms (by
> marketcap) from each country, and delete the residual
> observations.

gen negsize = -size
bys country (negsize) : keep if _n < 101
drop negsize

Hope this helps,
Maarten

-----------------------------------------
Maarten L. Buis
Institut fuer Soziologie
Universitaet Tuebingen
Wilhelmstrasse 36
72074 Tuebingen
Germany

http://home.fsw.vu.nl/m.buis/
-----------------------------------------




      

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   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