egen min = min(foo), by(CONAME)
drop if min < 0
If any observations are negative, the minimum will be
too.
Nick
[email protected]
mert 0723
> I am trying to use the "Drop" function to do something that should be
> simple, but I've looked through the manuals and can't find
> how to do it.
>
> I have a big panel of n companies, with 10 years of data per
> company. The
> companies are identified by the variable CONAME. If the company has a
> negative dividend reported in any year, I would like to drop *all*
> observations of that company (i.e. all observations
> associated with the
> CONAME corresponding to the negative dividend figure). How do
> I do this? If
> I just type "drop if dividend < 0", it only drops that
> observation, not the
> other observations for that CONAME. Help appreciated.
>
*
* 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/