Assignment2

Zoe Bean
2/2/2022

I have chosen to use the Game of Thrones interactions data provided by the class, as it seems interesting.

source("./Import Scripts/Game of Thrones Interactions.R")
#################################################################################################
"Game of Thrones Interactions.R" imports the interactions Network from the Game of Thrones 
Dataset. It is a large, weighted, undirected network showing how often characters interact. The
weight of the edge between two charecters is the number of times they are mentioned together.
This network is closely related to the kills network and the mairrages network, each of which has
their own import script. 

The import script has created four objects that represent the network:
     -network_adjacency     (an adjacency matric)
     -network_nodes         (a dataframe of node attributes)
     -network_igraph        (an igraph object)
     -network_statnet       (a network object compatable with statnet packages like sna & ergm)

Each object name starts, quite generically, with "network_" and ends with the type of object it 
is. Note that the names are generic so that this import script is compatable with other scripts
we will use with this course.
################################################################################################

Tutorial 1 information

#network size, weighted, directed, bipartite
print(network_statnet)
 Network attributes:
  vertices = 298 
  directed = FALSE 
  hyper = FALSE 
  loops = FALSE 
  multiple = FALSE 
  bipartite = FALSE 
  total edges= 9131 
    missing edges= 0 
    non-missing edges= 0 

 Vertex attribute names: 
    appear major majorpov pov vertex.names 

 Edge attribute names not shown 
#attributes

#vertices
network::list.vertex.attributes(network_statnet)
[1] "appear"       "major"        "majorpov"     "pov"         
[5] "vertex.names"
head(network_statnet %v% "vertex.names")
[1] "Addam Marbrand"          "Aegon Frey (Jinglebell)"
[3] "Aegon I Targaryen"       "Aegon Targaryen"        
[5] "Aemon Targaryen"         "Aeron Greyjoy"          
#edges
network::list.edge.attributes(network_statnet)
[1] "weight"
head(network_statnet %e% "weight")
[1] 1 1 1 1 2 3

This is an edgelist dataset. It has 298 vertices and 9131 edges, it is not directed or bipartite, and it is weighted. The vertices are the people, with attributes regarding the time and location of their appearances, as well as the point of view the story is in for these appearances.

Tutorial 2 Information

#dyad census
sna::dyad.census(network_statnet)
      Mut Asym  Null
[1,] 9131    0 35122
#triad census
sna::triad.census(network_statnet, mode="graph") #not directed, so graph mode
           0       1      2      3
[1,] 2387417 1402866 428129 147884
#transistivity
transitivity(network_igraph)#get network transitivity
[1] 0.508903
#average path length
average.path.length(network_igraph,directed=F)
[1] 1.846677

Since this is a non-directed dataset, there are no asymmetric dyads. Therefore, there are 9131 dyads and 35122 nodes that are not connected via dyad.

There are 2387417 triads that are type 0, meaning that the nodes are unconnected, 1402866 that are type 1, meaning that there is one edge between two of the nodes, 428129 that are type 2, meaning that there are two edges connecting the three nodes, and 147884 that are type 3, meaning that all of the nodes in the triad are fully connected.

Of all of the connected triads (meaning all triads that have 2 or more edges), about half of them are fully connected with 3 edges, meaning that if person A met person B and person C also met person B, there is about 50% of a chance that A has also met C.

The average path length is 1.85, which means that between any two people on the network, there are typically 2 or less degrees of separation between them.