The study of dominance hierarchies dates back to the 1920s, when SchjelderupEbbe (1922) first described the emergence of linear dominance hierarchies in flocks of chickens (this is also the origin of the expression 'peck order' or 'pecking order'). Subsequently, mathematicians like Kendall & Babington Smith (1940) and Landau (1951) derived formulas to describe the structures of such hierarchies (for a good overview of these methods, see de Vries (1995Animal Behaviour) as well as Appleby (1983Animal Behaviour). The methods by Kendall and Landau, however, were derived in the context of tournamentsa specific type of networks in which all asymmetric dyadic relations (e.g., dominantsubordinate) are known. This contrasts with most data on animal dominance hierarchies. Most of the time, there are pairs that are not observed to interact. To deal with this problem, various methods have been used to 'fill in' these unknown relations. The most common method was pioneered by de Vries (1995), in which randomization procedures are used to fill in unknown relations. Linearity indices, such as Landau's h and Kendall's K can then be calculated using these 'filled' tournaments. However, we (Shizuka & McDonald 2012) recently showed that randomization procedures to fill in dominance data sets can obscure true patterns of transitivity of dominance relations that actually occurred. In this study, we introduced a measure we called 'triangle transitivity', based on the proportion of actual threeway relations that were established (i.e., triangles) that were transitive (i.e., if A beats B and B beats C, then A also beats C). We show that the random expectation of this proportion is 0.75, no matter the size or density of the network. Using this, we can evaluate how orderly dominance relations are, and whether these values correspond to existing linearity measures. The following codes will take a dominance data set (in the form of binary dominantsubordinate relations in a matrix) and generate the relevant indices (P_{t}: the proportion of triangles that are transitive, and t_{tri}: this proportion scaled so that it is 0 for the random expectation and 1 for maximum transitivity). It also conducts a 'conditional uniform graph test' (think of it as a Monte Carlo procedure for testing network metrics) to test whether the given dominance set is more orderly than expected by chance. This set of codes is published as supplemental materials in this study: Shizuka, D. and D. B. McDonald. 2012. A social network perspective on transitivity and linearity in dominance hierarchies. Animal Behaviour. DOI:10.1016/j.anbehav.2012.01.011 You can (hopefully) find all the details you need in that paper. Please email me if you would like me to send you the pdf, and please cite the paper if you end up using these codes in your work. ***UPDATE (9/30/2014)*** I have updated this script in two ways: (i) You can now start the script using a raw interaction matrixi.e., you don't have to convert the matrix to binary dominants=1 and subordinates=0; (2) I incorporated the changes from the errata in Animal Behavior, in which I point out that randomizations of very sparse dominance networks can result in some networks that contain no triangles (i.e., triangle transitivity = NA). The updated script will throw out such notriangle random networks. Special thanks to James Curley for pointing out a simple way to convert interaction matrices into dominance (0/1) matrices. Here are the codes:

R Resources > Social Networks in R >