Learn R Programming

Sabermetrics (version 1.0)

eqa: Equivalent Average

Description

A baseball metric invented by Clay Davenport and intended to express the production of hitters in a context independent of park and league effects. EQA represents a hitter's productivity using the same scale as batting average.

Usage

eqa(H, TB, BB, HBP, SB, SAC, SF, AB, CS)

Arguments

H
Hits
TB
Total Bases
BB
Walks
HBP
Hit by pitch
SB
Stolen bases
SAC
Sacrifice hit/bunt
SF
Sacrifice flies
AB
At bats
CS
Caught stealing

Value

  • Returns (H+TB+1.5*(BB+HBP)+SB+SAC+SF)/(AB+BB+HBP+SAC+SF+CS+(SB/3))

References

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

Examples

Run this code
## The equivalent average (eqa) function is currently defined as
function (H, TB, BB, HBP, SB, SAC, SF, AB, CS) 
{
    eqa <- (H + TB + 1.5 * (BB + HBP) + SB + SAC + SF)/(AB + 
        BB + HBP + SAC + SF + CS + (SB/3))
    return(eqa)
  }
  
## Let's take 2014's MLB MVP, Mike Trout, and find his OPS
## Stats for Mike Trout available on
## http://www.baseball-reference.com/players/t/troutmi01-bat.shtml
## For 2014, Trout had 173 H, 338 TB, 83 BB, 10 HBP, 16 SB, 0 SAC, 10 SF, 602 AB, 2 CS
## The formula for his EQA using the ops function is below
## Output should be .9496958
eqa(173,338,83,10,16,0,10,602,2)

Run the code above in your browser using DataLab