node_x_accuracy() counts, for each node's report of a cognitive social structure, the possible ties on which it agrees or disagrees with an ideal network. The four columns are the confusion matrix of the report:

  • true_positives: ties in both the report and the ideal.

  • false_positives: ties in the report but not in the ideal.

  • false_negatives: ties in the ideal but not in the report.

  • true_negatives: ties in neither.

From these, e.g. a node's sensitivity is true_positives / (true_positives + false_negatives), and its specificity is true_negatives / (true_negatives + false_positives). For the ideal, see node_by_accuracy().

node_x_accuracy(.data, ideal = NULL)

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.

Value

A node_motif matrix with one row for each node in the network and a column for each motif type, giving the count of each motif in which each node participates. It is printed as a tibble, however, to avoid greedy printing. If the network is labelled, then the node names will be in a column named names.

Examples

node_x_accuracy(ison_hightech)
#> # A tibble: 21 × 4
#>   true_positives false_positives false_negatives true_negatives
#>            <dbl>           <dbl>           <dbl>          <dbl>
#> 1            134             203              46            457
#> 2             93              38              87            622
#> 3             85             113              95            547
#> 4            119             116              61            544
#> 5            125             134              55            526
#> 6             61              20             119            640
#> # ℹ 15 more rows