assignment1_

Author

Jorge Balmaseda Hdez

Published

September 29, 2024

Question 1

There are 250 assassination attempts recorded in the data, so that 88 countries experienced at least one assassination attempt. The average number of assassination attempts per year for these countries is 2,5.

nrow(leaders)
[1] 250
length(unique(leaders$country))
[1] 88
leaders %>% 
group_by(age, year)
# A tibble: 250 × 11
# Groups:   age, year [237]
    year country     leadername      age politybefore polityafter interwarbefore
   <int> <chr>       <chr>         <int>        <dbl>       <dbl>          <int>
 1  1929 Afghanistan Habibullah G…    39           -6       -6                 0
 2  1933 Afghanistan Nadir Shah       53           -6       -7.33              0
 3  1934 Afghanistan Hashim Khan      50           -6       -8                 0
 4  1924 Albania     Zogu             29            0       -9                 0
 5  1931 Albania     Zogu             36           -9       -9                 0
 6  1968 Algeria     Boumedienne      41           -9       -9                 0
 7  1992 Algeria     Boudiaf          73           -2       -5.67              0
 8  1908 Argentina   Alcorta          48            1        1                 0
 9  1916 Argentina   de la Plaza      76            2        2                 0
10  1929 Argentina   Irigoyen         77            2       -8                 0
# ℹ 240 more rows
# ℹ 4 more variables: interwarafter <int>, civilwarbefore <int>,
#   civilwarafter <int>, result <chr>
mean(table(leaders$year))
[1] 2.45098

Question 2

The success rate is of 21%. This result does not speak for to the validity of the assumption that the success of assassination attempts is randomely determines, since it is not 50%.

leaders <-leaders %>%
  mutate(success = case_when(result == "dies between a day and a week" ~ 1, 
                             result == "dies between a week and a month" ~ 1,
                             result == "dies within a day after the attack" ~ 1,
                             result == "dies, timing unknown" ~ 1,
                             result == "hospitalization but no permanent disability" ~ 0,
                             result == "not wounded" ~ 0,
                             result == "plot stopped" ~ 0,
                             result == "survives but wounded severely" ~ 0,
                             result == "survives, whether wounded unknown" ~ 0,
                             result == "wounded lightly" ~ 0))

successrate <- leaders %>% 
  summarize(succesrate = mean(success))
print(successrate)
  succesrate
1      0.216

Question 3

Average polity score before the assassination attempt shows a difference of about a point between those countries where it was and wasn’t successful (being lower in countries where it wasn’t successful). The data also shows that successfully assassinated leaders where on average almost 4 years older. It therefore looks like the average polity score and age of the leaders could help explain the differences in success of assassination attempts. Statistical tests would be needed to assess the significance of the observed differences.

avgpolitybefore <- leaders %>% 
  group_by(success) %>% 
  summarize(avgpolitybefore = mean(politybefore))

print(avgpolitybefore)
# A tibble: 2 × 2
  success avgpolitybefore
    <dbl>           <dbl>
1       0          -1.74 
2       1          -0.704
avgage <- leaders %>% 
  group_by(success) %>% 
  summarize(avgage = mean(age))

print(avgage)
# A tibble: 2 × 2
  success avgage
    <dbl>  <dbl>
1       0   52.7
2       1   56.5

Question 4

There is almost a 1,5 percentage-point difference - resulting from a 22,2% success rate for countries that didn’t experience a war before the assassination attempt and a 20,7 success rate for those that did. At first, without testing for significance, it seems a minor difference. Would it be significant, it would mean that countries that didn’t experience war before the assassination attempt were slightly more likely to experience a successful assassination attempt. Pre-assassination peace would to a small degree account for the success of assassination attempts.

###create dichotomous variable
leaders <-leaders %>%
  mutate(warbefore = if_else(civilwarbefore == 1 | interwarbefore == 1, 1, 0))
###check whether it worked
table(leaders$warbefore, leaders$civilwarbefore)
   
      0   1
  0 158   0
  1  38  54
table (leaders$warbefore, leaders$interwarbefore)
   
      0   1
  0 158   0
  1  45  47
##porcentage of countries that experienced war before assassination attempt
summarize(leaders, summary = mean(leaders$warbefore == 1))
  summary
1   0.368
##porcentage of countries that didn't experience war before assassination attempt
summarize(leaders, summary = mean(leaders$warbefore == 0))
  summary
1   0.632
##success rate comparison between countries with(out) war before assassination attempt
leaderswar <- leaders %>% 
  filter(warbefore == 1)

leaderspeace <- leaders %>% 
  filter(warbefore == 0)

##success rate countries without war before assassination attempt
mean(leaderspeace$success)
[1] 0.221519
##success rate countries with war before assassination attempt
mean(leaderswar$success)
[1] 0.2065217
### ALTERNATIVELY

warbefore_success <- leaders %>% 
  group_by(success, warbefore) %>% 
  count() %>% 
  pivot_wider(names_from = success,
              values_from = n) %>% 
  rename(unsuccessful = "0",
         successful = "1") %>% 
  mutate(total_result = unsuccessful + successful,
         prop_succes = successful / total_result)

