ADI: Function ADI

Description Usage Arguments Details Value Author(s) References Examples

View source: R/ADI.R

Description

Calculates Average Dominance Index.

Usage

1
ADI(data_sheet, bytes, ...)

Arguments

data_sheet

either a data.frame f.e imported from a data sheet containing
"Name","item.number"
"action.from.","action.to","kind.of.action"
"name.of.action","action.number","classification","weighting"

or only "action.from.","action.to","kind.of.action"if exists actions and items

actions: with "name.of.action","action.number","classification","weighting
weighting the factor which should be used to calculate the behavior (1 for "action.from"" wins -1 for "action.to" wins")
Setting a behaviour to 2 means it is count double
items: with "Name","item.number"

bytes

a string where each enabled action is set to 1 and each disabled action is set to 0
Setting a behaviour to 2 means it is count double

...

Additional parameters:

actions

(data.frame) with "name.of.action","action.number","classification","weighting"; Classification 1 if "action.from"" wins; Classification 2 if "action.to" wins

weighting

the factor which should be used to calculate the behavior (1 for "action.from"" wins -1 for "action.to" wins")
Setting a behaviour to 2 means it is count double

vcolors

as much colors as items, colors will returned as sorted ADI colors means color 1 = item rank 1, color 2 = item rank 2, and so on

Details

Calculates Average Dominance Index.

Value

returns a list with
ADI - the Average Dominance index
Colors - the colors supported by vcolors sorted by ADI of the items
ADI_count_matrix - the counts from which the ADI was calculated

Author(s)

Knut Krueger, Knut.Krueger@equine-science.de

References

The Construction of Dominance Order: Comparing Performance of Five Methods Using an Individual-Based Model C. K. Hemelrijk, J. Wantia and L. Gygax, Behaviour Vol. 142, No. 8 (Aug., 2005), pp. 1037-1058 doi: 10.1163/156853905774405290
On using the DomWorld model to evaluate dominance ranking methods , de Vries, Han, Behaviour, Volume 146, Number 6, 2009 , pp. 843-869(27) doi: 10.1163/156853909X412241

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
{ #you can eihter use:
data_sheet=data.frame   ("action.from"=c(1,4,2,3,4,3,4,3,4,3,4,3,4,3,4),
                         "action.to"=c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),
"kind.of.action"= c(4,1,1,4,3,4,3,4,3,4,3,4,3,4,3),stringsAsFactors=FALSE)
items= data.frame ("Name"=c("item1","item2","item3","item4","item5","item6") ,
                   "item.number"=c(1:6),stringsAsFactors=FALSE)
actions=data.frame("name.of.action"= c("leading","following","approach","bite","threat to bite",
                                      "kick","threat to kick", "chase","retreat"),
                  "action.number"=c(1:9),
                  "classification"=c(1,2,1,1,1,1,1,1,2) ,
                  "weighting"=c(1,-1,1,1,1,1,1,1,-1),stringsAsFactors=FALSE)
#all  encounters  without leading and following
bytes= "001111111"  
ADI(data_sheet,items=items,actions=actions,bytes)
# or you can use a complete f.e Excel sheet
# you can save this data as basic excel sheet to work with
data(data_ADI)
bytes= "001111111"  
ADI(data_ADI,bytes)
}

Example output

OpenJDK 64-Bit Server VM warning: Can't detect initial thread stack location - find_vma failed
$ADI
       Pferd2     Pferd3 Pferd1    Pferd4 Pferd5 Pferd6 results.ADI id rank
Pferd2     NA        NaN      1       NaN    NaN    NaN  1.00000000  2    1
Pferd3    NaN         NA    NaN 0.9166667    NaN    NaN  0.91666667  3    2
Pferd1      0        NaN     NA 1.0000000    NaN    NaN  0.50000000  1    3
Pferd4    NaN 0.08333333      0        NA    NaN    NaN  0.04166667  4    4
Pferd5    NaN        NaN    NaN       NaN     NA    NaN  0.00000000  5    5
Pferd6    NaN        NaN    NaN       NaN    NaN     NA  0.00000000  6    6

$Colors
[1] ""

$ADI_count_matrix
       Pferd1 Pferd2 Pferd3 Pferd4 Pferd5 Pferd6
Pferd1     NA      0      0      2      0      0
Pferd2      1     NA      0      0      0      0
Pferd3      0      0     NA     11      0      0
Pferd4      0      0      1     NA      0      0
Pferd5      0      0      0      0     NA      0
Pferd6      0      0      0      0      0     NA

Warning message:
system call failed: Cannot allocate memory 

Dominance documentation built on Feb. 23, 2021, 5:13 p.m.

Related to ADI in Dominance...