FDI: Function FDI

Description Usage Arguments Value Author(s) References Examples

View source: R/FDI.r

Description

Calculate FDI - the Frequency Based Dominance index.

Usage

1
FDI(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
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 FDI colors means color 1 = item rank 1, color 2 = item rank 2, and so on

Value

returns a list with
FDI - the Frequency Based Dominance index
Colors - the colors supported by vcolors sorted by FDI of the items
FDI_count_matrix - the counts from which the FDI 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"  
FDI(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"  
FDI(data_ADI,bytes)
   }

Example output

OpenJDK 64-Bit Server VM warning: Can't detect primordial thread stack location - find_vma failed
        Pferd2 Pferd1 Pferd5 Pferd6 Pferd3 Pferd4 Sum_Bi Sum_bij      FDI id
Pferd2      NA      1      0      0      0      0      1       2 0.250000  2
Pferd1       0     NA      0      0      0      2      2       1 0.500000  1
Pferd5       0      0     NA      0      0      0      0       0 1.000000  5
Pferd6       0      0      0     NA      0      0      0       0 1.000000  6
Pferd3       0      0      0      0     NA     11     11       1 1.153846  3
Pferd4       0      0      0      0      1     NA      1      11 1.230769  4
Sum_Bi       0      1      0      0      1     13     NA      NA       NA NA
Sum_bij      0      0      0      0     13      2     NA      NA       NA NA
        rank
Pferd2     1
Pferd1     2
Pferd5     3
Pferd6     4
Pferd3     5
Pferd4     6
Sum_Bi    NA
Sum_bij   NA

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

Related to FDI in Dominance...