node_by_accuracy() measures how well each node's report of a cognitive social structure agrees with an ideal network, from 0 to 1 where the report is the ideal.

A cognitive social structure (Krackhardt 1987) asks each node to report the ties of the whole network. Each report is compared with the ideal tie by tie. By default, the ideal is the locally aggregated structure, where a tie exists if both of its ends report it. Note that this ideal uses each node's reports of its own ties, so a node agrees with it on part of its own dyads. For a different ideal, such as a consensus structure, give it as ideal, e.g. manynet::to_flat(.data, attribute = "by"). Where the network holds several layers of reports, each layer is compared with the same layer of the ideal, and the cells are pooled.

There are two variants:

  • "hamming" (the default) is the share of possible ties on which the report and the ideal agree, whether on a tie or on its absence. This is the classic accuracy. Most possible ties are absent in a sparse network, so a node that reports few ties can still score high.

  • "jaccard" is the share of ties in either the report or the ideal that are in both. It ignores ties absent from both.

These are one minus the "hamming" and "jaccard" variants of net_by_divergence() between each node's report and the ideal. For the counts of each kind of agreement and error, see node_x_accuracy().

node_by_accuracy(.data, ideal = NULL, variant = c("hamming", "jaccard"))

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

ideal

The ideal network to compare each report against, with the same nodes as the network. By default, the locally aggregated structure of the network itself.

variant

Character string naming which variant of the measure to compute, where more than one definition of the same quantity is in use. The variant chosen is reported when the result is printed.

Value

A node_measure numeric vector the length of the nodes in the network, providing the scores for each node. If the network is labelled, then the scores will be labelled with the 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().

References

On cognitive social structures

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

Examples

node_by_accuracy(ison_hightech)
#> # Hamming accuracy, normalized [0, 1]
#> ▁▁▁▁▂▃▃▁ 
#>      V1    V2    V3    V4    V5    V6    V7    V8    V9   V10   V11   V12   V13
#> 1 0.704 0.851 0.752 0.789 0.775 0.835 0.751  0.83 0.807 0.789 0.805 0.821 0.817
#> # ... and 8 more values from this nodeset. Use `print_all(...)` to print all values.
node_by_accuracy(ison_hightech, variant = "jaccard")
#> # Jaccard accuracy, normalized [0, 1]
#> ▃▂▃▂▁ 
#>      V1    V2    V3    V4    V5    V6    V7    V8    V9   V10   V11   V12   V13
#> 1  0.35 0.427  0.29 0.402 0.398 0.305  0.33 0.381 0.355 0.359 0.333 0.385  0.26
#> # ... and 8 more values from this nodeset. Use `print_all(...)` to print all values.