Lab 2: QAP, CSS & Structural Equivalence

Re-Analyzing Friend & Advice Networks from Krackhardt (1987)

Student Name Here

2017-10-31

Introduction

This lab will examine how to measure individuals’ perceived structure of social networks (cognitive social structures or CSS) and how to analyze these perceptions, drawing on notions of structural equivalence and quadratic assignment procedure discussed in class.

We will be using the Krackhardt’s Advice and Friendship data sets. 1 This is the data set reported in Krackhardt, D. (1987) “Cognitive Social Structures,” Social Networks, 9: 109—34. Reading that paper before carrying out the analysis is strongly recommended. The 21 respondents are managers in a company.

There are four sections to this lab below: CSS analysis, visualization, structural equivalence, and differences and correlation. We are not looking for an essay response to every question, but you should succinctly convey that you understand how to interpret and make inferences based on the outputs from these analyses.

This assignment is designed to use the sna package in the R statistical programming language.2 See Butts, Carter T., sna: Tools for Social Network Analysis, R package version 2.4.; see also ?? sna for documentation and Butts, Carter T. (2008). “Social Network Analysis with sna.” Journal of Statistical Software, 24(6). You are provided the RData file. krackhardt_css_data.RData

Our visualization for this exercise will be done using ggnet2,3 Moritz Marbach and Francois Briatte, with help from Heike Hoffmann, Pedro Jordano and Ming-Yu Liu; see ?? ggnet2. a visualization package which applies the visualization framework developed in ggplot2, an up-and-coming visualization framework created by RStudio that is well on its way to being recognized as the professional standard in R visualization.4 See ?? ggplot2, and the tidyverse website.

Before You Start:

Because you will not be collecting data in this lab, feel free to knit early and often to see how your responses are being formatted! Please do your best to maintain the formatting provided by this assignment. It makes grading significantly easier when answers are easy to read.

Download all the files for this lab and save them in the same folder. Open the CSS_Lab.R file in RStudio (File > Open). After the R script is loaded in the editor, set the working directory so that R knows where to find the RData file you are going to load (Session > Set Working Directory > To Source File Location).

The data file krackhardt_css_data.RData consists of two CSS data objects:

● advice_nets: respondents’ perceptions about their own and others’ advice ties within the organization

● friendship_nets: respondents’ perceptions about their own and others’ friendship ties within the organization

I. CSS Analysis and Extraction (20 pts)

We’ll begin by viewing an example response matrix. Notice that this is a binary sociomatrix.

Advice Matrix Table

V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21
1 0 1 1 1 1 0 0 1 0 1 1 0 1 0 0 1 0 1 1 0 0
2 1 0 1 1 1 0 1 1 0 1 0 0 1 1 0 1 1 1 1 0 1
3 0 1 0 0 1 0 1 1 0 1 0 0 0 1 0 1 0 1 1 0 1
4 1 1 0 0 0 1 1 1 0 0 0 0 0 0 0 0 0 1 0 0 1
5 1 1 0 0 0 1 1 1 0 1 1 0 1 1 0 1 1 1 1 1 1
6 0 1 0 0 0 0 1 0 0 0 0 1 0 1 0 0 1 0 0 0 1
7 0 1 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 1 0 0 1
8 1 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 0 1 0 0 1
9 0 1 0 0 1 0 1 0 0 0 0 0 1 1 1 0 1 1 1 1 0
10 0 1 0 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 1 0
11 1 1 1 0 1 0 1 1 0 0 0 0 1 1 1 0 0 1 1 0 0
12 0 1 0 0 0 1 1 1 0 0 0 0 0 1 0 0 0 1 0 0 1
13 1 1 0 0 1 0 1 1 1 1 1 0 0 1 1 0 0 1 0 0 1
14 0 1 0 0 0 1 1 0 0 0 1 0 0 0 0 0 0 1 0 0 1
15 0 1 0 0 1 0 1 0 0 0 1 0 0 1 0 0 0 1 1 0 0
16 1 1 0 1 0 0 0 1 0 1 0 0 0 0 0 0 0 1 0 0 0
17 1 1 1 0 1 1 1 1 0 0 0 1 1 1 1 0 0 0 1 0 1
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 1 1 1 0 1 0 1 1 0 1 1 0 1 1 1 1 1 1 0 1 1
20 0 1 0 0 0 1 1 1 0 1 1 0 1 1 1 1 0 1 1 0 0
21 0 1 0 0 0 1 1 1 0 0 0 1 0 1 0 0 1 1 0 0 0

