nwdyads

Dyad census

Syntax

nwdyads 
[netname]
netname may be a list of networks or a wildcard such as lazega_*, as in nwsummarize; the census is shown for each network and the r() results are those of the last one.

Description

Returns the dyad census of a network (or a list of networks). This is a way to characterize a network based on its dyads.

In directed networks, each dyad (pair of nodes i and j) can be one of the following:

1) M: mutually connected: M_ij = M_ji = 1

2) A: asymmetrically connected: M_ij = 1, but M_ji = 0

3) N: not connected at all: M_ij = M_ji = 1

In undirected network, each dyad (pair of nodes i and j) can be one of the following:

1) M: connected: M_ij = M_ji = 1

2) N: unconnected: M_ij = M_ji = 0

The command also returns the reciprocity of the network.

reciprocity = M / (M + A)

Examples

. nwwebuse florentine
. nwdyads flomarriage

    Dyad census:  flomarriage

    Mutual |      Null
-----------+-----------
        20 |       100

. nwwebuse glasgow
. nwdyads glasgow3

    Dyad census:  glasgow3

    Mutual |      Asym |      Null
-----------+-----------+-----------
        45 |        32 |      1148

Supported network types

Binary: yes (only) - the dyad census (mutual/asymmetric/null) is inherently a presence/absence classification. Directed: yes - a directed network gets the full M/A/N census; an undirected network collapses to M/N only (every tie is definitionally mutual). Weighted: not applicable. Signed: not applicable. Two-mode: yes - the null dyads are counted over the pairs of nodes from different modes; reciprocity of an undirected two-mode network has no meaning and is shown as n/a.

Stored results

  • Scalars:
  • r(_100) mutual dyads
  • r(_010) asymmetric dyads
  • r(_001) null dyads
  • r(reciprocity) M / (M + A)

  • Macros:
  • r(name) name of network

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.