Bookmark and Share

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: AW: dyadic dataset w string id


From   "Martin Weiss" <[email protected]>
To   <[email protected]>
Subject   st: AW: dyadic dataset w string id
Date   Thu, 25 Feb 2010 17:58:51 +0100

<> 

" I have a variable id1 that is a 4-character string specific to each
country;"



Your life may be unneccessarily harsh if you stick to string as the type for
"id1". If you

*************
destring, replace
*************

Stata checks whether any vars in your dataset can be safely turned into
numeric ones.


HTH
Martin


-----Ursprüngliche Nachricht-----
Von: [email protected]
[mailto:[email protected]] Im Auftrag von Sorin Krammer
Gesendet: Donnerstag, 25. Februar 2010 17:37
An: [email protected]
Betreff: st: dyadic dataset w string id

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/


*
*   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–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index