Bookmark and Share

Notice: On March 31, it was announced that Statalist is moving from an email list to a forum. The old list will shut down at the end of May, and its replacement, statalist.org is already up and running.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: dyadic dataset w string id


From   Sorin Krammer <skrammer@mit.edu>
To   <statalist@hsphsun2.harvard.edu>
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: skrammer@mit.edu

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


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