This vignette tries to implement the SPSS code used by the Murder Accountability Project to look for serial killers.
library(murderdata) library(dplyr) library(magrittr)
We are using the supplementary data set since it has the most detail.
glimpse(md_supplementary)
As you can see there are plenty of data to look at. So lets get to it.
We will create a data set that summarizes the data for us. We will group by the sex of the victim, the country of the murder and the weapon used. Then we will summarize total murders, cases solved and the percentage solved.
serial_killers <- md_supplementary %>% mutate(solved = solved %>% factor() %>% as.numeric() %>% subtract(1)) %>% group_by(vicsex, cntyfips, weapon) %>% summarise(total = n(), solved = sum(solved), percentage = mean(solved)) %>% ungroup() serial_killers %>% head() %>% knitr::kable()
We want to find possible serial killers. We will focus on female victims only, then find counties where more than 33% of a specific type of murder (by choice of weapon) has gone unsolved.
possible_serial_killers <- serial_killers %>% filter(vicsex == "Female", percentage <= .33) %>% mutate(unsolved = total - solved) %>% arrange(desc(unsolved))
possible_serial_killers %>% select(-vicsex) %>% head() %>% knitr::kable()
Here we see that in San Mateo County in California we have seven women burned to death and none of them have been solved... Is there a potential serial killer lurking?
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.