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 with multiple zero values


From   Sergiy Radyakin <[email protected]>
To   "[email protected]" <[email protected]>
Subject   Re: st: Drop observations with multiple zero values
Date   Fri, 7 Jun 2013 16:13:11 -0400

see the other post then for negatives

On Fri, Jun 7, 2013 at 4:10 PM, G. Anderson <[email protected]> wrote:
> Thanks a lot Sergiy
>
> This is helpful, although some of the variables do contain negatives
> unfortunately!
>
>
>
> On Jun 7 2013, Sergiy Radyakin wrote:
>
>> tempvar r
>> egen `r'=rowtotal(A B C)
>> drop if `r'==0
>>
>> missings are treated as zeroes and things get more complicated if any
>> of the vars may contain negatives.
>> Best, Sergiy
>>
>> On Fri, Jun 7, 2013 at 4:02 PM, G. Anderson <[email protected]> wrote:
>>>
>>> Hi,
>>>
>>> Does anybody know how I can drop observations if a number of values are
>>> zero?
>>>
>>> I can do this by manually inputting
>>> drop if( A==0 & B==0 & C==0)
>>> But I was wondering if there was any easier way of doing this (especially
>>> when I have a lot of variables)- perhaps using varlist somehow?
>>>
>>>
>>> Many Thanks,
>>>
>>> Gareth *
>>> *   For searches and help try:
>>> *   http://www.stata.com/help.cgi?search
>>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>>> *   http://www.ats.ucla.edu/stat/stata/
>>
>> *
>> *   For searches and help try:
>> *   http://www.stata.com/help.cgi?search
>> *   http://www.stata.com/support/faqs/resources/statalist-faq/
>> *   http://www.ats.ucla.edu/stat/stata/
>>
> *
> *   For searches and help try:
> *   http://www.stata.com/help.cgi?search
> *   http://www.stata.com/support/faqs/resources/statalist-faq/
> *   http://www.ats.ucla.edu/stat/stata/
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


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