Tuesday, February 20, 2018

A Lemma Research - Penalty Box and TOI - Part II

Part I

After completing the first part of the lemma research - penalty box - the second part was shorter, easier, but just as useful. I decided to find out the share of time teams spend on average while at even strength, on power play/shorthanded and with empty net. Then given this number, and the number of goals scored in each such situation, I was able to calculate the frequency of EVG/PPG/SHG/ENG or the reverse of it which I called the difficult of such goal.

I scanned the database of all games between the 1999/00 season and today, and all the goals extracted from these games. Penalty shot goals were ignored, regardless if during the game itself, or in post-game shootout. The EN time was calculated as total game time minus goaltender TOI. PP/SH time was deducted from the recorded PP TOI of the players. The EV time would naturally become the total game time minus EN minus PP of both teams.

Then I calculated the difficulty of scoring a goal in each of these situations through the following formula:

DiffTYPE = ( GOALSEV /  GOALSTYPE ) x ( TOITYPE / TOIEV )

where the difficulty of the EV goal is considered "1". Here are the combined results of the difficulties in a table:
SeasonEV PP SH EN
1999 1.000 0.502 3.506 0.162
2000 1.000 0.473 3.387 0.146
2001 1.000 0.492 3.635 0.153
2002 1.000 0.468 3.585 0.167
2003 1.000 0.445 3.127 0.221
2005 1.000 0.535 4.247 0.272
2006 1.000 0.506 4.000 0.228
2007 1.000 0.458 3.597 0.187
2008 1.000 0.438 3.745 0.183
2009 1.000 0.456 4.044 0.192
2010 1.000 0.450 3.517 0.177
2011 1.000 0.460 3.568 0.169
2012 1.000 0.430 3.890 0.169
2013 1.000 0.453 3.209 0.198
2014 1.000 0.427 3.564 0.171
2015 1.000 0.415 3.284 0.158
2016 1.000 0.419 3.252 0.178
2017 1.000 0.427 3.052 0.168

If you divide 1 by these values you can get the relative frequency of goals scored in each situation.

The dataset containing this data is available on the website, on the Request Analysis page.

So why did I need these two lemmas? That blog post won't be ready any time soon, and I better resume the "Page A Day series'.

Monday, February 19, 2018

A Lemma Research - Penalty Box and TOI

Nothing derails from the regular blogging like a research that you've been so eager to start, but were putting off to finish simpler and more materialistic stuff, but then you couldn't hold it off any longer.

But then, I realized that in order to do that research I need to perform a lemma research. Just like its mathematical namesake, a lemma research is one that is done for the sake of a bigger one, yet producing a useful result by itself.

So I noticed that I needed the penalty box data. Who was in the penalty box during a power play goal? More specifically, who was responsible for that goal, i.e. who left the penalty box as the result (or had a non-matched 5-minute major penalty during it). Once there was a feed that had penalty box data, but it was only since 2010 or so, and it seems to have become discontinued. Therefore I gathered the game data I already had and just went through the power play goals from 1987/88 through now, and tried to match them with penalties, while weeding out all the cancelling and all the irrelevant (e.g. misconduct) ones.

I am glad to tell that I was able to create a consistent, at least at first look, dataset. But before that I had to go in and correct penalty box entries for about 160 goals manually. About 35 of them were just forced to enter the penalty data manually, because any algorithm assigning the player in the box to the goal would be ambiguous. However I also discovered about 125 goals (120 pre 1999/00, when extra reports were introduced, and only five since) that should not even be marked as power play goals. There was no matching penalty. Of course, the mistake can be on the penalty data in the NHL report: the time of the penalty may be reported wrongly. But until further notice, these goals should not be considered PPG:

