NETWORK Procedure
Example 2.4 Betweenness and Closeness Centrality for Project Groups in a Research Department
This example uses the same data as in Influence Centrality for Project Groups in a Research Department, which illustrates influence centrality by considering the link weights that represent some measure of reporting magnitude. In Example 2.2, links between managers (or leads) and direct reports have higher link weights than links between nonmanagers. This interpretation makes sense in the context of influence centrality because weight and the metric are directly related. However, for closeness and betweenness centrality, weight and the metric are inversely related.
This example considers the speed of the flow of information between people. In this sense, connections between managers and direct reports have smaller values, which cost less in the shortest path calculations. As described in the section Closeness Centrality, by default, PROC NETWORK uses the reciprocal of the link weight to find the shortest paths of the closeness and betweenness centrality metrics.
The following statements calculate weighted (and unweighted) closeness and betweenness centrality.
proc network
logLevel = moderate
links = mylib.LinkSetInDept
outLinks = mylib.LinkSetOut
outNodes = mylib.NodeSetOut;
centrality
close = both
between = both;
run;
%put &_NETWORK_;
The progress of the procedure is shown in Output 2.4.1.
Output 2.4.1: PROC NETWORK Log: Closeness and Node Betweenness Centrality for Project Groups in a Research Department
| NOTE: ------------------------------------------------------------------------------------------ |
| NOTE: ------------------------------------------------------------------------------------------ |
| NOTE: Running NETWORK. |
| NOTE: ------------------------------------------------------------------------------------------ |
| NOTE: ------------------------------------------------------------------------------------------ |
| NOTE: Reading the links data. |
| NOTE: Data input used 0.00 (cpu: 0.00) seconds. |
| NOTE: Building the input graph storage used 0.00 (cpu: 0.00) seconds. |
| NOTE: The number of nodes in the input graph is 18. |
| NOTE: The number of links in the input graph is 35. |
| NOTE: Link weight values for betweenness and closeness centrality are automatically inverted. |
| You can use the AUXWEIGHT= option in the LINKSVAR statement to specify the link weight |
| values used by betweenness and closeness centrality. |
| NOTE: Processing centrality metrics. |
| NOTE: Processing between/close centrality metrics using 256 threads across 16 machines. |
| Real |
| Algorithm Nodes Complete Time |
| centrality 18 100% 0.11 |
| NOTE: Processing between/close centrality metrics used 0.11 seconds. |
| NOTE: Processing centrality metrics used 0.10 (cpu: 0.02) seconds. |
| NOTE: The Cloud Analytic Services server processed the request in 0.45251 seconds. |
| NOTE: The data set MYLIB.LINKSETOUT has 35 observations and 5 variables. |
| NOTE: The data set MYLIB.NODESETOUT has 18 observations and 5 variables. |
| STATUS=OK PROBLEM_TYPE=CENTRALITY SOLUTION_STATUS=OK CPU_TIME=1.65 REAL_TIME=0.45 |
The nodes data table mylib.NodeSetOut shows the weighted and unweighted closeness and node betweenness centrality, as shown in Output 2.4.2.
Output 2.4.2: Closeness and Betweenness Centrality for Project Groups in a Research Department
| node | centr_close_wt | centr_close_unwt | centr_between_wt | centr_between_unwt |
|---|---|---|---|---|
| Angel | 0.44156 | 0.29310 | 0.00000 | 0.00000 |
| Chang | 0.44156 | 0.29310 | 0.00000 | 0.00000 |
| Chapman | 0.88696 | 0.50000 | 0.44118 | 0.23235 |
| Christoph | 0.68456 | 0.48571 | 0.05882 | 0.11275 |
| Gotti | 0.81600 | 0.51515 | 0.20956 | 0.28444 |
| Graffe | 0.67105 | 0.43590 | 0.08088 | 0.06642 |
| Gukrishnan | 0.46575 | 0.32692 | 0.00000 | 0.00000 |
| Hund | 0.45133 | 0.36957 | 0.00000 | 0.00000 |
| Kabutz | 0.50746 | 0.38636 | 0.00000 | 0.03885 |
| Leon | 0.50746 | 0.38636 | 0.00000 | 0.03885 |
| Nardo | 0.51777 | 0.42500 | 0.00000 | 0.00000 |
| Oliver | 0.73913 | 0.44737 | 0.04044 | 0.02230 |
| Patrick | 0.50000 | 0.37778 | 0.00000 | 0.00000 |
| Polark | 0.69388 | 0.38636 | 0.30882 | 0.30882 |
| Snopp | 0.75556 | 0.38636 | 0.16176 | 0.08088 |
| Weng | 0.44156 | 0.29310 | 0.00000 | 0.00000 |
| Yu | 0.87179 | 0.50000 | 0.50000 | 0.41262 |
| Zhuo | 0.58286 | 0.47222 | 0.06618 | 0.15172 |
The links data table mylib.LinkSetOut shows the weighted and unweighted link betweenness centrality, as shown in Output 2.4.3.
Output 2.4.3: Link Betweenness Centrality for Project Groups in a Research Department
| from | to | weight | centr_between_wt | centr_between_unwt |
|---|---|---|---|---|
| Chang | Angel | 1 | 0.00654 | 0.00654 |
| Christoph | Gotti | 1 | 0.02288 | 0.08551 |
| Christoph | Nardo | 1 | 0.04248 | 0.03922 |
| Christoph | Yu | 2 | 0.12092 | 0.14107 |
| Christoph | Zhuo | 1 | 0.02941 | 0.04575 |
| Gotti | Chapman | 3 | 0.17974 | 0.08682 |
| Gotti | Oliver | 1 | 0.00000 | 0.03050 |
| Gotti | Patrick | 1 | 0.05229 | 0.05392 |
| Graffe | Hund | 1 | 0.06209 | 0.04270 |
| Graffe | Yu | 2 | 0.16013 | 0.11024 |
| Graffe | Zhuo | 1 | 0.03268 | 0.07625 |
| Gukrishnan | Leon | 1 | 0.00654 | 0.03050 |
| Kabutz | Gotti | 1 | 0.06536 | 0.11187 |
| Kabutz | Gukrishnan | 1 | 0.00654 | 0.03050 |
| Kabutz | Leon | 1 | 0.00654 | 0.00654 |
| Kabutz | Snopp | 1 | 0.03268 | 0.03126 |
| Leon | Gotti | 1 | 0.06536 | 0.11187 |
| Nardo | Gotti | 1 | 0.04902 | 0.04575 |
| Nardo | Zhuo | 1 | 0.01961 | 0.02614 |
| Oliver | Chapman | 3 | 0.12745 | 0.06776 |
| Oliver | Patrick | 1 | 0.03268 | 0.01797 |
| Polark | Angel | 1 | 0.09804 | 0.09804 |
| Polark | Chang | 1 | 0.09804 | 0.09804 |
| Polark | Yu | 2 | 0.36601 | 0.36601 |
| Snopp | Chapman | 3 | 0.23529 | 0.14227 |
| Snopp | Gukrishnan | 1 | 0.09804 | 0.05011 |
| Snopp | Leon | 1 | 0.03268 | 0.03126 |
| Weng | Angel | 1 | 0.00654 | 0.00654 |
| Weng | Chang | 1 | 0.00654 | 0.00654 |
| Weng | Polark | 1 | 0.09804 | 0.09804 |
| Yu | Chapman | 3 | 0.35294 | 0.22734 |
| Zhuo | Gotti | 1 | 0.04902 | 0.09052 |
| Zhuo | Hund | 1 | 0.04902 | 0.06841 |
| Zhuo | Oliver | 1 | 0.02288 | 0.03453 |
| Zhuo | Patrick | 1 | 0.02614 | 0.03922 |
Note that Chapman (the director) and Yu (a manager who reports to Chapman) both have the highest weighted closeness centrality. However, Yu’s weighted betweenness centrality is highest because he serves as a gatekeeper between his three groups (D4a, D4b, and D4c) and the rest of the department.