Network Data and Network Types

What is a social network?

  • Nodes
    • Usually people
  • Edges / ties
    • Relationships between them
      • Friendship
      • Hatred
      • Advice
      • Time spent together
      • Diseases transmitted

Network Data

  • What are the three main ways of representing networks?

Matrices

sw = watts.strogatz.game(2, 4, 1, .2)
as_adjacency_matrix(sw)
## 16 x 16 sparse Matrix of class "dgCMatrix"
##                                      
##  [1,] . . . 1 1 . . . . . . . 1 . . .
##  [2,] . . 1 . . 1 . . . . . . . . 1 .
##  [3,] . 1 . 1 . . 1 . . . . . . . 1 .
##  [4,] 1 . 1 . . . . 1 . . 1 1 1 . . .
##  [5,] 1 . . . . 1 . 1 . . . 1 . . . .
##  [6,] . 1 . . 1 . . . . 1 . . . . . .
##  [7,] . . 1 . . . . . . 1 1 1 1 1 . .
##  [8,] . . . 1 1 . . . . 1 . . . . . .
##  [9,] . . . . . . . . . . . 1 1 . . .
## [10,] . . . . . 1 1 1 . . 1 . . . . .
## [11,] . . . 1 . . 1 . . 1 . . . . . 1
## [12,] . . . 1 1 . 1 . 1 . . . . 1 . .
## [13,] 1 . . 1 . . 1 . 1 . . . . 1 1 1
## [14,] . . . . . . 1 . . . . 1 1 . 1 .
## [15,] . 1 1 . . . . . . . . . 1 1 . .
## [16,] . . . . . . . . . . 1 . 1 . . .

Edgelists

as_edgelist(sw)
##       [,1] [,2]
##  [1,]    7   13
##  [2,]    1    5
##  [3,]    2    3
##  [4,]    2    6
##  [5,]    3    4
##  [6,]    3    7
##  [7,]    1    4
##  [8,]    4    8
##  [9,]    5    6
## [10,]    4   11
## [11,]    7   14
## [12,]    6   10
## [13,]    7   10
## [14,]    7   11
## [15,]    5    8
## [16,]    4   12
## [17,]    8   10
## [18,]    9   13
## [19,]   10   11
## [20,]   13   14
## [21,]    5   12
## [22,]   11   16
## [23,]    9   12
## [24,]    7   12
## [25,]   13   15
## [26,]    1   13
## [27,]   14   15
## [28,]   12   14
## [29,]    2   15
## [30,]    3   15
## [31,]   13   16
## [32,]    4   13

Graphs/plots/sociograms

plot(sw,
     vertex.label.cex = .5
     )

Where does social network data come from?

  • Surveys
  • Observation
  • Trace data

Network Types

Ego networks

  • Typically created from surveys
plot(make_ego_graph(sw, nodes = 1)[[1]])

Extended ego networks

Bipartite Networks

  • 20 random reddittors and their communities

What does this data look like?

head(r)
## # A tibble: 6 × 3
##   author        subreddit        posts
##   <chr>         <chr>            <dbl>
## 1 ohsemantics   goodyearwelt        37
## 2 ohsemantics   nba                 83
## 3 RandomDood420 badpeoplestories    74
## 4 Its_bigC      Mustang             92
## 5 RealMcKoi     lego                 1
## 6 PokemonBeing  truezelda            1

Bipartite networks can be “projected”

  • People who post in the same communities

Communities with the same users

Nodes and edges can have attributes

Edge attributes

  • Usually this is weight

What can we learn from networks?

  • Metrics about the network
    • Density, clustering, etc.
  • Metrics about the nodes
    • Power, influence, popularity
  • Look at how things change over time

Tuesday Lecture

Today’s Dad Joke

Shout out to people wondering what the opposite of ‘in’ is.

Housekeeping

  • Discussion questions
    • Monday at noon

Schedule

  • Housekeeping / Announcements (5-10)
  • Discussion and review (35-45)
  • Consolidation and Confusion (10-15)
  • Supplementary lectures
    • Response to needs
    • Discuss at end of class

Review

  • How did installing R + RStudio go?
  • Homework review
    • Encouragement to be prepared
    • Time to identify confusion - it’s OK to be confused!
  • Discussion questions review

Consolidation

  • What were some of the key ideas?
  • What are you thinking differently about now?
  • What are remaining questions/confusions?