Dyadic Lagged Association Rate

Description

Calculate lagged association rate g(tau) from Whitehead (2008) for each dyad individually

Usage

1
2
3
4
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)

Arguments

group_by_individual

a K x N matrix of K groups (observations, gathering events, etc.) and N individuals (all individuals that are present in at least one group)

times

K vector of times defining the middle of each group/event

timejump

step length for tau

output_style

either 1 or 2, see details

min_time

minimum/starting value of tau

max_time

maximum/ending value of tau

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)

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.

Value

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.

Author(s)

Damien R. Farine

References

Expanded from Whitehead (2008)

Examples

1
2
3
4
5
6
7
8
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..)