Social Networks

15  Introduction to Matrices

  • Welcome
  • Introduction to Networks
    • 1  What Are Networks?
    • 2  What is A Social Network?
  • Graph Theory: The Basics
    • 3  Introduction to Graphs
    • 4  Graphs and their Subgraphs
    • 5  Types of Ties in Social Networks
    • 6  Types of Ties and Their Graphs
    • 7  Basic Graph Metrics
    • 8  Nodes and their Neighborhoods
    • 9  Nodes and their Degrees
    • 10  Degree-Based Graph Metrics
    • 11  Indirect Connections
    • 12  Directed Indirect Connections
    • 13  Graph Connectivity
    • 14  Tree Graphs
  • Matrices: The Basics
    • 15  Introduction to Matrices
    • 16  The Adjacency Matrix
    • 17  Matrix Operations: Row and Column Sums
    • 18  Basic Matrix Operations
    • 19  Matrix Multiplication
  • Motifs
    • 20  Triads
  • Centrality
    • 21  Centralities based on Degree
    • 22  Centralities based on the Geodesic Distance
    • 23  Centralities based on Shortest Paths
    • 24  The “Big Three” Centrality Metrics
    • 25  Getting Centrality from Others
  • Two-Mode Networks
    • 26  Affiliation Networks
  • Ego Networks
    • 27  Ego Network Metrics
    • 28  Collecting Ego-Network Data
    • 29  Theories of Ego Network Homogeneity
  • Subgroups and Blocks
    • 30  Clique Analysis
    • 31  Cohesive Subsets
    • 32  Equivalence and Similarity
    • 33  Local Node Similarities
  • Network Theory
    • 34  Dunbar’s Theory of Social Circles
    • 35  The Strength of Weak Ties
    • 36  Structural Holes and Brokerage
    • 37  Simmelian Tie Theory
    • 38  Dyadic Balance
    • 39  Triadic Balance
    • 40  Structural Balance
    • 41  Theories of Valenced Interactions
    • 42  Dominance Hierarchies
    • 43  The Diffusion of Innovations
    • 44  The Small World

Table of contents

  • 15.1 Matrices
    • 15.1.1 Relationship Matrices
    • 15.1.2 Diagonal versus off-diagonal cells
  • References

View source

15  Introduction to Matrices

The lessons so far have focused on exploring the various ways social networks can be represented as graphs and on computing metrics directly from them. This lesson will focus on using a matrix as a second way of representing networks. More accurately, as noted in Chapter 1, matrices are a useful way to represent graphs quantitatively, which in their turn, represent networks (flashback to the three-step network shuffle).

Networks represented as graphs feel quite intuitive to us. Actors are points (nodes), and links or interactions between actors are lines (edges). We feel we can get a good sense of the network by looking at the pictorial network diagram, with points representing actors and lines representing pairwise links between them.

Networks represented as a matrix, however, are a bit more abstract. They are far more mathematically useful, however. With many tens, hundreds, thousands, or millions of nodes and edges, creating a graph with such data only results in what network analysts call a “hairball.” Nothing can be understood from such a picture.

15.1 Matrices

Thus, representing social networks as a matrix provides us with greater analytic leverage. This was a brilliant idea that first occurred to Elaine Forsyth and Leo Katz in the mid 1940s (Forsyth and Katz 1946). When we represent the network as a matrix, we can efficiently compute features of the network that we could not estimate by “eyeballing.”

What is a matrix?1 A matrix is, quite simply, a set of attributes that represent the values of a particular case. Breaking that explanation down, we can imagine a matrix as in Table 15.1. This common matrix, which we will refer to as an attribute-value matrix, a toy example of which is presented in Table 15.1, resembles a spreadsheet. Well, that is because a spreadsheet is a matrix!

Table 15.1: Example of a general matrix.
Attribute 1 Attribute 2 Attribute 3
Case 1 Value 1 Value 4 Value 7
Case 2 Value 2 Value 5 Value 8
Case 3 Value 3 Value 6 Value 9
Case 4 Value 10 Value 11 Value 12
Case 5 Value 13 Value 14 Value 15

