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]
st: Delete companies based on observations
From
"M@rk " <[email protected]>
To
"Statalist" <[email protected]>
Subject
st: Delete companies based on observations
Date
Wed, 13 Nov 2013 10:48:43 +0100
Dear Users,
For my research I need to delete all companies of which I have equal or less
than 13 observations. I already tried the following commands, without the
desired result.
drop if _n<=13, by(comnam)
drop if comnam[_n]<=13
I assume that the count funtion in Stata can help me to delete these
companies, but I do not know how to incorporate this in a command in order
to do the deletions.
If somebody could help me with this, I would be very grateful.
Many thanks in advance.
Kind Regards,
Mark Krap
*
* 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/