Dateset Description: The personal friendship network of a faculty of a UK university, consisting of 81 vertices (individuals) and 817 directed and weighted connections. The school affiliation of each individual is stored as a vertex attribute. (igraphdata documentation). This dataset is licensed under a Creative Commons Attribution-Share Alike 2.0 UK: England & Wales License (details)[http://creativecommons.org/licenses/by-sa/2.0/uk/]. Ref: 10.1103/PhysRevE.77.016107
loading libraires
library(igraph)
library(igraphdata)
library(RColorBrewer)
data("UKfaculty")
A node represents a faculty member. An edge represents a relationship between two faculty members. These faculty members are from three different schools.
is.simple(UKfaculty): TRUEis.weighted(UKfaculty): TRUEis.directed(UKfaculty): TRUEis.connected(UKfaculty): TRUEThis is a simple network. This network contains no self-loops and no multiple edges. Edge weights represented relationship strength. This is a directed network. A is a friend of B does not necessarily mean that B is also a friend of A.
# select colors
colors = brewer.pal(4, "Dark2")
# assign colors to groups
V(UKfaculty)$color = sapply(V(UKfaculty)$Group, function(x) colors[x])
plot(UKfaculty, layout = layout_nicely(UKfaculty, dim = 2),
vertex.color = V(UKfaculty)$color, vertex.frame.color = NA,
vertex.label = NA, vertex.shape = 'square',
vertex.size = 3.5, edge.arrow.size = 0.3, edge.curved = TRUE,
edge.width = E(UKfaculty)$weight ^ 0.8,
edge.color = rgb(0, 0, 0, alpha = 0.1))
title("UK Faculty Friendship Network (Directed)", cex.main = 1)
Are friendships in this friendship network reciprocal? This can be examined by converting this network to an undirected one, keeping only reciprocal edges.
UKfaculty_undirected <- as.undirected(
UKfaculty,
mode = "mutual", # keeping only mutual ties
edge.attr.comb = list(weight="sum", "ignore") # sum edge weights, ignore other attributes
)
is.simple(UKfaculty_undirected): TRUEThe contrast between directed and undirected networks is impressive. The network became more sparse. It seems that the unreciprocated relationships are a large part of this friendship network.
What is the ratio of unreciprocated ties over reciprocated ties? Unreciprocal edges are 2.4041667 times as many as reciprocal edges .
A large amount of friendships are unreciprocal. Exploring relationships between outdegree and indegree will reveal where this unreciprocity comes from:
Computing indegree and outdegree
degree_out = degree(UKfaculty, mode = 'out')
degree_in = degree(UKfaculty, mode = 'in')
Visualizing relationships between outdegree and indegree
Outdegree means giving friendship; indegree means receiving friendships. In this plot, each point represents a node (i.e. a faculty member). If someone gives and receives equal amount of friendships, the point should lie exactly on the y = x line. Points below the y = x line indicate giving more than receiving friendships. Points above the y = x line indicate receiving more than giving more friendships. Interestingly, faculty members with outdegrees greater than 21 (the red points) gave a lot more friendships than they have received.
It would be interesting to investigate why they gave more friendships than they receive. Are they the people who are super friendly? Or are they in a position where they have to give more friendships?
If people who gave more friendships than they receive because they are friendly, they should be more in center of this friendship network. People like friendly person. Therefore, they should also have more reciprocal ties.
If they gave more friendships than they receive because they are trying to exchange friendships for resources, they should be giving their unreciprocal friendships to people in a more central position. People who occupied central position in their network are more resourceful [ref].
In my next blog article, I’ll further explore this question.
In addition, the degree distribution is very interesting.
There are greater variation in outdegree than in indegree. Would this be an evidence for the friendly hypothesis?