generate_preseason_mlm: Generates the preseason projections for the teams

Description Usage Arguments Value Examples

View source: R/generate_preseason_mlm.r

Description

This function generates preseason projections using mulilevel models to estimate the contribution of each team's offense and defense provides to their Expected Points Added per Play.

Usage

1
generate_preseason_mlm(run_plays, pass_plays)

Arguments

run_plays

the cleaned run plays after the add_epa function

pass_plays

the cleaned pass plays after the add_epa function

Value

a data frame containing the estimated team values at the end of each year.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
years <- 2013:2014
plays <- readin("play", years)
teams <- readin("team", years)
runs <- readin("rush", years)
pass <- readin("pass", years)
games <- readin("game", years)
conf <- readin("conference", years)
epa_model <- expected_points_build(plays[plays$Year != 2014, ], drives[drives$Year != 2014, ])
fixed_games <- fix_games(games)
model_plays <- combine_run_pass(runs, pass, fixed_games) %>% remove_garbage %>% fix_fcs(teams, conf) %>% add_epa(epa_model)
preseason_vals <- generate_preseason_mlm(model_plays[[1]], model_plays[[2]])

mattmills49/MELLS documentation built on May 21, 2019, 1:25 p.m.