sampling.uncertainty {ANTs}R Documentation

Metric uncertainty

Description

Perform a matrix boostrapping approach to estimate the confidence intervals surrounding each pairwise association.

Usage

sampling.uncertainty(
  df,
  nboot,
  metric = "met.strength",
  assoc.indices = FALSE,
  actor = NULL,
  receiver = NULL,
  scan = NULL,
  id = NULL,
  index = "sri",
  progress = TRUE,
  ...
)

Arguments

df

a data frame of individual interactions or associations

nboot

an integer indicating the number of bootstrap wanted.

metric

the network metric to compute

assoc.indices

a bolean indicating if association indices must be used

actor

If argument assoc.indices is FALSE, fill this argument, an integer or a string indicating the column of the individuals performing the behaviour.

receiver

If argument assoc.indices is FALSE, fill this argument, an integer or a string indicating the column of the individuals receiving the behaviour.

scan

If argument assoc.indices is TRUE, fill this argument, a numeric or character vector representing one or more columns used as scan factors.

id

If argument assoc.indices is TRUE, fill this argument, a numeric or character vector indicating the column holding ids of individuals.

index

a string indicating the association index to compute.

progress

a boolean indicating if function should print progress.

...

additional argument related to the computation of the metric declared.

  • 'sri' for Simple ratio index: x/x+yAB+yA+yB

  • 'hw' for Half-weight index: x/x+yAB+1/2(yA+yB)

  • 'sr' for Square root index:x/sqr((x+yAB+yA)(x+yAB+yB))

Details

This process evaluates network metrics uncertainty by performing a boostrap with replacement on the data frame of associations and recomputing the network metric of interest.

Value

3 elements:

Author(s)

Sebastian Sosa

References

Lusseau, D., Whitehead, H., & Gero, S. (2009). Incorporating uncertainty into the study of animal social networks. arXiv preprint arXiv:0903.1519.

Examples

test <- sampling.uncertainty(df = sim.focal.directed, nboot = 100,
                             actor = "actor", receiver = "receiver", 
                             metric = "met.strength")

# objects returned by the function
test$metrics
test$summary
test$plot

# Example with metric extra arguments
sampling.uncertainty(df = sim.focal.directed, nboot = 100,
                     actor = "actor", receiver = "receiver", 
                     metric = "met.affinity", binary = FALSE)
sampling.uncertainty(df = sim.focal.directed, nboot = 100, 
                     actor = "actor", receiver = "receiver", 
                     metric = "met.affinity", binary = TRUE)

# Example with individual associations
sampling.uncertainty(df = sim.grp, nboot = 100, assoc.indices = TRUE, 
                     scan = c("day", "location", "time"), id = "ID")

[Package ANTs version 0.0.16 Index]