Given a categorical vertex attribute describing mutually exclusive groups, the assortativity coefficient represents the tendency for nodes to form ties with similar alters.
assort_discrete(g, node_attr_name, ...) assort_scalar(g, val1, val2 = NULL) assort_degree(g)
g |
|
---|---|
node_attr_name |
|
... | Arguments passed to or from other methods. |
val1 | Continuous vector. |
val2 | Continuous vector. |
$$ r = \frac{ \sum_i{e_{ii} - \sum_i{a_ib_i}} } {1 - \sum_i{a_ib_i} } $$
\(e\): mixing matrix
\(e_{ii}\): diagonal of mixing matrix
\(a_i\): row sums of mixing matrix
\(b_i\): column sums of mixing matrix
M. E. J. Newman, Mixing patterns in networks, Physical Review E, 67 026126, 2003. https://arxiv.org/pdf/cond-mat/0209450.pdf.
data("faux.desert.high", package = "ergm") assort_discrete(faux.desert.high, node_attr_name = "race")#> [1] 0.01577169#> [1] 0.5445606