I am using the brokerage (g, attribute) function from sna for R to find the Gould Fernandez brokerage roles of my network. I would like then to find the specific triads of this brokerage roles to analyse the alter-ego-alter relationships even further.
Does anyone have an idea which formula I can use to identify this specific triads?
Replicable Sample
g2 <- make_graph(~ A --+ B:D, B --+ D:F, C--+B , D--+A:B:F:E, E--+ D, F--+ A:E:G, G--+ F)
type<-c("one","two","three","one","two","three","one")
vertex_attr(g2,"type")<-type
g2_N<-intergraph::asNetwork(g2)
brokerage_roles<-brokerage(g2_N,type)
brokerage_roles$raw.nli
I receive the following brokerage role output
w_I w_O b_IO b_OI b_O t
A 0 0 2 0 0 2
B 0 1 2 0 0 3
D 0 1 3 2 1 7
F 1 0 1 3 1 6
C 0 0 0 0 0 0
E 0 0 0 1 0 1
G 0 0 0 0 0 0
I would like to identify an approach to find out for example between which specific alters node A is brokering in the 2 b_01 triads found in the brokerage role node census and what type (node attribute) they have.
Within the sample network is easy to identify, but my actual data sets contains 125 nodes.
Thank you in advance for your help!
Potential Approach
I tried the potential approach described here to find all possible triads, classify them based on triad census terminology and then filter for the open triads to start to identify brokerage opportunties.
However the results seem not to be aligned with the brokerage role analysis and therefore the approach is erroneous.
node_triad_census(g2_N)
triads <- combn(1:network.size(g2_N),3, simplify = F) # all potential triad combinations
triad_census_test <- lapply(1:length(triads),
function(x) triad.classify(g,tri=triads[[x]])) #create data frame with all possible triads
triads <- data.frame(matrix(unlist(triads), nrow=length(triads), byrow=T),
triad = unlist(triad_census_test)) #give classification to each triad
open_triads <- triads[which(triads$triad == "021D" | # subset of triads
triads$triad == "021U" |
triads$triad == "021C" |
triads$triad == "111D" |
triads$triad == "111U" |
triads$triad == "201"),]
I don't know the answer but note that the brokerage function calls a C function called brokerage_R (see source code here). You might make some headway by inspecting this function to see what is happening under the hood. I inspected the output of this function by modifying the brokerage function to just output the raw result of the C code:
However I didn't find this very enlightening, which is why inspecting the C code could be helpful. I couldn't find the C code in the SNA source but it must be in there somewhere. The method is based on shortest paths, rather than a triad census, so even though it is limited to paths of length 2 I'm not sure that you could reproduce the result from a triad census.