Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at

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

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

From   Nick Cox <>
To   "''" <>
Subject   st: RE: drop duplicates within variable with -by- option
Date   Mon, 16 May 2011 16:55:33 +0100

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 

[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:

© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index