NETWORK Procedure

Example 2.7 Recursive Community Detection on Zachary’s Karate Club Data

This example illustrates the use of the RECURSIVE option in PROC NETWORK for community detection on Zachary’s Karate Club data (Zachary 1977). The data table appears in Community Detection on Zachary’s Karate Club Data. The current example forces each community to contain no more than five nodes and limits the number of links between any pair of nodes within any community to be no greater than 2.

proc network
   links             = mylib.LinkSetIn
   outNodes          = mylib.NodeSetOut;
   community
      resolutionList = 1.0
      recursive (maxCommSize = 5 maxDiameter = 2 relation = AND)
      outCommunity   = mylib.CommOut;
run;

The output data table mylib.NodeSetOut contains the community identifier of each node, as shown in Output 2.7.1.

Output 2.7.1: Community Nodes Output

nodecommunity_1
04
17
28
36
45
51
61
71
86
93
106
111
127
135
145
152
162
171
188
192
208
214
227
232
249
259
269
274
289
2910
304
313
3210
332


The output data table mylib.CommOut contains the number of nodes in each community, as shown in Output 2.7.2.

Output 2.7.2: Community Number of Nodes Output

levelresolutioncommunitynodesintra_linksinter_linksdensitycut_ratioconductance
1115640.600000.027590.25000
11254120.400000.082760.60000
1132171.000000.109380.77778
11444170.666670.141670.68000
1153290.666670.096770.69231
11632120.666670.129030.75000
11732150.666670.161290.78947
11832100.666670.107530.71429
1194470.666670.058330.46667
11102171.000000.109380.77778


Last updated: August 07, 2026