These functions offer ways to measure the distribution or assortativity of ties in a network:
net_by_heterophily() measures how embedded nodes in the network
are within groups of nodes with the same attribute.
net_by_homophily() measures how embedded nodes in the network
are within groups of nodes with the same attribute, but with more options for method.
net_by_assortativity() measures the degree assortativity in a network.
net_by_spatial() measures the spatial association/autocorrelation
(global Moran's I) in a network.
Note that for two-mode networks, homophily is calculated on the mode with the attribute of interest, and the other mode is ignored. If the attribute is present on both modes, homophily is calculated on the first mode by default, but a message is given and the user can choose to calculate homophily on the other mode instead by subsetting the attribute vector and converting the network to a one-mode network.
net_by_heterophily(.data, attribute)
net_by_homophily(
.data,
attribute,
assortativity = c("ie", "ei", "yule", "geary")
)
net_by_assortativity(.data)
net_by_spatial(.data, attribute)A network object of class stocnet, igraph, tbl_graph, network, or similar.
Internally any of these will be coerced to an efficient implementation.
For more information on possible coercions, see e.g. manynet::as_stocnet().
Name of a nodal attribute, mark, measure, or membership vector.
Which method to use for *_homophily().
Either "ie" (negative E-I index), "ei" (E-I index),
"yule" (Yule's Q), or "geary" (Geary's C).
Default is "ie".
The E-I index is the number of ties between (or external) nodes
grouped in some mutually exclusive categories
minus the number of ties within (or internal) these groups
divided by the total number of ties.
This value can range from 1 to -1,
where 1 indicates ties only between categories/groups and -1 ties only within categories/groups.
Yule's Q is a measure of association for two binary variables, calculated as: $$Q = \frac{ad - bc}{ad + bc}$$ where \(a\) is the number of ties between nodes in the same category, \(b\) is the number of ties between nodes in different categories, \(c\) is the number of non-ties between nodes in the same category, and \(d\) is the number of non-ties between nodes in different categories. This value can range from -1 to 1, where 1 indicates perfect association (all ties are between nodes in the same category), -1 indicates perfect disassociation (all ties are between nodes in different categories), and 0 indicates no association.
Geary's C is a measure of spatial autocorrelation, calculated as: $$C = \frac{(n - 1) \sum \limits_{i=1}^n \sum\limits_{j=1}^n w_{ij} (x_i - x_j)^2}{2W \sum\limits_{i=1}^n (x_i - \bar{x})^2}$$ where \(n\) is the number of nodes, \( w_{ij}\) is the weight of the tie between nodes \(i\) and \(j\), \(x_i\) is the attribute value of node \(i\), \(\bar{x}\) is the mean attribute value across all nodes, and \(W\) is the sum of all tie weights. This value can range from 0 to 2, where values less than 1 indicate positive autocorrelation (similar values are more likely to be connected), values greater than 1 indicate negative autocorrelation (dissimilar values are more likely to be connected), and a value of 1 indicates no autocorrelation. If an incompatible method is chosen for the attribute type, a suitable alternative will be used instead with a message.
A network_measure numeric score.
The object also carries the measure it computed, the range its values
can fall within, and whether and how those values were normalized.
These are shown as a one-line header when the object is printed.
Where a measure offers a choice between several ways of counting the
same thing, it also carries the variant it used.
All can be retrieved with attr().
Given a partition of a network into a number of mutually exclusive groups then The E-I index is the number of ties between (or external) nodes grouped in some mutually exclusive categories minus the number of ties within (or internal) these groups divided by the total number of ties. This value can range from 1 to -1, where 1 indicates ties only between categories/groups and -1 ties only within categories/groups.
Moran's I is conventionally read on \([-1, 1]\), where positive values indicate that tied nodes hold similar values and negative values that they hold dissimilar ones. Its actual bounds, however, are set by the eigenvalues of the weight matrix, and on the unstandardised weights used here it can fall outside that interval. Its range is therefore declared open at both ends, and the conventional interval read as a guide rather than a guarantee.
Krackhardt, David, and Robert N. Stern. 1988. Informal networks and organizational crises: an experimental simulation. Social Psychology Quarterly 51(2): 123-140. doi:10.2307/2786835
McPherson, Miller, Lynn Smith-Lovin, and James M. Cook. 2001. "Birds of a Feather: Homophily in Social Networks". Annual Review of Sociology, 27(1): 415-444. doi:10.1146/annurev.soc.27.1.415
Newman, Mark E.J. 2002. "Assortative mixing in networks". Physical Review Letters, 89(20): 208701. doi:10.1103/physrevlett.89.208701
Moran, Patrick Alfred Pierce. 1950. "Notes on continuous stochastic phenomena". Biometrika 37(1): 17-23. doi:10.2307/2332142
Other diversity:
measure_assort_node,
measure_diverse_net,
measure_diverse_node,
motif_composition,
motif_homophily
Other measures:
measure_assort_node,
measure_breadth,
measure_broker_node,
measure_broker_tie,
measure_brokerage,
measure_central_between,
measure_central_close,
measure_central_degree,
measure_central_eigen,
measure_central_tie_between,
measure_central_tie_close,
measure_central_tie_degree,
measure_central_tie_eigen,
measure_closure,
measure_closure_node,
measure_cohesion,
measure_core,
measure_diffusion_infection,
measure_diffusion_net,
measure_diffusion_node,
measure_diverse_net,
measure_diverse_node,
measure_features,
measure_fit,
measure_fragmentation,
measure_hierarchy,
measure_periods
marvel_friends <- to_unsigned(to_uniplex(fict_marvel, "relationship"), "positive")
net_by_heterophily(marvel_friends, "Gender")
#> # E-I index [-1, 1]
#> [1] -0.285
net_by_heterophily(marvel_friends, "Attractive")
#> # E-I index [-1, 1]
#> [1] -0.632
net_by_homophily(marvel_friends, "Gender")
#> # IE index [-1, 1]
#> [1] 0.285
net_by_assortativity(ison_networkers)
#> # Degree assortativity [-1, 1]
#> [1] -0.41
net_by_spatial(ison_lawfirm, "age")
#> # Moran's I (-Inf, Inf)
#> [1] 0.126