Parameters and Power Plays

Robb Tufts
on March 31, 2014

Editor's note: Robb Tufts is a sports data blogger with hockey vizzes featured on McKeen's Hockey and St. Louis Game Time. He also creates vizzes for the U.S. Green Building Council's website.

One of the things I love about writing for St. Louis Game Time are the questions readers and the other writers pose to me from time to time. The most recent question was posed by one of our writers. Essentially, there is a perception the Blues were missing the net a lot when taking shots during power plays. He wanted to know if what people claimed they were seeing with their eyes could be confirmed or denied using stats.

I used data from the new hockey stats site to put together the two charts you see below. I was able to calculate the number of missed shots by subtracting the shots for from the team’s fenwick for stat. The fenwick stat in hockey counts all shots (except blocked shots) that a team makes. This includes goals, misses, saves. So in order to pull the number of misses out of the fenwick stat, we subtract the number of shots for (which are shots on net and goals scored) from fenwick. That should leave us with just the missed shots for each team. And since each team has different amounts of power play time, I created a shots missed per 60 minutes of ice time. The per 60 minutes of ice time is created by dividing the time on ice for a team by 60. So the shots missed per 60 is shots missed divided by the per 60 minutes of ice time.

As you can see, the St. Louis Blues are just at the league average in the number of misses per 60 and also at the league median for minutes of power play time. So are the Blues really bad at taking shots during the power play? Not really. With the median amount of power play time, they are making an average number of misses. I like that sound of that.

But what's even better is the fact that they are one of the top teams in goals scored and goals per 60 scored in the league right now. They are above median and above average, respectively, in both of those stats. Not to mention they have the third best shooting percentage in the league at the moment.

The Blues' power play is doing a pretty decent job so far this season.

This viz doesn’t contain a lot of interactivity, but I did provide a way for individuals to be able to sort the bars using the different stats contained within each of the charts. This is easily done using a parameter and a calculated field.

First I created a parameter for each of the charts. Then I created a list within the parameter of the different measures I wanted a reader to be able to sort by.

Next, I created a calculated field using the parameter in a case statement. This assigns the proper value to this calculated field based on what the reader chooses.

Finally, I added the field in the sort by for the dimension and set the direction to descending.

You can use this same technique to change give your reader the ability to choose different measures for color encoding, or even for choosing what measure they want to view on an axis.
While there isn’t a lot of drilling down or interactivity in this visualization, providing the reader with something as simple as a method to sort by different values (including those that might not be included in the actual visualization) provides them with a certain amount of control and ability to explore different relationships.