Homework 2: Brief Analysis of the Florentine Family Set
The Network I chose was the Florentine family dataset network from the network package. This dataset represents marriages between influential families in Florence. Each node represents a family with arrows indicating which family married into which other family.
Network size for the Florentine Family network dataset is described briefly by the code below:
set.seed(2)
# I access the florentine families dataset through the package "network"
data(flo, package="network")
# In order to make the dataset usable I make it into a matrix using as.matrix()
matrix_florentine <- as.matrix(flo)
# Next I used the graph.adjacency command to make the florentine dataset into
# An Adjacency Matrix
florentine<- graph.adjacency(flo, mode="directed", weighted=NULL)
plot(florentine, vertex.color="skyblue1", vertex.label.color="navy",
vertex.label.dist=1, vertex.size=7, edge.arrow.size=0.5, margin=0000)
vcount(florentine)
[1] 16
ecount(florentine)
[1] 40
statted_florentine<-as.network(matrix_florentine)
print(statted_florentine)
Network attributes:
vertices = 16
directed = TRUE
hyper = FALSE
loops = FALSE
multiple = FALSE
bipartite = FALSE
total edges= 40
missing edges= 0
non-missing edges= 40
Vertex attribute names:
vertex.names
No edge attributes
The number of vertices in the dataset is 16, in this case these nodes each represent a florentine family. Te number of edges is 40. In this instance ties or edges, represent marriages between these influential families. The is the same in both the statnet and igraph outputs.
Next the features of the dataset are described using the 3 commands in the code chunk below.
is_bipartite(florentine)
[1] FALSE
is_directed(florentine)
[1] TRUE
is_weighted(florentine)
[1] FALSE
These results suggests that the florentine family dataset is not bipartite, which would indicate that they do not fall into to sets. In addition the dataset’s ties are directed do they flow in directions as a result of which family is marrying to which, and the ties are unweighted because marriage cannot vary in numerican significance, it is simply a category that is either true or false between families.
vertex_attr_names(florentine)
[1] "name"
edge_attr_names(florentine)
character(0)
network::list.vertex.attributes(statted_florentine)
[1] "na" "vertex.names"
network::list.edge.attributes(statted_florentine)
[1] "na"
The vector attribute names are the names of the florentine families.
The edge attributes do not have name.
igraph::dyad.census(florentine)
$mut
[1] 20
$asym
[1] 0
$null
[1] 100
sna::dyad.census(statted_florentine)
Mut Asym Null
[1,] 20 0 100
The dyad census indicates that amongest that among the dyad ties, being between 2 families, 20 are mutual and none are asymptotic. In addition 100 of the dyad are null, or not connected.
sna::triad.census(statted_florentine, mode="graph")
0 1 2 3
[1,] 324 195 38 3
sum(sna::triad.census(statted_florentine, mode="graph"))
[1] 560
For dyads there are 16 possibilities. Here our results are as follows:
324, 003 (A,B,C, the empty graph.)
195, 102 (A<->B, C, the graph with a mutual connection between two vertices.)
both of which are vacuously transitive
38, 030C (A<-B<-C, A->C.)
3, 300 (A<->B<->C, A<->C, the complete graph.)
which are both transitive
Both statnet and igraph confirm this, however igraph specifies the exact instances of each type of connection.
transitivity(florentine, type="global")
[1] 0.1914894
The global transitivity of the graph is 0.1914894 which is the ratio of triangles to connected triangles.
transitivity(florentine, type="average")
[1] 0.2181818
The average transitivity is the average transitivity of local triad clusters. Here it is 0.2181818. This is the ratio of local triangles to all connected triangles.
gtrans(statted_florentine)
[1] 0.1914894
Statnet code confirms this transitivity assessment.
V(florentine)[c("Peruzzi","Lamberteschi", "Ginori")]
+ 3/16 vertices, named, from e7ac6d4:
[1] Peruzzi Lamberteschi Ginori
First we see that the average path length between 2 nodes in our dataset is 2.485714
average.path.length(florentine,directed=F)
[1] 2.485714
I then test the distances between 3 families, those being the Peruzzi, Lamberteschi, and Ginori
distances(florentine,"Peruzzi", "Lamberteschi")
Lamberteschi
Peruzzi 3
The distance between the nodes of Peruzzi and Lamberteschi is 3
distances(florentine,"Peruzzi", "Ginori")
Ginori
Peruzzi 4
The distance between the nodes of Peruzzi and Ginori is 4
distances(florentine,"Lamberteschi","Ginori")
Ginori
Lamberteschi 3
The distance between the nodes of Lamberteschi and Ginori is 3.
isolates(statted_florentine)
[1] 12
The names of all families in our dataset is as follows:
as.vector(statted_florentine%v%'vertex.names')
[1] "Acciaiuoli" "Albizzi" "Barbadori" "Bischeri"
[5] "Castellani" "Ginori" "Guadagni" "Lamberteschi"
[9] "Medici" "Pazzi" "Peruzzi" "Pucci"
[13] "Ridolfi" "Salviati" "Strozzi" "Tornabuoni"
The names of the isolated influential families is as follows below:
Text and figures are licensed under Creative Commons Attribution CC BY-NC 4.0. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".
For attribution, please cite this work as
Milstein (2022, Feb. 17). Data Analytics and Computational Social Science: Initial Network Analysis Florentine Family. Retrieved from https://nmilsteinuma.github.io/posts/2022-01-31-the-sharpe-ratio/
BibTeX citation
@misc{milstein2022initial, author = {Milstein, Noah}, title = {Data Analytics and Computational Social Science: Initial Network Analysis Florentine Family}, url = {https://nmilsteinuma.github.io/posts/2022-01-31-the-sharpe-ratio/}, year = {2022} }