*! version 1.0.0 22avr2016

Title

nwcluster -- Calculates the clustering coefficient of a network's vertices following Onnela et al(2005, Phys. Rev. E) index for weigthed networks.

Syntax

nwcluster
[netname]
[,
valued
direction()
]

valued Weighted clustering coefficient is calculated in addition to binary clustering coefficient

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

Description

Calculates the clustering coefficient of each nodes i in a network and
saves the result as a Stata variable _clustering.

For weighted networks, if valued option is specified, the weighted clustering coefficient _wclustering is calculated in addition.

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.

The local clustering coefficient of a node i is defined as the share of network neighbors N_i(g) of i who are directly connected among themselves.
The weighted generalization corresponds to the one proposed by Onnela et al(2005, Phys. Rev. E).

nwcluster also returns the average clustering coefficient

Examples

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

. webnwuse gang, nwclear
. nwcluster gang_valued , valued

Saved results

nwcluster saves the following in r():

Scalars

r(overall_cc) overall clustering coefficient

r(avg_cc) average clustering coefficient

nwcluster, valued saves the following in r():

Scalars

r(overall_cc) overall clustering coefficient

r(avg_cc) average clustering coefficient

r(overall_wcc) weighted overall clustering coefficient

r(avg_wcc) average overall clustering coefficient

See also

nw_wcc (SSC) computes another clustering coefficient for weighted networks, following Fagiolo (2007, Phys. Rev. E). The main differences is that for directed networks, nwcluster (Onnela's index) either only focus on inward or outward edges; while nw_wcc (Fagiolo's index) identify different clustering patterns based on both inward and outward edges.

nwcluster 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)

Author

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

references

Onnela, J. P., Saramäki, J., Kertész, J., & Kaski, K. (2005). Intensity and coherence of motifs in weighted complex networks. Physical Review E, 71(6), 065103.

Fagiolo, G. (2007). Clustering in complex directed networks. Physical Review E, 76(2), 026107