GameID P Time Scorer Team
198720125 3 9:19 BOB SWEENEY Boston Bruins
198720134 3 18:58 RICK TOCCHET Philadelphia Flyers
198720239 1 1:23 STEPHANE RICHER Montreal Canadiens
198720367 1 4:51 DALE HAWERCHUK Winnipeg Jets
198720388 1 17:46 TROY MURRAY Chicago Blackhawks
198720389 3 3:55 PAUL MACLEAN Winnipeg Jets
198720431 2 6:56 PETER TAGLIANETTI Winnipeg Jets
198720449 2 12:34 MIKKO MAKELA New York Islanders
198720471 3 10:51 ANTON STASTNY Quebec Nordiques
198720484 2 13:38 MARIO LEMIEUX Pittsburgh Penguins
198720528 1 6:32 CHARLIE SIMMER Pittsburgh Penguins
198720610 3 3:08 LAURIE BOSCHMAN Winnipeg Jets
198720735 3 8:10 MIKE FOLIGNO Buffalo Sabres
198720755 1 3:06 GARRY GALLEY Washington Capitals
198720755 2 0:29 GERALD DIDUCK New York Islanders
198720787 1 17:02 AARON BROTEN New Jersey Devils
198720799 2 0:49 JIMMY CARSON Los Angeles Kings
198720802 2 3:24 MIKE FOLIGNO Buffalo Sabres
198720804 1 18:03 PAT VERBEEK New Jersey Devils
198730134 1 7:52 BRUCE DRIVER New Jersey Devils
198730223 3 9:47 MARK JOHNSON New Jersey Devils
198730314 2 12:31 CAM NEELY Boston Bruins
198820088 2 6:17 RANDY MOLLER Quebec Nordiques
198820088 2 7:11 ANTON STASTNY Quebec Nordiques
198820147 1 15:58 JOHN CULLEN Pittsburgh Penguins
198820150 2 2:29 KEVIN DINEEN Hartford Whalers
198820203 3 12:45 JOE MULLEN Calgary Flames
198820241 2 18:53 DAN QUINN Pittsburgh Penguins
198820307 3 10:12 MARIO LEMIEUX Pittsburgh Penguins
198820318 2 5:24 GAETAN DUCHESNE Quebec Nordiques
198820331 3 7:36 PAUL GAGNE Toronto Maple Leafs
198820489 1 16:20 DALE HUNTER Washington Capitals
198820542 1 18:13 DOUG EVANS St. Louis Blues
198820727 3 7:49 PAUL MACLEAN Detroit Red Wings
198820803 2 6:58 DOUG SMITH Vancouver Canucks
198820821 3 17:43 BRENT FEDYK Detroit Red Wings
198920146 1 5:14 KEVIN DINEEN Hartford Whalers
198920158 1 5:26 TROY MURRAY Chicago Blackhawks
198920220 2 15:53 NEAL BROTEN Minnesota North Stars
198920238 1 2:39 GREG PASLAWSKI Winnipeg Jets
198920303 2 4:55 PAT ELYNUIK Winnipeg Jets
198920475 3 8:25 BRIAN MULLEN New York Rangers
198920543 3 18:46 AL MACINNIS Calgary Flames
198920667 1 3:04 JEREMY ROENICK Chicago Blackhawks
198920749 1 8:18 CRAIG JANNEY Boston Bruins
198920818 2 1:25 JOHN OGRODNICK New York Rangers
198930231 2 13:43 TRENT YAWNEY Chicago Blackhawks
198930322 2 18:01 JARI KURRI Edmonton Oilers
199020005 3 19:54 RAY SHEPPARD New York Rangers
199020056 1 15:44 DAVE TAYLOR Los Angeles Kings
199020262 2 11:20 BOBBY HOLIK Hartford Whalers
199020612 3 7:18 JOHN CHABOT Detroit Red Wings
199020636 1 15:02 BRIAN LEETCH New York Rangers
199020647 2 9:16 KENNETH JR HODGE Boston Bruins
199020704 2 12:47 KELLY KISIO New York Rangers
199020716 3 0:34 JOE SAKIC Quebec Nordiques
199020762 2 5:16 MARK RECCHI Pittsburgh Penguins
199020815 2 19:28 KEVIN STEVENS Pittsburgh Penguins
199030222 3 2:17 DINO CICCARELLI Washington Capitals
199030235 3 14:04 BRIAN PROPP Minnesota North Stars
199120059 3 2:20 DOUG GILMOUR Calgary Flames
199120070 2 10:26 DAVE GAGNER Minnesota North Stars
199120093 3 18:48 DARREN TURCOTTE New York Rangers
199120238 3 0:18 PAUL RANHEIM Calgary Flames
199120313 3 11:52 JEREMY ROENICK Chicago Blackhawks
199120407 1 10:39 BOBBY CARPENTER Boston Bruins
199120504 2 18:42 JIMMY CARSON Detroit Red Wings
199120617 2 16:43 MARTY MCSORLEY Los Angeles Kings
199120625 3 18:17 TODD ELIK Minnesota North Stars
199120638 1 13:15 GREG ADAMS Vancouver Canucks
199120755 3 10:48 DOUG GILMOUR Toronto Maple Leafs
199130143 3 13:57 AL IAFRATE Washington Capitals
199220002 2 5:17 SCOTT STEVENS New Jersey Devils
199220013 1 12:08 RICK TOCCHET Pittsburgh Penguins
199220023 2 17:32 MARIO LEMIEUX Pittsburgh Penguins
199220068 2 17:22 MIKE GARTNER New York Rangers
199220091 3 19:34 JOE JUNEAU Boston Bruins
199220121 1 6:14 MIKE GARTNER New York Rangers
199220149 2 18:44 CHRIS KONTOS Tampa Bay Lightning
199220181 3 6:21 ULF DAHLEN Minnesota North Stars
199220287 1 16:56 CHRIS KONTOS Tampa Bay Lightning
199220337 2 5:42 ALEXANDER MOGILNY Buffalo Sabres
199220388 1 15:45 GREG HAWGOOD Edmonton Oilers
199220401 2 12:48 JEFF NORTON New York Islanders
199220562 3 9:19 CHRIS KONTOS Tampa Bay Lightning
199220563 1 9:25 TEPPO NUMMINEN Winnipeg Jets
199220589 3 9:18 ROD BRIND'AMOUR Philadelphia Flyers
199220595 1 7:20 CRAIG JANNEY St. Louis Blues
199220908 2 16:28 VALERI KAMENSKY Quebec Nordiques
199220986 1 15:44 JIRI SLEGR Vancouver Canucks
199320065 1 15:37 DENIS SAVARD Tampa Bay Lightning
199320092 3 11:22 SERGEI FEDOROV Detroit Red Wings
199320636 1 16:40 TIM SWEENEY Mighty Ducks Of Anaheim
199320643 3 16:50 MARTIN LAPOINTE Detroit Red Wings
199320740 2 7:53 KEITH TKACHUK Winnipeg Jets
199320840 1 17:17 SERGEI ZUBOV New York Rangers
199320905 3 18:16 KEVIN STEVENS Pittsburgh Penguins
199420025 2 1:32 KELLY BUCHBERGER Edmonton Oilers
199420072 2 7:27 STEVE THOMAS New York Islanders
199420087 1 9:52 KEITH TKACHUK Winnipeg Jets
199420332 2 2:35 GRANT LEDYARD Dallas Stars
199420332 2 7:11 RAY SHEPPARD Detroit Red Wings
199520189 2 15:41 LUC ROBITAILLE New York Rangers
199520226 3 17:34 CHRIS GRATTON Tampa Bay Lightning
199520490 2 9:41 TODD BERTUZZI New York Islanders
199520539 3 13:25 MARK MESSIER New York Rangers
199520560 1 9:03 VYACHESLAV KOZLOV Detroit Red Wings
199520694 3 15:43 RON FRANCIS Pittsburgh Penguins
199520744 2 6:41 SCOTT MELLANBY Florida Panthers
199520750 2 9:05 NICKLAS LIDSTROM Detroit Red Wings
199520766 1 16:00 BENOIT HOGUE Dallas Stars
199520776 2 5:53 MARIO LEMIEUX Pittsburgh Penguins
199520809 1 12:47 ADAM GRAVES New York Rangers
199520847 2 16:40 KEITH PRIMEAU Detroit Red Wings
199620127 3 12:03 ALEXEI ZHAMNOV Chicago Blackhawks
199620211 2 13:08 GREG ADAMS Dallas Stars
199620466 3 14:50 JOZEF STUMPEL Boston Bruins
199620792 1 11:50 BRENDAN SHANAHAN Detroit Red Wings
199621058 2 1:41 MARTIN GELINAS Vancouver Canucks
199720028 2 18:01 TREVOR LINDEN Vancouver Canucks
199720067 3 16:29 TERRY YAKE St. Louis Blues
199920756 1 6:46 JAMIE LANGENBRUNNER Dallas Stars
200520486 1 17:28 ROB COLLINS New York Islanders
200620150 1 7:59 NATHAN HORTON Florida Panthers
200620627 1 5:00 RYANE CLOWE San Jose Sharks
200821010 1 16:44 MIKAEL SAMUELSSON Detroit Red Wings
201620276 2 12:03 JOHAN LARSSON Buffalo Sabres

