Bookmark and Share

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   "Dimitriy V. Masterov" <[email protected]>
To   [email protected]
Subject   Re: st: duplicates for one variable
Date   Wed, 24 Nov 2010 09:51:28 -0500

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


DVM


On Wed, Nov 24, 2010 at 9:35 AM, Shehzad Ali <[email protected]> wrote:
> Hi listers,
>
> 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.
>
> I would appreciate your help.
> Many thanks,
> Shehzad
>
>
>
>
>
> *
> *   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index