nwreach

Reachability network

Syntax

nwreach 
[netname]
[,
sym
name(string)
xvars
nwreplace
force]
   
sym Symmetrize network before calculation of reachability
name(newnetname) Name of the new network; default = reach
xvars Generate Stata variables for the network
nwreplace if a network named newnetname already exists, drop it and use this name anyway - required, not silent (see nwgeodesic for the same convention)
force Run the command although its matrices would not fit in memory (it stops with r(484) above 12 GB otherwise)

Description

nwreach calculates the reachability network. The dyads x_ij in the reachibility network take value 1 when there is at least one path between nodes i and j in the original network netname, and 0 if there is no such path.

Examples

. nwclear
. nwrandom 10, prob(.1)
. nwreach random, sym
. nwsummarize _reach, matonly

      1    2    3    4    5    6    7    8    9   10
   +---------------------------------------------------+
 1 |   0                                               |
 2 |   1    0                                          |
 3 |   1    1    0                                     |
 4 |   1    1    1    0                                |
 5 |   1    1    1    1    0                           |
 6 |   1    1    1    1    1    0                      |
 7 |   1    1    1    1    1    1    0                 |
 8 |   0    0    0    0    0    0    0    0            |
 9 |   1    1    1    1    1    1    1    0    0       |
10 |   1    1    1    1    1    1    1    0    1    0  |
   +---------------------------------------------------+

In this example, there is basically one isolate node (node 8) who is unconnected from everybody else.

Supported network types

Binary: yes (only) - reachability is a structural yes/no property; nwgeodesic’s own weighted distance semantics do not carry through here. Directed: yes - reachability follows the direction of the ties and the network is not symmetrized unless sym is given (same convention as nwgeodesic). Weighted: not applicable. Signed: not applicable. same as for the bipartite graph read as a one-mode network (valid; no mode-specific normalisation).

See also


nwcommands version 3.17.6, 9 November 2026 (check your installed version)


Back to top

nwcommands is free software under the GNU General Public License, version 3, as are the model packages nwsaom, nwergm, nwdynam and nwrem. Citing and licenses · Get help · GitHub. Issues with the core go to the nwcommands repository; issues with a model package go to that package's own repository.

This site uses Just the Docs, a documentation theme for Jekyll.