Skip to contents

Get KenPom Win Probability

Usage

kp_winprob(game_id, year)

Arguments

game_id

Game id of game to pull

year

Year of game to pull

Value

Returns a named list of tibbles: winprob_dataset, game_data, runs

winprob_dataset

col_nametypes
periodinteger
wpnumeric
time_leftnumeric
visitor_scoreinteger
home_scoreinteger
visitor_scoringinteger
home_scoringinteger
possession_teamcharacter
possession_numbercharacter
game_idnumeric
yearnumeric

game_data

col_nametypes
game_idcharacter
yearinteger
full_datecharacter
datecharacter
game_timecharacter
venuecharacter
citycharacter
team1character
team1scoreinteger
team1_rkcharacter
team2character
team2scoreinteger
team2_rkcharacter
dominance_season_rkcharacter
tension_season_rkcharacter
excitement_season_rkcharacter
lead_changes_season_rkcharacter
minimum_wp_season_rkcharacter
dominance_rkcharacter
tension_rkcharacter
excitement_rkcharacter
lead_changes_rkcharacter
minimum_wp_rkcharacter
dominancecharacter
tensioncharacter
excitementcharacter
favchgcharacter
min_wpcharacter

runs

col_nametypes
startnumeric
endnumeric
visitorinteger
homeinteger

See also

Other KenPom Boxscore Functions: kp_box()

Examples

# \donttest{
  try(kp_winprob(game_id = 1238, year = 2020))
