expected_points_build: Builds an Expected Points Model

Description Usage Arguments Value Examples

View source: R/expected_points_build.R

Description

Takes in play by play data and drive info to estimate the value of each spot on the field. The model is built using a B-spline regression model predicting the number of points scored on the drives based on the current field position.

Usage

1
expected_points_build(plays, drives)

Arguments

plays

the "play.csv" data frame for the years to use to build the model

drives

the "drive.csv" data frame

Value

a named vector where the names are the yardlines on the field and the values are the estimated point values associated with that spot.

Examples

1
2
3
4
plays <- readin("play", 2014)
drives <- readin("drive", 2014)
epa_values <- expected_points_build(plays, drives)
## Not run: ggplot2::qplot(x = as.numeric(names(epa_values)), y = epa_values, xlab = "Distance From End Zone", ylab = "Expected Points", geom = "line", main = "Expected Points Model Results")

mattmills49/MELLS documentation built on May 21, 2017, 11:09 p.m.