prob_calc {runexp} | R Documentation |
Calculates player probabilities given players' game statistics.
Description
Uses player statistics to calculate the probability of six possible at bat outcomes (walk, single, double, triple, homerun, or out). Also estimates the probability of a player attempting a steal (SBA) and succeeding in an attempted steal (SB). Player game statistics are commonly available on team's public webpages.
Usage
prob_calc(playerData)
Arguments
playerData |
data frame of the players statistics (details below) |
Details
The playerData
data frame must contain the following columns
of player statistics:
Name: player name
Number: player number
AB: at bats
BB: walks
HBP: hit by pitch
H: hits
2B: doubles
3B: triples
HR: homeruns
ATT: attempted steals
SB: successfully stolen bases
Plate appearances (PA) are calculated as AB + BB + HBP. The player probabilities are calculated as:
Walk probability: W = (BB + HBP) / (PA)
Single probability: S = (H - (2B + 3B + HR)) / (PA)
Double probability: D = 2B / PA
Triple probability: TR = 3B / PA
Home Run probability: HR = HR / PA
Out probability: O = (PA - (H + BB + HBP)) / PA
Probabilities calculated from limited at bats will not be very useful. Note,
this function does not assign TRUE/FALSE values for fast players. These may
be manually assigned or will be assigned based on SBA probability when chain
or sim
functions are called.
SBA (Stolen Base Attempt) is the probability a player will attempt to steal given they are on first base and there is no runner on second. As a default, we estimate a player's SBA probability using a rough thresholding rule based on the team's overall SB probability and the player's SB probability. Essentially, we group the players into three categories:
Almost Always Attempt to Steal Group: These players receive the SBA probability of the team's overall SB probability which is calculated as (Team's total # of SB)/(Team's total # of SBA)
50/50 Attempt to Steal Group: These players receive SBA probability of 0.50
Never Attempt to Steal Group: These players receive SBA probability of 0.0
We recommend reviewing these default probabilities before proceeding with run expectancy calculations.
Value
a dataframe of the players' probabilities for W, S, D, TR, HR, O, SBA, and SB
Examples
probs <- prob_calc(wku_stats) # probs corresponds to wku_probs