Rstudio code for MWP
You can read about this project at https://comfortablynumb-ers.blogspot.com/2020/02/win-probability-analysis-part-1-mean.html follow me at @kevgk2 on Twitter check out more rstudio guides and nflscrapR links at the bottom #legend: #pbp: play by play #WP: win probability #MWP: average win probability #WPE: win probability expected wins #pyth: pythagorean wins #install packages install.packages("nflscrapr") install.packages("tidyverse") install.packages("lubridate") install.packages("na.tools") install.packages("ggimage") #load libraries library(nflscrapR) library(tidyverse) library(lubridate) library(na.tools) library(ggimage) #determining the mean WP for a particular game #scrape games week_14_games <- scrape_game_ids(2019, weeks = 14) #pull play by play for specific game Gb_Was_PbP <- week_14_games %>% filter(home_team == "GB") %>% pull(game_id) %>% scrape_json_play_by_pl...