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: Efficient way to create adjacency matrix in Mata


From   Benjamin Allaire <[email protected]>
To   <[email protected]>
Subject   st: Efficient way to create adjacency matrix in Mata
Date   Wed, 29 Jun 2011 16:01:41 -0400

Listers -

Question: what is the most efficient way to create an adjacency matrix in mata, 
given a unique identifier ("id") and a club id ("club_id") for folks in the same club.

So the data looks like this:

id    club_id
1       1
2       1
3       2
4       2
5       2

Is there a clever way to do it without looping over the people? 

Any help would be most appreciated,

Thanks,
Ben

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