CSI: CSI (individual CSI)

View source: R/CSI.R

CSIR Documentation

CSI (individual CSI)

Description

CSI (individual CSI)

Usage

CSI(
  b.source,
  from = NULL,
  to = NULL,
  behaviours = NULL,
  ot.source = NULL,
  ot.type = "table",
  duration.NA.treatm = "omit"
)

Arguments

b.source

data frame with behavioural data

from

character or date in format YYYY-MM-DD, by default the earliest and latest date in b.source, respectively

to

character or date in format YYYY-MM-DD, by default the earliest and latest date in b.source, respectively

behaviours

character string with codes of behaviours to be considered, by default all behaviours that occur in the data are considered. Can also be a named list if merging of different codes into broader categories is desired (see details).

ot.source

data frame with observation time data

ot.type

character: "table" (OT for each ID, separated by date). "party"-style not supported!

duration.NA.treatm

by default "omit", i.e. if there is a duration column in behav.source and not all data points have a duration (i.e. NA) for a given behaviour (e.g. grooming), these NA data points will be deleted; alternatively "count", i.e. behaviours for which not all durations are given will be transformed into "1", i.e. they will be counted as single occurences (for example, grooming will become "grooming bouts")

Details

Typically, behaviours to be considered are supplied in the form behaviours=c("groom", "approach"). If you wish to merge behaviours into broader categories, supply a named list, e.g. list(groom=c("grm.received", "grm.given"), greet=c("greet", "mount", "grunt")). In such a case, behaviours in a given category are summed first to calculate the rates with which the behaviour categories occur.

Value

a data.frame with CSI and standardized CSI. For the latter, the rates of behaviours are z-transformed before they are summed and divided by the number of behaviours.

References

Sapolsky, R. M., Alberts, S. C., & Altmann, J. (1997). Hypercortisolism associated with social subordinanceor social isolation among wild baboons.Archives of General Psychiatry,54(12), 1137–1143. https://doi.org/10.1001/archpsyc.1997.01830240097014

Examples

## Not run: 
data(dataset3)
CSI(dataset3$dataseq)

## End(Not run)

gobbios/socialindices documentation built on Feb. 14, 2023, 3:56 p.m.