*! version 1.1 Agust2022

Title

nwassortativity -- Computes assortativity coefficients.

Syntax

nwassortativity
[,
NETwork()
Attribute()
Discrete
Continuous
]

network(netname) Indicate the network name. Can be a network, a mata matrix or a prefix designing Stata variables adjacency matrix. Required.

attribute(varname) Indicate the node's attribute on which to compute the assortativity. Required .

discrete Indicates that attribute(varname) is discrete.

continuous Indicates that attribute(varname) continuous.

Either discrete or continuous should be indicated.

Description

The assortativity coefficient corresponds to the preference for a network's nodes to attach to others that are similar in some way.

nwassortativity returns the assortativity coefficient of nodes based on the attribute defined in option attribute(varname)

For continuous attributes, the assortativity coefficient is computed as the Pearson correlation coefficient of attributes between neighbors nodes.

For discrete attributes, the assortativity coefficient is computed follwing Newman (2003) method.

Examples

clear
webnwuse gang

nwassortativity, net(gang) at(Age) continuous
nwassortativity, net(gang) at(Birthplace) discrete

Author

Charlie Joyez, Université Côte d'Azur
charlie.joyez@univ-cotedazur.fr

references

Newman, M. E. (2003). Mixing patterns in networks. Physical review E, 67(2), 026126.