nwvalue

Return a tie value

Syntax

nwvalue 
[netname][,
ego(nodename)
alter(nodename)
egoid(integer)
alterid(integer)]
nwvalue
netname[egoid,alterid]

Description

The command returns the scalar r(value) with the value of the tie between the nodes ego and alter if those nodes exists. It also returns the names of those nodes when ids are used. Either the option pair ego(), alter() or egoid(), alterid() need to be specified.

Network types

Directed: the stored cell (row ego, column alter) is returned, never symmetrized. Valued: the stored value is returned. Two-mode: same as for the bipartite graph read as a one-mode network. Signed: a negative value is returned as stored. See nwnetworktypes.

Limits

The value of one cell of a network held as stored ties is read from the sparse index (no matrix).

Examples

. nwwebuse florentine
. nwvalue flobusiness, ego("medici") alter("pazzi")
. nwvalue flobusiness, egoid(2) alterid(9)
. nwvalue flobusiness[2,9]
. return list

Stored results

  • Scalars
  • r(value) — value of the tie from ego to alter
  • r(ego_id) — position of ego in the network
  • r(alter_id) — position of alter in the network
  • r(ego_valid) — 1 if ego exists (with ego() and alter())
  • r(alter_valid) — 1 if alter exists (with ego() and alter())

  • Macros
  • r(ego) — name of ego
  • r(alter) — name of alter

See also


nwcommands version 3.25.0, 14 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.