Thursday, July 30, 2009

Playing with the Lead and the Percentages: Part Two

The other day, I wrote about how, in any particular season, the sum of a team's shooting and save percentage is correlated with how much time that team spent playing with the lead, and how this relationship is, in turn, related to shot differential.

The purpose of this post is to elaborate upon that.

Firstly, the issue of causation. While it goes without saying that correlation does not imply causation, I think it's reasonable to assume that there some sort of causal relationship here.

I think that the arrow of causation is bi-directional. For one, a team that is lucky or good with the percentages when the score is tied will, on average, tend to play with the lead more. In this sense, having a good team PDO number causes a team to play more with the lead.

On the other hand, however, I think that playing with lead is, in and of itself, beneficial to shooting and save percentage. I'm basing this assumption on the fact that shot ratios are subject to the leading/trailing effect. I suspect that there's some sort of trade off involved whereby the leading team's advantage in shot ratio is met with a corresponding disadvantage in the percentages.

Thus, good percentages leads to playing with the lead more, which in turn begets good percentages.

Secondly, my prediction is that playing with the lead accounts for the fact that the spread in even strength shooting percentage is somewhat larger than what would be predicated by chance alone.

Here is what has demonstrated thus far:

The distribution of team EV S% when the score is tied is entirely random.

There are no 'real effects' with respect to EV S% when the score is tied. That is to say, it has no sustain.

Some of the variation in overall EV S% at the team level is non-random. That is to say, there is more variation than what would be predicted from chance alone.

This being the case, the logical implication is that the playing to score effect is one of - perhaps the only - non-random contributions to EV S%.

As a preliminary test for this hypothesis, I looked at the relationship between [minutes played with the lead - minutes played trailing] and various even strength variables for the 2008-09 season. The results are contained below:


While the results are not unequivocally supportive, I think it tends to accord with my theory.

The teams that do better with the percentages when the score is tied at EV tend to play more with the lead overall - that's not unexpected. Moreover, and perhaps more importantly, teams that did better with the percentages at EV when the score wasn't tied tended to play more with the lead as well.

Of course, I'll refrain from saying anything with confidence until further analysis is performed.

Tuesday, July 28, 2009

Playing With The Lead and the Percentages



Depicted above is a graph showing the relationship between playing with the lead and PDO number at the team level for last season. The teams coded in black are teams that had an aggregate shot differential greater than 100 last season. Teams coded in red are teams that had a negative shot differential less than -100. Teams coded in white are teams that had a shot differential between 100 and -100.

Team PDO is defined as the sum of team shooting percentage and team save percentage. Unlike conventional PDO numbers, these figures are not solely for even strength play - special teams play is included. The same is true for the minutes played data. However, empty netters have been excluded in calculating each team's shooting and save percentage.

Playing with the lead is favorable to the percentages. The relationship is quite strong, too - the correlation between [Minutes played leading - Minutes played trailing] and Team PDO was 0.63 for last season. This is similar to the correlations observed in other seasons.


Only 2007-08 is anomalous. And even then, the correlation is positive.

What's interesting, however, is how the relationship varies according to shot differential.

I've long been opposed to the idea that there exists a relationship between shot totals and the percentages at the team level. I've been particularly opposed to the idea that there is a relationship between goaltender save percentage and number of shots faced. Now, in fairness, there isn't much of a relationship between the two in general. Shown below is the correlation between Team PDO and team shot differential for every season since 2002-03.

Thus, only in 2007-08 was there anything of a relationship. The correlations for every other season are insignificantly different from zero. On a related note, I did the same thing for shots against and goaltender save percentage in a previous post and obtained similar results.

Of course, the teams that get outshot over the course of a season tend to be the teams that are consistently playing from behind. (The correlation is approximately 0.5-0.6).

Once this fact that is controlled for, a positive relationship between Team PDO and shot differential emerges. That is to say, teams with negative differentials tend to do much better in terms of the percentages than what would otherwise be predicted on the basis of their [Minutes played leading - Minutes played trailing] differential.

