View source: R/sampling.uncertainty.R
sampling.uncertainty | R Documentation |
Perform a matrix boostrapping approach to estimate the confidence intervals surrounding each pairwise association.
sampling.uncertainty(
df,
nboot,
metric = "met.strength",
assoc.indices = FALSE,
actor = NULL,
receiver = NULL,
scan = NULL,
id = NULL,
index = "sri",
...
)
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: |
... |
additional argument related to the computation of the metric declared.
|
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.
3 elements:
A matrix in which each column represents a node metric variation through bootstrapping, with the first row representing the original metric.
A summary of bootstrap distribution for each node.
A plot of metric variations through bootstrap
Sebastian Sosa
Lusseau, D., Whitehead, H., & Gero, S. (2009). Incorporating uncertainty into the study of animal social networks. arXiv preprint arXiv:0903.1519.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.