So I guess I can try to offer whatever help this might be to push this fix along. Somebody please correct me if I miss or put something out of place.
Team Pass Yards should be:Net Passing Yards of all players that had an a pass attempt or sack (
Passing Yards - Sack Yards)
Pretty easy correction here with only 2 constants and one operation - which gets minutely more complicated if you have multiple players with either a pass or sack.
Team Rushing Yards should be:Net Rushing Yards for all players with a rush attempt (Rushing Yards - Tackle
d For Loss Yards)
Looks simple too but there is one thing that might make the calculation tricky. Offensive fumble recoveries should be counted as rush attempts by the player recovering the fumble. This means if you are going to allow for recorded rush yards on a fumble recovery the point at which you receive negative yards is no longer the LOS like a regular non-aborted rush and TFL. The point at which you measure positive and negative rush yards is now the point of the fumble recovery. (
http://www.nflgsis.com/gsis/documentation/stadiumguides/guide_for_statisticians.pdf)If you look at fumbled snaps by the punter in GLB2 specifically, you can see they are incorrectly recorded. For instance, this game
http://glb2.warriorgeneral.com/game/game/11155 shows the punter fumbling, recovering the fumble for 21 yards, but being credited with -15 rushing yards. He should be credited with 21 rushing yards. The same logic would apply to any other offensive player recovering a fumble. If they advance or regress the fumble from the point at which they recovered, they should gain those yards as rushing yards, whether they are an OLineman, or WR or whoever. (
http://www.nflgsis.com/gsis/documentation/stadiumguides/guide_for_statisticians.pdf)The reason you don't need something like (fumble return yards + rush yards - TFL yards) is because for the offense there shouldn't be a different recorded statistical category for fumble return yards and rushing yards. Fumble return yards is a purely defensive stat.
So if we get that right then we can incorporate that into rushing yards and get an accurate number.
Total Offensive Yards would then simply be:
The addition of both passing a rushing yards gained after considering negatives
(Net Rushing Yards + Net Passing Yards)This is plain. I think the problem was just a mistake in adding erroneous extra statistics, so this should be very easy and quick to clean up.
Passing Yards Allowed would then be:
The total yards given up by the defense after considering negatives (Net Passing Yards of the opponent)
There a couple ways to calculate this (total yards allowed - sack yards) or (total pass yards of opponent - sack yards) but I think it would be easiest to just use the net passing yards since that is already going to be calculated for the offensive team to apply to their team. But if you can't go off the number calculated and attributed to the offense, say maybe because it wants to calculate pass yards allowed for the defense first, then you can still accomplish an accurate measure by one of the two calculations above.
I thought there may be a problem with sack yards if the rusher forced a fumble as well as a sack similar to the rush yards/offensive fumble recovery thing, but it seems to be still correctly crediting the rusher with a sack, forced fumble, and sack yards (although not a TFL or tackle). So that's good, just in case anybody was thinking of investigating that.
Rushing Yards Allowed would then be:
Total yards the ball was advanced by the offense after considering negatives (
Total rush yards - TFL yards from opponent's players with a rushing attempt)
It is important to note there is a difference in a RB's TFL and a LB's TFL. One is tackle
d for a loss, and one is a tackle for a loss. Since tackle for loss yards is not shown for defensive players like sack yards are, I'm going to allow for possibility it is not even recorded. Therefore you can use the opponent's yards counted as tackled for loss, add those up and subtract that total from the opponent's rushing total. We just have to make sure offensive fumble recoveries are counted as rushes and credited with the correct amount of rush yards, based on the point of recovery.
Total Yards allowed would then be:
(
Net Passing Yards of Opponent + Net Rushing Yards of Opponent)
This whole thing seems over-simplistic. I have no idea how I wrote this much about something that simple. Talking it out wouldn't take nearly as long, just looks like more when you are trying to justify each thing :/
So we clearly just need to remove a couple things like receiving yards, because that is the same measure of passing yards - just attributed to a different player, and return yards, and anything else not listed above. It's probably already fixed and I just wasted my time. Oh well, at least through this I found out offensive fmble recoveries were being recorded incorrectly.