Introduction:
The world today is as interconnected as it has ever been. Economic, social, and political change in one country send shock waves across the world. Because of this, international relations and diplomacy are constantly in use and tested. The most prevalent form of these international relations—besides financial markets—are treaties. For centuries treaties have shaped and manipulated borders, security, and trade. Do certain countries influence treaty making and international relations more than others? Do these specific power brokers enhance national security and make the world a safer place? These are the questions I hope to answer in the project below. With that in mind, I hypothesize that the “Major World Powers” (which I will define below)—like the United States, Russia, France, Germany, and the United Kingdom—will have a greater connection via treaties to the rest of the world. Because I expect a high volume from these countries, I also hypothesize that in the years of greater treaty making, we can expect future years of peace.

The data set used to explore this question came from the Correlates of War Formal Interstate Alliance Dataset (created by University of Alabama Professor of Political Science, Douglas Gibler). Specifically, I used version 4.3—the Directed-Dyad Format—which made it so countries listed as state_name1 (state #1) made promises or directed the treaty toward the country listed as state_name2 (state #2). I chose this data set so that I could make it a directed network. Furthermore, I manipulated the dataset so that the columns listing state #1 and state #2 were the first two in the data, making it easier to create an igraph. Thus, I removed the version ID (which according to Professor Gibler—who I reached out to—are an arbitrarily assigned grouping of numbers), and the state name codes.

I have attached the variable dictionary for better understanding, but I will also briefly summarize the variables I used here. First, dyad_st_year, represents the year in which the alliance went into effect according to the Correlates of War system. Next, the types of treaties are listed in 0 and 1 form, with a 1 indicating the type of treaty it is. There is overlap, meaning a defense treaty can also count as a nonaggression treaty for example. The dictionary describes a left_censor treaty as an alliance that existed prior to 1/1/1816—the furthest back the dataset goes. A right_censor treaty is a directed dyad that is still considered in effect as of 12/31/2012. The final three types of treaties are defense, which says state #1 signed a defense pact to protect state #2, a neutrality treaty, which indicates that state #1 agreed to remain neutral toward state #2, a nonaggression treaty, which says that state #1 agrees to not attack state #2, and lastly an entente treaty, which says that state #1 agreed to consult with state #2 in the event of a crisis.

Using this information, I will first explore the volume and types of connections, then conduct a network analysis to see how countries interact with each other.

In [1]:
alliance <- read.csv("~/Downloads/version4.1_csv/alliance_v4.1_by_directedNEW.csv", header=TRUE)
library(igraph)
library(ggplot2)
g=graph.data.frame(alliance,directed=TRUE)

Attaching package: ‘igraph’

The following objects are masked from ‘package:stats’:

decompose, spectrum

The following object is masked from ‘package:base’:

union



As I explained above, the dataset I chose above allowed me to make this igrpah into a directed network. Thus, after loading in the data (which I manipulated ahead of time), I created igrpah "g" to be used for later network analysis.

In [2]:
dim(alliance)

1. 6444
2. 15
United KingdomPortugal 1 1 1816 NA NA NA 1 1 1 0 1 0 4.1
Portugal United Kingdom 1 1 1816 NA NA NA 1 1 1 0 1 0 4.1
United KingdomSweden 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1
Sweden United Kingdom 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1
Hanover Bavaria 1 1 1838 15 3 1848 0 0 1 0 1 1 4.1
Hanover Bavaria 29 11 1850 15 6 1866 0 0 1 0 1 1 4.1
In [3]:
TPY<-table(alliance$state_name1, alliance$dyad_st_year)

TreatyperYear<-apply(TPY, MARGIN=2, FUN=sum)

barplot(TreatyperYear)

1816
78
1827
6
1831
2
1832
4
1833
26
1834
12

To begin, I created a plot of the total number of treaties per year. This is a good jumping off point to best see how the number of treaties fluctuates over time, with some years hitting around 400 different treaties and others close to zero. Furthermore, although this is a simple graphic, it is useful for knowing which years or decades to explore in greater detail later on. It appears that diplomacy has increased over time, and that the post-World War II era serves as a defining moment that the world got smaller and more connected via treaties.

This graphic is a good starting point, however, not every treaty is equal in terms of relevance or power. To best see how these treaties are truly operating with each other, it is necessary to look at the treaties induced (meaning they are state #1) by the major world powers. Using Professor James Morrow's, "The Political Determinants of International Trade: The Major Powers, 1907-1990" list of major powers I selected the US, Russia, UK, France, and Germany. I removed Italy from my list of Major powers given its current lack of international involvement, which aligns with additional scholarly research (see works cited). Additionlly, the eigenvector and betweeness centrality scores below confirm that these countries are indeed at the center of international diplomacy. Although, I am making certain assumptions with my selection, I beleive that current and historical rhetoric would agree that these are the countries that have been at the center of the world for the longest time.

In [4]:
Major<-alliance[alliance$state_name1==c("United States of America", "Russia", "United Kingdom", "France", "Germany"),] head(Major) dim(Major)  Warning message in is.na(e1) | is.na(e2): “longer object length is not a multiple of shorter object length”Warning message in ==.default(alliance$state_name1, c("United States of America", :
“longer object length is not a multiple of shorter object length”
3United Kingdom Sweden 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1
45Germany Baden 1 1 1816 15 3 1848 1 0 1 0 1 1 4.1
50Germany Wuerttemburg 29 11 1850 15 6 1866 0 0 1 0 1 1 4.1
55Germany Mecklenburg Schwerin 1 1 1843 15 3 1848 0 0 1 0 1 1 4.1
203United Kingdom France 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1
207Russia United Kingdom 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1
1. 135
2. 15
In [5]:
years <- seq(1811, 2009, by = 1)
Major$decade = cut(Major$dyad_st_year, seq(from = 1810, to = 2010, by = 10), include.lowest=TRUE, labels=seq(1810,2000, by=10))
Major$decade  1. 1810 2. 1810 3. 1840 4. 1840 5. 1820 6. 1820 7. 1830 8. 1830 9. 1830 10. 1830 11. 1830 12. 1830 13. 1830 14. 1830 15. 1830 16. 1830 17. 1840 18. 1840 19. 1850 20. 1850 21. 1850 22. 1850 23. 1850 24. 1850 25. 1860 26. 1860 27. 1860 28. 1870 29. 1870 30. 1880 31. 1880 32. 1880 33. 1890 34. 1900 35. 1900 36. 1900 37. 1900 38. 1910 39. 1910 40. 1910 41. 1910 42. 1910 43. 1920 44. 1920 45. 1920 46. 1920 47. 1930 48. 1930 49. 1930 50. 1930 51. 1930 52. 1930 53. 1930 54. 1930 55. 1930 56. 1930 57. 1930 58. 1930 59. 1930 60. 1930 61. 1930 62. 1930 63. 1930 64. 1930 65. 1940 66. 1940 67. 1940 68. 1940 69. 1940 70. 1940 71. 1940 72. 1940 73. 1940 74. 1970 75. 1980 76. 1940 77. 1940 78. 1940 79. 1940 80. 1980 81. 1980 82. 1940 83. 1980 84. 1990 85. 1940 86. 1940 87. 1940 88. 1990 89. 1940 90. 1940 91. 1940 92. 1990 93. 1940 94. 1980 95. 1980 96. 1980 97. 1950 98. 1950 99. 1950 100. 1950 101. 1950 102. 1950 103. 1950 104. 1950 105. 1950 106. 1950 107. 1950 108. 1950 109. 1950 110. 1950 111. 1950 112. 1960 113. 1960 114. 1960 115. 1960 116. 1960 117. 1960 118. 1960 119. 1960 120. 1960 121. 1960 122. 1960 123. 1970 124. 1970 125. 1980 126. 1980 127. 1990 128. 1990 129. 1990 130. 1990 131. 1990 132. 1990 133. 1990 134. 2000 135. 2000 In [6]: ggplot(Major, aes(decade))+geom_bar(aes(fill=state_name1), color="black")+facet_wrap(~state_name1) + theme(axis.text.x=element_text(angle=90),legend.justification=c(1,0), legend.position=c(1,0),text = element_text(size=10))+ xlab("Years, 1810-2010") + ylab("Totsl Number of Treaties Signed")+ ggtitle("Major Powers Treaty Count Over Time")  After sub-setting for the 5 Major countries, our number of treaties is reduced from 6444 to 135, a much more manageable work size. Next, to better get a sense of trends we take the dyad_st_year numbers and place them into decades from 1810 to 2010. To see how the number of treaties signed by the major powers has changed over time, above is a ggplot with the count of treaties for each country from 1810-2010. It appears that France and Germany, and UK have had fairly consistent history of international involvement. Meanwhile, the US and Russia have an increased role in the later part of the 20th century. The US comes into the world strong following World War I. After that and WWII, I believe that the use of nuclear weapons and the US and Russia nuclear umbrellas are the cause for the increase for both countries. Using the network analysis later in this project I will explore this idea further. In [7]: ggplot(Major, aes(state_name1)) + geom_bar(aes(fill = state_name1), position = "identity")+ theme(axis.text.x=element_text(angle=90),text = element_text(size=10))+ xlab("Major Powers") + ylab("Totsl Number of Treaties Signed By Type of Treaty")+ ggtitle("Major Powers Treaty Count and Type; 1810-2010")  In [8]: head(Major) Major$Type=rep("defense", 135)
Major$Type[Major$defense==0]<-"non-defense"

3United Kingdom Sweden 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1 1810
45Germany Baden 1 1 1816 15 3 1848 1 0 1 0 1 1 4.1 1810
50Germany Wuerttemburg 29 11 1850 15 6 1866 0 0 1 0 1 1 4.1 1840
55Germany Mecklenburg Schwerin 1 1 1843 15 3 1848 0 0 1 0 1 1 4.1 1840
203United Kingdom France 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820
207Russia United Kingdom 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820
3United Kingdom Sweden 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1 1810 defense
45Germany Baden 1 1 1816 15 3 1848 1 0 1 0 1 1 4.1 1810 defense
50Germany Wuerttemburg 29 11 1850 15 6 1866 0 0 1 0 1 1 4.1 1840 defense
55Germany Mecklenburg Schwerin 1 1 1843 15 3 1848 0 0 1 0 1 1 4.1 1840 defense
203United Kingdom France 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820 defense
207Russia United Kingdom 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820 defense
3United Kingdom Sweden 1 1 1816 15 2 1911 1 0 0 0 0 1 4.1 1810 non-defense
45Germany Baden 1 1 1816 15 3 1848 1 0 1 0 1 1 4.1 1810 defense
50Germany Wuerttemburg 29 11 1850 15 6 1866 0 0 1 0 1 1 4.1 1840 defense
55Germany Mecklenburg Schwerin 1 1 1843 15 3 1848 0 0 1 0 1 1 4.1 1840 defense
203United Kingdom France 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820 non-defense
207Russia United Kingdom 6 7 1827 14 9 1829 0 0 0 0 0 1 4.1 1820 non-defense
In [9]:
ggplot(Major, aes(decade)) + geom_bar(aes(fill = Type), position = "stack")+
theme(axis.text.x=element_text(angle=90),text = element_text(size=10))+
ggtitle("Major Powers Defense and Non-defense Treaty Count; 1810-2010")


To better see treaty trends over time, I created a new column that combines treaty types by defense or non-defense treaties (this includes all remaining treaties beside left_censor and right_censor). In doing this we can see that over time there is fairly strong balance between defense and non-defense treaties over time. The exceptions are what we would expect. Following WWII in the 1940s most treaties were defensive, and then in the years after WWII, when the world tried to move away from all out world, an increase in non-aggression and neutrality treaties occurred.

In [10]:
set.seed(1)
lout<-layout.fruchterman.reingold(g)
layout3 <- layout_with_fr(g, start.temp = 50)

install.packages("ggplot2")
require(ggplot2)
library(ggplot2)

 0.107117 -1.61153 0.154165 -1.11844 -0.873453 0.149191 2.57292 -3.61353 2.33854 -3.27738 1.03474 -2.51463
 1.43723 5.70975 1.02341 5.98187 3.15582 6.63501 2.5787 7.73301 2.93451 7.43495 1.77262 6.15057
The downloaded binary packages are in

In [11]:
plot.igraph(g, layout=layout3, vertex.size=5, vertex.label.cex=.5, asp = 0)


After exploring trends over time, I turned my attention to the network connections of treaty making. There is not a lot of scholarly work out on this type of international relations studies, but the leading research involves Emilie Hafner-Burton’s “Network Analysis for International Relations”. According to this article, network analysis plays a vital role in investigating the connection between countries. Hafner-Burton concludes that using network analysis to identify power we can redefine “access, brokerage, and exit options”. This study affirms that the work below is part of a new wave of international relations, and that “network analysis has already been demonstrated in more precise description of international networks.”

The first network created is of all the original directed data. It is very messy given the number of nodes and edges. To better understand if this is expected in later networks, I then created a histogram of node degree. It appears that most countries have less than 100 treaties, with only a handful of countries playing a larger role on the international stage.

In [12]:
deg<- degree(g, mode="all")
hist(deg, breaks=50, main="Histogram of node degree")

In [13]:
bins <- unique(quantile(deg, seq(0,1, length.out = 5)))
bins
which(deg >150)

1. 2
2. 26
3. 61
4. 94.5
5. 334
United Kingdom
1
Germany
6
Austria-Hungary
13
Russia
16
France
19
Italy
20
Turkey
22
Argentina
26
Brazil
27
28
Peru
29
Bolivia
30
Chile
33
Guatemala
40
Honduras
41
Nicaragua
43
Costa Rica
44
United States of America
45
Egypt
63
Panama
68
In [14]:
eigenCent <- evcent(g)$vector sort(eigenCent, decreasing = TRUE)[1:10] sort(eigenCent, decreasing = FALSE)[1:10] bt<-betweenness(g) sort(bt, decreasing = TRUE)[1:10] sort(bt, decreasing = FALSE)[1:10] cor(eigenCent, bt) which(eigenCent >.7 & bt > 1800)  United States of America 1 France 0.981315617699136 United Kingdom 0.968453914860171 Honduras 0.868574701357546 Guatemala 0.868574701357546 Nicaragua 0.868574701357545 Costa Rica 0.868574701357545 Russia 0.858514946306702 Bolivia 0.798457219976544 Peru 0.788696598446502 Swaziland 2.64758247593819e-06 South Africa 0.000186352593367774 Eritrea 0.000354361875127963 South Sudan 0.000551914840847177 Namibia 0.000767618314601063 Zimbabwe 0.000767618314601064 Indonesia 0.00090016086702185 Bangladesh 0.00125561123569057 Equatorial Guinea 0.00189507788325635 Sao Tome and Principe 0.00189507788325636 United States of America 9120.41933968553 Russia 7980.04458479172 France 3880.97952102288 United Kingdom 2563.45878371417 Canada 2351.08290533115 Congo 2208.78789623737 Germany 2187.06256774829 Iraq 1991.84177023687 Liberia 1981.48080293577 Austria-Hungary 1899.64472093545 Sweden 0 Hanover 0 Bavaria 0 Baden 0 Saxony 0 Wuerttemburg 0 Hesse Electoral 0 Hesse Grand Ducal 0 Mecklenburg Schwerin 0 Two Sicilies 0 0.372364767002473 United Kingdom 1 Russia 16 France 19 United States of America 45 In [15]: gmajor=graph.data.frame(Major,directed=TRUE) eigenCentmajor <- evcent(gmajor)$vector
sort(eigenCentmajor, decreasing = TRUE)[1:10]
sort(eigenCentmajor, decreasing = FALSE)[1:10]

btmajor<-betweenness(gmajor)
sort(btmajor, decreasing = TRUE)[1:10]
sort(btmajor, decreasing = FALSE)[1:10]

cor(eigenCentmajor, btmajor)

France
1
United Kingdom
0.842480692833743
Russia
0.787223793205964
United States of America
0.382204413709778
Germany
0.355849878604621
Spain
0.274751283134194
Austria-Hungary
0.256506984865263
Italy
0.249041463640986
Poland
0.189396382545198
Romania
0.178293813723556
Latvia
0.0185680900459195
Mecklenburg Schwerin
0.0185680900459195
Bulgaria
0.0185680900459195
German Federal Republic
0.0185680900459195
0.0185680900459195
Mexico
0.0199432580883249
Costa Rica
0.0199432580883249
Paraguay
0.0199432580883249
Dominica
0.0199432580883249
Denmark
0.0199432580883249
Russia
91.3144257703081
France
81.9919913419913
United States of America
80.2222222222222
United Kingdom
44.7475511416688
Germany
26.7238095238095
Sweden
0
0
Wuerttemburg
0
Mecklenburg Schwerin
0
Belgium
0
Sweden
0
0
Wuerttemburg
0
Mecklenburg Schwerin
0
Belgium
0
Austria-Hungary
0
Portugal
0
Turkey
0
Spain
0
Italy
0
0.868241235545145

Above is the eigenvector and betweeness scores for both the total data and for the Major countries subset. Later in the project I will use the eigenvector score between it is a simpler measurer (0 to 1 scale), and because the correlation between the two scores for the major countries is .86, meaning there is heavy carryover into which countries are at the center of that network.

In [16]:
colVals <-rep("grey80", length(V(gmajor)$name)) colVals[which(V(gmajor)$name=="United States of America")] <-"blue"
colVals[which(V(gmajor)$name=="Russia")] <-"red" colVals[which(V(gmajor)$name=="France")] <-"purple"
colVals[which(V(gmajor)$name=="Germany")] <-"pink" colVals[which(V(gmajor)$name=="United Kingdom")] <-"green"
V(gmajor)\$color<-colVals

plot.igraph(gmajor, layout=layout3, vertex.size=eigenCentmajor, vertex.label.cex=.5, asp = 0, vertex.color=colVals)

Warning message in layout[, 1] + label.dist * cos(-label.degree) * (vertex.size + :
“longer object length is not a multiple of shorter object length”Warning message in layout[, 2] + label.dist * sin(-label.degree) * (vertex.size + :
“longer object length is not a multiple of shorter object length”