The advice_nets and friendship_nets objects are R lists that each contain 21 networks, one for each respondent’s perception about what the advice and friendship networks look like. Let’s view the characteristics of a sample friendship network. We’ll visualize the ties within that network in the next Part.

Individual Respondent Network

V1 V2 V3 V4 V5 V6 V7 V8 V9 V10 V11 V12 V13 V14 V15 V16 V17 V18 V19 V20 V21
V1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0
V2 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 1 0 0 1
V3 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
V4 1 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0
V5 0 0 0 0 0 0 0 0 1 0 0 0 1 0 1 0 0 0 1 0 0
V6 0 0 0 0 0 0 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0
V7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V8 1 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0
V9 0 0 1 0 1 1 0 0 0 0 0 0 1 0 0 0 0 0 1 0 0
V10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V11 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
V12 1 0 0 1 0 1 0 1 0 0 0 0 0 0 0 0 1 0 0 0 0
V13 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0
V14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V15 0 0 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0
V16 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V17 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 1
V18 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
V19 0 0 0 1 1 0 0 0 0 0 0 0 1 0 1 0 0 0 0 0 0
V20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
V21 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0 0 0

Next, we’ll aggregate the individual observations of each actor within the network into a single network. There are multiple ways to do so. Each presents a different manner of combining the 21 responses into a single aggregated network. These include four locally aggregated structures (LAS) and one consensus aggregated structure. First, we calculate the four LAS: row, column, intersection, and union.

Friendship, Column.

Friendship, Column Matrix

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0
2 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
4 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1
6 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
8 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 0 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
12 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 1 0
16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 0 0 0 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
20 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Friendship, Row.

Friendship, Row

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0
2 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
6 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 1 1 0 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 1 1 1 0 1 1 0 0 1 0 0 0 1 1 0 1 0 0 1 0 1
12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 0 0
16 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 0 0 1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0

Analysis

Conceptually, how do these two networks differ from one another? What are the pros and cons of using this method? The network are very different by LAS from column method and row method. For LAS from column method, the network is sparse, there is really no node has high centrality of degree. While for LAS from row method, node 11 and has high outdegree, he/she percerives to be friends with other people, while other people doesn’t think so. Pros: Row method represent one’s own idea with network, it represents one’s true feeling about network. This method is subjective and could be potential more accurate if people’s feeling about their network are correct. Cons: However, people might not answer survey question honestly, this could cause inaccurancy for network data.

Friendship, Intersection.

Friendship Intersection

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 1 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
16 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Analysis

What information does the ‘intersection’ method capture? What are the pros and cons of using this method? The edge only exists if two people both agree they are connected. This represents the will of people’s feeling about connection. Pros: the imformation about if two people connect(like “1” in this matrix) is highly correct. Cons: If one people mentioned the friend relationship with another people but another people didn’t mention about it, then this edge will not be counted. This cause problem. This concept is too strict. Sometimes people may feel difficult of determining who are truly friends or just working partners. Also some person didn’t confirm the friend relationship is because they are too cool to admit it. Thus intersection method could potentially reduce number of edges.

Friendship, Union.

