elo.seq: Calculate Elo ratings

Description Arguments Details Value Author(s) References Examples

View source: R/elo.seq.r

Description

Calculate Elo ratings from a sequence of dominance interactions

Arguments

winner

Either a factor or character vector with winners IDs of dominance interactions

loser

Either a factor or character vector with loser IDs of dominance interactions

Date

character vector of form "YYYY-MM-DD" with the date of the respective interaction

draw

logical. Did the interaction end undecided (i.e. drawn or tied)? By default all FALSE, i.e. no undecided interactions occurred. Note that in this case, winner/loser values can be interchanged

presence

option to supply data about presence and absence of individuals for part of the time the data collection covered. see details

startvalue

the value of Elo ratings of the two individuals that are involved in the first interaction of the overall sequence prior to this interaction. By default set to 1000. See also init.

k

factor k that determines the maximum change in ratings. By default k=100

init

what Elo rating does an individual have prior to its first interaction. Three options are available: average: individuals always start with the value specified in startvalue. Given stable composition of the group, this also reflects the average Elo rating on each day in that group,
bottom: subjects entering at the current lowest Elo value if the lowest value getting lower its getting lower for all subjects which had this lowest values before, it is reflecting that in some species new subjects entering a group at the bottom level "bottom entry"
bottom_low: same as bottom but additionally the start values getting after the first interaction lower for all non-interacting subjects and, reflecting that we have at start no knowledge about the subjects this option offers for "bottom entry" species the possibility to consider that in a way that those subjects which are not interacting getting lower from start on,

iterate

not yet implemented

runcheck

should several checks regarding data integrety be performed, by default TRUE. See seqcheck

progressbar

should progress bars be displayed, by default progressbar=TRUE

Details

the presence 'matrix' is actually an object of class data.frame containing information about wether an individual was present on a given day or not. The first column represents the dates, running at least from the date of the earliest interaction until at least the date of the last interaction with one line per day (regardless of whether there were actually interactions observed on each day). Further, each individual is represented as a column in which "1" indicates an individual was present on the row-date and a "0" indicates the individuals absence on this date. NAs are not allowed. See advpres for an example.

Value

An object of class elo, which is list with 10 items that serves as basis to extract relevant info.

mat

a date by ID-matrix with raw Elo ratings

lmat

a date by ID-matrix with raw Elo ratings

cmat

a date by ID-matrix with raw Elo ratings

pmat

a date by ID-matrix with with presence data

nmat

a date by ID-matrix containing the number of interactions a given ID was involved in on a given day

logtable

details on each single interaction

stability

a data.frame containing information about stability (see stab.elo)

truedates

vector of class Date covering the ranges of dates in the dataset

misc

various

allids

a (sorted) character vector with all IDs that occur in the dataset

Author(s)

Christof Neumann & Lars Kulik

References

Albers, P. C. H. & de Vries, H. 2001. Elo-rating as a tool in the sequential estimation of dominance strengths. Animal Behaviour, 61, 489-495.

Neumann, C., Duboscq, J., Dubuc, C., Ginting, A., Irwan, A. M., Agil, M., Widdig, A. & Engelhardt, A. 2011. Assessing dominance hierarchies: validation and advantages of progressive evaluation with Elo-rating. Animal Behaviour, 82, 911-921.

Examples

1
2
3
data(adv)
SEQ <- elo.seq(winner=adv$winner, loser=adv$loser, Date=adv$Date)
summary(SEQ)

Example output

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

[1] "loop 1: Elo calculations"

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |....                                                                  |   6%
  |                                                                            
  |......                                                                |   9%
  |                                                                            
  |........                                                              |  12%
  |                                                                            
  |...........                                                           |  15%
  |                                                                            
  |.............                                                         |  18%
  |                                                                            
  |...............                                                       |  21%
  |                                                                            
  |.................                                                     |  24%
  |                                                                            
  |...................                                                   |  27%
  |                                                                            
  |.....................                                                 |  30%
  |                                                                            
  |.......................                                               |  33%
  |                                                                            
  |.........................                                             |  36%
  |                                                                            
  |............................                                          |  39%
  |                                                                            
  |..............................                                        |  42%
  |                                                                            
  |................................                                      |  45%
  |                                                                            
  |..................................                                    |  48%
  |                                                                            
  |....................................                                  |  52%
  |                                                                            
  |......................................                                |  55%
  |                                                                            
  |........................................                              |  58%
  |                                                                            
  |..........................................                            |  61%
  |                                                                            
  |.............................................                         |  64%
  |                                                                            
  |...............................................                       |  67%
  |                                                                            
  |.................................................                     |  70%
  |                                                                            
  |...................................................                   |  73%
  |                                                                            
  |.....................................................                 |  76%
  |                                                                            
  |.......................................................               |  79%
  |                                                                            
  |.........................................................             |  82%
  |                                                                            
  |...........................................................           |  85%
  |                                                                            
  |..............................................................        |  88%
  |                                                                            
  |................................................................      |  91%
  |                                                                            
  |..................................................................    |  94%
  |                                                                            
  |....................................................................  |  97%
  |                                                                            
  |......................................................................| 100%
[1] "loop 2: Stability calculations"

  |                                                                            
  |                                                                      |   0%
  |                                                                            
  |....                                                                  |   6%
  |                                                                            
  |......                                                                |   9%
  |                                                                            
  |........                                                              |  12%
  |                                                                            
  |...........                                                           |  15%
  |                                                                            
  |.............                                                         |  18%
  |                                                                            
  |...............                                                       |  21%
  |                                                                            
  |.................                                                     |  24%
  |                                                                            
  |...................                                                   |  27%
  |                                                                            
  |.....................                                                 |  30%
  |                                                                            
  |.......................                                               |  33%
  |                                                                            
  |.........................                                             |  36%
  |                                                                            
  |............................                                          |  39%
  |                                                                            
  |..............................                                        |  42%
  |                                                                            
  |................................                                      |  45%
  |                                                                            
  |..................................                                    |  48%
  |                                                                            
  |....................................                                  |  52%
  |                                                                            
  |......................................                                |  55%
  |                                                                            
  |........................................                              |  58%
  |                                                                            
  |..........................................                            |  61%
  |                                                                            
  |.............................................                         |  64%
  |                                                                            
  |...............................................                       |  67%
  |                                                                            
  |.................................................                     |  70%
  |                                                                            
  |...................................................                   |  73%
  |                                                                            
  |.....................................................                 |  76%
  |                                                                            
  |.......................................................               |  79%
  |                                                                            
  |.........................................................             |  82%
  |                                                                            
  |...........................................................           |  85%
  |                                                                            
  |..............................................................        |  88%
  |                                                                            
  |................................................................      |  91%
  |                                                                            
  |..................................................................    |  94%
  |                                                                            
  |....................................................................  |  97%
  |                                                                            
  |......................................................................| 100%
Elo ratings from 7 individuals
total (mean/median) number of interactions: 33 (9.4/9)
range of interactions: 7 - 11 
date range: 2010-01-01 - 2010-02-02 
startvalue: 1000 
uppon arrival treatment: average 
k: 100 
proportion of draws in the data set: 0 

EloRating documentation built on May 29, 2017, 7:14 p.m.