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
One of the things that makes science such a cool pastime is that sometimes, when digging through data to investigate a hypothesis that you have, that data tells you that something very different from what you started investigating is happening!
So let's start this story with the hypothesis that we were investigating. Back in January, Philadelphia imposed a new tax on sweetened beverages distributed within its city limits. The tax, when passed through to retail customers, has resulted in a significant price increases for soft drinks. So much so that some soft drinks have seen their cost increase to be greater than some alcohol-containing beverages.
We wondered then if that relative change in costs might be prompting Philadelphia's consumers to change their drinking habits? Could something like sports drinks becoming more costly than beer be leading more Philadelphians to switch to harder drinks? And if so, could increases in some of the well established social consequences of alcohol consumption be far behind?
It occurred to us that one way to find out would be to consider the impact that increased alcohol consumption might have, where we might expect things like arrests for Driving Under the Influence (DUI) of alcohol might increase in response to its recently having become more relatively affordable for consumers. So we pulled data for the number of DUI arrests in Philadelphia County, which falls entirely within Philadelphia's city boundaries, from the Pennsylvania Uniform Crime Reporting System. The chart below reveals what we found for all DUI arrests by month from January 2007 through March 2017:
A quick inspection of 2017's data for the year to date versus that for the previous ten years is pretty definitive, at least for the first three months for which we have data - we can reject the hypothesis that higher soft drink costs are leading Philadelphia consumers to drink more alcohol-containing beverages that are in turn leading to more DUI arrests!
Now for the cool part where the data sent us onto a major detour. The following chart shows the same data in full chronological order, which shows the overall trends for Philadelphia County DUI arrests over time.
Here, we can confirm that since early 2011, the number of DUI arrests in Philadelphia have significantly trended downward.
Although the data only extends back to January 2007, it's enough to tell us that Philadelphia DUI arrests would appear to follow a multi-year cycle, where there are what we might describe as two full cycles before June 2012. Both upcycles would appear to be tied to increased law enforcement activities rather than an increase in the incidence of drunken driving, as suggested by slowly declining number of fatal crashes involving alcohol impairment during this time.
But after June 2012, things would appear to have changed for the better. The one-year-rising, one-year-falling pattern goes away, where in its place, a much steadier and consistent downtrend has taken hold, which also coincides with a much more pronounced declining trend in the number of alcohol-related vehicle crashes.
So what happened in June 2012 to change things for the better? On 6 June 2012, the ridesharing service operated by Uber was launched in Philadelphia's metropolitan area, which was followed by Lyft two-and-a-half years later.
Since using the rideshare apps are much less costly and more convenient than hailing traditional taxi for rides around town, these services have quickly become popular among Philadelphia's alcohol-consuming community, which would appear to have significantly reduced the number of DUI arrests and vehicle accidents involving alcohol consumption in the city.
Not that the city of Philadelphia's leadership isn't trying to snatch defeat from the jaws of success. In this case however, the state of Pennsylvania's leadership acted to override the city's entrenched political interests to act instead in the best interest of the public, where the positive trend in fewer DUI arrests has been allowed to continue.
It's a long way from where we started when we began investigating our original hypothesis, but turning up direct evidence of the public benefits of ridesharing apps to the people who live in a city like Philadelphia along the way makes for the kind of detour we like to follow!
Labels: crime, technology
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.