Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down on April 23, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: st: RE: drop duplicates within variable with -by- option


From   David Torres <torresd@umich.edu>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: RE: drop duplicates within variable with -by- option
Date   Mon, 16 May 2011 12:05:57 -0400

As always, Nick, you help so much.  Couldn't be more clear.

D
--
David Diego Torres, MA(Sociology)
PhD Candidate in Sociology

2044 Population Studies Center
University of Michigan Institute for Social Research
Ann Arbor MI  48106-1248
Tel 734.763.4098
Fax 734.763.1428
torresd at umich dot edu


Quoting Nick Cox <n.j.cox@durham.ac.uk>:

The "by ID" element is not a problem, nor does it call for special action.

Suppose you are looking for duplicates on -x- and -y- and there is also the idea that you are checking for these within -ID-. The identifier variable does not have any special role here. You just want to look for -duplicates- on three variables, e.g.

. duplicates list ID x y

That is, -duplicates- is indifferent to the special meaning of any identifier variable.

If this does not make things clear, show us a specific example of what you want

Nick
n.j.cox@durham.ac.uk
[author of -duplicates-]

David Torres

I have data in long format and need to drop duplicate observations
within a variable by ID.  I've looked at the -duplicates- command and
it doesn't seem to help me get what I want.


*
*   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/





*
*   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–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index