Friendship Union

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 0 1 0 1 0 0 0 1 0 0 0 1 0 0 0 1 0 0 0 0 0
2 1 0 0 0 0 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 0
4 1 1 0 0 0 0 0 1 0 0 0 1 1 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 1 0 0 1 0 0 0 0 1 0 1
6 0 1 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1
7 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1
8 1 1 0 1 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0
9 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
10 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 1 1 1 0 1 1 0 1 1 0 0 0 1 1 0 1 0 0 1 0 1
12 1 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 1 1 0
16 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1
18 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 0 0 1 0 1 0 0 0 0 0 0 0 0 1 1 0 0 0 0 0 0
20 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 0 1 0 0 1 1 1 0 0 0 0 1 0 1 0 0 1 0 0 0 0

Anaylsis

What kind of information does the union method capture? What are the pros and cons of using this method? The union method will show that number of friends in network would be more than true story. As if one people believe there is friendship between two people, then they are friends(“1”) in matrix no matter how other people disagree.

Pros: It should capture non-friend relationship correctly in this case. Cons: It captures too many frind relationships which cause chaos for analysis.

Friendship, Median.

Friendship Median

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
2 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
3 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
4 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0
5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
6 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
7 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
8 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
9 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
10 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
11 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
12 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
13 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
15 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
16 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
17 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
18 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
19 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
20 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
21 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Analysis

What kind of information does the median measure capture? What are the pros and cons of using this method? Median says if more than 50% of people believe two people are friends, then they are friends. Pros: It combines most people’s observation and feel, its dataset is potentially reliable. Cons: Sometimes, what most people believe could be wrong especially when they are not familiar with those people.

Finally, we’ll also load the data for our advice network for later analysis.

ad_column <- consensus(advice_nets, mode="digraph", diag=FALSE, method="OR.col")
ad_row    <- consensus(advice_nets, mode="digraph", diag=FALSE, method="OR.row")
ad_intersection <- consensus(advice_nets, mode="digraph", diag=FALSE, method="LAS.intersection")
ad_union  <- consensus(advice_nets, mode="digraph", diag=FALSE, method="LAS.union")
ad_median <- consensus(advice_nets, mode="digraph", diag=FALSE, method="central.graph")

II. Visualization (25 pts)

Define Network Structure

First, we’re going to define the position of the nodes on the network so that it is easier to compare edges across graphs.

Base Graph Structure

Base Graph Structure

Plot Two Aggregated Friendship Networks

Using our initial node placement as a template, we will now visualize the ties for aggregated networks.

# If you pass ggnet2 the mode value of a matrix, it will use the first two vectors to position the nodes on their x and y axes. Thus, if we call baseLayout throughout the rest of the visualizations, the nodes will remain in place but the edges drawn between the visualizations will change. 
ggnet2(fr_union_net, mode = baseLayout, label = TRUE,  arrow.size = 8, edge.color="red", arrow.gap = 0.03) + theme(panel.background = element_rect(fill = "#fffff8"))
Friendship, Union.

Friendship, Union.

Analysis

Describe what this network shows in your own words. For nodes, this network shows that nodes 1, 2, 21, 19 and 14 have high indegree connections, many people are believed to be friends with them. node 11 has high outdegree which means node 11 believe he/she is friend of many people. Node 18 doesn’t have friends. Also there are many mutual dyadic edges, and also triads such as 5, 14, 19 and 14, 19, 3. It follows theory of balance.

Friendship, Row.

Friendship, Row.

Analysis

Describe what this network shows in your own words. In this network, still node 11 has most outdegree connections. Node 2 and 14 seems to have highest indegree connections. As it is row method, the arrow direction of edge are all personal feelings with other people, which results into many asymmetric edge. Node 18 and 20 have no friends. Node 10 can also be preceived to have no friends as no arrow is pointed to him.

What are the relevant similiarities and differences between the two networks? What do they mean? The first network is union method and second network is row method. similarities: Both networks have some nodes with high degree centrality such as nodes 2 and 14. Also, nodes 10 and 18 both have no friends. differences: There are more links in first network. Also first network has much more mutual edges.

As the union method includes all edges of row method.They potentially have similar layouts.

Plot Two Aggregated Advice Networks

Choose two of the aggregated advice networks calculated above to visualize.

