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

st: RE: Simple "Drop" Question


From   "Nick Cox" <n.j.cox@durham.ac.uk>
To   <statalist@hsphsun2.harvard.edu>
Subject   st: RE: Simple "Drop" Question
Date   Thu, 14 Oct 2004 13:54:11 +0100

egen min = min(foo), by(CONAME) 
drop if min < 0 

If any observations are negative, the minimum will be 
too. 

Nick 
n.j.cox@durham.ac.uk 

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/



© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index