net_x_homophily() returns the two-by-two table from which network-level homophily is calculated, together with the summaries built from it.

Where net_by_heterophily() returns the EI index alone, this returns the counts it rests on, so that the index can be interpreted against the network's own composition.

Note that on a weighted network the two report different values. A contingency table counts ties, so net_x_homophily() treats every tie alike, whereas net_by_heterophily() sums tie weights and so gives more say to stronger ties. On unweighted networks the two agree exactly. Apply manynet::to_unweighted() first to compare them directly.

net_x_homophily(.data, attribute)

Arguments

.data

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().

attribute

Name of a nodal attribute, mark, measure, or membership vector.

Value

A network_motif named numeric vector or sometimes a data frame with one row and a column for each motif type, giving the count of each motif in the network. This is printed as a tibble to avoid greedy printing of long vectors.

Expected EI

The EI index depends on how large the categories are, not only on how nodes choose between them. A network split into two equal groups will have a lower EI than one in which a small minority is surrounded by a large majority, even if nodes in both are equally indifferent to category.

ExpectedEI gives the EI that would be observed if ties were distributed at random across all possible pairs, holding category sizes fixed. Comparing EI against it separates the network's mixing from its composition: an EI above the expected value indicates more crossing of category boundaries than chance alone would produce, and one below it indicates less.

References

On the EI index

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

Examples

net_x_homophily(ison_networkers, "Discipline")
#> # A tibble: 1 × 8
#>   TieSame TieDiff NoTieSame NoTieDiff PctSame    EI ExpectedEI  YulesQ
#>     <dbl>   <dbl>     <dbl>     <dbl>   <dbl> <dbl>      <dbl>   <dbl>
#> 1     144     296       194       358   0.327 0.345      0.319 -0.0539