# Feel free to edit this portion of the code if you would like to plot different aggregated measures.
# Plot the ad_intersection network.
ad_intersect_net <- graph.adjacency(ad_intersection) # make an igraph network object from the advice intersection adjacency matrix

ggnet2(fr_intersection, mode = baseLayout, label = TRUE,  arrow.size = 8, edge.color="pink", arrow.gap = 0.03) + theme(panel.background = element_rect(fill = "#fffff8")) # plots the advice intersection network
Advice, Intersection.

Advice, Intersection.

Analysis

Describe what this network shows in your own words. This network uses the intersection method. By intersection method, it is found that half of nodes are not connected with other nodes. Even some nodes are connected, the network is very sparse. But the connected edges shall have high accuracy. Node 1 has highest centrality in this network. Among 9 edges, 5 of them are mutual edges and 4 of them are asymmetric edges. There is no triad case in this network.

Advice, Median.

Advice, Median.

Analysis

Describe what this network shows in your own words. This network is generated by median network. This is the network that more than 50% of people perceive(agree on). In this network, half of nodes have no connections. The network is very sparse and there are no triads.

What are the relevant similiarities and differences between the two networks? What do they mean? similarities: both networks are very sparse, similar number of edges. differences: Two methods have very different edge connections. e.g. By intersection method, node 1 has highest degree of connection, while by median method, no one is connected to node 1.

Plot Two Individual Self-Report Networks

Next, we’ll plot two of the individual self-report networks. Choose two respondents (by number, 1—21) from either advice_nets or friendship_nets, or visualize both of a single respondent’s self-reports.

Respondent Networks

Respondent Network 1.

Respondent Network 1.

Respondent Network 2.

Respondent Network 2.

Analysis

What respondents did you choose to visualize? Why? I choose respondent 18 for both advice seek and friendship visulization. As node 18 is disconnected with other nodes in networks. I’m intereted how node 18 would draw the network and try to find out why he/she is isolated.

What do their networks show? Can you draw any conclusions about each actor’s role in the network? For friendship network, the edges are very sparse. We could guess that node 18 doesn’t have any friends, also he doesn’t know many people and their relations, thus only 5 edges present. For advice network, it is a very dense network, most of nodes receives a large amount of indgree edge except node 9, 15 and 16. The advice network is pretty active. Thus some people in this company are mainly in work relationship. Also most of edges in advice seeking network are mutual network, people looks for help in mutual way. It is difficult to draw conclusions about actor’s role in these two networks, but I could guess node 9, 15 and 16 are not the core person in this company as they didn’t play important role in advice seeking network.Also node 18 might be manager of this company, though he/she doesn’t have any friend, still many people come and ask him/her for advice.

Plot the Intersection of the FR_Union and Ad_Union Networks

Finally, we’re going to plot the intersection of two networks.

Intersection of Friendship, Union, and Advice, Union.

Intersection of Friendship, Union, and Advice, Union.

Analysis

What does this network show? Why might this visualization be useful? This network shows that node 1, 21 and 14 has highest degree of connections. Node 9, 10, and 17 has only a few connections. Node 18 and 13 has no connections. The edge in this visulization represents people who are friends and also advice seeking. This network can be compared to friend network aggragated by mutual method, it is found that the edge number of node 19, 13 drop significantly, which means they don’t ask advice from all of their friends.

III. Structural Equivalence (25 pts)

In this section, we will compute the structural equivalence among the actors using the locally aggregated structure (LAS). Based upon the exploratory visualizations you created in Part II, choose one LAS structure for both the AD and FR relation type to compute structural equivalence (e.g. ad_union and fr_union).

Analysis

Outline your rationale for choosing your networks. I’ll choose structure of row aggregation. The reasons I choose row method is that: It has relative correct information about edge, and it doesn’t have many edges like union do but could potentially show correct results. Also, unlike intersection which removes a lot of edge information, the remaining edge is only a small set.

Structural Equivalence Matrices

