LRA {asnipe} | R Documentation |
Calculate lagged association rate g(tau)
from Whitehead (2008) for each dyad individually
LRA(group_by_individual, times, timejump, output_style = 1, min_time = NULL, max_time = NULL, identities = NULL, which_identities = NULL, locations = NULL, which_locations = NULL, start_time = NULL, end_time = NULL, classes = NULL, which_classes = NULL, association_rate = TRUE)
group_by_individual |
a |
times |
K vector of times defining the middle of each group/event |
timejump |
step length for |
output_style |
either 1 or 2, see details |
min_time |
minimum/starting value of |
max_time |
maximum/ending value of |
identities |
N vector of identifiers for each individual (column) in the group by individual matrix |
which_identities |
vector of identities to include in the network (subset of identities) |
locations |
K vector of locations defining the location of each group/event |
which_locations |
vector of locations to include in the network (subset of locations) |
start_time |
element describing the starting time for inclusion in the network (useful for temporal analysis) |
end_time |
element describing the ending time for inclusion in the network (useful for temporal analysis) |
classes |
N vector of types or class of each individual (column) in the group by individual matrix (for subsetting) |
which_classes |
vector of class(es)/type(s) to include in the network (subset of classes) |
association_rate |
calculate lagged rate of association (see details) |
Calculates the dyadic lagged association rate. The lagged rate of association incorporates the number of observations of each individuals as a simple ratio index within each time period, leading to a better estimation of the assocation rate for data where many observations of individuals can be made within a single time period.
If output_style == 1
then a stack of matrices is returned that is N x N x tau
.
If output_style == 2
then a dataframe is returned containing the focal ID, associate, tau
, and lagged association rate.
Damien R. Farine
Expanded from Whitehead (2008)
data("group_by_individual") data("times") data("individuals") ## calculate lagged association rate lagged_rates <- LRA(gbi,times,3600, classes=inds$SPECIES, which_classes="GRETI", output_style=2) ## do something (run a model, plot a surface, etc..)