Abstract
Network theory might be the most interdisciplinary framework to date (e.g., Barabási, 2011; Borgatti, Mehra, Brass, & Labianca, 2009; Wasserman & Faust, 1994; Watts & Strogatz, 1998). In the past decade, network analysis has become increasingly important in psychology, where it was introduced as a psychometric framework for the representation of clinical and cognitive psychological constructs (e.g., Borsboom, 2008; Cramer, Waldorp, van der Maas, & Borsboom, 2010; Boschloo, van Borkulo, Borsboom, & Schoevers, 2016; McNally et al., 2015; van Borkulo, Boschloo, Borsboom, Penninx, & Schoevers, 2015; van de Leemput et al., 2014; van der Maas et al., 2006). More recently, network modeling has also been introduced into social psychology in the form of the Causal Attitude Network (CAN) model, which conceptualizes attitudes as networks of causally interacting evaluative reactions (i.e., beliefs, feelings, and behaviors toward an attitude object; Dalege et al., 2016).
The CAN model provides a promising theoretical framework for research on attitudes and other related social psychological core constructs, such as self-concept, prejudice, and interpersonal attraction. The generality of the data-analytic framework and simulation techniques that the CAN model uses, invites the application of the model to many different attitude objects. The model may be thus useful to researchers with various substantive interests, and here, we provide a brief tutorial on how to apply network theory to attitudes. While we focus on attitude networks, the techniques discussed here can easily be transferred to related constructs.
The outline of this article is as follows. First, we briefly discuss what a network is. We then illustrate network estimation from data on attitudes and calculation of standard network measures. Finally, we show how one can use simulations to investigate consequences of manipulating structural properties of an estimated network. The tutorial provides code in the programming language R (R Core Team, 2013), and we assume basic familiarity with R. Readers, who are not familiar with R, are referred to Torfs and Bauer (2014) for an excellent introduction to R.
What is a Network?
A network (called a graph in the mathematical literature) is an abstract representation of a system of entities or variables (i.e., nodes) that have some form of connection with each other (i.e., edges). Nodes can represent any entity or variable, like people, brain regions, or evaluative reactions, and edges can represent any form of connection, like friendship, associations in blood flow, or direct causal connections. Figure 1 shows an example of a simple network. Networks can be unweighted (i.e., edges are either present or absent) or weighted (i.e., edges can also differ in magnitude), and networks can be directed (i.e., edges indicate the direction of the connection) or undirected (i.e., edges show no direction). Here we focus on weighted undirected networks because the techniques for estimating directed networks from correlational data require assumptions that are often not tenable in psychological data (e.g., there are no reciprocal influences between variables; Costantini et al., 2014). Excellent and thorough introductions to network theory are provided in Kolaczyk (2009) and Newman (2010).