Now, we’ll generate the matrices used to evaluate structural equivalence. Note that we’ll be using the Euclidean distance method.5 Hint: the way you interpret results using the Pearson correlation method and the Euclidean distance method are inverse. You should review the readings or slides from class to make sure you understand how to interpret results.

Advice SEM

## starting httpd help server ... done

Advice SEM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 NA 3.61 3.87 2.65 4.12 3.74 3.87 3.46 4.12 3.32 3.87 3.32 4.12 4.00 3.46 2.65 4.00 4.36 4.36 3.46 4.24
2 3.61 NA 3.74 4.00 3.74 3.87 3.16 3.61 4.47 3.46 3.74 3.46 4.00 3.00 3.87 3.46 4.12 4.00 4.24 4.58 3.87
3 3.87 3.74 NA 4.00 3.16 3.00 3.74 3.87 3.46 3.16 2.83 3.16 3.46 3.00 3.32 3.46 3.32 4.24 3.16 3.87 3.61
4 2.65 4.00 4.00 NA 4.00 3.61 4.24 3.00 3.74 2.83 3.74 3.46 4.00 3.87 3.32 2.45 3.87 4.69 4.24 3.61 4.12
5 4.12 3.74 3.16 4.00 NA 3.87 4.00 3.87 3.74 3.46 3.16 4.00 3.16 3.32 3.32 3.16 3.61 4.69 2.83 4.12 4.36
6 3.74 3.87 3.00 3.61 3.87 NA 3.32 3.74 3.87 3.61 3.87 2.24 3.87 3.46 4.00 3.87 3.16 4.58 4.36 4.24 3.16
7 3.87 3.16 3.74 4.24 4.00 3.32 NA 3.87 4.47 3.74 3.74 3.16 4.00 3.00 4.12 3.74 3.87 4.24 4.47 4.80 3.87
8 3.46 3.61 3.87 3.00 3.87 3.74 3.87 NA 4.58 2.65 3.61 3.00 3.61 4.00 3.74 3.00 4.24 4.36 4.36 4.47 4.47
9 4.12 4.47 3.46 3.74 3.74 3.87 4.47 4.58 NA 3.74 3.74 3.74 2.83 3.61 3.32 3.74 3.61 4.47 3.16 3.87 4.12
10 3.32 3.46 3.16 2.83 3.46 3.61 3.74 2.65 3.74 NA 2.45 3.16 3.16 3.32 3.00 2.45 3.87 4.47 4.00 4.12 4.36
11 3.87 3.74 2.83 3.74 3.16 3.87 3.74 3.61 3.74 2.45 NA 4.00 3.16 3.00 3.00 3.16 3.32 4.47 3.74 3.87 4.12
12 3.32 3.46 3.16 3.46 4.00 2.24 3.16 3.00 3.74 3.16 4.00 NA 3.46 3.61 3.61 3.46 3.32 4.69 4.24 4.36 3.61
13 4.12 4.00 3.46 4.00 3.16 3.87 4.00 3.61 2.83 3.16 3.16 3.46 NA 3.61 3.00 3.16 4.36 4.47 3.16 4.58 4.58
14 4.00 3.00 3.00 3.87 3.32 3.46 3.00 4.00 3.61 3.32 3.00 3.61 3.61 NA 3.16 3.32 3.74 3.87 3.32 4.24 4.00
15 3.46 3.87 3.32 3.32 3.32 4.00 4.12 3.74 3.32 3.00 3.00 3.61 3.00 3.16 NA 2.65 3.74 4.36 3.00 3.46 4.24
16 2.65 3.46 3.46 2.45 3.16 3.87 3.74 3.00 3.74 2.45 3.16 3.46 3.16 3.32 2.65 NA 3.87 4.47 3.74 3.87 4.36
17 4.00 4.12 3.32 3.87 3.61 3.16 3.87 4.24 3.61 3.87 3.32 3.32 4.36 3.74 3.74 3.87 NA 5.00 4.12 3.46 3.74
18 4.36 4.00 4.24 4.69 4.69 4.58 4.24 4.36 4.47 4.47 4.47 4.69 4.47 3.87 4.36 4.47 5.00 NA 4.47 4.36 4.36
19 4.36 4.24 3.16 4.24 2.83 4.36 4.47 4.36 3.16 4.00 3.74 4.24 3.16 3.32 3.00 3.74 4.12 4.47 NA 4.12 4.58
20 3.46 4.58 3.87 3.61 4.12 4.24 4.80 4.47 3.87 4.12 3.87 4.36 4.58 4.24 3.46 3.87 3.46 4.36 4.12 NA 4.24
21 4.24 3.87 3.61 4.12 4.36 3.16 3.87 4.47 4.12 4.36 4.12 3.61 4.58 4.00 4.24 4.36 3.74 4.36 4.58 4.24 NA
# Fri endship SEM

