Learn R Programming

Sabermetrics (version 2.0)

fip: Field Independent Pitching (FIP)

Description

FIP is a statistic that measure a pitcher's performance independent of defense. FIP uses outcomes that do not take into account a team's defense.

Usage

fip(HR, BB, HBP, K, IP, year)

Arguments

HR
Homeruns given up
BB
Walks given up
HBP
Hit by pitches given up
K
Strikeouts
IP
Innings Pitched
year
Season

Value

Returns a numerical vector equal to ((13*HR)+(3*(BB+HBP))-(2*K))/IP + constantConstant = Season FIP Constant

Details

While FIP is not a complete representation of a pitcher's performance, it is regarded as a better representation of performance than ERA.

References

http://www.fangraphs.com/library/pitching/fip/

See Also

era, whip, xfip, fipminus

Examples

Run this code
## Let's calculate Clayton Kershaw's 2014 FIP
## He had 9 HR's, 31 BB's, 2 HBP's, 239 K's, and 198.333 IP's
## We should get 1.81 as our output
fip(9,31,2,239,198.333,2014)

## The function is currently defined as
function (HR, BB, HBP, K, IP, year) 
{
    constant <- weights$cFIP[which(weights$Season == year)]
    fip <- ((13 * HR) + (3 * (BB + HBP)) - (2 * K))/IP + constant
    return(fip)
  }

Run the code above in your browser using DataLab