Learn R Programming

Sabermetrics (version 2.0)

xfip: xFIP

Description

xFIP is a statistic that estimates a pitcher's expected run prevention independent of the performance of the defense.

Usage

xfip(flyballs, lgHRFB, BB, HBP, K, ip, year)

Arguments

flyballs
Fly balls allowed
lgHRFB
League HR/FB Percentage
BB
Balls Allowed
HBP
Hit By Pitches Allowed
K
Strikeouts
ip
Innings Pitched
year
Season

Value

Returns a numeric value equal to (13*(flyballs*lgHRFB)+(3*(BB+HBP))-(2*K))/(ip)+constant

Details

xFIP is almost exactly like FIP, except it uses the expected number of home runs taking the pitcher's fly balls allowed times the league average home run per fly ball rate.

References

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

See Also

fip,xfipminus

Examples

Run this code
## The function is currently defined as
function (flyballs, lgHRFB, BB, HBP, K, ip, year) 
{
    constant <- linearWeights$cFIP[which(linearWeights$Season == 
        year)]
    xfip <- (13 * (flyballs * lgHRFB) + (3 * (BB + HBP)) - (2 * 
        K))/(ip) + constant
    return(xfip)
  }

Run the code above in your browser using DataLab