Friendship SEM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
1 NA 2.65 3.16 2.45 3.16 3.16 3.46 2.83 2.65 3.00 3.61 3.16 2.65 3.46 3.32 2.00 3.16 2.83 3.46 2.83 3.46
2 2.65 NA 3.00 2.65 2.65 1.73 2.65 3.00 2.45 2.45 3.74 2.65 2.45 3.00 3.16 2.24 2.65 2.65 3.32 2.65 3.00
3 3.16 3.00 NA 2.45 2.45 2.45 2.83 2.83 1.73 2.24 3.32 2.83 1.73 2.45 1.73 2.45 2.45 2.00 2.83 2.00 3.16
4 2.45 2.65 2.45 NA 2.83 2.45 2.45 2.45 1.73 1.73 3.87 1.41 1.73 2.83 2.24 2.00 2.00 1.41 3.16 1.41 3.16
5 3.16 2.65 2.45 2.83 NA 2.45 2.83 2.83 2.24 2.65 3.61 2.83 2.24 2.00 2.24 2.83 2.45 2.45 2.00 2.45 3.46
6 3.16 1.73 2.45 2.45 2.45 NA 2.00 3.16 1.73 1.73 3.61 2.45 1.73 2.45 2.65 2.45 2.00 2.00 3.16 2.00 2.45
7 3.46 2.65 2.83 2.45 2.83 2.00 NA 3.16 2.24 1.73 4.12 2.45 2.24 2.83 2.65 2.83 2.00 2.00 3.46 2.00 2.83
8 2.83 3.00 2.83 2.45 2.83 3.16 3.16 NA 2.65 2.65 3.00 2.83 2.65 2.83 2.65 2.00 2.83 2.45 3.16 2.45 3.46
9 2.65 2.45 1.73 1.73 2.24 1.73 2.24 2.65 NA 1.41 3.46 2.24 NA 2.24 2.00 1.73 1.73 1.00 2.65 1.00 3.00
10 3.00 2.45 2.24 1.73 2.65 1.73 1.73 2.65 1.41 NA 3.74 2.24 1.41 2.65 2.00 2.24 1.73 1.00 3.00 1.00 3.00
11 3.61 3.74 3.32 3.87 3.61 3.61 4.12 3.00 3.46 3.74 NA 4.12 3.46 3.32 3.46 3.32 3.87 3.61 3.61 3.61 3.61
12 3.16 2.65 2.83 1.41 2.83 2.45 2.45 2.83 2.24 2.24 4.12 NA 2.24 2.83 2.65 2.45 1.41 2.00 3.46 2.00 3.16
13 2.65 2.45 1.73 1.73 2.24 1.73 2.24 2.65 NA 1.41 3.46 2.24 NA 2.24 2.00 1.73 1.73 1.00 2.65 1.00 3.00
14 3.46 3.00 2.45 2.83 2.00 2.45 2.83 2.83 2.24 2.65 3.32 2.83 2.24 NA 2.24 2.83 2.45 2.45 2.45 2.45 3.16
15 3.32 3.16 1.73 2.24 2.24 2.65 2.65 2.65 2.00 2.00 3.46 2.65 2.00 2.24 NA 2.65 2.24 1.73 2.65 1.73 3.32
16 2.00 2.24 2.45 2.00 2.83 2.45 2.83 2.00 1.73 2.24 3.32 2.45 1.73 2.83 2.65 NA 2.45 2.00 3.16 2.00 3.16
17 3.16 2.65 2.45 2.00 2.45 2.00 2.00 2.83 1.73 1.73 3.87 1.41 1.73 2.45 2.24 2.45 NA 1.41 3.16 1.41 3.16
18 2.83 2.65 2.00 1.41 2.45 2.00 2.00 2.45 1.00 1.00 3.61 2.00 1.00 2.45 1.73 2.00 1.41 NA 2.83 NA 3.16
19 3.46 3.32 2.83 3.16 2.00 3.16 3.46 3.16 2.65 3.00 3.61 3.46 2.65 2.45 2.65 3.16 3.16 2.83 NA 2.83 3.74
20 2.83 2.65 2.00 1.41 2.45 2.00 2.00 2.45 1.00 1.00 3.61 2.00 1.00 2.45 1.73 2.00 1.41 NA 2.83 NA 3.16
21 3.46 3.00 3.16 3.16 3.46 2.45 2.83 3.46 3.00 3.00 3.61 3.16 3.00 3.16 3.32 3.16 3.16 3.16 3.74 3.16 NA

