} ANLY560 Time Series Project - Tegveer Ghura - Data Visualization

Summary

The analysis of the data collected begins from this pivotal section. Every data science project, especially those utilizing Time Series data, starts with Data Visualization because it allows for easy and intuitive interpretation of complex data sets. These visualizations help data scientists identify patterns, trends, and relationships that might otherwise be difficult to discern by looking at the summary statistics the raw data, for example. The visualizations presented below were created using Tableau and the packages ggplot2 and Plotly in the R software.

Visualizing the GTD™

For the purpose of this project, the focus will be on the United States, so the data has been filtered accordingly. An important point to keep in mind is that incidents of terrorism from 1993 are not present in the GTD™ because they were lost by the authors. Hence, few visualizations created in R, using the GTD™, do reflect this aberration, as missing values for the year 1993 were not imputed.

To start, the visualizations below provide a general overview of how the number of terrorist attacks and fatalities have changed over time.

Evolution of Volume of Terrorist Attacks and Fatalaties (1970-2020) in the US

Code
plot_ly(data=gtd_monthly_attacks_deaths, x=~Date)  %>% 
    add_trace(type = 'scatter', mode = 'lines', y=~num_attacks, 
            name="Attacks", line = list(color = 'red')) %>%
    add_trace(type = 'scatter', mode = 'lines', y=~num_fatal, 
            name="Fatalities", line = list(color = 'black')) %>%
  layout(title="Monthly Count of Terrorist Attacks & Fatalities in the US",
         yaxis=list(title=("Count")),
         xaxis=list(title=("Date"))) %>%
  layout(hovermode = "x")
Code
plot_ly(data=gtd_monthly_attacks_deaths %>% filter(num_fatal<20), x=~Date)  %>% 
    add_trace(type = 'scatter', mode = 'lines', y=~num_attacks, 
            name="Attacks", line = list(color = 'red')) %>%
    add_trace(type = 'scatter', mode = 'lines', y=~num_fatal, 
            name="Fatalities", line = list(color = 'black')) %>%
  layout(title="Monthly Count of Terrorist Attacks & Fatalities in the US",
         yaxis=list(title=("Count")),
         xaxis=list(title=("Date"))) %>%
  layout(hovermode = "x")
Code
gtd_yearly <- gtd_USA %>% 
              group_by(year(Date)) %>% 
                  summarise(num_attacks = n(), 
                            nkill=sum(nkill))

gtd_yearly_cum_attacks_deaths <- gtd_yearly %>% 
                      summarise(cum_attacks=cumsum(num_attacks),
                             cum_deaths = cumsum(nkill)) %>% 
  mutate(Date=gtd_yearly$`year(Date)`)

plot_ly(data=gtd_yearly_cum_attacks_deaths, x=~Date)  %>% 
    add_trace(type = 'scatter', mode = 'lines', y=~cum_attacks, 
            name="Cumulative Attacks", line = list(color = 'red')) %>%
    add_trace(type = 'scatter', mode = 'lines', y=~cum_deaths, 
            name="Cumulative Fatalities", line = list(color = 'black')) %>%
  layout(title="Yearly Cumulative Count of Terrorist Attacks & Fatalities in the US",
         yaxis=list(title=("Cumulative Count")),
         xaxis=list(title=("Date"))) %>%
  layout(hovermode = "x")

The first plot (Number of Monthly Attacks and Fatalities) conveys the significance of the 9/11 Attacks on US history. The big black spike in fatalities, totaling approximately 3000, is representative of the attack and an “outlier” from both series. As a result, in order to depict the trend of both series clearly, it was imperative to filter out the 9/11 Attacks and that is why the second plot was created. A cumulative graph of number of attacks and fatalities is showcased as well that provides further context about the impact of the 9/11 Attacks. Total fatalities were much lower than total number of attakcs from 1970 to 2000, but the toll of the 9/11 Attacks were significant enough to surpass the 2,424 attacks that occurred up until the tragedy.

Moreover, the total number of fatalities between 1970 and 2000 was 492 and the total number of fatalities between 2001 and 2020 was 419, suggesting that attacks apart from 9/11 follow a similar trend in death rate. Lastly, the number of attacks between the years 1976 and 2004 follow a concave shape, implying that the volume of attacks must be diminishing through the years. However, a steep, exponential rise in not only the number of attacks but also the number of fatalities is noticed after 2004!

Here are a few facts (“Terrorist Attacks in the u.s Between 1970 and 2013: Data from the ... - DHS,” n.d.) attacks in the US between 1970 and 2013:

  • Approximately 85% of all deaths from terrorist attacks during this period occurred in the coordinated attacks on September 11, 2001.

  • Nearly 80% of all terrorist attacks involved no casualties (fatalities or injuries).

  • More than half of terrorist attacks took place during the 1970s. Between 2000 and 2013, there were fewer than 20 attacks per year on average.

Evolution of Terrorist Attacks: Approach, Victims, and Weapons (Raw Counts)

The above bar chart races allow for an animated way to display the number of attacks changing over time by the categorical variables, Attack Type, Victim Type, and Weapon Type. The 1970s and 1980s were dominated by Bombing/Explosion Terrorist Attacks in the US, with Facility/Infrastructure Attacks gaining momentum by the end of the 1980s. Many of these bombings were carried out by leftist extremist groups, such as the Weather Underground and the Black Liberation Army, who were motivated by a variety of political and social causes, including opposition to the Vietnam War, racial injustice, and government oppression (Serrano 2008).

