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]
st: how drop a block of cases based other variable values
From
Daniel Marcelino <[email protected]>
To
[email protected]
Subject
st: how drop a block of cases based other variable values
Date
Fri, 9 Dec 2011 08:45:05 -0500
Dear all,
can anyone point me how can I drop all observations belonging to
"r" based on "winner" value? I meant, I don't wish to drop only
observations where winner values is 1, but
given I got a winner in "r==a" I want drop all observations of this group.
I tried with no success: bysort r: drop if winner==1
//replication
clear
input str2 r byte(w v1 v2 winner)
"a" .5 1 2 .
"a" .1 2 3 .
"a" .9 3 2 1
"a" .9 3 4 1
"a" .2 4 5 .
"a" .3 5 1 .
"b" .4 1 2 .
"b" .1 2 3 .
"b" .7 3 4 .
"b" .8 4 1 .
"b" .8 4 5 .
"b" .9 5 1 .
end
Thanks,
Daniel
*
* 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/