DSI: DSI ("dyadic CSI")

View source: R/DSI.R

DSIR Documentation

DSI ("dyadic CSI")

Description

DSI ("dyadic CSI")

Usage

DSI(
  b.source,
  from = NULL,
  to = NULL,
  behaviours = NULL,
  ot.source = NULL,
  ot.type = "table",
  duration.NA.treatm = "omit",
  presence = NULL,
  directed = FALSE,
  onlyfocaldyads = TRUE,
  limit2focalnonfocal = FALSE
)

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

eiter "table" (OT for each ID, separated by date) or "party"

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")

presence

optional data.frame in the form of date by ID, with 0 and 1 indicating whether an ID was present on a given day or not; first column must be a date (YYYY-MM-DD); see createnullpresence

directed

logical, if actors and receivers are differentiated, a directed CSI is returned, i.e. with each dyad represented twice (once in each direction within the dyad)

onlyfocaldyads

logical, TRUE by default. Should only focal-focal dyads be returned? If FAlSE, returns also focal-nonfocal dyads if such were found in the data.

limit2focalnonfocal

logical, FALSE by default. Limits returned data to focal-nonfocal dyads. This is relevant only if there are such dyads in the data set and if onlyfocaldyads=FALSE. Otherwise this argument is ignored and a warning returned.

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 DSI and standardized DSI. For the latter, the rates of behaviours are z-transformed before they are summed and divided by the number of behaviours.

References

Silk, J. B., Altmann, J., & Alberts, S. C. (2006). Social relationships among adult female baboons (Papio cynocephalus) I. Variation in the strength of social bonds.Behavioral Ecology and Sociobiology,61(2), 183–195. https://doi.org/10.1007/s00265-006-0249-2 Silk, J. B., Cheney, D. L., & Seyfarth, R. M. (2013). A practical guide to the study of social relationships. Evolutionary Anthropology,22(5), 213–225. https://doi.org/10.1002/evan.21367

Examples

## Not run: 
data(dataset3)
DSI(dataset3$dataseq, presence = dataset3$presence)
DSI(dataset3$dataseq)

data(dataset3)
DSI(dataset3$dataseq, onlyfocaldyads=TRUE,
limit2focalnonfocal = FALSE) #default
DSI(dataset3$dataseq, onlyfocaldyads=FALSE,
limit2focalnonfocal = FALSE)
DSI(dataset3$dataseq, onlyfocaldyads=FALSE,
limit2focalnonfocal = TRUE)
DSI(dataset3$dataseq, onlyfocaldyads=TRUE,
limit2focalnonfocal = TRUE)

DSI(dataset3$dataseq, onlyfocaldyads=TRUE,
limit2focalnonfocal = FALSE, presence=dataset3$presence)
DSI(dataset3$dataseq, onlyfocaldyads=FALSE,
limit2focalnonfocal = FALSE, presence=dataset3$presence)
DSI(dataset3$dataseq, onlyfocaldyads=FALSE,
limit2focalnonfocal = TRUE, presence=dataset3$presence)
DSI(dataset3$dataseq, onlyfocaldyads=TRUE,
limit2focalnonfocal = TRUE, presence=dataset3$presence)

DSI(dataset3$dataseq, ot.source=dataset3$ot, onlyfocaldyads=TRUE,
limit2focalnonfocal = FALSE, presence=dataset3$presence)
DSI(dataset3$dataseq, ot.source=dataset3$ot, onlyfocaldyads=FALSE,
limit2focalnonfocal = FALSE, presence=dataset3$presence)
DSI(dataset3$dataseq, ot.source=dataset3$ot, onlyfocaldyads=FALSE,
limit2focalnonfocal = TRUE, presence=dataset3$presence)
DSI(dataset3$dataseq, ot.source=dataset3$ot, onlyfocaldyads=TRUE,
limit2focalnonfocal = TRUE, presence=dataset3$presence)

## End(Not run)

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