  Population attributable fractions aim to quantify the proportion of the cases
of an outcome (for example, a disease) that would have been avoided had no
individuals in the population been exposed to a given exposure. This quantity
thus plays a crucial role in epidemiology and public health, notably to guide
policies, interventions or to assess the burden of a disease due to a
particular exposure. Various statistical methods have been proposed to estimate
attributable fractions using observational data. When time-to-event data are
used, several of these formulas yield invalid results. Alternative valid
formulas are available but remain scarcely used. We propose a new estimator of
the attributable fraction that is both conceptually simple and easy to
implement using common statistical software. Our proposed estimator makes use
of the Kaplan-Meier estimator to address censoring and potentially
non-proportional hazards, as well as inverse probability weighting to control
confounding. Nonparametric bootstrap is proposed to produce inferences. A
simulation study is used to illustrate and compare our proposed estimator to
several alternatives. The results showcase the bias of many commonly used
traditional approaches and the validity of our estimator under its working
assumptions.
