• tie_by_diversity() measures the heterogeneity of the nodes that each tie joins. For a tie between two nodes, this is the diversity of its two ends. For a hypergraph, it is the diversity of the members of each hyperedge, and these are the values that node_by_diversity() gives the hyperedges in the two-mode form of the hypergraph. A tie without members returns NA. A summary of the tie measure then describes the network as a whole.

tie_by_diversity(
  .data,
  attribute,
  diversity = c("blau", "teachman", "variation", "gini")
)

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.

diversity

Which method to use for *_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.

Value

A tie_measure numeric vector the length of the ties in the network, providing the scores for each tie. If the network is labelled, then the scores will be labelled with the ties' adjacent nodes' names.

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

Examples

tie_by_diversity(ison_lawfirm, "gender")
#> # Blau's index, normalized [0, 1]
#>   `1->2` `1->2` `1->4` `1->8` `1->17` `1->17` `1->17` `1->20` `1->39` `1->40`
#> 1      0      0      0      0       0       0       0       0     0.5       0
#> # ... and 2561 more values from this nodeset. Use `print_all(...)` to print all values.
tie_by_diversity(to_hypergraph(ison_southern_women), "Title")
#> # Blau's index, normalized [0, 1]
#>      E1    E2    E3    E4    E5    E6    E7    E8    E9   E10   E11   E12   E13
#> 1 0.444 0.444 0.278 0.375 0.219 0.375  0.42 0.408   0.5  0.48     0   0.5 0.444
#> # ... and 1 more values from this nodeset. Use `print_all(...)` to print all values.