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

Change of possession at the quarter #182

Closed
ConnerEvans opened this issue Feb 11, 2021 · 2 comments · Fixed by #177
Closed

Change of possession at the quarter #182

ConnerEvans opened this issue Feb 11, 2021 · 2 comments · Fixed by #177

Comments

@ConnerEvans
Copy link

I think the calculation of ep and epa is wrong when there is a change in possession at the end of the quarter. In this instance NO punted the ball to CAR at the end of the quarter but the possession team doesn't change until after the END OF QUARTER row which affects the ep and epa.

library(tidyverse)
pbp <- readRDS(url(glue::glue("https://raw.githubusercontent.com/guga31bb/nflfastR-data/master/data/play_by_play_2020.rds")))
pbp %>% filter(game_id == '2020_17_NO_CAR', between(play_id, 920, 990)) %>% select(posteam, down, ydstogo, desc, ep, epa) %>% View
Screen Shot 2021-02-10 at 9 25 04 PM

@ConnerEvans
Copy link
Author

I think the epa of row 2 should be 0 and the epa of row 1 should be (-2.419) - (-1.943) = -0.476

guga31bb added a commit that referenced this issue Feb 11, 2021
@guga31bb guga31bb linked a pull request Feb 11, 2021 that will close this issue
@guga31bb
Copy link
Member

Good catch thank you!

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.

2 participants