To illustrate this, I assigned each team an expected PDO number based upon its [Minutes played leading - Minutes played trailing] differential. I then determined the correlation between expected PDO and shot differential for each of the involved seasons.

While the strength of the correlation varies from year to year, it's apparent that having a negative shot differential allows a team to outperform it's expected PDO.

I suspect that this is true for the following reasons:

The team that plays with the lead will tend to have a higher scoring chance/shot ratio than a team that plays from behind. This is because a team that plays from behind is forced to take more chances in an attempt to tie the score.

However, a team that has a good shot differential will tend to get the better of the play regardless of whether it is leading or trailing. Likewise, a team with a poor shot differential will tend to get dominated territorially regardless of goal state.

To use a concrete example, if San Jose is playing Florida, and San Jose is winning, San Jose is still likely getting the better of the play. The puck will tend to spend much more time in Florida's end than in San Jose's. Therefore, while San Jose will surely still end up outchancing the Panthers, it is likely that the Panthers will end up with the better scoring chance/shots ratio on account of generating more of its shots through odd man rushes and the like (rather than, say, shots from the periphery of the offensive zone that are generated through periods of sustained pressure).

Anyway, I plan to analyze the data in more detail in the future. I think it might go a long way in accounting for some of the more anomalous teams over the past few years (2006-07 Predators, 2006-07 Sabres, 2007-08 Canadiens, and so forth). I also think that it also might have some utility in terms of goaltender analyis.

One more thing: Intuitively, I would expect that the leading-trailing effect would be most pronounced at even strength.

As much as I would have liked to confine the data to even strength play only, that wasn't possible. Granted, the correlation between leading-trailing differential and leading-trailing differential at even strength is bound to be quite high.

Wednesday, July 1, 2009

Zone Shift

I've been doing a bit of work with the Zone Shift stat as of late.

For those unfamiliar, Zone Shift is a stat conceptualized by Vic Ferrari, who has from time-to-time discussed the metric at his blog.

For individual players, Zone Shift is calculated as follows:

[EV Shifts Started in the Defensive Zone - EV Shifts Started in the Offensive Zone] -
[EV Shifts Ended in the Defensive Zone - EV Shifts Ended in the Offensive Zone]

What Zone shift is essentially measuring, albeit somewhat crudely, is the ability of the player to move the puck in the right direction - a valuable, if underrated, asset to have as a player.

Having said that, in browsing through the data, I couldn't help but notice that the players with the best Zone Shift numbers tended to take a large proportion of defensive zone draws relative to their teammates.

In order to quantify the effect, I calculated each team's aggregate zone shift ratio - that is, EV Defensive Zone draws/EV Offensive Zone Draws - and multiplied that ratio by one hundred. This stat can be termed 'TEAM ZONE RATIO.' To give a concrete example, the Thrashers were destroyed territorial this year at EV and took roughly 1.34 EV Defensive Zone draws for each Offensive Zone draw, thus giving them a TEAM ZONE RATIO figure of approximately 134.

I then figured out the exact same stat for all players - that is, for all EV faceoffs that the player was on the ice for when his shift BEGAN - in the league that were on the ice for at least 50 EV faceoffs in all three zones (Defensive, Offensive, Neutral). We'll call this figure PLAYER ZONE RATIO STARTING.

I then subtracted this figure from the TEAM ZONE RATIO of that player's team. This stat can be called 'PLAYER ZONE DIFFERENTIAL.'

Again, to give a concrete example, Colby Armstrong took approximately 1.51 EV Defensive Zone draws for each EV Offensive Zone Draw, therefore giving him a PLAYER ZONE RATIO STARTING figure of around 151, and a PLAYER ZONE DIFFERENTIAL of 17 (151-134=17).

