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: drop duplicates within variable with -by- option


From   TA Stat <tastat@gmail.com>
To   statalist@hsphsun2.harvard.edu
Subject   Re: st: drop duplicates within variable with -by- option
Date   Tue, 17 May 2011 20:54:18 +0700

"by" command is not allowed to use with "duplicates" but use both "ID"
and "another variable" (or other variables) to look for duplicates.
That means you are looking for any duplicates of X1 (e.g. height)
within X2 (e.g. class).  It is like a conditional criteria by
searching ID first, then another variable.

Peter

On Mon, May 16, 2011 at 9:36 PM, David Torres <torresd@umich.edu> wrote:
> 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.
>
> Thanks,
> Diego
> *
> *   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