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: Adjacency matrix in Stata


From   jean-luc morin-chesnel <[email protected]>
To   [email protected]
Subject   st: Adjacency matrix in Stata
Date   Sun, 30 Mar 2014 18:55:31 +0200

Dear all,

I have a panel dataset at the individual - day - product level
(unbalanced) and I would like to obtain a adjacency matrix in Stata,
but I do not know how to proceed.

That is, I assume that 2 individuals are connected in the network if
they buy the same product the same day more than N times in my dataset
(lets say N=10).

So I would like to obtain a matrix of adjacency in Stata: a MxM matrix
(M in the number of investors) where the coefficient mij=1 iff
investor i and investor j are connected in the network.

I do not know how to proceed because I think that I should use loops,
but it seems to me that it is not very efficient to do so in Stata
(the dataset is large: 100k individuals). Any suggestion is very
welcomed.

Many thanks,
Regards,

JL
*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/faqs/resources/statalist-faq/
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index