50% off: Unlimited data and AI learning.
The Learning Leader's Guide to AI Literacy

Sabermetrics (version 1.0)

dice: Defense-Independent Component ERA (DICE)

Description

A function gives a number that is better at predicting a pitcher's ERA in the following year than the pitcher's actual ERA in the current year.

Usage

dice(HR, BB, HBP, K, IP)

Arguments

HR
Home Runs Allowed
BB
Walks Allowed
HBP
Batters Hit
K
Strikeouts
IP
Innings Pitched

Value

  • Returns 3 + ((13*HR+3*BB+3*HBP-2*K)/IP)

References

http://en.wikipedia.org/wiki/Defense_independent_pitching_statistics

Examples

Run this code
## Defense-Independent Component ERA (dice) function is currently defined as
function (HR, BB, HBP, K, IP) 
{
    defenseERA <- 3 + ((13 * HR + 3 * BB + 3 * HBP - 2 * K)/IP)
    return(defenseERA)
  }
  
## Let's take 2014's MLB MVP, Clayton Kershaw, and find his DICE
## Stats for Clayton Kershaw available on
## http://www.baseball-reference.com/players/k/kershcl01-pitch.shtml
## For 2014, Kershaw allowed 9 HR, 31 BB, 2 HBP, 239 K, and 198.1 IP
## The formula for his DICE using the dice function is below
## Output should be 1.677436
dice(9,31,2,239,198.1)

Run the code above in your browser using DataLab