The most important feature of a matrix is thus its organization into rows and columns. The number of rows and the number of columns define the dimensions of the matrix (just as the length and width of your apartment define its dimensions in space). So when we say that a matrix is 5 \(\times\) 3, we mean it has five rows and three columns. When referring to the dimensions of a matrix, the rows always come first, and the columns always come second. So the more general way to say it is that the dimensions of a matrix are R \(\times\) C, where R is the number of rows and C is the number of columns.

The intersection of a particular row (say row 2 in Table 15.1 and a particular column (say column 3 Table 15.1 defines a cell in the matrix. So when referring to a particular value in Table 15.1 we would speak of the \(ij^{th}\) cell in the matrix (or \(c_{ij}\)), where c is a general stand-in for the value of a given cell, i a general stand-in for a given row, and j is a generic stand-in for a given column. We refer to i as the matrix row index and j as the matrix column index.

Typically, we give matrices names using boldfaced capital letters, so if we call the matrix shown in Table 15.1, matrix B, then we can refer to a specific cell in the matrix using the notation b\(_{ij}\) (note the lowercase), which says “the cell corresponding to row i and column j of the B matrix.”

Thus, in Table 15.1, cell b\(_{32}\) refers to the intersection between row 3 (representing case 3) and column 2 (representing attribute 2), where we can find value 6. For instance, let’s say cases are people, and attributes are the information we collected about each person (e.g., by surveying them), such as their age, gender identity, and racial identification, and so forth. Thus, if attribute 2 in Table 15.1 was age, and case 3 was a person, then value 6 would record that person’s age (e.g., 54 years old).

15.1.1 Relationship Matrices

We do not generally use attribute-value matrices to represent networks. Instead, we typically use a particular type of matrix called a relationship matrix. A relationship matrix is when, instead of asking what value an attribute has, we ask about the value of describing how a case relates to other cases. If attribute-value matrices relate cases to attributes, then relationship matrices relate cases to one another (which is precisely the idea behind a “network”).

To do that, we put the same list of cases on both the rows and columns of the matrix. Thus, we create a matrix with the organizational properties shown in Table 15.2.

Table 15.2: Example of a relationship matrix.
Case 1 Case 2 Case 3
Case 1 Value 1 Value 2 Value 3
Case 2 Value 4 Value 5 Value 6
Case 3 Value 7 Value 8 Value 9

A relationship matrix thus captures exactly that, the relationship between two cases as shown in Table 15.2. So each cell, as the intersection of two cases (the row case and column case), gives us the value of the relationship between the cases. This value could be “friends” (if the two people are friends) or “not friends” (if they are not friends). The value could be the strength of the relationship. For instance, each cell could contain the number of times a given case (e.g., a person) messaged another case.

Relationship matrices are different from attribute value matrices in that the latter are typically rectangular matrices. In a rectangular matrix, the number of rows (e.g., people) can be different from the number of columns (e.g., attributes). For instance, the attribute-value matrix used by social scientists who collect survey data on people is rectangular, with many more cases (rows) than attributes (columns). Some networks, like two-mode networks represented as bipartite graphs, are best studied using rectangular matrices.

Relationship matrices have some unique attributes. For instance, all relationship matrices are square matrices. A square matrix is one that has the same number of rows and columns: \(R = C\). So the relationship matrix shown in Table 15.2 is \(3 \times 3\). A square matrix with n rows (and thus the same number of columns) is said to be a matrix of order n.

15.1.2 Diagonal versus off-diagonal cells

In a relationship matrix, we need to distinguish between two types of cells. First, there are the cells that lie along the main diagonal, an imaginary line that runs from the upper-left corner to the lower-right corner; these are called diagonal cells, whose values are shown in italics in Table 15.2. So if we name the matrix in Table 15.2 matrix A, then we can see that any cell a\(_{ij}\) in which i = j falls along the main diagonal; these are Values 1, 5, and 9 Table 15.2. Every other cell in which i \(\neq\) j, is an off-diagonal cell (The mathematical symbol for “does not equal” is \(\neq\)).

In reference to the main diagonal, off-diagonal cells are said to be above the main diagonal if the row index for that cell is smaller than the column index (e.g., a\(_{i < j}\)). So in Table 15.2, values 2, 3, and 6, corresponding to cells a\(_{12}\) a\(_{13}\) and a\(_{23}\), respectively, are above the main diagonal. In the same way, cells in which the row index is larger than the column index are said to be below the main diagonal (e.g., a\(_{i > j}\)). So in Table 15.2, values 4, 7, and 8, corresponding to cells a\(_{21}\) a\(_{31}\) and a\(_{32}\), respectively, are below the main diagonal.

Note that in a square matrix, the values above and below the main diagonal have a “triangular” arrangement. Accordingly, we sometimes refer to the upper and lower triangles of a square matrix as the upper and lower triangles.

Note also that if the relationship matrix represents relationships among cases and the cases are people in a social network, then the diagonal cells in the matrix represent the relationships of people with themselves! Now, if you have seen M. Night Shyamalan’s movies about people with split personalities, it is quite possible for people to have a rich set of relationships with themselves. Some of these may even form a social network inside a single head (Martin 2017). But we are not psychiatrists, so we are interested primarily in interpersonal, not intrapersonal relations.

Table 15.3: Example of a relationship matrix with blocked diagonals.
Case 1 Case 2 Case 3
Case 1 – Value 1 Value 2
Case 2 Value 3 – Value 4
Case 3 Value 5 Value 6 –

This means that most of the time, we can ignore the diagonal cells in relationship matrices and rewrite them as in Table 15.3, where values appear only in the off-diagonal cells. So here we can see the relationship between Case 1 and Case 2 is Value 1, and the relationship between Case 2 and Case 1 is Value 3. Wait, would that mean Values 2 and 4 are the same? The answer is maybe. Depends on which type of network tie is being captured, as discussed in the lesson on graph theory. If the tie is symmetric (and thus represented in an undirected graph), then the values will have to be the same. But if the asymmetric (and thus represented in a directed graph), then they don’t have to be.

By convention, in a relationship matrix, we say that the case located in row i sends (a tie) to the case located in column j, so if the relationship matrix was capturing friendship, we might say that i considers j to be a friend (sends the consideration) and so if i is Case 1 (row 1) and j is Case 2 (column 2), that would be Value 1 (e.g., “Are we friends?” Value 1 = Yes/No). But when i is now Case 2 (row 2) and j is Case 1 (column 1), we are now asking if Case 2 considers Case 1 to be a friend (e.g., “Are we friends?” Value 3 = Yes/No). If friendship is considered an asymmetric tie in this case, then that could be true, or it could not be. For instance, Case 2 can rebuff Case 1’s friendship offer.

Note that if the tie we recorded in a relationship matrix is symmetric, we can simplify the presentation even further. The reason is that, as already noted, if a relationship is symmetric, then the value of the tie that i sends to j is necessarily the same as the value of the tie that j sends to i. This means that, in the relationship matrix, the value of cell a\(_{ij}\) has to be the same as the value of the cell a\(_{ji}\) for all rows i and columns j in the matrix. This yields a symmetric relationship matrix, like that shown in Table 15.4.

Table 15.4: Example of a symmetric relationship matrix with blocked diagonals.
Case 1 Case 2 Case 3
Case 1 – Value 1 Value 2
Case 2 Value 1 – Value 3
Case 3 Value 2 Value 3 –

Note that a symmetric relationship matrix is simpler than its asymmetric counterpart, because now we only have to worry about half of the values. So before, in Table 15.3, we had to worry about six distinct relationship values, but now we only have to worry about three. This means that in a symmetric matrix, all the network information we need is contained in either the lower or upper triangle. As we will see, in many applications, we can ignore one of the triangles altogether!

There are many types of relationship and attribute-value matrices, as the basic principles just stated can be varied to capture different underlying facets of relationships. Subsequent lessons will cover various ways to best capture different aspects of networks in matrix form and then manipulate them to produce sociologically meaningful results.

References

Forsyth, Elaine, and Leo Katz. 1946. “A Matrix Approach to the Analysis of Sociometric Data: Preliminary Report.” Sociometry 9 (4): 340–47.
Martin, John Levi. 2017. “The Structure of Node and Edge Generation in a Delusional Social Network.” Journal of Social Structure 18 (1): 1–21.

  1. Note that the answer to this question is simpler than the more profound: “What is the Matrix?” https://www.youtube.com/watch?v=O5b0ZxUWNf0↩︎

14  Tree Graphs
16  The Adjacency Matrix
Copyright 2023, Omar Lizardo & Isaac Jilbert