<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/dynamic-networks-visualizing-arms-trades-over-time/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://scweiss.blogspot.com/2017/06/dynamic-networks-visualizing-arms_14.html"> sweissblaug</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<div dir="ltr">I previously made some network graphs of Middle East country relationships <a rel="nofollow" href="http://scweiss.blogspot.com/2014/07/mideast-graph-3-slate-middle-east.html" target="_blank">here</a> using Slate’s <a rel="nofollow" href="http://www.slate.com/blogs/the_world_/2014/07/17/the_middle_east_friendship_chart.html" target="_blank">Middle East Friendship Chart</a>. I was thinking of a way to visualize these relationships (and possibly other ones) with more rule based and objective measure over time. What kind of public dataset could show countries relationships accurately?
<p>I used weapons / arms trades between nations to explore these relationships. I think arms trades are a good indicator of how friendly countries are together because 1) countries won’t sell to enemies and 2) if a country wants to befriends country, buying weapons are a good way to do buy influence.
<div></div>
<div><a rel="nofollow" href="https://www.sipri.org/databases/armstransfers" target="_blank">SIPRI</a> has a very detailed dataset of international arms transfers between >257 nations / organizations in the post war era. The include a type / description and quantity for all trades. For this analysis I will use only the fact that two countries bought or sold some weapons for a particular year. </div>
<div></div>
<div>One can create adjacency matrices from this dataset and make some network plots. However, doing this one year at a time will not create have a smooth plots over time. I decided to use <a rel="nofollow" href="https://github.com/fchollet/keras/blob/master/examples/mnist_siamese_graph.py" target="_blank">siamese network graphs</a> to embed a country indicator and year variable in two dimensions with the response variable being whether or not countries traded arms in that particular year. This will transform the country and year of a country into a 2 dimensional space, and means if two points are near each other they probably traded in that particular year.
<p>You can check out the graph <a rel="nofollow" href="http://rpubs.com/sweiss/284033" target="_blank">her</a>e. It’s cool that we can see Iran moving away from US to Russia / Soviet Union around 1979 while Egypt and Iraq move towards US. </div>
<div>One can also explore other relationships. Below is a graph of relationships of the world in 1960. There is a Russia/ Soviet Union cluster and a US / Western Europe Cluster. Neat!
<div><a rel="nofollow" href="https://i1.wp.com/3.bp.blogspot.com/-KLcy2-Wl1c0/WT3nB8X8W8I/AAAAAAAACfA/8dGpZRCFIDQLb3-_N1phRT77j4ejV6GDACLcB/s1600/embed%2B1960.png?ssl=1" target="_blank"><img border="0" data-original-height="664" src="https://i2.wp.com/3.bp.blogspot.com/-KLcy2-Wl1c0/WT3nB8X8W8I/AAAAAAAACfA/8dGpZRCFIDQLb3-_N1phRT77j4ejV6GDACLcB/s640/embed%2B1960.png?resize=450%2C664&ssl=1" data-recalc-dims="1" data-original-width="450"></a></div>
<div></div>
<div></div>
<div>Analysis was done in <a rel="nofollow" href="https://github.com/samcarlos/Dynamic_Network" target="_blank">python</a> (using the Keras example for siamese network) and R (for plotting).</div>
</div>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://scweiss.blogspot.com/2017/06/dynamic-networks-visualizing-arms_14.html"> sweissblaug</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...

	<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/kH7a_Mh23mc" height="1"></a></div>