#> $winprob_dataset
#>     period     wp time_left visitor_score home_score visitor_scoring
#> 1        1 0.5264     40.00             0          0               0
#> 2        1 0.5529     39.63             2          0               1
#> 3        1 0.5763     39.40             2          0               0
#> 4        1 0.6022     39.23             4          0               1
#> 5        1 0.6240     38.92             4          0               0
#> 6        1 0.6021     38.58             4          0               0
#> 7        1 0.5759     38.38             4          2               0
#> 8        1 0.6001     38.20             6          2               1
#> 9        1 0.6219     37.80             6          2               0
#> 10       1 0.5990     37.72             6          2               0
#> 11       1 0.6231     37.48             6          2               0
#> 12       1 0.6462     37.38             8          2               1
#> 13       1 0.6693     36.97             8          2               0
#> 14       1 0.6477     36.83             8          2               0
#> 15       1 0.6716     36.65             8          2               0
#> 16       1 0.6502     36.48             8          2               0
#> 17       1 0.6751     36.23             8          2               0
#> 18       1 0.6998     35.95            10          2               1
#> 19       1 0.7228     35.48            10          2               0
#> 20       1 0.7448     35.47            12          2               1
#> 21       1 0.7635     35.08            12          2               0
#> 22       1 0.7444     35.00            12          2               0
#> 23       1 0.7642     34.68            12          2               0
#> 24       1 0.7454     34.58            12          2               0
#> 25       1 0.7651     34.38            12          2               0
#> 26       1 0.7853     34.25            14          2               1
#> 27       1 0.7671     33.93            14          4               0
#> 28       1 0.7509     33.42            14          4               0
#> 29       1 0.7291     33.15            14          6               0
#> 30       1 0.7084     32.87            14          6               0
#> 31       1 0.6840     32.80            14          8               0
#> 32       1 0.7335     32.33            17          8               1
#> 33       1 0.7562     32.12            17          8               0
#> 34       1 0.7353     31.97            17          8               0
#> 35       1 0.6892     31.68            17         11               0
#> 36       1 0.6647     31.42            17         11               0
#> 37       1 0.6927     30.82            17         11               0
#> 38       1 0.6929     30.67            18         11               1
#> 39       1 0.7177     30.43            18         11               0
#> 40       1 0.7410     30.35            20         11               1
#> 41       1 0.7166     29.97            20         13               0
#> 42       1 0.6938     29.55            20         13               0
#> 43       1 0.6670     29.20            20         15               0
#> 44       1 0.6942     29.00            22         15               1
#> 45       1 0.7194     28.48            22         15               0
#> 46       1 0.6966     28.25            22         15               0
#> 47       1 0.7209     27.95            22         15               0
#> 48       1 0.6959     27.60            22         15               0
#> 49       1 0.7208     27.30            22         15               0
#> 50       1 0.6961     27.17            22         15               0
#> 51       1 0.6688     27.10            22         17               0
#> 52       1 0.6444     26.70            22         17               0
#> 53       1 0.6743     26.32            22         17               0
#> 54       1 0.6756     26.08            23         17               1
#> 55       1 0.7037     25.72            23         17               0
#> 56       1 0.7301     25.32            25         17               1
#> 57       1 0.7553     25.00            25         17               0
#> 58       1 0.7306     24.77            25         17               0
#> 59       1 0.7052     24.13            25         19               0
#> 60       1 0.6792     23.93            25         19               0
#> 61       1 0.7102     23.62            25         19               0
#> 62       1 0.6865     23.17            25         19               0
#> 63       1 0.7160     22.82            25         19               0
#> 64       1 0.7407     22.52            27         19               1
#> 65       1 0.7695     22.13            27         19               0
#> 66       1 0.7927     22.03            29         19               1
#> 67       1 0.7744     21.53            29         21               0
#> 68       1 0.7558     21.15            29         21               0
#> 69       1 0.7055     20.75            29         24               0
#> 70       1 0.6747     20.00            29         24               0
#> 71       2 0.6747     20.00            29         24               0
#> 72       2 0.7138     19.55            29         24               0
#> 73       2 0.7444     19.17            31         24               1
#> 74       2 0.7755     19.12            31         24               0
#> 75       2 0.7394     18.48            31         24               0
#> 76       2 0.7397     18.27            31         25               0
#> 77       2 0.7111     18.03            31         25               0
#> 78       2 0.7440     17.75            31         25               0
#> 79       2 0.7163     17.37            31         25               0
#> 80       2 0.7492     17.18            31         25               0
#> 81       2 0.8046     17.07            34         25               1
#> 82       2 0.7505     16.70            34         28               0
#> 83       2 0.7793     16.48            36         28               1
#> 84       2 0.7818     16.12            36         29               0
#> 85       2 0.8099     15.68            38         29               1
#> 86       2 0.8411     15.30            38         29               0
#> 87       2 0.8638     15.05            40         29               1
#> 88       2 0.8871     14.63            40         29               0
#> 89       2 0.8696     14.28            40         29               0
#> 90       2 0.8918     13.92            40         29               0
#> 91       2 0.8752     13.75            40         29               0
#> 92       2 0.8947     13.63            40         29               0
#> 93       2 0.8786     13.27            40         29               0
#> 94       2 0.8597     13.13            40         31               0
#> 95       2 0.8362     12.85            40         31               0
#> 96       2 0.8118     12.58            40         33               0
#> 97       2 0.8130     12.27            41         33               1
#> 98       2 0.8416     12.27            41         33               0
#> 99       2 0.8135     12.20            41         33               0
#> 100      2 0.8483     11.68            41         33               0
#> 101      2 0.8706     11.62            43         33               1
#> 102      2 0.8965     11.07            43         33               0
#> 103      2 0.9294     10.70            46         33               1
#> 104      2 0.9482     10.27            46         33               0
#> 105      2 0.9441      9.75            46         33               0
#> 106      2 0.9360      9.22            46         35               0
#> 107      2 0.9230      8.75            46         35               0
#> 108      2 0.9081      8.63            46         37               0
#> 109      2 0.8870      8.45            46         37               0
#> 110      2 0.8633      8.43            46         39               0
#> 111      2 0.8970      7.68            48         39               1
#> 112      2 0.8775      7.38            48         41               0
#> 113      2 0.8469      7.17            48         41               0
#> 114      2 0.8817      6.98            48         41               0
#> 115      2 0.9274      6.63            51         41               1
#> 116      2 0.9499      6.15            51         41               0
#> 117      2 0.9393      5.75            51         41               0
#> 118      2 0.9067      5.40            51         44               0
#> 119      2 0.8834      5.05            51         44               0
#> 120      2 0.9167      4.85            51         44               0
#> 121      2 0.8960      4.32            51         44               0
#> 122      2 0.9251      4.32            51         44               0
#> 123      2 0.9519      4.07            53         44               1
#> 124      2 0.9359      3.77            53         46               0
#> 125      2 0.9634      3.30            55         46               1
#> 126      2 0.9714      2.85            55         47               0
#> 127      2 0.9633      2.35            55         47               0
#> 128      2 0.9797      2.18            55         47               0
#> 129      2 0.9842      1.75            56         47               1
#> 130      2 0.9778      1.62            56         49               0
#> 131      2 0.9779      1.55            57         49               1
#> 132      2 0.9499      1.38            57         52               0
#> 133      2 0.9168      1.30            57         52               0
#> 134      2 0.8880      1.05            57         54               0
#> 135      2 0.9276      0.52            58         54               1
#> 136      2 0.9818      0.33            58         54               0
#> 137      2 0.9930      0.25            60         54               1
#> 138      2 0.9988      0.15            60         54               0
#> 139      2 0.9978      0.08            60         54               0
#> 140      2 1.0000      0.00            60         57               0
#>     home_scoring possession_team possession_number game_id year
#> 1              0                                 0    1238 2020
#> 2              0               V                 1    1238 2020
#> 3              0               H                 1    1238 2020
#> 4              0               V                 2    1238 2020
#> 5              0               H                 2    1238 2020
#> 6              0               V                 3    1238 2020
#> 7              1               H                 3    1238 2020
#> 8              0               V                 4    1238 2020
#> 9              0               H                 4    1238 2020
#> 10             0               V                 5    1238 2020
#> 11             0               H                 5    1238 2020
#> 12             0               V                 6    1238 2020
#> 13             0               H                 6    1238 2020
#> 14             0               V                 7    1238 2020
#> 15             0               H                 7    1238 2020
#> 16             0               V                 8    1238 2020
#> 17             0               H                 8    1238 2020
#> 18             0               V                 9    1238 2020
#> 19             0               H                 9    1238 2020
#> 20             0               V                10    1238 2020
#> 21             0               H                10    1238 2020
#> 22             0               V                11    1238 2020
#> 23             0               H                11    1238 2020
#> 24             0               V                12    1238 2020
#> 25             0               H                12    1238 2020
#> 26             0               V                13    1238 2020
#> 27             1               H                13    1238 2020
#> 28             0               V                14    1238 2020
#> 29             1               H                14    1238 2020
#> 30             0               V                15    1238 2020
#> 31             1               H                15    1238 2020
#> 32             0               V                16    1238 2020
#> 33             0               H                16    1238 2020
#> 34             0               V                17    1238 2020
#> 35             1               H                17    1238 2020
#> 36             0               V                18    1238 2020
#> 37             0               H                18    1238 2020
#> 38             0               V                19    1238 2020
#> 39             0               H                19    1238 2020
#> 40             0               V                20    1238 2020
#> 41             1               H                20    1238 2020
#> 42             0               V                21    1238 2020
#> 43             1               H                21    1238 2020
#> 44             0               V                22    1238 2020
#> 45             0               H                22    1238 2020
#> 46             0               V                23    1238 2020
#> 47             0               H                23    1238 2020
#> 48             0               V                24    1238 2020
#> 49             0               H                24    1238 2020
#> 50             0               V                25    1238 2020
#> 51             1               H                25    1238 2020
#> 52             0               V                26    1238 2020
#> 53             0               H                26    1238 2020
#> 54             0               V                27    1238 2020
#> 55             0               H                27    1238 2020
#> 56             0               V                28    1238 2020
#> 57             0               H                28    1238 2020
#> 58             0               V                29    1238 2020
#> 59             1               H                29    1238 2020
#> 60             0               V                30    1238 2020
#> 61             0               H                30    1238 2020
#> 62             0               V                31    1238 2020
#> 63             0               H                31    1238 2020
#> 64             0               V                32    1238 2020
#> 65             0               H                32    1238 2020
#> 66             0               V                33    1238 2020
#> 67             1               H                33    1238 2020
#> 68             0               V                34    1238 2020
#> 69             1               H                34    1238 2020
#> 70             0               V                35    1238 2020
#> 71             0               H                35    1238 2020
#> 72             0               H                36    1238 2020
#> 73             0               V                36    1238 2020
#> 74             0               H                37    1238 2020
#> 75             0               V                37    1238 2020
#> 76             1               H                38    1238 2020
#> 77             0               V                38    1238 2020
#> 78             0               H                39    1238 2020
#> 79             0               V                39    1238 2020
#> 80             0               H                40    1238 2020
#> 81             0               V                40    1238 2020
#> 82             1               H                41    1238 2020
#> 83             0               V                41    1238 2020
#> 84             1               H                42    1238 2020
#> 85             0               V                42    1238 2020
#> 86             0               H                43    1238 2020
#> 87             0               V                43    1238 2020
#> 88             0               H                44    1238 2020
#> 89             0               V                44    1238 2020
#> 90             0               H                45    1238 2020
#> 91             0               V                45    1238 2020
#> 92             0               H                46    1238 2020
#> 93             0               V                46    1238 2020
#> 94             1               H                47    1238 2020
#> 95             0               V                47    1238 2020
#> 96             1               H                48    1238 2020
#> 97             0               V                48    1238 2020
#> 98             0               H                49    1238 2020
#> 99             0               V                49    1238 2020
#> 100            0               H                50    1238 2020
#> 101            0               V                50    1238 2020
#> 102            0               H                51    1238 2020
#> 103            0               V                51    1238 2020
#> 104            0               H                52    1238 2020
#> 105            0               V                52    1238 2020
#> 106            1               H                53    1238 2020
#> 107            0               V                53    1238 2020
#> 108            1               H                54    1238 2020
#> 109            0               V                54    1238 2020
#> 110            1               H                55    1238 2020
#> 111            0               V                55    1238 2020
#> 112            1               H                56    1238 2020
#> 113            0               V                56    1238 2020
#> 114            0               H                57    1238 2020
#> 115            0               V                57    1238 2020
#> 116            0               H                58    1238 2020
#> 117            0               V                58    1238 2020
#> 118            1               H                59    1238 2020
#> 119            0               V                59    1238 2020
#> 120            0               H                60    1238 2020
#> 121            0               V                60    1238 2020
#> 122            0               H                61    1238 2020
#> 123            0               V                61    1238 2020
#> 124            1               H                62    1238 2020
#> 125            0               V                62    1238 2020
#> 126            1               H                63    1238 2020
#> 127            0               V                63    1238 2020
#> 128            0               H                64    1238 2020
#> 129            0               V                64    1238 2020
#> 130            1               H                65    1238 2020
#> 131            0               V                65    1238 2020
#> 132            1               H                66    1238 2020
#> 133            0               V                66    1238 2020
#> 134            1               H                67    1238 2020
#> 135            0               V                67    1238 2020
#> 136            0               H                68    1238 2020
#> 137            0               V                68    1238 2020
#> 138            0               H                69    1238 2020
#> 139            0               V                69    1238 2020
#> 140            1               H                70    1238 2020
#> 
#> $game_data
#>   game_id year                 full_date       date game_time
#> 1    1238 2020 Friday, November 29, 2019 2019-11-29   7:00 PM
#>                        venue          city       team1 team1score team1_rk
#> 1 The Arena at NW Florida St Niceville, FL Florida St.         60       16
#>       team2 team2score team2_rk dominance_season_rk tension_season_rk
#> 1 Tennessee         57       21                2265              2424
#>   excitement_season_rk lead_changes_season_rk minimum_wp_season_rk dominance_rk
#> 1                 2519                   2503                 2803        99999
#>   tension_rk excitement_rk lead_changes_rk minimum_wp_rk dominance tension
#> 1      99999         99999           99999         99999      1.08    1.18
#>   excitement favchg min_wp
#> 1       1.07      0 0.5264
#> 
#> $runs
#>   start   end visitor home
#> 1 39.63 34.25      14    2
#> 
# }