Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
From | Rongrong Zhang <r05zhang@gmail.com> |
To | statalist@hsphsun2.harvard.edu |
Subject | st: eliminate duplicate |
Date | Sat, 28 Dec 2013 14:52:10 -0500 |
Hello, this is a very rudimentary quesiton: I want to keep the unique combination of the following two variables (string type) naics io_nr . 5417 . 5417 5417 5417 5417 5417 . 1110 . 1110 111 1110 sort io_nr naics duplicates tag io_nr naics, gen(dup) I do not think I should do : drop if dup>0, because that will drop both rows of 5417. would it be better to do : bysort naics: gen x=_n; drop if x>1 thanks! Rochellle my data set * * 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/