--- title: "multilayer" output: rmarkdown::html_vignette vignette: > %\VignetteIndexEntry{multilayer} %\VignetteEngine{knitr::rmarkdown} %\VignetteEncoding{UTF-8} --- ```{r, include = FALSE} knitr::opts_chunk$set( collapse = TRUE, comment = "#>" ) ``` ----- ## Installation You can install the development version from [github/anespinosa]((https://github.com/anespinosa/netmem)): ```{r inst, eval=FALSE} # install.packages("devtools") devtools::install_github("anespinosa/netmem") ``` ```{r setup} library(netmem) ``` ----- ### Multilayers *Multilayer networks* is a framework that considers complex patterns of relationships between the same and/or different nodes. However, from a social network and sociological perspective, different types of multilayer structures are often referred to as *multiplex networks* (or *multi-relational*), *multilevel networks*, *network of networks* [Kivelä et al. (2014)](https://doi.org/10.1093/comnet/cnu016), *two-mode networks*, among others. Furthermore, and from a matrix perspective, the 'backbone' of these complex structures are mainly represented through the comfortable combination of different types of matrices. The primary matrix used in social network analysis is the adjacency matrix or sociomatrix and the incidence matrix. ----- ### Two-mode networks There are different ways of referring to incidence matrices. From the social network perspective is often considered as *affiliation network*, which consist of a set of binary relationships between members of two sets of items (i.e., "is a member of" or "is a participant in" or "has") ([Borgatti and Halgin, 2011](https://methods.sagepub.com/book/the-sage-handbook-of-social-network-analysis/n28.xml)). In general, these networks have a bipartite property in which there are two classes such that all ties occur only between classes and never within classes. For example, in this section we will use the classical example of the Southern Woman extracted from the `R` package [classicnets](https://github.com/anespinosa/classicnets): ```{r} A <- matrix( c( 1, 1, 1, 1, 1, 1, 0, 1, 1, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0 ), byrow = TRUE, ncol = 14 ) ``` As a common practice, an incidence matrix is often converted to adjacent matrices. These are given by the matrix product $AA^T$ and $A^TA$, where $A$ is the incidence matrix and matrix $A^T$ is the transpose of $A$. The relationship between these matrices in the context of social networks was explored by [Breiger (1974)](https://doi.org/10.2307/2576011). ```{r} matrix_projection(A) ``` Another concept often used is *bipartite network*, which means that the graph's nodes can be partitioned into two classes. While in some cases, these classes can be different entities (e.g., actors participating in activities or belonging to clubs), this assumption is not always clear. For example, dichotomic attributes of ascribed characteristics also have a bipartite property. An approach that was devised specifically for affiliation data, was provided by [Bonacich (1972)](https://doi.org/10.1080/0022250X.1972.9989806): ```{r} bonacich_norm(A) ``` The difference between *affiliation networks* and *bipartite networks* allowed us to avoid confounding the concept of social proximity (e.g., being part of the same laboratory) with social similarity (e.g., having an ascribed gender) ([Rivera et al., 2010](https://doi.org/10.1146/annurev.soc.34.040507.134743)). In addition, this distinction is important because these mechanisms are often considered competing alternatives to understanding social relationships. *Two-mode networks* is a broader concept that emphasizes the difference between entities of different levels. Therefore, these entities are likewise differentiated as rows and columns in the incidence matrix. Some researchers differentiate between the informational or socio-cognitive dimensions and social networks of concrete relations - or proxies - between agents ([Leydesdorff, 2008](https://doi.org/10.1002/asi.20732)). For example, informational or socio-cognitive networks can be an incidence matrix of actors and survey's items, citation networks or a tweet message. Therefore, the incidence matrix of socio-cognitive networks are often called *occurrence networks*. For example, in scientometric, information is often explored using co-occurrence of overlapping ties: ```{r} minmax_overlap(A, row = TRUE, min = TRUE) minmax_overlap(A, row = FALSE, min = TRUE) co_ocurrence(A, similarity = c("ochiai"), occurrence = TRUE, projection = FALSE) ``` ----- ## Multilevel Networks Connections between individuals are often embedded in complex structures, which shape actors’ expectations, behaviours and outcomes over time. These structures can themselves be interdependent and exist at different levels. Multilevel networks are a means by which we can represent this complex system by using nodes and edges of different types ([Lazega and Snijders, 2016](https://www.springer.com/gp/book/9783319245188), [Knoke et a., 2021](https://www.cambridge.org/core/books/multimodal-political-networks/43EE8C192A1B0DCD65B4D9B9A7842128). For multilevel structures, we tend to collect the data in different matrices representing the variation of ties within and between levels. Often, we describe the connection between actors as an adjacency matrix and the relations between levels through incidence matrices. The comfortable combination of these matrices into a common structure would represent the multilevel network that could be highly complex. ### Example