Hi all, I am struggling with something similar to the original poster. I am using Stata 15 and have 432 observations. I have a column of unique actor ID's and columns of 300+ forums, 0 if actor did not attend the forum and a 1 if the actor attended a forum. Hence, this is wide data. What I need to do is create a weighted adjacency matrix, actor X actor with cells populated by the number of forums actors coparticipate in. If anyone could help, I would be much indebted. Here is a sample of my data.
Code:
* Example generated by -dataex-. To install: ssc install dataex
clear
input int Actorid byte(Forum2 Forum4 Forum6 Forum9 Forum17 Forum18 Forum19 Forum21)
1 0 0 0 0 0 0 0 0
3 0 0 0 0 0 0 0 0
8 0 0 0 0 0 0 0 0
18 0 0 0 0 0 0 0 0
23 0 1 0 0 0 0 0 0
26 0 0 0 0 0 0 0 0
29 0 0 0 0 0 0 0 0
36 0 0 0 0 0 0 0 0
38 0 0 0 0 0 0 0 0
42 0 0 0 0 0 0 0 0
46 0 0 0 0 0 0 0 0
60 0 0 0 1 0 0 0 0
65 0 0 0 0 0 0 0 0
71 0 1 0 0 0 0 0 0
79 0 0 0 0 0 0 0 0
end
------------------ copy up to and including the previous line ------------------
Listed 15 out of 442 observations
Thanks!
0 Response to Weighted adjacency matrix
Post a Comment