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

Re: st: RE: converting data to adjacency matrix


From   Alan Neustadtl <[email protected]>
To   [email protected]
Subject   Re: st: RE: converting data to adjacency matrix
Date   Mon, 31 Jan 2005 08:17:19 -0500

This looks like a social network problem.  How about using Ucinet or
Pajek?  Both are designed for problems like this and then can be used
for an appropriate graph-type analysis.  Ucinet can be used for a
limited time for free, Pajek is free.

Best,
Alan

On Mon, 31 Jan 2005 10:25:40 -0000, Nick Cox <[email protected]> wrote:
> -contract-, -reshape-.
> 
> contract ID*
> 
> reshape wide _freq , i(ID_Ent~1) j(ID_Ent~2)
> 
> qui foreach v of var _freq* {
>        replace `v' = 0 if mi(`v')
> }
> 
> Having said that, this structure makes
> many manipulations more difficult in
> Stata, despite possibly seeming more
> natural for your problem.
> 
> Nick
> [email protected]
> 
> Sascha Robert
> 
> > 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
> >
> 
> *
> *   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/
>
*
*   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