Subscribe Bookmark
Jeff_Perkinson

Community Manager

Joined:

Jun 23, 2011

Analyzing Tar Heel JMP Shots

Ahhh, springtime in North Carolina, when a young man’s thoughts turn to … basketball.


Last weekend, the University of North Carolina Tar Heels advanced to the Final Four for the 18th time by beating the University of Oklahoma. As a Carolina alum, I had a passing interest in the game.


When the Heels had a big lead in the second half, I remembered Bill James’ formula for determining when the outcome of a college basketball game is no longer in doubt.


  • Take the number of points one team is ahead.
  • Subtract three.
  • Add a half-point if the team that is ahead has the ball, and subtract a half-point if the other team has the ball. (Numbers less than zero become zero.)
  • Square that.
  • If the result is greater than the number of seconds left in the game, the lead is safe.


I quickly grabbed my computer and put that formula into a column of a JMP data table and ran the Profiler on it to see what the curves looked like. Suffice it to say, the lead wasn’t safe then, but eventually the boys in blue had the game in hand.


Since then, I’ve used JMP’s File>Internet Open… feature to import the play-by-play table from ESPN.com. The graph below shows that UNC got an early 7-point lead and never trailed in the game.

After a little data cleanup, I created a Bubble Plot to show the size of the lead at each scoring event and how safe the lead was at the time.


The bubbles represent each time a team scored and are colored by who had the ball after that score. For example, a blue bubble indicates that OU scored and UNC had the ball afterward. The plot is animated by the time into the game. Click the Play button to watch the game unfold.


Advance the Minutes slider to 33:48 into the game (6:12 to to go in the game), and you'll see that UNC had a 19-point lead, but it wasn’t safe yet. UNC didn’t put it away until the 37:53 mark (2:07 to go), when Wayne Ellington hit two free throws to seal the deal.

[iframe src ="/jmp/uploads/swf/SafeLeadBubblePlot.htm" width="620" height="420" border="0"]


I also created a Profiler to see how close to 100% safe the Tar Heels were with 6:12 to go.

[iframe src ="/jmp/uploads/swf/UNC_vs_OU.htm" width="620" height="320" border="0"]

UNC had the ball and a 19-point lead at 6:12. If Tyler Hansbrough had hit one of his notorious (yet ugly) hook shots from under the basket or if Ty Lawson had drilled a jumper from the top of the key, the game would have, effectively, been over. If…if…if…I guess it doesn’t matter now. They won, after all.


By the way, the Bubble Plot and Profiler above were created using the new Save as Flash (SWF) feature in JMP 8. Now, when you find a compelling model or visualization of data over time, you too can communicate that to colleagues who don't have JMP.


If you’d like to see the data table I created with the play-by-play data, you’ll find it in the File Exchange.

2 Comments
Community Member

Analyzing UNC Tar Heel JMP Shots in NCAA Championship Game - JMP Blog wrote:

[...] men's basketball team has won the NCAA championship, I've updated the Bubble Plot and Profiler I posted last week using data from the final [...]

Community Member

In analytics, who inspires you? - SAS Voices wrote:

[...] Bill James, pioneer of using objective evidence and thinking in probabilities and now even using it to solve crime. â Daryl Morey, General Manager, Houston Rockets [...]

Article Tags