I then figured out each player's zone ratio for all shifts that ended with him on the ice. We'll term this PLAYER ZONE RATIO ENDING. Going back to Armstrong again, he ended 1.16 shifts in his own zone for every faceoff ended in other team's end of the rink, therefore giving him a PLAYER ZONE RATIO ENDING number of 116.

Finally, I subtracted each player's ZONE RATIO ENDING number from his ZONE RATIO STARTING number in order to produce a ZONE SHIFT number. Armstrong's was around 35, which is pretty good - one of the best in the league, in fact.

It appears that starting a high proportion of your EV faceoffs in your own zone relative to your team average - in other words, having a high PLAYER ZONE DIFFERENTIAL - is pretty favorable toward ZONE SHIFT. Among all players on the ice for at least 50 EV faceoffs in each zone, the correlation was 0.80. Moreover, each unit increase in PLAYER ZONE DIFFERENTIAL is worth approximately a 0.88 increase in ZONE SHIFT. In other words, the effect is considerable.

To further illustrate this, consider the top ten players in unadjusted ZONE SHIFT during the 2008-09 season: Shultz, Sauer, Veilleux, Smithson, (Ryan) Johnson, Zigomanis, Hall, (Zybynek) Michalek, McClement - all of these players took a much higher percentage of defensive zone draws than their teammates.

Long story short: It's easier to have a good Zone Shift number if you're starting more in your own end of the rink relative to your teammates, and if the metric is to be worth anything at all, this ought to be corrected for.

And I've attempted to do exactly that. Contained below is a listing of the league's best and worst players in ADJUSTED ZONE SHIFT - adjusted because the stat attempts to control for the above bias. I've also included the unadjusted ZONE SHIFT numbers as well.

This stat is, of course, imperfect, and further corrections are probably necessary, which is something I intend to look at in the near future. I just figured I'd throw this up in the interim.

Monday, June 8, 2009

Scoring Chances by Game State

For those that aren't aware, Dennis King, one of the posters at mc79hockey.com, took the time to track scoring chances for the Oilers over the course of the 08-09 NHL season. An example.

The work that he did is really quite impressive -- for every game, Dennis managed to record the scoring chances for each team, the time that the scoring chance occurred at, which players were on the ice when the scoring chance occurred, and game for and against totals for every Oiler player.

Needless to say, to do that for an entire season is no small task, and Dennis deserves some major credit for all the work that he put into the project.

For those interested, Scott Reynolds at GospelofHockey has made some interesting posts on the subject, as has Vic Ferrari (see here and here, for a few examples).

The topic of this post, however, is whether scoring chances differ according to game state. The term game state is a little vague -- in this case, I'm using the term to refer to whether or not the score was tied at the time the scoring chance happened. In other words, is there a 'playing to the score effect' in terms of scoring chances?

Prior to examining the results, I wasn't sure what to anticipate. On the one hand, shot ratio does vary according to the score, and the effect is fairly marked. As scoring chances are (highly) correlated with shots on goal, intuitively one might expect a parallel effect on scoring chance numbers.

On the other hand, there are reasons to expect a more moderate effect. The team that is playing from behind often plays quite desperately in an attempt to avoid losing. Consequently, the trailing team tends to be more liberal in its shot selection and, on account of playing more aggressively, is forced to concede a high frequency of odd-man rushes against.

Using the data provided by Dennis, I've looked at how the Oilers scoring chance numbers varied according to game state -- that is, whether they were trailing, tied, or leading at the time the scoring chance happened.

I've presented the overall results -- that is, the results for every game situation (EV, PP, SH), as well as the results at even strength only.

I've also added a second table that breaks down the data by period.

I should note that this data is only for 49 of the 77 games that Dennis tracked scoring chances for -- I wasn't able to easily cut and paste the first 30 or so games into excel. Nonetheless, I think that 49 games provides an adequate sample size.

The results:



The abbreviations in each column, from left to right, stand for: scoring chances for, scoring chances against, goals for, goals against, scoring chances for per goal, scoring chances against per goal, time on ice, scoring chances for per minute, scoring chances against per minute.

