Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: Re: data management help


From   Christopher F Baum <[email protected]>
To   [email protected]
Subject   st: Re: data management help
Date   Mon, 4 Oct 2004 07:21:49 -0400

On Oct 4, 2004, at 2:33, Mindy wrote:

I have a data set with 131,000 firm observations over 14 years.
Individual firms may be in the data set between 1 and 14 times. I want
to keep only those firms that have observations for the entire 14 year
period.

piece of cake:

bysort firm: keep if _N==14

A harder problem is to impose a condition like 'companies must have at least four consecutive years of earnings data.' I have dealt with that successfully (with a little help from Nick and -tsspell-).

Kit Baum, Boston College Economics [email protected]
http://ideas.repec.org/e/pba1.html

*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* 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