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: merge not in (exclude)


From   Nicholas Winter <[email protected]>
To   [email protected]
Subject   Re: st: merge not in (exclude)
Date   Tue, 15 Mar 2011 18:59:04 -0400

If I understand what you want to do, something like this:

use A
desc using B, varlist
foreach v in `r(varlist)' {
   capture drop `v'
   if !_rc local dropped `dropped' `v'
}
di "Dropped: `dropped'


- Nick Winter
On 3/15/2011 3:08 PM, Argyn Kuketayev wrote:
Hello

i have two data sets A and B. I want to remove all observations from
A, which name variable values are present in B.

it's like "A.name not in (select name from B)" clause in SQL.

any ideas?

cheers

--
--------------------------------------------------------------
Nicholas Winter                                 434.924.6994 t
Assistant Professor                             434.924.3359 f
Department of Politics                  [email protected] e
University of Virginia          faculty.virginia.edu/nwinter w
S385 Gibson Hall, South Lawn
*
*   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