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

st: RE: Simple "Drop" Question

From   "Nick Cox" <[email protected]>
To   <[email protected]>
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 

[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:

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