{'fraction_non_alphanumeric': 0.014145810663764961, 'fraction_numerical': 0.0, 'mean_word_length': 5.785977859778598, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Generalized affiliation indices extract affiliations from social network data

In the analysis of animal social networks, a common challenge has been distinguishing affiliations – active preferences of pairs of individuals to interact or associate with one another – from other, structural, causes of association or interaction. Such structural factors can include patterns of use of the habitat in time and space, gregariousness and differential association rates among age/sex classes. In an approach with similarities to the multiple regression quadratic assignment procedures test, we suggest calculating generalized affiliation indices as the residuals from a regression of the measures of association or interaction on structural predictor variables, such as gregariousness and spatiotemporal overlap. If the original data are association indices or counts of interactions, then generalized linear models with binomial or Poisson error structures, respectively, can be used in place of linear regression. Anscombe or deviance residuals can be used to assess the significance of particular affiliation indices. Generalized affiliation indices can be used as the weights of links in a social network representation. They can then be portrayed in network diagrams or cluster diagrams and used to calculate network statistics, to delineate communities by maximizing modularity and to test for overall affiliation using data‐stream permutation tests. We evaluate the effectiveness of such generalized affiliation indices using simulated and real association data, finding that the method removes much of the effect of structural variables on association patterns, revealing real affiliations. While the approach is very promising, it is limited by the extent to which the input predictor variables represent important structural factors.