*! version 1.0.0 22avr2016

Title

nwreciprocity -- Calculates reciprocity metrics for (weighted) directed networks

Syntax

Syntax 1

nwreciprocity
[,
net(netname)
loop(iter)
kdensity
]

Syntax 2

nwreciprocity
[,
nodes()
density()
loop(iter)
kdensity
]

net(netname) Network name

loop(iter) Number of iterations for null model estimation, but default set to 1000

kdensity Displays the kernel density of estimated null models reciprocity.

nodes(#) Set the number of nodes of the null model to estimate

density(#) Set the density [0;1] of the null model to estimate

show Displays the iteration number

Description

Syntax 1 (when net() is specified), nwreciprocity() returns the reciprocity coefficient of a given network,
comparing the share of reciprocated ties of the empirical network to the average of random with same dimensions
(number of nodes, density, total weigth).

The reciprocity coefficient corresponds to a comparison of the weighted reciprocity
(the share of reciprocated weights over total edge's weight) with the average reciprocity of null models
with same dimensions (number of nodes, density, total weigth).

Following Squartini, T., Picciolo, F., Ruzzenenti, F., and Garlaschelli, D.
Reciprocity of weighted networks.
Scientific reports, 3, 2013;
the reciprocity coefficient could be written as rho = (r - r_null / (1-r_null)
Where r is the real weighted reciprocity, and r_null the average weighted reciprocity of null models.

The reciprocity coefficient rho could be interpreted compared to zero :
rho>0: over-reciprocity of empirical network
rho>0: no reciprocity tendency.
rho<0: sub-reciprocity of empirical network

The number of iteration for the average of null models is set by loop

Syntax 2 (when net() is not specified), returns only the average reciprocated weights of null models with dimensions set in nodes(), density() and weight().

Saved results

nwreciprocity saves the following scalars in r():

For syntax 1 and 2:

r(mean_null) mean share of reciprocated ties from the random networks (weighted reciprocity)

r(density) network density (weighted reciprocity)

r(nodes) number of nodes in the networks

r(loop) number of iterations for null model (weighted reciprocity)

For syntax 1 only:

r(mean_real) share of reciprocated ties from the empirical network (weighted reciprocity)

r(r_coeff) reciprocity coefficient of the empirical network, compared to null models.

Examples

reciprocity of a given network and comparison to a null model :

. webnwuse klas12b, nwclear
. nwkeep klas12b_wave2
. nwreciprocity, net(klas12b_wave2) loop(50) kdensity

average reciprocity of a null model :

. nwreciprocity, nodes(10) density(0.5) loop(50) show

Author

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

See also

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