Attributable fraction function based on Instrumental Variables (IV) regression as an ivglm object in the ivtools package.
ivglm
ivtools
Useful links