Exploring Differences in Terrorism Across Regions

Posted on Feb 20, 2019

The frequency of terrorist attacks is increasing over time, which presents a greater need for analysis to reveal trends and inferences. This study used various visualization techniques in R to display the differences in attacks across countries and over time.


In order for the data to be clearly displayed for the user, a world map was used to exploit the differences across countries (displayed above). A choropleth map was used as the base layer of the map to display the frequency of attacks in which countries with high frequencies were represented by darker colors. Labels for each country showed the frequency of attacks since 1970, along with the most common type of attack, target, and weapon. The regions with the most activity were southern Asia, Middle East and North Africa, and the Western part of South America.

Blue markers were plotted on top of the base map to display the coordinates of each attack. Because many attacks were included in the dataset, only attacks in 2017 were plotted to ensure the map wouldn't be operating at a slow speed (however, all data points were used for all other aspects of the project). A slider at the bottom allowed the user to view the changes in attack throughout 2017 in which steps on the slider represents months of the year. Observing the points change over time revealed that the general locations targeted did not drastically change throughout 2017. In other words, if a city was targeted early in 2017, it was likely to be targeted again in later months.

Attack Types by Region

Another visualization tool used was an interactive stacked bar graph displaying the frequency of each attack type. The application gives the user the opportunity to add and subtract regions, depending on the parts of the world that he/she wish to explore. This chart shows that bombing attacks are the most common globally and armed attack is the second most. Additionally, it appears that regardless the type of attack, the distribution across regions stays constant in which the Middle East and North Africa, South Asia, and South America account for the greatest frequencies.

Attacks Over Time

The last method of visualization was a plot of attacks from 1970 to 2017. The frequency over attacks is clearly rising over time with its peak being in 2014. Data from 1993 was excluded by the creators of the database. The graph reveals a high activity of terrorism in Central America and the Caribbean during the 1980's, but little activity in that region after that. In the last decade, the Middle East and North Africa, South Asia, and Sub-Saharan Africa have accounted for the overwhelming majority of attacks.


The purpose of this study was to allow the user to clearly visualize differences in terrorist attacks across regions and time. The distribution of each type was shown to be fairly constant across regions, while the distribution across regions did not remain constant over time. An idea for further analysis would be to display a network between origin country of the attacker and the targeted country. This database did not include the nationality of the attacker, so a network between countries could not be displayed on the map.

R code for this project can be found here.

Site URL:Β https://brosen.shinyapps.io/rShiny_Terrorism

About Author

Benjamin Rosen

Ben recently graduated from the NYC Data Science Academy to achieve his goal of becoming a junior data scientist. He has a passion for predictive modeling and using analytics to enhance decision-making. Ben earned his B.A. in economics...
View all posts by Benjamin Rosen >

Related Articles

Leave a Comment

No comments found.

View Posts by Categories

Our Recent Popular Posts

View Posts by Tags

#python #trainwithnycdsa 2019 airbnb Alex Baransky alumni Alumni Interview Alumni Reviews Alumni Spotlight alumni story Alumnus API Application artist aws beautiful soup Best Bootcamp Best Data Science 2019 Best Data Science Bootcamp Best Data Science Bootcamp 2020 Best Ranked Big Data Book Launch Book-Signing bootcamp Bootcamp Alumni Bootcamp Prep Bundles California Cancer Research capstone Career Career Day citibike clustering Coding Course Demo Course Report D3.js data Data Analyst data science Data Science Academy Data Science Bootcamp Data science jobs Data Science Reviews Data Scientist Data Scientist Jobs data visualization Deep Learning Demo Day Discount dplyr employer networking feature engineering Finance Financial Data Science Flask gbm Get Hired ggplot2 googleVis Hadoop higgs boson Hiring hiring partner events Hiring Partners Industry Experts Instructor Blog Instructor Interview Job Job Placement Jobs Jon Krohn JP Morgan Chase Kaggle Kickstarter lasso regression Lead Data Scienctist Lead Data Scientist leaflet linear regression Logistic Regression machine learning Maps matplotlib Medical Research Meet the team meetup Networking neural network Neural networks New Courses nlp NYC NYC Data Science nyc data science academy NYC Open Data NYCDSA NYCDSA Alumni Online Online Bootcamp Online Training Open Data painter pandas Part-time Portfolio Development prediction Prework Programming PwC python Python Data Analysis python machine learning python scrapy python web scraping python webscraping Python Workshop R R Data Analysis R language R Programming R Shiny r studio R Visualization R Workshop R-bloggers random forest Ranking recommendation recommendation system regression Remote remote data science bootcamp Scrapy scrapy visualization seaborn Selenium sentiment analysis Shiny Shiny Dashboard Spark Special Special Summer Sports statistics streaming Student Interview Student Showcase SVM Switchup Tableau team TensorFlow Testimonial tf-idf Top Data Science Bootcamp twitter visualization web scraping Weekend Course What to expect word cloud word2vec XGBoost yelp