Learn R Programming

compete (version 0.1)

devries: Calculate the linearity of a dominance hierarchy - De Vries' method

Description

Calculate the linearity of a dominance hierarchy - De Vries' method

Usage

devries(m, Nperms = 10000, history = FALSE, plot = FALSE)

Arguments

m
A matrix with individuals ordered identically in rows and columns.
Nperms
Number of randomizations
history
Whether to store results of randomization
plot
Whether to plot results of randomization

Value

The modified Landau's h' value of m, the associated p-value

References

Han de Vries (1995) An improved test of linearity in dominance hierarchies containing unknown or tied relationships. Animal Behaviour 50 pp. 1375-1389.

Further details

This code is an edited and faster version of code originally written by Dai Shizuka. http://biosci.unl.edu/daizaburo-shizuka Note that plot will only be shown if history=F

Examples

Run this code
devries(bonobos)
devries(mouse,plot=TRUE)
devries(people,history=TRUE)

Run the code above in your browser using DataLab