nwcorrelate
Correlate networks and variables
Syntax
1) Correlate nodes of a network
nwcorrelate
netname
[,
context(context)
name(newnetname)]
2) Correlate two networks with each other
nwcorrelate
netname1
netname2
[,
permutations(int)
save(filename)
kdensity_options]
3) Correlate one network and one variable
nwcorrelate
netname
,
attribute(varname)
[mode(expand_mode)
name(newnetname)
keepexpand
permutations(int)
save(filename)
kdensity_options]
context(context) |
Determines whether incoming or outgoing ties should be considered when correlating two nodes; default = both |
name(newnetname) |
Name of new network with node correlations; default = _corr |
mode(expand_mode) |
How to expand the attribute variable |
keepexpand |
Keep the network generated by nwexpand |
permutations(integer) |
Number of QAP permuations |
save(filename) |
Save QAP permuation results in file |
Description
This command is the network version of correlate. It can be used in three different ways:
1) Correlate nodes of a network
2) Correlate two networks with each other
3) Correlate one network and one variable
The option permutation() creates QAP permutations of the first network and generates a distribution of correlation coefficients under the null-hypothesis that there is no correlation. In practice, rows and columns of netname are reshuffled and the correlation coefficient is calculated again and again. Based on this distribution a p-value and a confidence interval is calculated. A plot is displayed and additional information is returned in the return vector.
Supported network types
Binary: yes. Directed: yes, via context(incoming|outgoing|both) for the node-correlation mode. Weighted: yes, natively - uses raw tie values throughout, no dichotomize option. Signed: not checked. Two-mode: not checked.
Stored results
Node correlations
- Scalars:
-
r(avg_corr) average correlation coefficient between nodes
- Macros:
- r(name) name of network
- r(corrname) name of new network with coefficients
Two networks or one network and one attribute
- Scalars:
- r(corr) correlation coefficient
- r(pvalue) p-value of correlation coefficient
- r(ub) upper bound, 95% confidence interval
-
r(lb) lower bound, 95% confidence interval
- Macros:
- r(name_1) name of netname1
- r(name_2) name of netname2 or the expanded network
References
Granovetter, M. (1973). The strength of weak ties. American Journal of Sociology 78(6), 1360-1380.
Zachary, W. (1977). An information flow model for conflict and fission in small groups. Journal of Anthropological Research 33, 452-473.
See also
-
last certified : 24 Aug 2026