Title: | Testing Steepness of Dominance Hierarchies |
---|---|
Description: | The steepness package computes steepness as a property of dominance hierarchies. Steepness is defined as the absolute slope of the straight line fitted to the normalized David's scores. The normalized David's scores can be obtained on the basis of dyadic dominance indices corrected for chance or by means of proportions of wins. Given an observed sociomatrix, it computes hierarchy's steepness and estimates statistical significance by means of a randomization test. |
Authors: | David Leiva <[email protected]> & Han de Vries <[email protected]>. |
Maintainer: | David Leiva <[email protected]> |
License: | GPL (>= 2) |
Version: | 0.3-0 |
Built: | 2024-11-16 04:49:13 UTC |
Source: | https://github.com/cran/steepness |
Steepness is a package that computes steepness as a property of dominance hierarchies. Steepness is defined as the absolute slope of the straight line fitted to the normalized David's scores. The normalized David's scores can be obtained on the basis of dyadic dominance indices corrected for chance or from the matrix of win proportions. Given an observed sociomatrix, it computes hierarchy's steepness and estimates statistical significance by means of a randomization test (see de Vries, Stevens and Vervaecke, 2006).
Package: | steepness |
Version: | 0.2-2 |
Date: | 2014-29-09 |
Depends: | >= 3.1.0 |
License: | GPL version 2 or newer |
Index:
getDij Dyadic dominance index corrected for chance -Dij- getDS David's scores -DS- getNormDS Normalized David's scores -NormDS- getOrderedMatrix Ordered matrix according to NormDS values getPij Matrix of proportions of wins -Pij- getStp Hierarchy's steepness measure -Stp- getwl Several win and loss measures at individual level steeptest Statistical significance for steepness statistic
David Leiva <[email protected]> & Han de Vries <[email protected]>.
Maintainer: David Leiva <[email protected]>
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
For more information see: getDij
, getDS
, getNormDS
, getOrderedMatrix
, getPij
, getStp
, getwl
, steeptest
.
Function to obtain matrix of dyadic dominance indices corrected for chance from the observed sociomatrix.
getDij(X, names=NULL)
getDij(X, names=NULL)
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. |
names |
Character vector with the names of individuals. This vector is NULL by default |
getDij
is only applied for square matrices in which the set of n actors is also the set of n partners. The matrices must also be numeric.
Dij |
Matrix of observed dyadic dominance indices corrected for chance. |
David Leiva [email protected] & Han de Vries [email protected].
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getDij(X,individuals) print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getDij(X,individuals) print(res,digits=3)
Function to obtain David's scores from the observed sociomatrix.
getDS(X, names=NULL, method=c("Dij","Pij"))
getDS(X, names=NULL, method=c("Dij","Pij"))
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. The matrix must be square and numeric. |
names |
Character vector with the names of individuals. This vector is NULL by default |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
getDS
is obtained by means of the following expression: where w1 is the sum of i's Dij or Pij values (depending on the
method
specification); w2 is the weighted sum of i‘s dyadic dominance indices corrected for chance or the weighted sum of i’s win proportions; l1 is the sum of i's Dji or Pji values and l2 is the sum of i's dyadic lose indices corrected for chance or the weighted sum of i's lose proportions.
DS |
David's scores based on dyadic dominance indices corrected for chance or on win proportions. |
David Leiva [email protected] & Han de Vries [email protected].
David, H. A. (1988). The Method of Paired Comparisons. London: C. Griffin.
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getDS(X,names=individuals,method="Dij") print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getDS(X,names=individuals,method="Dij") print(res,digits=3)
Function to obtain normalized David's scores from the observed sociomatrix.
getNormDS(X, names=NULL, method=c("Dij","Pij"))
getNormDS(X, names=NULL, method=c("Dij","Pij"))
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. The matrix must be square and numeric. |
names |
Character vector with the names of individuals. This vector is NULL by default |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
getNormDS
is obtained by means of the following expression:
NormDS |
Normalized David's scores based on dyadic dominance indices corrected for chance or based on the win proportions, depending on the method specified. |
David Leiva [email protected] & Han de Vries [email protected].
David, H. A. (1988). The Method of Paired Comparisons. London: C. Griffin.
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getNormDS(X,names=individuals,method="Dij") print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getNormDS(X,names=individuals,method="Dij") print(res,digits=3)
Function to order the observed matrix of dyadic dominance encounters according to the individuals' NormDS values.
getOrderedMatrix(X, names=NULL, method=c("Dij","Pij"))
getOrderedMatrix(X, names=NULL, method=c("Dij","Pij"))
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. |
names |
Character vector with the names of individuals. This vector is NULL by default |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
getOrderedMatrix
is only applied for square matrices in which the set of n actors is also the set of n partners. The matrices must also be numeric.
ordered.matrix |
Matrix of observed dyadic dominance encounters ordered according to the individuals' NormDS values. |
ordered.names |
Vector of individuals' names ordered according to their NormDS values. |
order.seq |
Sequence used in the order of the matrix of dyadic encounters and the vector of names. |
David Leiva [email protected] & Han de Vries [email protected].
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getOrderedMatrix(X,individuals,method="Dij")$ordered.matrix print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getOrderedMatrix(X,individuals,method="Dij")$ordered.matrix print(res,digits=3)
Function to obtain matrix of win proportions from the observed sociomatrix.
getPij(X, names=NULL)
getPij(X, names=NULL)
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. |
names |
Character vector with the names of individuals. This vector is NULL by default |
getPij
is only applied for square matrices in which the set of n actors is also the set of n partners. The matrices must also be numeric.
Pij |
Matrix of observed win proportions. |
David Leiva [email protected] & Han de Vries [email protected].
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getPij(X,individuals) print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getPij(X,individuals) print(res,digits=3)
Function to obtain hierarchy's steepness measure from the observed sociomatrix.
getStp(X, method=c("Dij","Pij"))
getStp(X, method=c("Dij","Pij"))
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. The matrix must be square and numeric. |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
getStp
is the absolute value of the slope of the best-fitted line between the normalized David's scores and the rank dominance in a decreasing order. The regression is obtained by Ordinary Least Squares method.
getStp |
Steepness measure based on dyadic dominance indices corrected for chance or based on the matrix of win proportions, depending on the method specified. |
David Leiva [email protected] & Han de Vries [email protected].
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") print(getStp(X,method="Dij"),digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") print(getStp(X,method="Dij"),digits=3)
Function to obtain win and loss measures at individual level from the observed sociomatrix.
getwl(X, names=NULL, method=c("Dij","Pij"))
getwl(X, names=NULL, method=c("Dij","Pij"))
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. The matrix must be square and numeric. |
names |
Character vector with the names of individuals. This vector is NULL by default |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
By means of the empirical sociomatrix of wins and losses this function computes several win-loss measures at individual level. Specifically, it computes w, weighted.w, l and weighted.l. w is the sum of individuals' dyadic dominances Dij or the sum of proportions of wins Pij by rows, depending on the specification of the method. weighted.w measures is the sum of individuals' Dij or Pij values weighted by the w values of their interactants. l is the sum of individuals' dyadic dominance indices Dij or the sum of individuals' proportions of wins Pij by columns. And finally, weighted.l is the columns sum of individuals' Dij or Pij values weighted by the l values of their interactants. These measures are used when computing David's scores.
The result is a data frame with the following components:
w |
Sum of dyadic dominance indices Dij or proportions of wins Pij by rows. |
weighted.w |
Weighted sum of dyadic dominance indices Dij or proportions of wins Pij. |
l |
Sum of dyadic dominance indices Dij or proportions of wins Pij by columns. |
weighted.l |
Weighted sum of dyadic dominance indices Dij or proportions of wins Pij. |
David Leiva [email protected] & Han de Vries [email protected].
David, H. A. (1988). The Method of Paired Comparisons. London: C. Griffin.
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getwl(X,names=individuals,method="Dij") print(res,digits=3)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") res <- getwl(X,names=individuals,method="Dij") print(res,digits=3)
Estimates statistical significance for steepness measure on the basis of dyadic dominance indices corrected for chance Dij or based on proportions of wins Pij.
steeptest(X, rep, names=NULL, method=c("Dij","Pij"), order=TRUE)
steeptest(X, rep, names=NULL, method=c("Dij","Pij"), order=TRUE)
X |
Empirical sociomatrix containing wins-losses frequencies in dyadic encounters. The matrix must be square and numeric. |
rep |
Number of simulations for carrying out the randomization test. |
names |
Character vector with individuals' names. |
method |
A character string indicating which dyadic dominance measure is to be used for the computation of David's scores. One of "Dij" or "Pij", can be abbreviated. |
order |
Logical, if TRUE, results for Dij, DS and NormDS are ordered according to the individuals' NormDS values. TRUE by default. |
steeptest
estimates statistical significance for steepness measures based on dyadic dominance index corrected for chance Dij or based on the matrix of win proportions Pij, depending on the method
specified. This procedure simulates a number of sociomatrices under a uniform distribution by means of callings to C routine steep, then computes steepness based on Dij or Pij. Specifically, it computes normalized David's scores, see getNormDS
for more details. Then it computes the steepness measure based on these indices, see getStp
. After rep
simulations the sampling distribution for the statistic (Stp) is estimated. Then statistical significance is computed as follows when results are shown by means of summary
method:
Where NS is computed as:
The number of times that simulated values are greater than or equal to the empirical value, if right-tailed p value is calculated.
And the number of times that simulated values are lower than or equal to the empirical value, if left-tailed p value is calculated.
And NOS represents the number of simulated values.
steeptest
returns an object of class steeptest containing the following components:
call |
Function call. |
names |
Character vector with individuals' names. |
method |
A character string indicating which dyadic dominance measure is used for the computation of David's scores. |
rep |
Number of simulations for carrying out the randomization test. |
matdom |
If |
DS |
David's scores based on Dij or Pij, depending on the specification of the |
NormDS |
Normalized David's scores based on dyadic dominance indices corrected for chance or on proportions of wins in dyadic encounters. |
Stp |
Steepness value based on Normalized David's scores. |
interc |
Intercept of the fitted line based on Normalized David's scores. |
Stpsim |
The function provides results of the randomization procedure for the steepness measure based on NormDS. |
David Leiva [email protected] & Han de Vries [email protected].
David, H. A. (1988). The Method of Paired Comparisons. London: C. Griffin.
de Vries, H., Stevens, J. M. G., & Vervaecke, H. (2006). Measuring and testing the steepness of dominance hierarchies. Animal Behaviour, 71, 585-592.
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") STP <- steeptest(X, rep=9999, names=individuals, method="Dij", order=TRUE) summary(STP) plot(STP)
############################################################################## ### Example taken from Vervaecke et al. (2007): ### ############################################################################## X <- matrix(c(0,58,50,61,32,37,29,39,25,8,0,22,22,9,27,20,10,48, 3,3,0,19,29,12,13,19,8,5,8,9,0,33,38,35,32,57, 4,7,9,1,0,28,26,16,23,4,3,0,0,6,0,7,6,12, 2,0,4,1,4,4,0,5,3,0,2,1,1,5,8,3,0,10,3,1,3,0,0,4,1,2,0), nrow=9,byrow=TRUE) individuals <- c("V","VS","B","FJ","PR","VB","TOR","MU","ZV") STP <- steeptest(X, rep=9999, names=individuals, method="Dij", order=TRUE) summary(STP) plot(STP)