met.assortativity {ANTs} | R Documentation |
Calculates the binary or weighted version of vertices Newman's assortativity for categorical or continuous attributes.
met.assortativity(
M,
attr,
se = FALSE,
weighted = TRUE,
df = NULL,
perm.nl = TRUE,
nperm = NULL
)
M |
a square adjacency matrix, or a list of square adjacency matrices, or an output of ANT functions stat.ds.grp, stat.df.focal, stat.net.lk. |
attr |
a factor vector of attributes for categorical assortativity. a numeric vector of attributes for continuous assortativity. |
se |
a boolean, if TRUE it computes the assortativity standard error. |
weighted |
a boolean, if TRUE it computes the weighted assortativity version of the network. |
df |
a data frame of same length as the input matrix or a list of data frames if argument M is a list of matrices or an output of ANT functions stat.ds.grp, stat.df.focal, stat.net.lk. |
perm.nl |
a boolean, if TRUE it permutes argument attr. |
nperm |
an integer indicating the number of permutations wanted. |
Assortativity allows the study of homophily (preferential interaction between nodes with similar attributes) and heterophily (the preferential interaction between nodes with different attributes). Attributes can be individual characteristics such as sex or age, or individual node metrics such as the met.degree.
a double representing the assortativity index of the network if argument M is a square matrix.
A list of doubles if argument M is a list of matrices and if argument df is NULL. Each double representing the assortativity index of the corresponding matrix of the list.
A list of arguments df with a new column of network assortativity if argumentdf is not NULL and if argument M is a list of matrices. The name of the column is adapted according to arguments values weighted and attr.
A list of arguments df with a new column of network assortativity if argument df is not NULL, if argument M is an output from ANT functions stat.ds.grp, stat.df.focal, stat.net.lk for multiple matrices permutations, and if argument df is a list of data frames of same length as argument M.
Sebastian Sosa, Ivan Puga-Gonzalez
Newman, M. E. (2003). Mixing patterns in networks. Physical Review E, 67(2), 026126.
Farine, D. R. (2014). Measuring phenotypic assortment in animal social networks: weighted associations are more robust than binary edges. Animal Behaviour, 89, 141-153.
Sosa, S. (2018). Social Network Analysis, in: Encyclopedia of Animal Cognition and Behavior. Springer.