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.

Cognitive social structures

A cognitive social structure records each node's report of the ties in the whole network, in a by column that names who reported each tie. Counting every report as a tie of its own would count each tie once for every perceiver who reports it. So the functions here first combine the reports into the locally aggregated structure of Krackhardt (1987), with the intersection rule: a tie exists if both of its ends report it, and a message says so. A tie that names no reporter is kept as it is.

A tie-level function still returns one value for each report, so that the result can be added back to the network it was given. Each report takes the value of the tie that it reports. A report of a tie that is not in the aggregated structure takes NA, or FALSE for a mark. tie_is_random() is the exception, and draws among the reports.

To combine the reports in a different way, do this before the function, e.g. with manynet::to_aggregated(over = "by").

Krackhardt, David. 1987. "Cognitive social structures". Social Networks 9(2): 109-134. doi:10.1016/0378-8733(87)90009-8

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