Once I had the Hubway bike system data loaded into a database, and modeled into MicroStrategy, I could start to play with the data and do some basic profiling. The more I looked at the data, the more I wanted to add things. For example, the trips table as the birth year of subscribing riders, which lends itself to creating an age attribute. To model in age, I created an attribute and used the pass-through applysimple function. This is the basic syntax needed: ApplySimple(“(year(#0)-#1)”, [start_date_desc], [birth_date]).
When added to a report by itself, the age attribute will generate the following SQL:
SELECT DISTINCT (YEAR(a11.start_date_desc)-a11.birth_date) CustCol_3
FROM trips a11
As mentioned in the part 1 post, the data offers the opportunity to add more layers and texture because the dimensions are so generic. Latitude and longitude coordinates can be used to derive the elevation, which would answer one of the questions on the Hubway Data Challenge web site, Do Hubway cyclists only ride downhill? A data dimension could be used to correlate against the academic schedule, or even gas prices. Anyway, on to the eye candy…
For those of you who read Stephen Few you know that visual design isn’t easy. Few’s philosophy espouses simplicity and elegance over complexity and flash. If you can’t generally understand the data in less than ten seconds you have failed your audience. Basic, muted colors that make careful use of highlights is preferred over harsh and bright color tones throughout. These are all great recommendations, and as I progress through the different phases of my interaction with the data I will adhere more closely to these recommendations. In the meantime, I simply want to profile the data using some basic charts and graphs. The alternative to graphing the data is that you get wide and long grids of data with visual appeal. The tradeoff is that you get to pivot the data, sort it, filter it, etc., but exceptions, trends, and a general sense of the data quality doesn’t readily present itself.
So, a quick and dirty way to start to understand the data is to graph it. I have gotten used to the MicroStrategy graphing options, but many developers will cite the core graphing technology as one of the weaker aspects of the platform. The widgets and visual insight graphics have exceeded the Desktop graphing capabilities, but I still like to use the graph formatting to create vertical / horizontal bar charts, scatterplots, and time-series analyses. So, simply to get a flavor of the data I created a few graphs.
This graph shows the activity (trips) for a month — in the page-by — and I tried see if there was a way to quickly tell whether temperature spikes led to a decrease in usage. To do this correctly I’d likely want to average out the trips by weekday and get a rolling temperature average. Only with the means in place can I get a true understanding of whether a 10 degree shift in temperature leads to an n% variation in usage.
One of the data challenge sample questions asks whether rentals after 2 AM are more likely to come from the under 25 population. I extended this question to ask whether usage varies by gender. I took liberties with the coloring for effect, but I would mute these tones in a dashboard. I also incorporated another axis (trip distance) to see whether rides are longer at certain times in the day, but since I didn’t use an average metric, the second axis isn’t very meaningful.
No basic correlation study should go without a scatterplot. The r values are included, but aren’t very telling. To make this graph work I had to clear out the trips that involved 0 distance (i.e., the rent and return location are the same). Because this graph also had month in the page-by, some months showed a higher r value than others. Again, I’m simply using this to get a feel for the data and get some general answers to high level questions.
Based on some feedback I got from a colleague, I was advised to try and label the axes. I tried to do something that tied the color of the axis to the metric, and this is what I got. To me this graph is telling in that it appears to suggest that as the bike rental program became part of the city culture, people started taking longer rides.
So, it’s a start. With some basic profiling underway I am starting to compile a list of some high level questions that might be telling or informative about the data. Station analysis and trip patterns are a good place to go with the data, and some of the questions that I’ve started to formulate go along these lines:
- Which station sees the most usage?
- What percent of trips end and start in the same place?
- What bikes see the most usage, and of them, what side of the river do they spend the most time on?
- How has usage changed this year versus last year? Can the data be used to illustrate the growth of the program in some neighborhoods versus others?