The resulting penalty box data is available on our website, in the Request Analysis section.
Hopefully, tomorrow, I'll blog about another useful dataset the lemma research has produced.

Monday, February 5, 2018

The Website - A Page A Day, Part V - Rink Repairs

Prologue
Part I
Part II
Part III
Part IV

Well, the pace didn't last long, but we're back with Part V - Rink Repair Statistics

Probably, this is the least hockey related page of the website, but hey, we can do it, and it's actually pretty easy, so why not?

The STOP events as listed in the Play-By-Play HTML summaries since the 2002/03 season on the NHL.com website contain the reason(s) for the stop. While most of them are game-based, such as ICING or OFFSIDE, one of the more rare ones caught our eye: RINK REPAIR. We decided to collect these stops and rank NHL home teams as well as NHL arenas by the amount of rink repairs that happened. We filter out the occasional venues, such as outdoor stadiums for NHL special events or the foreign arenas for the European showdown games.

Since we already parse practically all events from the Play-By-Play summaries (or PL), and classify them by types, we already have a collection of STOP events. And we also detect and catalog the reasons for the stoppages, so it is an easy Mongo query to extract all rink repairs incurred. We then aggregate them by locations and teams, and create SQL tables for easy quick display of the data.

And so we were able to assemble a nice set of tables displaying the level of maintenance in the rinks around the league. Here's a look at the 2016/17 season:

Arena Repairs
BARCLAYS CENTER 8
XCEL ENERGY CENTER 3
CANADIAN TIRE CENTRE 2
VERIZON CENTER 2
PEPSI CENTER 2
FIRST NIAGARA CENTER 2
NATIONWIDE ARENA 2
CENTRE BELL 2
WELLS FARGO CENTER 1
SCOTTRADE CENTER 1
ROGERS ARENA 1
REXALL PLACE 1
PRUDENTIAL CENTER 1
CONSOL ENERGY CENTER 1
BB&T CENTER 1
JOE LOUIS ARENA 1
HONDA CENTER 1
So the claims that the Islanders' current home has the worst ice has been substantial. For the last three years, actually, Barclays Center ranks among highest. Naturally, the old arenas like Canadian Tire Centre or Rexall Palace also seemed to get a lot of rink repairs during the games.
You can switch the year of the display or the mode between 'By Team' and 'By Arena'.
As with all the displayed tables on our site, there are links below it to see it in a pristine form, the direct link to the page for the selected season, and buttons to share it on Twitter and Facebook.
Once again, it doesn't seem like a highly meaningful piece of work, but we consider it fun, and it took about quarter an hour to implement altogether.
TODO:
  • Aggregate show by a period rather than a single season
  • Include arena ages (requires manual input of construction years)