Example of a simple undirected and unweighted network with 10 nodes (represented by circles) and 17 edges (represented by lines).
From a network perspective, attitudes are systems of causally interacting evaluative reactions that strive for a coherent representation of the attitude object (Dalege et al., 2016). Based on this basic idea, Dalege et al. (2016) developed the CAN model that links research on attitudes to network theory. Important tenets of the CAN model are that attitude networks show a high degree of clustering, with similar evaluative reactions exerting stronger influence on each other than dissimilar evaluative reactions (e.g., judging a person as honest exerts a stronger influence on judging this person as caring and vice versa than judging this person as intelligent) and that strong attitudes correspond to highly connected attitude networks. The CAN model further assumes that the dynamics of attitude networks can be captured by the Ising (1925) model, which originated from statistical physics. Here we use this assumption to simulate attitude networks based on the CAN model.
Network Analysis
In this section, we show how networks can be estimated from responses to attitude items and how one can calculate common network measures on these estimated networks. We focus on binary data, as the simulation based on the estimated networks that we discuss later is based on a model of binary variables. For estimating networks from continuous data or from data involving different types of variables, the interested reader is referred to Epskamp (2016) and Haslbeck and Waldorp (2016), respectively, and to the Supplemental Materials for examples. For the illustration of the techniques, we use the open-access data from the American National Election Study (ANES) of 2012 (available at www.electionstudies.org) on evaluative reactions toward Barack Obama (see Table 1 for an overview of the evaluative reactions). In the ANES of 2012, 5,914 individuals, representative of the adult U.S. American population, participated.
List of Items Tapping Evaluative Reactions and Their Abbreviations.
Estimation of Attitude Networks
For the estimation of attitude networks, we use the eLasso procedure (van Borkulo et al., 2014). The eLasso procedure regresses each variable on all other variables in turn, and each regression function is subjected to regularization to reduce the size of the statistical problem of regressing a variable on a large number of variables and cope with the problem of multicollinearity in a data set involving a large number of variables (see Friedman, Hastie, & Tibshirani, 2008; Tibshirani, 1996). The best-fitting regression function is selected using the extended Bayesian information criterion as described in Foygel and Drton (2010). The independent variables included in the selected regression function define the nodes that the dependent variable is connected to by edges, which are weighted by the regression parameters.
If the observed data are indeed realizations of a (sparse) network structure, this technique provides an accurate estimation of this network (van Borkulo et al., 2014). In this case, the resulting network can also be regarded as a
If one does not want to make the assumption that a causal network underlies the data, a network may still be highly useful, because the edges represent how well the connected variables predict each other if all other observed variables are being held constant. Thus, networks can be used to gain insight into the causal structure of the data, but also to merely describe the pattern of predictive relations in a dataset, or to represent the correlation structure of the data (Epskamp et al., 2012). In some instances, one might be willing to make the assumption that some of the variables measured form a causal system, while other variables might be worth controlling for without making the assumption that they form part of the causal system (i.e., covariates). We included a description in the Supplemental Material how to deal with covariates in network estimation.
Simulation studies have shown that for binary data, sample sizes of 500 are generally sufficient to estimate networks of low and moderate size (i.e., networks consisting of 10–30 nodes) and that for large networks (i.e., networks consisting of 100 nodes), a sample size of 1,000 is needed (van Borkulo et al., 2014). Regarding networks based on continuous data, sample sizes of 250 are generally sufficient for networks of moderate size (e.g., 25 nodes; Epskamp, 2016).
To estimate a network on the responses to the attitude items, which are stored in the data frame
The object
To plot the network, we can use the function

