assoc.gfi: Generalized affiliation index

View source: R/assoc.gfi.R

assoc.gfiR Documentation

Generalized affiliation index

Description

Computes generalized affiliation indices based on a matrix of interactions or associations and a confounding factor.

Usage

assoc.gfi(M1, M2, fr = TRUE, sym = FALSE, erase.diag = TRUE, index = "sri")

Arguments

M1

a square adjacency matrix representing individual interactions or associations. In the latter case, associations must be in the form of a gbi.

M2

a square adjacency matrix representing individual values of confounding factors.

fr

if true, it considers the argument M1 as an adjacency matrix representing interaction frequencies between individuals. Otherwise, it considers the argument M1 as an adjacency matrix representing associations between individuals.

sym

if true, it considers the argument M1 as an adjacency matrix representing symmetric interactions/associations.

erase.diag

if true, it omits the diagonal of the matrix.

index

a string indicating the association index to compute:

  • '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

Generalized affiliation indices allow to control for individual associations by a given confounding factor (such as temporal or spatial overlaps, gregariousness, social unit membership, kinship...). The principle is to perform a Generalized Linear Regression (GLR) on both matrices (one representing individual interactions/associations and the other one representing the confounding factor) and to use GLR residuals as association indices. For an adjacency matrix representing individual interactions, the GLR belongs to the Poisson family. For an adjacency matrix representing individual associations, the GLR belongs to the Binomial family. High positive values suggest strong associations between two individuals and negative values suggest avoidance between two individuals.

Value

a square adjacency matrix representing the generalized affiliation index between individuals.

Author(s)

Sebastian Sosa, Ivan Puga-Gonzalez.

References

Whitehead, H., & James, R. (2015). Generalized affiliation indices extract affiliations from social network data. Methods in Ecology and Evolution, 6(7), 836-844.

Examples

assoc.gfi(sim.gbi,sim.gbi.att, fr = FALSE)

SebastianSosa/ANTs documentation built on Sept. 25, 2023, 11:06 p.m.