<>
Ignore last email, sorry, knee jerk reaction. Here is a better idea:
***
clear*
//100 countries
set obs 100
//countries
gen country=_n
//200 firms per country
expand 200
gen size=rnormal(100000,10000)
//keep the biggest 100
sort country size
by country: keep if (_N-_n)<100
***
HTH
Martin
_______________________
----- Original Message -----
From: "Christian Weiß" <[email protected]>
To: <[email protected]>
Sent: Wednesday, July 01, 2009 10:24 PM
Subject: st: Deleting Only Particular Observations
Dear Statalist,
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.
How can I accomplish this?
Best regards
Christian
*
* 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/
*
* 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/