View previous topic :: View next topic |
Author |
Message |
cherokee_ACB
Joined: 22 Mar 2006 Posts: 157
|
Posted: Wed Mar 07, 2007 2:45 pm Post subject: 4 factors in boxscores |
|
|
I guess I'm not the only one who computes advanced stats like pace, efficiency and the four factors from game boxscores, and does it either mentally or with some computer assistance. Which is a pain, not a big pain, but it would be much better if those stats were part of the boxscores. Unfortunately, I know of no site that provides them.
So I decided to add them myself. Not by creating another site, but by writing a Greasemonkey script that inserts those stats into ESPN NBA boxscores. It looks like this
If anyone else wants to try it, you need Firefox, the Greasemonkey extension and this ESPN4Factors user script (warning: userscripts.org is giving server problems today. You may have to try again later)
Some APBRMetrics details:
- I use team total turnovers ("Team TO (pts off)" in the boxscore), not the sum of individual turnovers. I'm not sure this the standard practice, but seems to me more accurate
- I estimate possessions using Hollinger's formula, average both teams, multiply by the 0.976 factor and round to the nearest integer.
- I was tempted to use the technical fouls count that ESPN provides to improve the estimation of possession ending FTs, but decided not to because I wouldn't know then which factors to apply.
- FT/FG is FTM/FGA. I wonder if at the game level FTA/FGA would be more interesting.
- Pace computation does not work with live boxscores yet. All other stats should work, but I haven't checked yet. Maybe this weekend.
Comments? Anyone interested? If you try it, please let me know your impressions.
Last edited by cherokee_ACB on Fri Mar 09, 2007 1:16 pm; edited 2 times in total |
|
Back to top |
|
|
HoopStudies
Joined: 30 Dec 2004 Posts: 706 Location: Near Philadelphia, PA
|
Posted: Wed Mar 07, 2007 2:54 pm Post subject: |
|
|
Wow. I'm going to have to test this. And learn how you did it.
In looking at it, though, the Pace doesn't seem right. It looks like calculations done with pace are right, but not what is displayed. _________________ Dean Oliver
Author, Basketball on Paper
The postings are my own & don't necess represent positions, strategies or opinions of employers. |
|
Back to top |
|
|
Ed Küpfer
Joined: 30 Dec 2004 Posts: 787 Location: Toronto
|
Posted: Wed Mar 07, 2007 3:02 pm Post subject: |
|
|
Tested on this season's boxes and last season's. Works great. Good idea, good implementation. _________________ ed |
|
Back to top |
|
|
mateo82
Joined: 06 Aug 2005 Posts: 211
|
Posted: Wed Mar 07, 2007 3:35 pm Post subject: |
|
|
Very nice, I'm not familiar with greasemonkey but I'm going to try and see if I can add a feature where it will write that data to a file. |
|
Back to top |
|
|
Ben F.
Joined: 07 Mar 2005 Posts: 391
|
Posted: Wed Mar 07, 2007 3:41 pm Post subject: |
|
|
This is a great idea and a great tool. I'm not that familiar with greasemonkey scripts at all, but I wonder if you could do something similar where it loops through the play by play and provides an exact possession count, and exact DREB and OREB numbers? That would be incredible just to be able to load up a PBP and have the actual possession count at the top. |
|
Back to top |
|
|
Carlos
Joined: 21 Jan 2005 Posts: 64 Location: Montevideo, Uruguay
|
Posted: Wed Mar 07, 2007 4:17 pm Post subject: |
|
|
Great, great tool!!! I love it already.It seems as if pace is wrong, however. Only 84 possesions in a double overtime game? |
|
Back to top |
|
|
cherokee_ACB
Joined: 22 Mar 2006 Posts: 157
|
Posted: Wed Mar 07, 2007 5:35 pm Post subject: |
|
|
Carlos wrote: | Great, great tool!!! I love it already.It seems as if pace is wrong, however. Only 84 possesions in a double overtime game? |
Pace is possessions per 48 minutes. In this case, the estimate was 102 possessions.
Regarding the suggested additions, writing to a local file might not be possible due to security restrictions, while analyzing the PBP to count possessions is doable but complex - don't expect me to do it in the short term. |
|
Back to top |
|
|
mikez
Joined: 14 Mar 2005 Posts: 75
|
Posted: Wed Mar 07, 2007 6:43 pm Post subject: |
|
|
Well, make that employees of three teams who think this is great. All of our in-house stuff only does this after games -- I love that this one will work in-game, even if the pace isn't perfect. And you GPL'ed it so we can make changes.
Very nice work.
-MZ
P.S. Not bad OReb% in that game pictured above, eh? |
|
Back to top |
|
|
mateo82
Joined: 06 Aug 2005 Posts: 211
|
Posted: Wed Mar 07, 2007 6:48 pm Post subject: |
|
|
mikez wrote: | P.S. Not bad OReb% in that game pictured above, eh? |
I watched that game. It was Ryan Gomes. |
|
Back to top |
|
|
HoopStudies
Joined: 30 Dec 2004 Posts: 706 Location: Near Philadelphia, PA
|
Posted: Wed Mar 07, 2007 7:10 pm Post subject: |
|
|
cherokee_ACB wrote: | Carlos wrote: | Great, great tool!!! I love it already.It seems as if pace is wrong, however. Only 84 possesions in a double overtime game? |
Pace is possessions per 48 minutes. In this case, the estimate was 102 possessions.
Regarding the suggested additions, writing to a local file might not be possible due to security restrictions, while analyzing the PBP to count possessions is doable but complex - don't expect me to do it in the short term. |
Now that I know what it is, Pace is fine as it is.
I finally was able to actually get to userscripts.org, download it, and run it. I still get that kidlike joy when I see a program accomplishing something like that. Well done. _________________ Dean Oliver
Author, Basketball on Paper
The postings are my own & don't necess represent positions, strategies or opinions of employers. |
|
Back to top |
|
|
Eli W
Joined: 01 Feb 2005 Posts: 402
|
Posted: Wed Mar 07, 2007 11:47 pm Post subject: |
|
|
Great stuff.
I was also able to get this to work in Opera (without having to install Greasemonkey, which is Firefox only). Just save the script file (7817.user.js) into your user JavaScript folder (this can be set in Tools > Preferences > Advanced > Content > JavaScript options > User JavaScript files). The only bug I've found so far is that where it should list the team name it instead lists the points they scored in the first quarter (not a big deal at all). _________________ Eli W. (formerly John Quincy)
CountTheBasket.com |
|
Back to top |
|
|
deepak
Joined: 26 Apr 2006 Posts: 665
|
Posted: Thu Mar 08, 2007 2:17 am Post subject: |
|
|
Did you include the Team Turnovers when calculating pace and turnover%? |
|
Back to top |
|
|
TexasEx
Joined: 12 May 2006 Posts: 35 Location: Houston, TX
|
Posted: Thu Mar 08, 2007 10:49 am Post subject: |
|
|
Mikez - Seeing this tool in last night's Rockets/Celtics box score is VERY nice.....at least for my Rockets anyway. I still can't believe you all beat us a few games ago. |
|
Back to top |
|
|
holymoly
Joined: 30 Jul 2005 Posts: 63
|
Posted: Thu Mar 08, 2007 11:08 am Post subject: |
|
|
Fantastic, Great work Javi. It would be interesting to then use the 4 factors weightings to forecast the outcome of the game whilst its playing. _________________ .....
60% of the time, it works every time |
|
Back to top |
|
|
gabefarkas
Joined: 31 Dec 2004 Posts: 1313 Location: Durham, NC
|
Posted: Thu Mar 08, 2007 11:52 am Post subject: |
|
|
cherokee - I notice that you go through the trouble of pulling the clockData variable
Code: |
var clock = doc.getElementById('clockData');
var min = 48;
if (clock.textContent.match(/OT/)) {
if (clock.textContent.charAt(8) == 'O' ) {
min = 53;
}
else {
min = 48 + 5*clock.textContent.charAt(8);
}
|
However, then you don't seem to use it, as you just force the minutes to be 48 in all cases. I'm wondering if you're having trouble separating out the minutes from the seconds in the clockData variable? I'll see what's going on tonight when games are in progress and maybe it's just a simple tweak. |
|
Back to top |
|
|
|