I was unable to determine time on ice values for even strength due to the way in which the data was recorded.

Some observations:

1. In a recent post on shot ratio by goal state, Tyler at mc79hockey remarked that he wasn't convinced that sitting on the lead was a good strategy. I'm inclined to agree with him. The Oilers were solidly outchanced when playing with the lead, both at even strength and otherwise, and were outscored just as badly.

Likewise , Edmonton actually outchanced the opposition when playing from behind, albeit narrowly.

2. There isn't much evidence that scoring chance quality varies by game state. One might have predicted that the leading team would capitalize on a higher percentage of its scoring chances. However, that doesn't appear to be the case. The team that was leading tended to capitalize on a higher percentage of its scoring chances at even strength, but the difference is quite small and probably not statistically significant.

3. It's difficult to say whether or not the effect is more pronounced later in the game. This was certainly the case when the Oilers were trailing. However, when leading, the opposition decidedly outchanced the Oilers regardless of the period.

Saturday, May 30, 2009

Playoff Predictions -- Stanley Cup Finals

(2) Detroit v Pittsburgh (4)

There isn't much that I can say about these two teams that hasn't already been said.

This is a matchup between two quality teams.

While it was not obvious that the Pens were the best team in the East at the outset of the playoffs, I think that it would be difficult to argue that point now.

They've been dominant since the start of the second round despite having a less-than-impressive showing against the Flyers.

I feel confident in saying that this year's team is better than last year's, if only for the fact that they're now able to consistently outshoot the opposition.

Needless to say, the Wings are also an excellent team that, like Pittsburgh, is clearly deserving of its place in the Finals.

What concerns me about Detroit is their injury situation. They missed a few regulars in several of the games against Chicago and, while some of those players have returned to the lineup, I doubt that any of them have fully recovered at this point. I understand that Datsyuk is out for game 1, and that will hurt them.

This series will be closer than last year's finals. If not in the outcome, then certainly in terms of the play. Last year, the Pens were decisively outclassed in all three games at Joe Louis and marginally outclassed in their own building. The Wings outshot the Penguins in all six games last year, and had an aggregate shot advantage of roughy +80. I just don't see that happening again this year.

Even though the gap between these two teams has narrowed over the last 12 months -- or, more accurately, since Valentines Day -- I still think that Detroit will win. The Wings are, fundamentally, the best team in the league (well, either them or San Jose) and I just can't pick against them. I also want them to win, and this has surely influenced my decision.

I think there's also something to be said for the competitive imbalance between the two conferences. Back in 2007, the Senators had, not unlike Pittsburgh, advanced to the final without too much difficulty, and had looked good doing it.

Of course, as is currently the case, the West was the stronger conference in that year. The Ducks had had a more difficult road to the finals than Ottawa by virtue of facing tougher opponents. And yet, it seemed that few people took that into account judging the relative strength of the involved teams. I'm not going to make that same mistake.

Detroit in 7.

Monday, May 18, 2009

PP S% Percentage: Correction

Well, I feel like a bit of an idiot.

In my post examining powerplay shooting percentage, I concluded that a sizable component of the team-to-team variance in powerplay shooting percentage was non-random.

For the 2008-09 season, the standard deviation in team powerplay shooting percentage was about 0.018. I determined that the predicted standard deviation -- that is, the standard deviation that one would expect if powerplay shooting percentage was entirely random -- was roughly 0.011. Had that figure been correct, that would have meant that a mere 1/3 of the variation in powerplay shooting percentage could be accounted for by randomness.

However, I had erred in calculating that figure. The mistake is an embarrassing one: instead of using each team's shot totals, I used each team's PP S% multiplied by 1000 (the shooting percentages at behindthenet are expressed in this manner). Those familiar with Excel are aware that an incorrectly typed formula can sometimes have profound consequences.

As each team's shot total was roughly double their actual shot total, and the predicted standard deviation was much lower than it should have otherwise been.

