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

Re: st: converting data to adjacency matrix


From   "Hans J. Baumgartner" <[email protected]>
To   [email protected]
Subject   Re: st: converting data to adjacency matrix
Date   Mon, 31 Jan 2005 13:35:15 +0100

Hi,

I am not quite shure how your id-columns and id-rows correspond to each other but the command _reshape_ should be what you are looking for.

Hans


Sascha Robert schrieb:


Hi

I am quite new STATA, no wonder I can't solve the following problem:

I got data that represents relationships between entities:

"ID_Entity_1"        "ID_Entity_2"
1                    2
1                    2
2                    3
3                    1

I want to convert this data into a adjacency matrix looking like this:

                "ID_1"     "ID_2"     "ID_3"
"ID_1"             0          2          0
"ID_2"             0          0          1
"ID_3"             1          0          0

How can I do it?

Best regards,
Sascha

--
Hans J. Baumgartner DIW Berlin
German Institute for Economic Research
Dept. Public Economics
K´┐Żnigin-Luise-Str. 5; 14195 Berlin; Germany
Tel.: +49/30/89789-307
Fax.: +49/30/89789-114
http://www.diw.de
http://www.hansbaumgartner.de

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