konfound: An R Sensitivity Analysis Package to Quantify the Robustness of Causal Inferences
Abstract
Quantifying the Robustness of Inferences Sensitivity analysis, a statistical method crucial for validating inferences across disciplines, quantifies the conditions that could alter conclusions (Razavi et al., 2021). One line of work is rooted in linear models and foregrounds the sensitivity of inferences to the strength of omitted variables (Cinelli & Hazlett, 2019; Frank, 2000). A more recent approach is rooted in the potential outcomes framework for causal inference and foregrounds how hypothetical changes in a sample would alter an inference if such cases were otherwise observed (Frank et al., 2008, 2013; Frank & Min, 2007; Xu et al., 2019). One sensitivity measure is the Impact Threshold of a Confounding Variable, or ITCV, which generates statements about the correlation of an omitted, confounding variable with both a predictor of interest and the outcome (Frank, 2000). The ITCV index can be calculated for any linear model. The Robustness of an Inference to Replacement, RIR, assesses how replacing a certain percentage of cases with counterfactuals of zero treatment effect could nullify an inference (Frank et al., 2013). The RIR index is more general than the ITCV index. The sensitivity analysis techniques we describe in this paper and implement in the konfound R package differ from others in several ways. Unlike Linden et al. (2020), whose approach focuses on dichotomous outcomes and omitted variable sensitivity, our approach extends to continuous outcomes and evaluates both changes in estimates and standard errors. Oster (2019) focuses only on selection into the treatment based on unobservable variables versus observable variables necessary to nullify an estimate. The ITCV index focuses on the relationship of the unobservable to the predictor of interest and to the outcome. More generally, many others used simulation-based approaches, while our approach uses closed-form expressions to generate a single term representing sensitivity. These techniques, along with others, are reviewed and discussed (along with the ITCV and RIR approaches) in Frank et al. (2023). We have implemented the calculation of both the ITCV and RIR indices in the konfound R package. This package is intended to provide an easy-to-use and principled set of sensitivity techniques that are suitable for a range of model and dependent variable types and use cases. Its audience is broad: primarily social scientists, but also interested individuals in other disciplines (e.g., the health sciences). This paper provides an overview of two core functions within the konfound package, each of which can calculate the ITCV and RIR indices: konfound() and pkonfound(). These functions allow users to calculate the robustness of inferences using a model estimated (with R) or using information about a model from a published study, respectively. The konfound package is available from the Comprehensive R Archive Network (CRAN) at https://CRAN.R-project.org/package=konfound; it can be installed via the install.packages(“konfound”) function within R
Citation
Narvaiz et al., (2024). konfound: An R Sensitivity Analysis Package to Quantify the Robustness of Causal Inferences. Journal of Open Source Software, 9(95), 5779. doi:10.21105/joss.05779