Take a moment to compare the structural equivalence matrices (SEM) for the advice and friendship networks that you analyzed. You might want to refer to previous visualizations. Notice that it’s challenging to decode this information visually in matrix form, even for a relatively small network. We’ll search the matrix programmatically to understand more about it.

Next, we will identify the two nodes with the highest and lowest SEM Euclidean distance in each matrix as well as the mean value of distance across both networks.

Friendship SEM Summary Statitistics

## [1] "Friendship SEM"
##    row col
## 18  18   9
## 20  20   9
## 18  18  10
## 20  20  10
## 18  18  13
## 20  20  13
## 9    9  18
## 10  10  18
## 13  13  18
## 9    9  20
## 10  10  20
## 13  13  20
## [1] "Min. Value:"
## [1] 1
##    row col
## 11  11   7
## 7    7  11
## 12  12  11
## 11  11  12
## [1] "Max Value:"
## [1] 4.123106
## [1] "Mean Value:"
## [1] 2.569842

Advice SEM Summary Statistics

## [1] "Advice SEM"
##    row col
## 12  12   6
## 6    6  12
## [1] "Min. Value:"
## [1] 2.236068
##    row col
## 18  18  17
## 17  17  18
## [1] "Max. Value:"
## [1] 5
## [1] "Mean Value:"
## [1] 3.734561

Analysis

How do you interpret high and low values in this matrix, calculated using Euclidean distance? The high value means that two nodes has significantly different structure equivalence. While low value indicates that two nodes have similar structure equivalence.

Which network has the smallest minimum distance between nodes? Why might that be? You may want to refer to your earlier visualizations for more insight into the network. The advice network, the nodes are very densely connected. It shortens the travel distance between nodes.

Which network has the greatest maximum distance between nodes? Why might that be? The friend network, the network are more sparse and some of the nodes are not connected. The maximum distance between unconnected nodes are infinite large.

Which network exhibits more structural equivalence? Friend network.

IV. Differences and Correlation (30 pts)

Advice Networks

Now we will perform the QAP analysis on the advice networks by looping over every network in the list of networks and compare it against the median network we created in Part I. Let’s take a look at one of those values.

## 
## QAP Test Results
## 
## Estimated p-values:
##  p(f(perm) >= f(d)): 0 
##  p(f(perm) <= f(d)): 1 
## 
## Test Diagnostics:
##  Test Value (f(d)): 0.280373 
##  Replications: 1000 
##  Distribution Summary:
##      Min:     -0.2120312 
##      1stQ:    -0.04389317 
##      Med:     -0.007863598 
##      Mean:    -0.003011615 
##      3rdQ:    0.04017584 
##      Max:     0.1482646

The summary of the QAP test includes a number of values:

