+ - 0:00:00
Notes for current slide
Notes for next slide

POL 478H1 F

Intro to Network Analysis

Olga Chyzh [www.olgachyzh.com]

1 / 16

Today's Class

Network Analysis: an introduction

  1. Definitions. What is network analysis?

  2. Network features and measurements

  3. Collecting/managing network data

  4. Applications to Political Science

  5. Network Visualization

2 / 16

What is a network (i.e., a graph)?

A set of nodes and relation(s) defined on them

3 / 16

Defining Network Features & Measurements: What's a node?

  • A node can be defined as an entity that can form relations with other entities.

Synonyms:

  • actor: from sociometry, common terminology in sociology and psychology
  • vertex: from graph theory (i.e., math), common terminology in mathematics and physics

Term node is common in statistics and applied sciences outside of soc and psych.

4 / 16

Examples of Nodes

  • Individuals (Mad Men characters, legislators, terrorists)

  • Families

  • Organizations, Human Rights NGOs

  • Countries

5 / 16

Defining Network Features & Measurements: What's a relation?

  • A relation/tie defines the existence of an attribute relating nodes.

Synonyms:

  • link: common in computer science (e.g., huge lit on “Link Prediction”) and social sciences
  • edge: graph theoretic terminology common in physics and math, but also elsewhere

Ties can have characteristics:

  • Weight
  • Qualitative attributes
  • Direction
6 / 16

Exampesl of Ties

  • Romantic relationship, marriage, friendship

  • Business relationship

  • Cooperation/conflict

7 / 16

Network graphs can reveal important structures

8 / 16

Adolescent romantic and sexual networks

Bearman, Moody and Stovel

9 / 16

Adolescent Social Structure by Jim Moody

10 / 16

Adolescent Social Structure by Jim Moody

11 / 16

Managing Network Data

You might begin with either a matrix or information stored separately about edges and nodes. This depends on your data collection strategy.

Useful terminology for working in R:

  • Matrices: the adjacency matrix
  • Edges: linkages between actors or nodes
  • Vertices: nodes (or actors) in your system
12 / 16

Example: International Alliances 1914

Download the data here

  • Countries are nodes

  • Alliances are ties

defMat<-read.csv("https://raw.githubusercontent.com/ochyzh/POLS478/master/defmat1914.csv" , header=T)
head(defMat)
## name1 name2 ally
## 1 AUH GUA 0
## 2 AUH HON 0
## 3 AUH SAL 0
## 4 AUH NIC 0
## 5 AUH ECU 0
## 6 AUH UKG 0
13 / 16

Your Turn (5 min)

Can you transform defAlly into a matrix form as shown below?

as.matrix(defMat)[1:20,1:20]
## AUH BOL BUL COS ECU FRN GMY GRC GUA HON ITA JPN MNG NIC POR ROM RUS SAL
## [1,] NA 0 1 0 0 0 1 0 0 0 1 0 0 0 0 1 0 0
## [2,] 0 NA 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [3,] 1 0 NA 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
## [4,] 0 0 0 NA 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [5,] 0 0 0 0 NA 0 0 0 0 0 0 0 0 0 0 0 0 0
## [6,] 0 0 0 0 0 NA 0 0 0 0 0 0 0 0 0 0 1 0
## [7,] 1 0 1 0 0 0 NA 0 0 0 1 0 0 0 0 1 0 0
## [8,] 0 0 0 0 0 0 0 NA 0 0 0 0 0 0 0 0 0 0
## [9,] 0 0 0 0 0 0 0 0 NA 0 0 0 0 0 0 0 0 0
## [10,] 0 0 0 0 0 0 0 0 0 NA 0 0 0 0 0 0 0 0
## [11,] 1 0 0 0 0 0 1 0 0 0 NA 0 0 0 0 0 0 0
## [12,] 0 0 0 0 0 0 0 0 0 0 0 NA 0 0 0 0 0 0
## [13,] 0 0 0 0 0 0 0 0 0 0 0 0 NA 0 0 0 0 0
## [14,] 0 0 0 0 0 0 0 0 0 0 0 0 0 NA 0 0 0 0
## [15,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NA 0 0 0
## [16,] 1 0 0 0 0 0 1 0 0 0 0 0 0 0 0 NA 1 0
## [17,] 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 1 NA 0
## [18,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 NA
## [19,] 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
## [20,] 0 0 1 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
## SPN TUR
## [1,] 0 0
## [2,] 0 0
## [3,] 0 1
## [4,] 0 0
## [5,] 0 0
## [6,] 0 0
## [7,] 0 1
## [8,] 0 0
## [9,] 0 0
## [10,] 0 0
## [11,] 0 0
## [12,] 0 0
## [13,] 0 0
## [14,] 0 0
## [15,] 0 0
## [16,] 0 0
## [17,] 0 0
## [18,] 0 0
## [19,] NA 0
## [20,] 0 NA
14 / 16

Make a Network Graph

library(igraph)
pGraph <- graph_from_adjacency_matrix(as.matrix(defMat), weighted=NULL, mode="undirected",
diag=FALSE) #convert to an igraph object
pGraph <- delete.vertices(pGraph , which(degree(pGraph)==0)) #remove isolates
V(pGraph)$color <- "turquoise"
AllyPlot<- plot(pGraph,
edge.arrow.size=.2,
edge.color="black",
vertex.frame.color="black",
vertex.label=V(pGraph)$names,
vertex.label.color="black", layout=layout_with_fr,
edge.width=E(pGraph)$weight/5, edge.curved=.08, vertex.size=30)
15 / 16

Make a Network Graph

16 / 16

Today's Class

Network Analysis: an introduction

  1. Definitions. What is network analysis?

  2. Network features and measurements

  3. Collecting/managing network data

  4. Applications to Political Science

  5. Network Visualization

2 / 16
Paused

Help

Keyboard shortcuts

, , Pg Up, k Go to previous slide
, , Pg Dn, Space, j Go to next slide
Home Go to first slide
End Go to last slide
Number + Return Go to specific slide
b / m / f Toggle blackout / mirrored / fullscreen mode
c Clone slideshow
p Toggle presenter mode
t Restart the presentation timer
?, h Toggle this help
Esc Back to slideshow