Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: many-to-many merge

From   Luhang Wang <>
Subject   st: many-to-many merge
Date   Fri, 19 Aug 2005 10:49:28 -0400

Dear all,

I'm wondering whether there is some way to do a many-to-many merge in
the following sense:

eg. for some id, I have 2 observations in data set a, and 3
observations in data set b; how can I merge a and b to get a new data
set with 6 observations for this id(all the possible combinations of
the observations from a and b)?

What comes to my mind is to reshape one data set to a wide one to make
the id a unique identifier for merge, and then reshape the  resulting
data set back to a long one.

I'm curious about easier ways to do this. Thanks in advance for any suggestion.


*   For searches and help try:

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