warbefore_success
# A tibble: 2 × 5
# Groups:   warbefore [2]
  warbefore unsuccessful successful total_result prop_succes
      <dbl>        <int>      <int>        <int>       <dbl>
1         0          123         35          158       0.222
2         1           73         19           92       0.207

Question5

To answer the question of whether successful leader assassination leads to democratization I have calculated the average polity score for countries where leaders were successfully assassinated, before and after the assassination and compared them. Since the polity index goes from -10 to 10 with 10 meaning highest democratic levels, it seems that successful assassination attempts actually produce a deterioration of democratic institutions. These countries had an average polity score of -0,70 before the assassination attempts which fell down to -0,76 after its success. The difference is however very small. Again, it is difficult to assess its significance yet, but it does seem like an irrelevant difference, considering the number of cases in this data set. Furthermore it would be more appropriate to observe at the differences for each country in the polity score, since the effects in the scores of countries more or less democratic - to the right or left of the 0 - could be cancelling others out in the average score. To answer the question of whether successful leader assassination attempts lead to war I have looked at the difference between cases in which assassination attempts were successful and unsuccessful in respect to whether war followed the assassination attempt. Almost 30% of the countries where assassination attempts were unsuccessful experienced war, which is a 10 percetange-point difference with respect to those countries where the assassination attempt was successful (only 20% of these did experience war afterwards). It seems therefore that successful assassination attempts correlate with a lower chance to experience war. I have then wanted to look at it a bit closer by considering pre-assessination attempt war experience. I have thus looked at the way war experiences prior to the successful assassination attempts might account for the occurrence of war after them. Data show that there was double the chance (0,32/0,14= 2,29) to experience war after a successful assassination attempt if they had experienced war before it. In countries where the assassination attempt was unsuccessful the chance to experience war afterwards was four times higher if there had been war before. For both, unsuccessful and successful attempts alike, if there had been no war before, the probability of war is almost the same, around 14%. It therefore seems that the differences between the two have more to do with wars prior to the assassination attempts rather than to their success.

## assass success -> democratization
## avg polity score for countries with successful assessattempt after
avgpolityaftersuccess <- leaders %>% 
  filter(success == 1) %>% 
  summarize(avgpolityaftersuccess = mean(polityafter))

## avg polity score for countries with successful assassattempt before
avgpolitybforesuccess <- leaders %>%
  filter(success == 1) %>% 
  summarize(avgpolitybforesuccess = mean(politybefore))

## comparison of both avg
print(avgpolityaftersuccess)
  avgpolityaftersuccess
1            -0.7623457
print(avgpolitybforesuccess)
  avgpolitybforesuccess
1            -0.7037037
## asass success -> war
leaders <-leaders %>%
  mutate(warafter = if_else(civilwarafter == 1 | interwarafter == 1, 1, 0))

warrateaftersuccess <- leaders %>% 
  group_by(success, warafter) %>% 
  count() %>% 
  pivot_wider(names_from = warafter,
              values_from = n) %>% 
  rename(no_war_after = "0",
         war_after = "1") %>% 
  mutate(total_countries = no_war_after + war_after,
         prop_war = war_after / total_countries)

print(warrateaftersuccess)
# A tibble: 2 × 5
# Groups:   success [2]
  success no_war_after war_after total_countries prop_war
    <dbl>        <int>     <int>           <int>    <dbl>
1       0          138        58             196    0.296
2       1           43        11              54    0.204
## digging deeper

waraftersuccess_deponwarbefore_succ <- leaders %>% 
  filter(success == 1) %>% 
  group_by(warafter, warbefore) %>% 
  count() %>% 
  pivot_wider(names_from = warafter,
              values_from = n) %>% 
  rename(no_war_after = "0",
         war_after = "1") %>% 
  mutate(total_warafter = no_war_after + war_after,
         prop_war = war_after / total_warafter)

print(waraftersuccess_deponwarbefore_succ)
# A tibble: 2 × 5
# Groups:   warbefore [2]
  warbefore no_war_after war_after total_warafter prop_war
      <dbl>        <int>     <int>          <int>    <dbl>
1         0           30         5             35    0.143
2         1           13         6             19    0.316
waraftersuccess_deponwarbefore_unsucc <- leaders %>% 
  filter(success == 0) %>% 
  group_by(warafter, warbefore) %>% 
  count() %>% 
  pivot_wider(names_from = warafter,
              values_from = n) %>% 
  rename(no_war_after = "0",
         war_after = "1") %>% 
  mutate(total_warafter = no_war_after + war_after,
         prop_war = war_after / total_warafter)

print(waraftersuccess_deponwarbefore_unsucc)
# A tibble: 2 × 5
# Groups:   warbefore [2]
  warbefore no_war_after war_after total_warafter prop_war
      <dbl>        <int>     <int>          <int>    <dbl>
1         0          106        17            123    0.138
2         1           32        41             73    0.562