Intentional Homicide in South America 1995-2010
Intentional homicide is defined as unlawful death purposefully inflicted on a person by another person. The source of this stat is The United Nations Office on Drugs and Crime (UNODC).
I created the above image using ggplot2 which does 98% of the leg-work in most cases. Count is the number of homicides in a calendar year and homicide rate per 100.000 population.
Then with a litttle of Adobe Illustrator the final datavis looks like this:
require(XLConnect)
library(reshape)
library(ggplot2)
homicides <- wb["Sheet1"]
colnames(homicides) <- c("country","stat",seq(from=1995,to=2010))
h.count[,-2]
s <- melt(homicides,id.vars=c('country','stat'))
s <- subset(s, value!=-1)
s2 <- as.data.frame(cast(s,country+variable~stat))
midpoint <- mean(range(na.omit(s2$Rate)))
p <- ggplot(s2,aes(x=variable,y=country)) +geom_point(aes(size=Count,color=Rate))
p <- p+ scale_size(to = c(3, 10)) + scale_color_gradient2(low='darkgreen',mid="yellow", high="red",midpoint=midpoint)
p <- p+theme_bw()
p <- p+opts(panel.grid.major=theme_blank(),panel.grid.minor=theme_blank())
p
Categories: graph
ggplot2, unodc, homicide rate, united nations office, datavis


should really be a lineplot
Agree with you, if you were to show only one stat either count or rate. Here I tried to experiment upon showing multiple variables at the same time.
There is definitely value added when you try presenting things in a new way. Don’t worry about being snubbed by Tuftians and the like. You engage your audience with this fresh look and there is much to be said for that.
Are you willing to post the R code used to generate these plots?
Sure, I’ll post the code today
Jon, I just posted the code.
Can you post the data as well?
Hi Alberto,
While I find the graphs pleasant I do not think they are particularly informative. At the end of the day, people will be interested in the relative risk (murders/100,000) rather than the counts, which are distorted by population size. For example, there are many more homicides in Brazil (population ~195M) than in Venezuela (population ~ 29M); however, the latter is way more dangerous with 52 vs 30 homicides/100,000 people. If I were traveling to one of the two destinations I would care about relative risks and go to Brazil. We already know that their population sizes are quite different.
In addition, the scale for count is quite misleading. If we go to 2007, when there was data for all countries, Surinam (count 45) has the same circle size as Peru (count 845); almost 20 (!) times difference is not reflected.
I support Eduardo’s suggestion: line plots would let you compare the trends of violence across countries much more easily. I still think that there are occasions where you would like to use punchcard plots; see, for example, the the announcement of wolfram alpha pro.
Muchos saludos.
Luis,
My original graph was based only in the relative risk as it is the “standard way” of comparing countries with different population sizes. Then, I looked to a specific case: Argentina RR 5.3 vs. Suriname RR 8.5 in 2007 and showed it to different people (colleagues, friends, family) with different backgrounds and they all agreed that if they had to choose one of the two countries they’d go to Argentina.
Then I showed them the number of deaths (Suriname 45 vs Argentina 2052) and suddenly their perceptions of risk/danger changed along with their choice of destination ( They’d rather go Suriname) completely. Even though I explained them about population sizes they kept their new choice of going to Suriname. Did I persuade/bias people’s decisions by showing counts? Probably
The level of risk people are willing to take is a matter of perception and taste. While you would go Argentina based on the RR some other will take the chance and go to Suriname. Neither of both decisions are right or wrong, it just a perception on how keen someone is to take a certain level or risk.
That was the main reason behind adding all this information in a single graph, to let the reader make his/her own mind based on perception.
Regarding to the bubble sizes, that’s completely my fault for not knowing exactly how to make better cut offs using ggplot.
Saludos,
Alberto
Great. But to be more… homogeneous with my OS and my filosophy, I will use the Gimp instead Adobe things…