These functions are used to cluster some motif census object:

  • cluster_hierarchical() returns a hierarchical clustering object created by stats::hclust() on the proximities between nodes' profiles.

  • cluster_concor() returns a hierarchical clustering object created from a convergence of correlations procedure (CONCOR).

  • cluster_cosine() is deprecated; use cluster_hierarchical() with proximity = "cosine" instead.

These functions are not intended to be called directly, but are called within node_in_equivalence() and related functions. They are exported and listed here to provide more detailed documentation.

cluster_hierarchical(motif, distance = NULL, proximity = "pearson")

cluster_cosine(motif, distance = NULL)

cluster_concor(.data, motif)

Arguments

motif

A matrix returned by a node_x_*() function.

distance

Character string indicating which distance metric to pass on to stats::dist to compare nodes a second time, on their profiles of dissimilarities to all nodes. By default NULL, so that the proximities are clustered directly. Options include "euclidean", "maximum", "manhattan", "canberra", "binary", and "minkowski". Fewer, identifiable letters, e.g. "e" for Euclidean, is sufficient. Before v1.1.0 the default was "euclidean", so pass that to reproduce earlier results. Ignored when cluster = "concor".

proximity

Character string indicating how nodes' profiles should be compared, passed on to manynet::to_proximity(). By default "pearson", their correlation, but any measure offered there can be used, e.g. "cosine", "ruzicka", "overlap", "euclidean", or "hamming". Note that "jaccard" dichotomises a valued census; "ruzicka" is the weighted counterpart that keeps the counts. The proximities themselves are in the proximity element of the clustering, e.g. attr(node_in_structural(.data), "hc")$proximity, or can be made with manynet::to_proximity() from any census, using across = "rows" and dyad = "include". Ignored when cluster = "concor". "asis" clusters a motif that is already a node-by-node similarity. node_in_regular() does not take it, since regularity_*() already returns a node-by-node similarity, which is clustered as it is.

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

Value

A hierarchical clustering object created by stats::hclust(), with an additional distances element containing the distance matrix used for clustering and, for cluster_hierarchical(), a proximity element containing the node-by-node proximity matrix those distances were made from.

Hierarchical clustering

This method uses stats::hclust() to create a hierarchical clustering object from the proximities between nodes' profiles in the given motif census. First a matrix of how alike each pair of nodes' profiles are is created using manynet::to_proximity(), by default their Pearson correlation coefficients. Then a dissimilarity matrix is created by subtracting these proximities from 1, and this is given to stats::hclust() to enable dendrogram construction etc. Each pair of nodes is thus compared once.

Where distance is given, the nodes are compared a second time: stats::dist() measures the distance between each pair of nodes' profiles of dissimilarities to all nodes, and it is these distances that are clustered. This was the only behaviour before v1.1.0.

Some proximities, such as "count", "match", "crossmin", "maxcrossmin", and "covariance", are not bounded by 1. These are subtracted from the largest proximity observed instead, with a message, so that no dissimilarity is negative.

CONCOR

First a matrix of Pearson correlation coefficients between each pair of nodes' profiles in the given motif census is created. Then, again, we find the correlations of this square, symmetric matrix, and continue to do this iteratively until each entry is either 1 or -1. These values are used to split the data into two partitions, with members either holding the values 1 or -1. This procedure from census to convergence is then repeated within each block, allowing further partitions to be found. Unlike UCINET, partitions are continued until there are single members in each partition. Then a distance matrix is constructed from records of in which partition phase nodes were separated, and this is given to stats::hclust() so that dendrograms etc can be returned.

References

On CONCOR clustering

Breiger, Ronald L., Scott A. Boorman, and Phipps Arabie. 1975. "An Algorithm for Clustering Relational Data with Applications to Social Network Analysis and Comparison with Multidimensional Scaling". Journal of Mathematical Psychology, 12: 328-83. doi:10.1016/0022-2496(75)90028-0 .