add_2pt_probs: Get 2pt decision probabilities

View source: R/wrapper.R

add_2pt_probsR Documentation

Get 2pt decision probabilities

Description

Get various probabilities associated with each option on PATs (go for it, kick PAT).

Usage

add_2pt_probs(df)

Arguments

df

A data frame of decisions to be computed for.

Value

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

wp_0

Win probability when scoring 0 points on PAT.

wp_1

Win probability when scoring 1 point on PAT.

wp_2

Win probability when scoring 2 points on PAT.

conv_1pt

Probability of making PAT kick.

conv_2pt

Probability of converting 2-pt attempt.

wp_go1

Win probability associated with going for 1.

wp_go2

Win probability associated with going for 2.

Examples


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)


nflverse/nfl4th documentation built on Sept. 28, 2024, 2:30 a.m.