Statalist The Stata Listserver


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: duplicates tagged, but list is not limited to unique values


From   Michael McCulloch <mm@pinest.org>
To   statalist@hsphsun2.harvard.edu
Subject   st: duplicates tagged, but list is not limited to unique values
Date   Sat, 15 Apr 2006 10:46:44 -0700

I would like to tag and display duplicate values of 4 variables. This works if I DROP duplicates, but not if I TAG them. I'd like to be able to keep my data! Am I doing the DUPLICATES incorrectly, or the LIST?

***TAG METHOD
.sort var1 var2 var3 var4
.duplicates tag var1 var2 var3 var4, generate(tag)
.list var1 var2 var3 var4 tag if tag, noobs

var1 var2 var3 var4 tag
3 no yes .8571423 52
3 no yes .8571423 52
3 no yes .8571423 52
3 no yes .8571423 52
3 no yes .8571423 52

***DROP METHOD
.duplicates drop var1 var2 var3 var4, force
.list var1 var2 var3 var4 tag if &tag, clean noobs

var1 var2 var3 var4 tag
3 no yes .8571423 52
3 yes yes .5784351 12
4 no yes .7797139 70
5 no yes .6761742 21





Best wishes,
Michael


____________________________________

Michael McCulloch
Pine Street Clinic
124 Pine Street, San Anselmo, CA 94960-2674
tel 415.407.1357
fax 415.485.1065
email: mm@pinest.org
web: www.pinest.org
www.pinestreetfoundation.org





*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/




© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index