get_di_matrix: Transforms a frequency interaction sociomatrix (valued data)...

Description Usage Arguments Value References Examples

View source: R/get_di_matrix.R

Description

Transforms a frequency interaction sociomatrix (valued data) into a dichotomized 1/0 matrix

Usage

1
get_di_matrix(m, type = "wl")

Arguments

m

A matrix with individuals ordered identically in rows and columns.

type

Determines the type of dichotomized matrix to be returned. type="wl" is the default which returns a win-loss matrix with a '1' representing a consistent winner and a '0' representing a consistent loser for each dyad of the matrix. A consistent winner is defined as being the individual in each dyad that has absolutely more wins than defeats. In the default condition if competitors have the same number of wins each, they both receive a 0. If type="wlties" the default dichotomized win-loss matrix will be returned but it will also return 0.5 into cells for tied relationships. If type="wlties0" the default dichotomized win-loss matrix will be returned but it will also return 0.5 into cells for tied relationships. Additionally, if two competitors never interacted both cells for that relationship will be returned with a 0. If type="wlbinom" every relationship within the win-loss matrix is assessed for whether one competitor significantly wins more competitive interactions than the other competitor. Significance is calculated using a binomial test with probability of p=0.05. A '1' is given to significant winners within a relationship and a '0' is given to significant losers or if neither individual is a winner. If type="wlbinomties" The same procedure is done as for type="wlbinom", but if no signficiant winner/loser can be determined then a 0.5 is returned rather than a 0. If type="pa" the inputted matrix will be turned into a dichotomized presence-absence matrix, with a '1' indicating that the competitor in a the row of the matrix beat the competitor in the column at least once. A '0' indicates that that competitor never beat the other competitor. If type="dom" the inputted matrix will be turned into a dominance score matrix, with a '1' indicating that the competitor in a the row of the matrix dominates the competitor in the column. A '-1' indicates that that competitor in a row is subordinate to the competitor in the column. A '0.5' indicates a tie. A '0' indicates an observational or structural zero.

Value

A dichotomized win/loss or presence/absence matrix.

References

Appleby, M. C. 1983. The probability of linearity in hierarchies. Animal Behaviour, 31, 600-608.

Examples

1
2

Example output

   Dz He De Ho Lu Ki
Dz NA  0  0  0  0  0
He  1 NA  0  0  0  0
De  1  1 NA  0  0  0
Ho  1  0  1 NA  0  0
Lu  1  1  1  1 NA  0
Ki  1  1  1  1  1 NA
  A B C D E F G H I J K L
A 0 0 0 1 0 0 1 0 0 0 0 0
B 1 0 0 1 0 0 0 0 0 0 0 0
C 0 1 0 0 0 0 0 0 1 0 0 1
D 0 0 0 0 0 0 0 0 0 0 0 1
E 0 1 0 0 0 0 0 0 0 0 0 0
F 0 0 1 1 0 0 1 0 0 0 0 0
G 0 1 0 0 0 0 0 0 0 0 0 1
H 1 1 1 1 1 1 1 0 1 1 1 1
I 0 1 0 1 1 0 1 0 0 0 0 0
J 1 1 1 1 1 1 1 0 1 0 1 1
K 1 1 1 1 1 1 1 0 1 0 0 1
L 0 1 0 0 0 1 0 0 0 0 0 0

compete documentation built on May 29, 2017, 1:39 p.m.