Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
st: dyadic dataset w string id
From
Sorin Krammer <[email protected]>
To
<[email protected]>
Subject
st: dyadic dataset w string id
Date
Thu, 25 Feb 2010 11:36:32 -0500
Dear all,
I have a variable id1 that is a 4-character string specific to each country;
var1 is numeric and d1 is binary. I need to construct a dyadic dataset that
will include all dyadic combinations of this variable.
If the original dataset looks like this:
Year country id1
var1 d1
2008 Greece 0214
3000 1
2008 Greece 0543
6000 0
2008 Greece 1234
3000 1
?
What I am looking for would be:
Year country id1
id2 d1 d2
2008 Greece 0214
0543 1 0
2008 Greece 0543
1234 0 1
2008 Greece 1234
0214 1 1
Thank you kindly for your help.
Sorin
Sorin M.S. Krammer
Postdoctoral Fellow and Associate
MIT Sloan School of Management
50 Memorial Drive
Cambridge, Massachusetts 02142
United States
Email: [email protected]
*
* For searches and help try:
* http://www.stata.com/help.cgi?search
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/