Somebody asked this a while ago, but
I'm too lazy to search the archives
to find the answer.
You can go
gen max = cond(var1 > var2, var1, var2)
gen min = cond(var1 < var2, var1, var2)
and then apply -duplicates- to
-max- and -min-.
The more general points here
are that ordering makes sense for
strings, so inequalities also
make sense, and that -cond()-
can produce a string result.
Nick
[email protected]
Anne-C�lia Disdier
> I`ve the following "dyadic" dataset (where var1 and var2 are
> string variables):
>
> var1 var2
> a b
> b a
> a c
> c a
> b c
> c b
>
> In my case, ab and ba, ac and ca, bc and cb are the same
> observations. I just
> want to keep one of the two observations (for example ab, bc,
> ac). How can ask
> Stata to delete the second observation (ba, cb, ca)
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/