*! version 1.2.0 22apr206

Title

nwANND -- Calculates Average Nearest Neighbor Degree (ANND) of a network's nodes and derivated indexes for weighted networks.

Syntax

nwANND
[netname]
[,
valued
direction()
]

valued Consider edges values; calculate strength instead of degree

direction() Indicate inward or outward (default) degree direction for directed networks.

standardize Scales the output in the range [0,1].

Description

Calculates the average nearest neighbor degree i in a network and
saves the result as a Stata variable _ANND.

The average nearest neighbor degree for node i is equal to average degree of neighbouring vertices.

For weighted networks, if valued option is specified, the average nearest neighbor strength is calculated. Two indicators are thus computed. The Weighted Average Nearest Neigbhour Degree
(_WANND), And the Average Nearest Neighbour Strength ( _ANNS = ).
For details see : Fagiolo G, Reyes J, Schiavo S (2010) The evolution of the world trade web: a weighted-network analysis. Journal of Evolutionary Economics 20: 479–514.

For directed networks, the inward or outward direction should be specified in option direction(). If neither of them is specified, the outward direction is assumed by default.

standardize Option divides _degree by (N-1) with N the number of nodes. As a consequence _ANND ranges from 0 to 1.
Useful to compare centrality scores across networks of different size.
_strength is divided by (N-1) and by max_strength, not to outpace unity.

nwANND also returns the assortativity coefficient (also known as degree-degree correlation or dependency), defined as the Pearson correlation coefficient between _degree and _ANND.
If positive (negative), the network is said to be assortative (disassortative) : nodes tend to be connected with other nodes with similar (different) degree values.
The assortative coefficient is not impacted by the option standardize.

Saved results

nwANND saves the following in r():

Scalars

r(D_assort) Degree assortativity coefficient

nwANND, valued saves the following in r():

Scalars

r(S_assort) Strength assortativity coefficient (_Strengh x _ANNS correlation)

r(W_assort) Weighted Degree assortativity coefficient (_Degree x _WANND correlation)

Examples

. webnwuse glasgow, nwclear
. nwANND glasgow3, direction(outward)

. webnwuse gang, nwclear
. nwANND gang_valued, valued
. nwANND gang_valued, valued standardize

Author

Charlie Joyez, Paris-Dauphine University
charlie.joyez@dauphine.fr

See also

nwANND requires the nwcommands package developed by Thomas Grund.

For do-files and ancillary files, see:

. net describe nwcommands-ado, from(http://www.nwcommands.org)

For help files, see :

. net describe nwcommands-hlp, from(http://www.nwcommands.org)