Estimated p-values: These estimate the probability of observing the test statistic (graph correlation in this instance) value. Qaptest will show both the probability of observing a value higher than or lower than the value observed. If the correlation is substantially higher than zero, these values will often be 1 and 0. This means that, during the QAP process no value was observed that was higher (or potentially lower) than the observed value. To confirm this, look at the Min/Max values in the distribution summary (see below).

Test value: This is the observed correlation between the two graphs.

Distribution summary: This summarizes the distribution of values calculated during the QAP process.

Look over the results that R printed to the console. Each result should begin with the respondent’s index number. Below, we’ll summarize the results of the correlation between the consensus network and each of our 21 respondents.

1 0.28
2 0.52
3 0.49
4 0.69
5 0.49
6 0.49
7 0.56
8 0.54
9 0.53
10 0.55
11 0.45
12 0.47
13 0.62
14 0.49
15 0.58
16 0.70
17 0.47
18 0.39
19 0.49
20 0.46
21 0.48

Analysis

Examining the results from above, which respondent’s perceptions were the most/least “accurate” when compared to the median response (assuming the consensus is the ground truth)?6 Hint: look for the strongest correlation between the respondent’s network and the median network. According to results above, respondent 16(0.7) is most accurate and respondent 1 is least accurate(0.28).

QAP Plot, Advice

Let’s plot the QAP distribution for our advice networks.

Advice QAP

Advice QAP

Based on the results of the QAP test, is the most accurate observer’s correlation with the consensus network significant or spurious? How does the graph above help you make that determination? Where would you draw a vertical line? The correlation between observer 16 and consensus network is not significant. In order to draw vertical line, I’ll draw it at x-axis which covers first and last 5% of curve area. Approximately I’ll draw vertical line at -0.15 and 0.17.

Friendship Networks

We will repeat this process for friendship networks. Take a look at your console output to answer the following question.

Analysis

Are the results for the friendship network very similar or different from those you saw in the advice networks? Give some possible reasons why individuals have more precise representations of one kind of relation structure than another kind of relation structure. The results are very different. In advice network, the highest/lowest coefficients of correlation are both higher than friend network, this indicates better prediction of advice network. Also, the highest correlation coefficient in advice network is however lowest in friend network. People have more precise prediction of advice network, the reason could be that people could see when one persons ask advice or chat with other people. But they are not necessary friends. This surface level observation makes people confused about relationship between them. Thus friend network are more difficult to predict.

Considering Centrality

Next, we will investigate the correlation between various centrality measures and the union consensus network.

## Correlation with Degree Centrality: 0.214675
## Correlation with Betweennesss Centrality: 0.1479718
## Correlation with Closeness Centrality: 0.3286186
## Correlation with Eigenvector Centrality: 0.08114582

Analysis

Which centrality score of individuals in the consensus network are most highly correlated with their accuracy in predicting the consensus network? Based on the readings, suggest a rationale why individuals’ embeddedness or patterning of ties might result in different perceptions. The degree centrality of individual are most highly correlated with their accuracy in predicting consensus network. The ties of individual will influence that persons’s perceptions about network. Like what his/her friends think or who his/her friends make friends will all have influence on his/her thoughts.

Identifying Most and Least Similar Respondent Viewpoints

Next, we’ll run the QAP test on the individual advice/friendship networks. Take a look at your console output to answer this question.

## Proportion of draws which were >= observed value: 0
## Proportion of draws which were <= observed value: 1

Analysis

Which individual sees the two networks as the most similar? Which sees them as the least similar? respondent 16 sees two networks as the most similar, as it has highest coefficient of correlation: 0.47 respondent 18 sees two networks as the least similar, as it has lowest coefficient of correlation: 0.03

Submitting the Lab (5 pts)

After knitting your file to RPubs, copy the URL and paste it into the comment field of the Lab 2 Assignment on Canvas. Save this .Rmd file and submit it in the file portion of your Canvas assignment. Make sure to review your file and its formatting. Run spell check (built into RStudio) and proofread your answers before submitting.