Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: reshape and duplicates


From   "Victor, Jennifer Nicoll" <jnvictor@pitt.edu>
To   "'statalist@hsphsun2.harvard.edu'" <statalist@hsphsun2.harvard.edu>
Subject   st: reshape and duplicates
Date   Sun, 30 Mar 2008 11:42:50 -0400

Thank you Nick, for recommending the reshape command to me last week.  I now have converted my UCINET relational dataset into dyads in Stata.  However, I now have the problem of duplicate observations.  My data are non-directional so the pair A-B is the same as the pair B-A.  I need to efficiently delete the duplicates.  I need only the unique observations, where the unit of analysis is a pair.  Can someone help?

Essentially, I have...
ID1  ID2        name1   name2 ...
1       2       Smith, John     Jones, Abby
1       3       Smith, John     White, Rich
1       4       Smith, John     Black, Kelly
2       1       Jones, Abby     Smith, John
2       3       Jones, Abby     White, Rich
2       4       Jones, Abby     Black, Kelly
3       1       White, Rich     Smith, John
3       2       White, Rich     Jones, Abby
3       4       White, Rich     Black, Kelly
4       1       Black, Kelly    Smith, John
4       2       Black, Kelly    Jones, Abby
4       3       Black, Kelly    White, Rich

And I need to have....
ID1  ID2        name1   name2 ...
1       2       Smith, John     Jones, Abby
1       3       Smith, John     White, Rich
1       4       Smith, John     Black, Kelly
2       3       Jones, Abby     White, Rich
2       4       Jones, Abby     Black, Kelly
3       4       White, Rich     Black, Kelly

But I have 191,406 pairs.

Thanks for your help.
-Jennifer
___________________________________________
Jennifer Nicoll Victor
Assistant Professor
Department of Political Science
University of Pittsburgh
4600 Wesley W. Posvar Hall
(412) 624-7204
E-mail:  jnvictor@pitt.edu
Homepage:  http://www.pitt.edu/~jnvictor



*
*   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/



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