Network of the attitude toward Barack Obama. Nodes represent evaluative reactions and edges represent connections between evaluative reactions, with the edge width and color density corresponding to the strength of the connections. Green (red) edges represent positive (negative) connections. Colors of the nodes correspond to detected communities in the network. See Table 1 for the abbreviations of the nodes. See the online article for the color version of this figure.
The first argument in the function specifies the weight adjacency matrix to plot. The
Community Detection
Looking at the network shown in Figure 2, one can immediately recognize that nodes differ in their interconnectedness. To formalize this impression, we can use an algorithm that detects communities (or clusters) within the network. We use the walktrap algorithm (Pons & Latapy, 2005), as this algorithm performs well on psychological networks (Gates, Henry, Steinley, & Fair, 2016; Golino & Epskamp, 2016). An advantage of this algorithm compared to factor analyses is that it can detect dimensions of variables very well even when the different dimensions are highly correlated (Golino & Epskamp, 2016). To run the walktrap algorithm on the Obama network, we can use the function
This command creates the
This function runs the walktrap algorithm on the Obama network and saves the results to the object
To plot the network with the nodes being colored according to their community membership, we can use the following command, which creates Figure 2:
The
The interpretation of the results of the community detection algorithm is straightforward: The red nodes represent negative feelings toward Barack Obama; the green nodes represent positive feelings toward Obama; the light blue nodes represent judgments pertaining mainly to interpersonal warmth (with judging Obama as a good leader also belonging to this community); and the purple nodes represent judgments pertaining to Obama’s competence. The community structure of the Obama network is also in line with the postulate of the CAN model that similar evaluative reactions are likely to cluster (Dalege et al., 2016).
Node Centrality
While community detection can be used to inspect the global structure of the network, centrality of nodes can be used to inspect the structural importance of the different nodes. Centrality of nodes can, for example, be used to infer which evaluative reactions most likely influence decision-making (Dalege, Borsboom, van Harreveld, Waldorp, & van der Maas, 2017) and which evaluative reactions would be the most effective targets for persuasion attempts (see section on network simulation). The probably most popular measures of centrality are degree (called strength in weighted networks), closeness, and betweenness (Barrat, Barthélemy, Pastor-Satorras, & Vespignani, 2004; Freeman, 1978; Opsahl, Agneessens, & Skovretz, 2010). The most straightforward of these indices is strength, as it is the sum of the absolute edge values connected to a given node and therefore represents the direct influence a given node has on the network.
Closeness and betweenness both depend on the concept of shortest path lengths. The shortest path length between two given nodes refers to the shortest distance between these two nodes based on the edges that directly or indirectly connect these two nodes. Dijkstra’s algorithm is used to find shortest path lengths in weighted networks (Brandes, 2001; Dijkstra, 1959; Newman, 2001). Based on this algorithm, shortest path lengths represent the inverse of edge weights that have to be “travelled” on the shortest path (see the Supplemental Material for an illustration of shortest path lengths). Closeness sums the shortest path lengths between a given node and all other nodes in the network and takes the inverse of the resulting value. Therefore, closeness represents how likely it is that information from a given node “travels” through the whole network either directly or indirectly. Betweenness represents how strongly a given node can disrupt information flow in the network, as betweenness calculates the number of shortest paths a given node lies on.
To calculate the different centrality estimates for the Obama network, we can use the function
The first argument in these functions specifies the network for which we want to calculate the centrality indices, and the

