Bookmark and Share

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]

Re: st: Drop observations of groups with 0 as critical value


From   Nick Cox <[email protected]>
To   [email protected]
Subject   Re: st: Drop observations of groups with 0 as critical value
Date   Sat, 4 Jun 2011 15:59:52 +0100

egen anyzero = total(debtratio == 0), by(gvkey)
drop if anyzero

Nick

Felix/Achmed Aldai

> Below find an extract of my data set.
>
>
> gvkey           debtratio
> 1001            0,2
> 1001            0,23
> 1001            0,23
> 1001            0,23
> 1001            0,25
> 1200            0,05
> 1200            0
> 1200            0
> 1200            0
>
>
> I want to drop all the firms that have a zero debtratio. Meaning that once the debtratio becomes 0 I want to drop all the observations of this company (gvkey). So in the end I should only be left with firms that all have a nonzero debtratio.

*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index