assoc.gfi {ANTs}  R Documentation 
Computes generalized affiliation indices based on a matrix of interactions or associations and a confounding factor.
assoc.gfi(M1, M2, fr = TRUE, sym = FALSE, erase.diag = TRUE, index = "sri")
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:

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.
a square adjacency matrix representing the generalized affiliation index between individuals.
Sebastian Sosa, Ivan PugaGonzalez.
Whitehead, H., & James, R. (2015). Generalized affiliation indices extract affiliations from social network data. Methods in Ecology and Evolution, 6(7), 836844.
assoc.gfi(sim.gbi,sim.gbi.att, fr = FALSE)