Statalist The Stata Listserver


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

st: Generating all possible combinations of pairs


From   "K Jensen" <[email protected]>
To   [email protected]
Subject   st: Generating all possible combinations of pairs
Date   Wed, 27 Sep 2006 10:51:19 +0100

Hi

I have some repeated paired observations and would like to generate
all possible combinations of pairs.

The data looks like this :-
Pair  Subject  Var
101        1  134
101        2  563
101        2  455
102        1  345
102        1  363
102        1  299
102        2  647
102        2  352

I wish to generate data that looks like this :-
Pair  Var1  Var2
101   134   563
101   134   455
102   345   647
102   345   352
102   363   647
102   363   352
102   299   647
102   299   352

How can I accomplish this in Stata?

Thankyou in advance!

Karin
*
*   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–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index