gai: Generalised Affiliation Indices

View source: R/gais.R

gaiR Documentation

Generalised Affiliation Indices

Description

Caluclates a social network based on generalised affiliation indices (GAI). When non-social factors influence the observed interactions or associations, using GAIs can help to remove the effect of these factors, revealing underlying social affinities. This is done by fitting a generalised linear model, with the observed network as a response and non-social confounds as predictors, and using the residuals as a measure of affiliation.

Usage

gai(
  formula,
  family = "gaussian",
  weights = NULL,
  offset = NULL,
  type = c("deviance", "pearson", "response")
)

Arguments

formula

A glm style formula giving the response and predictor matrices.

family

Error family for fitting, either a glm family or one of "betar" or "negbin".

weights

Weights used for fitting, see Details.

offset

Offset used in fitting, see Details.

type

Type of residuals to calculate

Details

For association data, family = "binomial" is the most appropriate. In this case, the observed association indices should be the response matrix, and the dyadic denominators should be passed to the weights argument. For interaction rates, one of "poisson", "quasipoisson", or "negbin" should be passed to family, with log(sampling effort) passed as an offset. For completeness, beta regression is also included, using betareg::betareg(). Generally, its a good idea to test whether the predictors are important prior to calculating GAIs. This can be done using GLMQAP.

Value

A square matrix containing the generalised affiliation indices.


MNWeiss/aninet documentation built on Jan. 31, 2023, 3:55 a.m.