Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: st: duplicates for one variable
From
Nick Cox <[email protected]>
To
"'[email protected]'" <[email protected]>
Subject
RE: st: duplicates for one variable
Date
Wed, 24 Nov 2010 15:17:30 +0000
-search duplicates- would have got you there in one.
Nick
[email protected]
Shehzad Ali
Thanks, Dimitriy. That was spot on!
Also, thanks for Cinzia.
Dimitriy V. Masterov <[email protected]>
> Try -duplicates tag id time, gen(dups)-
>
> This will create variable named dups that will tell you which one:
>
> id time var3 dups
> 1 10 2.5 0
> 1 20 3.0 0
> 1 30 3.5 0
> 2 10 2.5 1
> 2 10 4.0 1
> On Wed, Nov 24, 2010 at 9:35 AM, Shehzad Ali <[email protected]>
> > I am looking to find duplicate observations on a certain variable 'time'.
>Here
> > is what the data looks like:
> >
> > id time var3
> > 1 10 2.5
> > 1 20 3.0
> > 1 30 3.5
> > 2 10 2.5
> > 2 10 4.0
> >
> > I want to identify the observations that are duplicate on the time variable
> > only, i.e. the last observation in the dataset above.
*
* 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/