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]

st: how do you drop repeated values in a variable to remain with only one?


From   Gwinyai Masukume <parturitions@gmail.com>
To   statalist <statalist@hsphsun2.harvard.edu>
Subject   st: how do you drop repeated values in a variable to remain with only one?
Date   Sun, 21 Apr 2013 08:51:41 +0200

Dear Stata list,

I have a dataset  with variable A, which has repeated  values:

A
1
2
2
2
3
3
4
5
5
6
6
6

Where the values are repeated e.g 2. I would like to drop the repeated
values and remain with only a single 2.
I have tried the duplicates drop command, but it does not work as the
repeated values are not duplicates, but say different hospital visits by
 the same individual.
I would still like to drop repeated values of the variable A. How can I
do this?

Thanks for your consideration.

Kind regards,
Gwinyai
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2014 StataCorp LP   |   Terms of use   |   Privacy   |   Contact us   |   Site index