Upon doing another set of simulations -- this time hopefully correctly -- it seems that the predicted standard deviation is somewhere in the area of 0.016.

This means that about two-thirds of the variance in team powerplay shooting percentage can be explained through randomness, which is considerably different from my original (flawed) estimate.

However, as identified by Vic Ferrari in the comments section, there was another reason why my study was somewhat flawed.

Vic correctly pointed out that the standard deviation in team powerplay shooting percentage will vary around the 'true' mean standard deviation from year to year. This means that using the standard deviation from any single season as an approximation for the true standard deviation is problematic.

I made the mistake of representing my findings as more or less definitive when that wasn't necessarily the case.

This methodological problem also applies to my earlier study that dealt with even strength shooting percentage.

Obviously, this somewhat limits the extent to which my findings are generalizable.

What I've done, then, is to apply this methodology to other seasons to see if the contribution of randomness to the overall variance is similar. I also did this for even strength shooting percentage (5-on-5 shooting percentage, strictly speaking, as the numbers are from behindthenet), as well as even strength shooting percentage when the score is tied.

The results:


Some observations:

1. It appears that all of the team-to-team variation in EV shooting percentage when the score is tied is due to randomness.

I don't think I've erred this time -- there was absolutely no interyear correlation between 07-08 and 08-09 for team EV shooting percentage when the score is tied (r=0.004).

2. By contrast, the contribution of randomness to EV shooting percentage in general is much lower, and appears to be somewhere around the order of 50%.

This implicates the 'playing to the score effect' as one of the non-random causes of team-to-team variation in EV S %.

3. Contrary to what my last post on the subject would have one believe, team powerplay shooting percentage actually appears to be more random in its distribution than EV shooting percentage, not less.

This seems counterintuitive to me and I'm not sure how much confidence can be placed in these findings. Perhaps there is some other flaw in my methodology that I've overlooked.

Playoff Predictions -- Third Round Part Two

(4) Pittsburgh vs Carolina (6)

That the Penguins-Capitals series went seven games was hardly surprising. What was surprising was the degree in which the Penguins outplayed the Capitals.

The Penguins outplayed the Capitals in at least five of the seven games, and had the edge in shots in all seven. The aggregate shots for the series were 256-180 in favor of Pittsburgh. It's not often that one team manages to outshot the other so decidedly over the course of a best of seven series. When it does happen, there can be no doubt as to which of the two teams was better, especially when the outshooting team is also the victor.

The Capitals had no difficulty at all in outshooting the opposition over the course of the regular season, and the fact that they were so visibly outplayed calls for an explanation. I'm not sure whether Washington played extremely poorly or Pittsburgh played extremely well. It's likely that both are true to some degree. In any event, the Penguins were clearly the better team and deserved to win.

I've written about Boston at length on this blog and frequent readers are well acquainted with my thoughts on the team. At the risk of belaboring the point, I'll keep my comments brief.

The Bruins are a reasonably good team that were eliminated by another reasonably good team. Some people have commented that the Bruins picked the wrong time of year to play their worst hockey, but I don't think that's accurate at all. The Bruins were trading scoring chances with the opposition all season long, yet came out ahead on the basis of strong goaltending and luck. Against Carolina, the Bruins again traded scoring chances in an entertaining and evenly-matched affair. They did not play poorly. The difference was that, unlike during the regular season, they didn't receive an undue share of the bounces. It's as simple as that.

It's funny -- if you asked the average hockey fan which of the two Eastern series' went according to expectation, and which of the two did not, they'd likely identify Pittsburgh-Washington as the former, and Carolina-Boston as the latter. I couldn't disagree more.

As for the series in question, I'm forced to go with the Penguins. The Penguins, as I mentioned earlier, were very impressive against the Capitals. If they play even somewhat similar against the Hurricanes, they should advance. Carolina, having defeated two quality opponents, is obviously a good team, and I don't anticipate that this will be an easy series for the Penguins. At the same time, I don't see them losing.

Pens in 6.