nflverse / nflverse-data

Automated nflverse data repository
https://www.nflverse.com
Creative Commons Attribution 4.0 International
139 stars 12 forks source link

[BUG] <RYOE Stats Don't Match Up With NextGenStats Website> #28

Closed JKnapp77 closed 10 months ago

JKnapp77 commented 11 months ago

Is there an existing issue for this?

Have you installed the latest development version of the package(s) in question?

What version of the package do you have?

1.3.2.7

Describe the bug

When I try to pull up the 2022 NextGenStats for RBs, the stats come up, and most of them come up correct. However, the RYOE, RYOE/Att., and Rush % OE stats come up completely different than what the NextGenStats website has.

Reprex

next_gen_2022 <- load_nextgen_stats(seasons = 2022, stat_type = "rushing") |> 
  filter(week == 0)

Expected Behavior

I expected the overall season stats for RYOE, RYOE/Att., and Rush % OE stats to match what the NextGenStats website has for them.

nflverse_sitrep

nflverse_sitrep()
── System Info ──────────────────────────────────────────────────────────────────────────────────────────────────
• R version 4.3.1 (2023-06-16)   • Running under: macOS Ventura 13.4.1
── nflverse Packages ────────────────────────────────────────────────────────────────────────────────────────────
• nflreadr (1.3.2.07)    • nflseedR (1.2.0)       • nflplotR (1.1.0.9006)  
• nflfastR (4.5.1.9004)  • nfl4th   (1.0.2.9006)  • nflverse (1.0.2)       
── nflverse Options ─────────────────────────────────────────────────────────────────────────────────────────────
No options set for nflreadr, nflfastR, nflseedR, nfl4th, nflplotR, and nflverse
── nflverse Dependencies ────────────────────────────────────────────────────────────────────────────────────────
• askpass     (1.1)     • hms        (1.1.3)    • progressr    (0.13.0)   
• cachem      (1.0.8)   • httr       (1.4.6)    • proto        (1.0.0)    
• cli         (3.6.1)   • isoband    (0.2.7)    • purrr        (1.0.1)    
• codetools   (0.2-19)  • janitor    (2.2.0)    • R6           (2.5.1)    
• colorspace  (2.1-0)   • jsonlite   (1.8.7)    • rappdirs     (0.3.3)    
• cpp11       (0.4.4)   • labeling   (0.4.2)    • RColorBrewer (1.1-3)    
• crayon      (1.5.2)   • lattice    (0.21-8)   • Rcpp         (1.0.10)   
• curl        (5.0.1)   • lifecycle  (1.0.3)    • rlang        (1.1.1)    
• data.table  (1.14.8)  • listenv    (0.9.0)    • rstudioapi   (0.14)     
• digest      (0.6.31)  • lubridate  (1.9.2)    • scales       (1.2.1)    
• dplyr       (1.1.2)   • magick     (2.7.4)    • snakecase    (0.11.0)   
• fansi       (1.0.4)   • magrittr   (2.0.3)    • stringi      (1.7.12)   
• farver      (2.1.1)   • MASS       (7.3-60)   • stringr      (1.5.0)    
• fastmap     (1.1.1)   • Matrix     (1.5-4.1)  • sys          (3.4.2)    
• fastrmodels (1.0.2)   • memoise    (2.0.1)    • tibble       (3.2.1)    
• furrr       (0.3.1)   • mgcv       (1.8-42)   • tidyr        (1.3.0)    
• future      (1.33.0)  • mime       (0.12)     • tidyselect   (1.2.0)    
• generics    (0.1.3)   • munsell    (0.5.0)    • timechange   (0.2.0)    
• ggplot2     (3.4.2)   • nlme       (3.1-162)  • utf8         (1.2.3)    
• globals     (0.16.2)  • openssl    (2.0.6)    • vctrs        (0.6.3)    
• glue        (1.6.2)   • parallelly (1.36.0)   • viridisLite  (0.4.2)    
• gsubfn      (0.7)     • pillar     (1.9.0)    • withr        (2.5.0)    
• gtable      (0.3.3)   • pkgconfig  (2.0.3)    • xgboost      (1.7.5.1)

Screenshots

See bottom:

Additional context

What it should be:

Screenshot 2023-08-08 at 6 57 30 PM

What I get:

Screenshot 2023-08-08 at 7 34 43 PM Screenshot 2023-08-08 at 7 34 46 PM
mrcaseb commented 10 months ago

Seems like NGS adjusted their model over the offseason. Our data was queried back in February. It's updated now

nflreadr::load_nextgen_stats(seasons = 2022, stat_type = "rushing") |> 
  dplyr::filter(week == 0) |> 
  dplyr::select(season, season_type, week, player_display_name, rush_yards_over_expected) |> 
  dplyr::arrange(dplyr::desc(rush_yards_over_expected))
#> ── nflverse Next Gen Stats weekly rushing data ─────────────────────────────────
#> ℹ Data updated: 2023-08-22 08:44:47 CEST
#> # A tibble: 48 × 5
#>    season season_type  week player_display_name rush_yards_over_expected
#>     <int> <chr>       <int> <chr>                                  <dbl>
#>  1   2022 REG             0 Nick Chubb                              284.
#>  2   2022 REG             0 Travis Etienne                          234.
#>  3   2022 REG             0 Tony Pollard                            226.
#>  4   2022 REG             0 Khalil Herbert                          165.
#>  5   2022 REG             0 Josh Jacobs                             158.
#>  6   2022 REG             0 Tyler Allgeier                          134.
#>  7   2022 REG             0 Jonathan Taylor                         126.
#>  8   2022 REG             0 D'Onta Foreman                          122.
#>  9   2022 REG             0 Rhamondre Stevenson                     118.
#> 10   2022 REG             0 Saquon Barkley                          114.
#> # ℹ 38 more rows
JKnapp77 commented 10 months ago

Awesome, thank you so much for looking into this and fixing it! Much appreciated!

On Tue, Aug 22, 2023 at 2:58 AM mrcaseb @.***> wrote:

Seems like NGS adjusted their model over the offseason. Our data was queried back in February. It's updated now

nflreadr::load_nextgen_stats(seasons = 2022, stat_type = "rushing") |> dplyr::filter(week == 0) |> dplyr::select(season, season_type, week, player_display_name, rush_yards_over_expected) |> dplyr::arrange(dplyr::desc(rush_yards_over_expected))#> ── nflverse Next Gen Stats weekly rushing data ─────────────────────────────────#> ℹ Data updated: 2023-08-22 08:44:47 CEST#> # A tibble: 48 × 5#> season season_type week player_display_name rush_yards_over_expected#> #> 1 2022 REG 0 Nick Chubb 284.#> 2 2022 REG 0 Travis Etienne 234.#> 3 2022 REG 0 Tony Pollard 226.#> 4 2022 REG 0 Khalil Herbert 165.#> 5 2022 REG 0 Josh Jacobs 158.#> 6 2022 REG 0 Tyler Allgeier 134.#> 7 2022 REG 0 Jonathan Taylor 126.#> 8 2022 REG 0 D'Onta Foreman 122.#> 9 2022 REG 0 Rhamondre Stevenson 118.#> 10 2022 REG 0 Saquon Barkley 114.#> # ℹ 38 more rows

— Reply to this email directly, view it on GitHub https://github.com/nflverse/nflverse-data/issues/28#issuecomment-1687585868, or unsubscribe https://github.com/notifications/unsubscribe-auth/A6JQ2E3CJTZH57AZKQSKXKTXWRKBJANCNFSM6AAAAAA3JGAKKI . You are receiving this because you authored the thread.Message ID: @.***>