These functions offer ways to measure the distribution or assortativity of ties in a network:

  • net_heterophily() measures how embedded nodes in the network are within groups of nodes with the same attribute.

  • node_heterophily() measures each node's embeddedness within groups of nodes with the same attribute.

  • net_assortativity() measures the degree assortativity in a network.

  • net_spatial() measures the spatial association/autocorrelation (global Moran's I) in a network.

net_by_heterophily(.data, attribute)

node_by_heterophily(.data, attribute)

net_by_homophily(.data, attribute, method = c("ie", "ei", "yule", "geary"))

node_by_homophily(.data, attribute, method = c("ie", "ei", "yule", "geary"))

net_by_assortativity(.data)

net_by_spatial(.data, attribute)

Arguments

.data

A network object of class mnet, igraph, tbl_graph, network, or similar. For more information on the standard coercion possible, see manynet::as_tidygraph().

attribute

Name of a nodal attribute or membership vector to use as categories for the diversity measure.

method

Which method to use for net_diversity(). Either "blau" (Blau's index) or "teachman" (Teachman's index) for categorical attributes, or "variation" (coefficient of variation) or "gini" (Gini coefficient) for numeric attributes. Default is "blau". If an incompatible method is chosen for the attribute type, a suitable alternative will be used instead with a message.

Homophily

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.

References

On heterophily

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

On assortativity

Newman, Mark E.J. 2002. "Assortative mixing in networks". Physical Review Letters, 89(20): 208701. doi:10.1103/physrevlett.89.208701

On spatial autocorrelation

Moran, Patrick Alfred Pierce. 1950. "Notes on continuous stochastic phenomena". Biometrika 37(1): 17-23. doi:10.2307/2332142

Examples

marvel_friends <- to_unsigned(to_uniplex(fict_marvel, "relationship"), "positive")
net_by_heterophily(marvel_friends, "Gender")
#> [1] -0.285
net_by_heterophily(marvel_friends, "Attractive")
#> [1] -0.632
node_by_heterophily(marvel_friends, "Gender")
#> ▅▂▁▂ 
#>   Abomination `Ant-Man` Apocalypse Beast `Black Panther` `Black Widow` Blade
#> 1         NaN       0.5         -1  -0.5          -0.545         0.692    -1
#> # ... and 46 more values from this nodeset. Use `print_all(...)` to print all values.
node_by_heterophily(marvel_friends, "Attractive")
#> ▆▂▁▁ 
#>   Abomination `Ant-Man` Apocalypse Beast `Black Panther` `Black Widow` Blade
#> 1         NaN      -0.5         -1  -0.8          -0.818        -0.846    -1
#> # ... and 46 more values from this nodeset. Use `print_all(...)` to print all values.
net_by_homophily(marvel_friends, "Gender")
#> [1] 0.285
net_by_assortativity(ison_networkers)
#> [1] -0.41
net_by_spatial(ison_lawfirm, "age")
#> [1] 0.126