Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CP and CPOE not calculating for incomplete passes in 2006-2008 #2

Closed
jeffgould231 opened this issue Apr 28, 2020 · 4 comments · Fixed by #3
Closed

CP and CPOE not calculating for incomplete passes in 2006-2008 #2

jeffgould231 opened this issue Apr 28, 2020 · 4 comments · Fixed by #3

Comments

@jeffgould231
Copy link

jeffgould231 commented Apr 28, 2020

It looks like CP and CPOE are not calculated for incomplete passes from 2006-2008, or at least no for Buffalo quarterbacks
image

@mrcaseb
Copy link
Member

mrcaseb commented Apr 28, 2020

It took you just a few hours to discover we are discounting Buffalo quarterbacks, lol!
Kidding aside, we'll look into this. Thanks for reporting this!

@mrcaseb
Copy link
Member

mrcaseb commented Apr 28, 2020

Can confirm all games between 2006 and 2008 with cp = NA on incomplete passes. There is only one game in this era having non-NA values for cp on incomplete passes: Game ID 2007101408

comb <- play_by_play_2006 %>%
  bind_rows(play_by_play_2007) %>%
  bind_rows(play_by_play_2008)

sum <- comb %>%
  filter(incomplete_pass == 1) %>%
  group_by(cp) %>%
  summarise(
    n=n(), 
    game_id = first(game_id), 
    play_id = first(play_id)
  )

sum
grafik

@guga31bb
Copy link
Member

Same. Looking into this now. I'm hoping it's a problem with the data I was using and not the code, but we'll see.

@guga31bb guga31bb linked a pull request Apr 28, 2020 that will close this issue
@guga31bb
Copy link
Member

guga31bb commented Apr 28, 2020

This has been fixed in the package (but we need to re-scrape and upload to nflfastR-data).

The problem was that in the CP and CPOE calculation, we filter out plays with no targeted receiver to get rid of throwaways. But in 2006-2008, the NFL usually didn't fill the targeted receiver field on incomplete passes, so we were only keeping complete passes (as you found).

We fixed this by adding some parsing of the play description field. Thank you for catching this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants