to your HTML Add class="sortable" to any table you'd like to make sortable Click on the headers to sort Thanks to many, many people for contributions and suggestions. Licenced as X11: http://www.kryogenix.org/code/browser/licence.html This basically means: do what you want with it. */ var stIsIE = /*@cc_on!@*/false; sorttable = { init: function() { // quit if this function has already been called if (arguments.callee.done) return; // flag this function so we don't do the same thing twice arguments.callee.done = true; // kill the timer if (_timer) clearInterval(_timer); if (!document.createElement || !document.getElementsByTagName) return; sorttable.DATE_RE = /^(\d\d?)[\/\.-](\d\d?)[\/\.-]((\d\d)?\d\d)$/; forEach(document.getElementsByTagName('table'), function(table) { if (table.className.search(/\bsortable\b/) != -1) { sorttable.makeSortable(table); } }); }, makeSortable: function(table) { if (table.getElementsByTagName('thead').length == 0) { // table doesn't have a tHead. Since it should have, create one and // put the first table row in it. the = document.createElement('thead'); the.appendChild(table.rows[0]); table.insertBefore(the,table.firstChild); } // Safari doesn't support table.tHead, sigh if (table.tHead == null) table.tHead = table.getElementsByTagName('thead')[0]; if (table.tHead.rows.length != 1) return; // can't cope with two header rows // Sorttable v1 put rows with a class of "sortbottom" at the bottom (as // "total" rows, for example). This is B&R, since what you're supposed // to do is put them in a tfoot. So, if there are sortbottom rows, // for backwards compatibility, move them to tfoot (creating it if needed). sortbottomrows = []; for (var i=0; i
We were digging into U.S. homicide data when we stumbled across some interesting statistics. The U.S. Department of Justice breaks down the number of homicides each year by both the race of the offenders as well as the race of the victims, at least for homicide cases where there's just a single offender and a single victim.
Since the data is only presented in table form, we thought it might make for a good data visualization project. Our first chart shows the number of victims, with the individual data points in each stacked column indicating the number of victims that were attributed to the indicated offender race category in 2008, the most recent year for which data has been posted at this writing. We should note that these homicides, with a single victim and a single offender, represent about 48.5% of the total number of homicides reported in the U.S. in 2008.
In reading the chart above, the total number of victims for each racial group is identified in the column heading at the bottom of the chart, while the total number of offenders for each racial group is identified in the data legend. These latter values are the sum of the data values for each victim racial category.
Next, we calculated the percentage of victims whose homicides were attributed to offenders of the indicated racial category, generating the chart below.
What we find is that in homicide cases where there's just a single victim whose murder may be attributed to a single offender, the victim racial's category is the same as that of the offender. In 2008, that means that 83.3% of murdered white victims were killed by white offenders, while 90% of black murder victims were killed by black offenders.
The same pattern is seen for homicide victims of other races, who were predominantly killed by offenders whose race was also categorized as "other," meaning their race was identified as being neither white nor black.
The pattern only breaks down when we get to the situation where the race of the victim has not been identified, where the offenders appear to be nearly equally split among the white, black and unknown racial categories. Here, homicide victims whose race is categorized as "other" accounts for very few of the murders where the victim's race has not been identified.
What that means however is that homicide victims are much, much more likely to have been killed by offenders of the same racial category than they are to have been killed by individuals of other racial categories.
U.S. Department of Justice. 2008 Crime in the United States. Expanded Homicide Data Table 6. Race and Sex of Victim by Race and Sex of Offender, 2008. [Single victim/single offender].
Labels: crime, data visualization, demographics
Welcome to the blogosphere's toolchest! Here, unlike other blogs dedicated to analyzing current events, we create easy-to-use, simple tools to do the math related to them so you can get in on the action too! If you would like to learn more about these tools, or if you would like to contribute ideas to develop for this blog, please e-mail us at:
ironman at politicalcalculations
Thanks in advance!
Closing values for previous trading day.
This site is primarily powered by:
The tools on this site are built using JavaScript. If you would like to learn more, one of the best free resources on the web is available at W3Schools.com.