add_2pt_probs | R Documentation |
Get various probabilities associated with each option on PATs (go for it, kick PAT).
add_2pt_probs(df)
df |
A data frame of decisions to be computed for. |
Original data frame Data frame plus the following columns added:
first_down_prob, wp_fail, wp_succeed, go_wp, fg_make_prob, miss_fg_wp, make_fg_wp, fg_wp, punt_wp
Win probability when scoring 0 points on PAT.
Win probability when scoring 1 point on PAT.
Win probability when scoring 2 points on PAT.
Probability of making PAT kick.
Probability of converting 2-pt attempt.
Win probability associated with going for 1.
Win probability associated with going for 2.
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 = 123,
score_differential = -2,
home_opening_kickoff = 0,
posteam_timeouts_remaining = 3,
defteam_timeouts_remaining = 3
)
probs <- nfl4th::add_2pt_probs(play)
dplyr::glimpse(probs)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.