One factor that contributed to the prevalence of domestic bombing attacks during this period was the rise of radical political activism and social unrest. The Vietnam War was a major source of division in American society, and many activists were inspired to use violent tactics in their protests. Additionally, the civil rights movement and the Black Power movement brought attention to issues of racial inequality, and some extremist groups sought to further their agendas through bombings and other violent actions. Another factor was the relative ease with which these groups could obtain explosives and other materials necessary to carry out bombings. Many of the bombs used in these attacks were constructed using readily available materials such as dynamite and pipe bombs, and there were few restrictions on the purchase of these materials at the time (Rosenau, n.d.).

In the 1970s and 1980s, a majority of the victims of these attacks included businesses (corporate offices, restaurants, gas stations, bars, cafés, etc.), the government (government building, government member, former members, or events sponsored by political parties, etc.), and private citizens and property (the public in general or attacks in public areas including markets, commercial streets, busy intersections and pedestrian malls) (“Codebook Methodology Inclusion Criteria and Variables - UMD,” n.d.). Moreover, numerous attacks on abortion clinics were conducted in the 1980s and 1990s by anti-abortion activists. These attacks took various forms, including bombings, arson, and other acts of violence, as well as peaceful protests and acts of civil disobedience. Another factor that contributed to the attacks on abortion clinics was the political and legal context of the time. In 1973, the US Supreme Court issued its landmark decision in Roe v. Wade, which established a constitutional right to abortion. This decision was highly controversial and sparked a wave of political and social activism on both sides of the issue.

From recent years, the data portrays an increase in attacks against both Religious Figures/Institutions and the police. Therefore, terrorists’ aims and agendas have transformed over time as the underlying narrative of a country’s political climate changes. In a smaller sense, to conduct an attack, the US has also suffered from the evolution of weapons used by terrorists. As aforementioned, the 1970s and 1980s experienced bombings as the majority of attacks and the weapons used during that time support this finding. Explosives and incendiaries made up the majority of weapons used in the 1970s and 1980s, with firearms gaining traction. By the late 90s, less use of explosives is seen and a shift to incendiaries, firearms, chemical, and biological weapons becomes prominent.

Here are some more facts (“Terrorist Attacks in the u.s Between 1970 and 2013: Data from the ... - DHS,” n.d.) related to the bar chart races:

  • 94% of attacks against abortion‐related targets were on clinics, while 6% targeted providers or personnel.

  • 78% of attacks against educational targets were on schools, universities, or
    other buildings, while 22% targeted teachers or other educational personnel.

  • 73% of attacks against government targets were on government buildings, facilities, or offices, while 27% targeted personnel, public officials, or politicians.

Evolution of Terrorist Attacks: Approach, Victims, and Weapons (Percent of Total)

Evolution of Terrorist Attacks By US State (Geospatial)

Visualizing the SIPRI Military Expenditure Database

Code
# new dataframe for total number of attacks 1970-2020
sipri_usa <- sipri_gdp %>% filter(Country=="United States of America")

# transpose to make columns into rows
sipri_usa <- as.data.frame(t(sipri_usa))
sipri_usa <- as.numeric(sipri_usa[-1,]) # delete first row 
sipri_usa <- round(sipri_usa*100, 4)

# convert to time series object
sipri_usa_ts <- ts(sipri_usa, start = c(1949), frequency = 1)

g <- autoplot(sipri_usa_ts, 
         main="Yearly US Military Expenditure as % of GDP",
         ylab = "Military Expenditure as % of GDP",
         xlab = "Date") +
  theme_minimal()
ggplotly(g) %>% layout(hovermode = "x")

Visualizing Department of Homeland Security’s Non-Immigrant Admissions Data

Code
dhs <- dhs %>% filter(Year>=2002)
fig <- plot_ly(dhs, x = ~Year, y = ~`Temporaryvisitorsforpleasure(B2)`,name = 'B2 Tourist Visa Holders', type = 'scatter', mode = 'lines')
fig <- fig %>% add_trace(y = ~`Temporaryvisitorsforbusiness(B1)`, name = 'B1 Business Visa Holders', type = 'scatter', mode = 'lines')
fig <- fig %>% add_trace(y = ~`Academicstudents(F1)`, name = 'F1 Student Visa Holders', type = 'scatter', mode = 'lines')

fig <- fig %>% layout(title = 'Select Non-Immigrant Admissions 2002-2021',
                      yaxis=list(title = 'Number of Admissions (in millions)'))
fig

Section Code

Code for this section can be found here

References

“Codebook Methodology Inclusion Criteria and Variables - UMD.” n.d. Global Terrorism Database. University of Maryland. https://www.start.umd.edu/gtd/downloads/Codebook.pdf.
Rosenau, William. n.d. “Leftist Terrorism in the United States.” Taylor &Amp; Francis. The Journal of Strategic Studies (2013). https://www.tandfonline.com/journals/fjss20.
Serrano, Richard A. 2008. “The 1970s Bombing Spree.” Los Angeles Times.
“Terrorist Attacks in the u.s Between 1970 and 2013: Data from the ... - DHS.” n.d. Terrorist Attacks in the U.S Between 1970 and 2013: Data from the Global Terrorism Database (GTD). START Consortium at the University of Maryland. https://www.dhs.gov/sites/default/files/publications/OPSR_TP_TEVUS_Terrorist-Attacks-US_1970-2013_Overview-508.pdf.