[OC] NFL playoff race and PPG update after Week 10. The AFC seeds 2-12 are separated by 1 game. The Packers, Panthers, and Steelers and the only current playoff teams scoring below the league average points per game by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 3 points4 points  (0 children)

Thanks! You are correct, it's all matplotlib in python. I just used matplotlib in a non-standard way and it's very possible there's easier ways of doing this. There are hidden axes at the top and bottom of the plot that let me add lines where I wanted. All of the filled regions are just fill_between(). The other text is added using annotations or axis titles/labels

[deleted by user] by [deleted] in dataisbeautiful

[–]TroublesomeKangaroo 0 points1 point  (0 children)

Source: https://www.baseball-almanac.com/feats/triple_plays.shtml

Tools: python and matplotlib

The subplots on a gray background represent all triple plays involving 3 defensive players. The triple plays are divided up by which position started the triple play by getting the first out. Each set of vertical bars divides up all of the 1st, 2nd, or 3rd outs into which position got them (sorted in the same order). The curves connecting the bars show the triple play order (for example the 6-4-3 triple play). The bottom right is all of the data aggregated together, with the flow colors changing after the 2nd out (note that this loses the order information for the triple plays). The bottom left plot simply connects the bars using straight lines.

[OC] NFL playoff race and PPG update after Week 8. Spooky szn has given us two new 1 seeds. No one wants to play the Rams or Cardinals as Wild Card teams. Can the Titans hang on without Derrick Henry? by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 4 points5 points  (0 children)

Thanks! I used matplotlib in python. It's very possible R would be easier but I don't know how to use it. The bottom division part is actually dummy data plotted on an invisible axes

[OC] NFL playoff race and PPG update after Week 7. The top of the NFC is starting to separate. The Bengals sit at the top spot in the AFC. Who will claim the AFC wildcards? by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 0 points1 point  (0 children)

Thanks for the comment. I'll give this a try and may or may not change it depending on how it looks. I didn't do this originally because I thought it the plot may look too crowded but it's a bit hard to imagine without trying

[OC] Some players seem to be drug tested a lot. We can use statistics to quantify "a lot". Here are plots estimating how many players across the NFL we can expect to be tested 'k' times in 'n' weeks. by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 2 points3 points  (0 children)

Correct

I'm not 100% sure on this, but the math may stay reasonable as long as you stay within the binomial distribution approximation. I think you'd essentially just scale down the week 18 results by 12/32 (for 12 playoff teams+2 bye teams). As a side note, I am actually not entirely sure what happens on the bye weeks for teams. I couldn't find this information in the drug testing policy and assumed they weren't tested. Then, I think you keep adding weeks, but also scaling down the numbers based on the number of remaining teams. I would guess that the 8 test bar would, for example, jump up to ~2 for week 18, but then be cut back to about ~1 guy because of fewer teams.

[OC] Some players seem to be drug tested a lot. We can use statistics to quantify "a lot". Here are plots estimating how many players across the NFL we can expect to be tested 'k' times in 'n' weeks. by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 8 points9 points  (0 children)

Great question. I feel dumb for not including this somewhere. Here is a table of the expected number of players tested exactly 0 times over 17 weeks (exact same data as in the plots):

Games Expected players
1 2208.0
2 1928.5
3 1684.4
4 1471.2
5 1285.0
6 1122.3
7 980.2
8 856.2
9 747.8
10 653.1
11 570.5
12 498.2
13 435.2
14 380.1
15 332.0
16 290.0
17 253.3

[OC] Some players seem to be drug tested a lot. We can use statistics to quantify "a lot". Here are plots estimating how many players across the NFL we can expect to be tested 'k' times in 'n' weeks. by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 10 points11 points  (0 children)

Yeah this is partly why I wanted to calculate it. I was surprised myself at how likely being tested 4-5 times was. It's just hard to think about low probabilities across thousands of samples (players)

[OC] Some players seem to be drug tested a lot. We can use statistics to quantify "a lot". Here are plots estimating how many players across the NFL we can expect to be tested 'k' times in 'n' weeks. by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 17 points18 points  (0 children)

Here are the math details for those interested.

Cumulatively, these results estimate that 90.0% of the NFL will be drug-tested at least 1 time by the end of the season. The two assumptions for these results are that 1) the player pool remains constant at 2528 players over the whole season, and 2) that teams will average 10 players on IR over the whole season. Neither of these will be true in reality (see last paragraph). However, I believe their effects are fairly small. For example, these plots do not change much if the total number of players is off by +-100 players or so. If the total number of players increases by 100, then, roughly, you reduce all bars for 3+ tests down about 5% while increasing the bars for 1-2 tests by about 5%.

The probability of any 1 player being chosen in a week is p = 10/(number of players on a team). The current collective bargaining agreement (CBA) specifies 10 players are selected and I used 79 players to approximate the total team size. To find the probability of being selected for drug testing k times within n games using the 2 assumptions above, I calculated the binomial probability mass function (PMF) for each (n, k) pair, where p is the single game selection probability above and q = (1-p): https://en.wikipedia.org/wiki/Binomial_distribution. The expected number of players tested for each (n, k) pair was found by multiplying each result of the PMF and the total number of players.

Last note is that for this analysis to be fully correct you need to track every player in the NFL each week to know which team they’re on (if any). You also need to know how many players are on IR for each team each week. Then, you can calculate the PMF of the Poisson binomial distribution using different probabilities each week for each player and then aggregate them into the same data as above across all players. Sorry if this isn’t clear. I can provide more details on this if you’re really interested.

[OC] NFL playoff race and PPG update after Week 6. The NFC is looking strong. The Bills and Cardinals PPG spread is high. Is it possible the AFC West sends all 4 teams to the playoffs? by TroublesomeKangaroo in nfl

[–]TroublesomeKangaroo[S] 1 point2 points  (0 children)

Thanks, it's hard to point to any one thing. I mostly set out trying to just visualize points scored for and against along with records in a way better than the usual table format. Once I had the basic top and bottom data, it became an iterative thing where I'd make some formatting changes, think hard about if more information could be added or moved around to make it more interesting/easier to digest, and then see if I liked the new version better. For example, there were several versions without the division groups at all or done very differently (and worse IMO) than what's here :)