Centrality plot of the Obama network. Left (middle) [right] panel shows the betweenness (closeness) [strength] estimates for each node of the Obama network. See Table 1 for the abbreviations of the nodes.
Network Connectivity
While centrality of nodes provides information on how change in a given node would affect the rest of the network, network connectivity provides general information on the dynamics of the network, as network connectivity and dynamics are closely connected (e.g., Kolaczyk, 2009; Manrubia & Mikhailov, 1999; Scheffer et al., 2012; Watts, 2002).
A common index of network connectivity is the average shortest path length (
The object
Comparison of Networks
While it can be informative to study one attitude network, in many instances we want to compare networks of different attitudes. To do this, we can use the recently developed Network Comparison Test (NCT; van Borkulo, Epskamp, & Millner, 2016). The NCT utilizes permutations (i.e., rearranging of samples) to test whether two networks are invariant with respect to global strength (i.e., the sum of all edge weights), network structure, and specific edge values. We illustrate the use of the NCT by comparing the network of the attitude toward Barack Obama to the network of the attitude toward Mitt Romney. To do so, we created two matched data frames on the evaluative reactions toward Barack Obama (
The first two arguments specify the data frames, we want to use to compare networks, the
The NCT indicated that the global strengths of the networks did not differ significantly but that the structures of the networks and some specific edges differed significantly. The difference in global strength was 1.12,

Edges that differ significantly between the Obama and the Romney network. Red (green) edges indicate edges that had a higher value in the Obama (Romney) network. Values indicate the difference between the edges in the Obama network and the Romney network. See the online article for the color version of this figure.
Network Simulation
While
To model dynamics of attitude networks, we make use of the Ising (1925) model, which represents an idealized model of probabilities that nodes in the network will be “on” or “off” (e.g., whether evaluative reactions will be endorsed or not). The Ising model consists of three classes of parameters. The first class represents continuous edge weights between nodes in the network that can be positive, negative, or 0. Positive (negative) edge weights make it more likely that the connected nodes assume the same (different) state and the higher the magnitude of the weights, the more likely it is that nodes assume the same (different) state. The second class represents continuous thresholds of nodes that also can be positive, negative, or 0. A positive (negative) threshold of a given node indicates that the node has the disposition to be “on” (“off”) and the higher the magnitude, the stronger the disposition of the given node. Finally, the Ising model utilizes a temperature parameter that scales the entropy of the network model (Epskamp, Maris, Waldorp, & Borsboom, in press; Wainwright & Jordan, 2008). High (low) temperature makes the network behave more (less) randomly by decreasing (increasing) the influence of both edge weights and thresholds. In attitude networks, temperature can be seen as formal conceptualization of consistency pressures (Dalege, Borsboom, van Harreveld, Waldorp, et al., 2017).
Network Connectivity
To simulate dynamics of estimated networks, we can use the function
To illustrate the consequences of varying network connectivity, we set all thresholds to 0 (implying all nodes have no disposition to be in a given state) and we manipulate the temperature of the network model. To simulate cases based on the Obama network with three different temperatures, we can use the following commands:
The first argument of the

Networks with different temperatures based on the Obama network and their associated distributions of sum scores.
Node Centrality
To illustrate the consequences of influencing nodes with different centrality, we show how to simulate targeting nodes differing in strength. As can be seen in Figure 3, the node with the highest (lowest) strength is the node Hns (Ang). Let us assume we want individuals to have a more positive attitude toward Obama and we focus on individuals who have a moderately negative attitude toward Obama. We can simulate a group of individuals with moderately negative attitudes by setting all thresholds of the evaluative reactions to a moderately negative value (e.g., −.1):
The mean sum score of this sample is −5.63 with a standard deviation (
Important to note here is that the persuasion attempt in both situations was equally strong. Yet the persuasion attempts significantly differed in their effectiveness reflected by the sum scores,
Testing Predictions From Simulations
In a recent study, Dalege, Borsboom, van Harreveld, Waldorp, et al. (2017) used the Ising model to derive predictions regarding network structure and prediction of behavior. Simulations showed that highly connected attitude networks are more predictive of behavior than weakly connected attitude networks. To test this prediction, Dalege, Borsboom, van Harreveld, Waldorp, et al. (2017) estimated attitude networks based on nonbehavioral evaluative reactions toward presidential candidates (like the network discussed in the current article) and correlated the network connectivity with how well the attitude (based on the sum score of the evaluative reactions) predicted the voting decision. They found an almost perfect correlation between network connectivity and predictability of voting decisions, supporting the hypothesis derived from simulations on the Ising model. This study provides an illustration of how network simulation can aid hypothesis generation and also how to devise research on behavior prediction in the attitude network framework.
Discussion
In this article, we provided a brief tutorial on estimating, analyzing, and simulating attitude networks. The combination of network analysis and simulation illustrates that network theory provides a framework to both test and develop formalized hypotheses on attitudes. It is our view that this makes network theory a unique framework, as it bridges the current gap between social psychological theorizing and psychometric theory.
Network analysis is a novel and still developing field in psychology. An important issue that needs to be tackled in the future is to devise strategies to make sure that all relevant nodes in a (attitude) network are measured. While currently the focus on questionnaire construction lies on selecting items that are highly interrelated (resulting in high reliability of the questionnaire), the network perspective on psychological constructs implies that the most important issue in questionnaire construction is to select items that provide a comprehensive picture of the measured construct. Such items might not be highly interrelated, which implies that validity and reliability of a questionnaire might in some instances be incompatible (Dalege et al., 2016).
With this tutorial, we aimed to provide an accessible introduction to network analysis and simulation on attitudes. While we have focused on attitudes in this tutorial, the techniques outlined here can also be applied to several other core social psychological constructs such as self-concept, prejudice, and interpersonal attraction. It is therefore our view that network theory provides a promising framework to move our field forward.
Footnotes
Declaration of Conflicting Interests
Funding
Supplemental Material
References
Supplementary Material
Please find the following supplemental material available below.
For Open Access articles published under a Creative Commons License, all supplemental material carries the same license as the article it is associated with.
For non-Open Access articles published, all supplemental material carries a non-exclusive license, and permission requests for re-use of supplemental material or any part of supplemental material shall be sent directly to the copyright owner as specified in the copyright notice associated with the article.
