add_4th_probs | R Documentation |
Get various probabilities associated with each option on 4th downs (go for it, kick field goal, punt).
add_4th_probs(df)
df |
A data frame of decisions to be computed for. |
Original data frame Data frame plus the following columns added:
Gain (or loss) in win prob associated with choosing to go for it (percentage points).
Probability of earning a first down if going for it on 4th down.
Win probability in the event of a failed 4th down attempt.
Win probability in the event of a successful 4th down attempt.
Average win probability when going for it on 4th down.
Probability of making field goal.
Win probability in the event of a missed field goal.
Win probability in the event of a made field goal.
Average win probability when attempting field goal.
Average win probability when punting.
play <-
tibble::tibble(
# things to help find the right game (use "reg" or "post")
home_team = "GB",
away_team = "TB",
posteam = "GB",
type = "post",
season = 2020,
# information about the situation
qtr = 4,
quarter_seconds_remaining = 129,
ydstogo = 8,
yardline_100 = 8,
score_differential = -8,
home_opening_kickoff = 0,
posteam_timeouts_remaining = 3,
defteam_timeouts_remaining = 3
)
probs <- nfl4th::add_4th_probs(play)
dplyr::glimpse(probs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.