We present R software packages RobustIV and controlfunctionIV for causal inference with possibly invalid instrumental variables. RobustIV focuses on the linear outcome model. It implements the two-stage hard thresholding method to select valid instrumental variables from a set of candidate instrumental variables and make inferences for the causal effect in both low- and high-dimensional settings. Furthermore, RobustIV implements the high-dimensional endogeneity test and the searching and sampling method, a uniformly valid inference method robust to errors in instrumental variable selection. controlfunctionIV considers the nonlinear outcome model and makes inferences about the causal effect based on the control function method. Our packages are demonstrated using two publicly available economic data sets together with applications to the Framingham Heart Study.
翻译:我们提出了R软件包RobustIV和controlfunctionIV,用于可能包含无效工具变量的因果推断。RobustIV专注于线性结果模型,它实现了两阶段硬阈值方法,从候选工具变量集合中筛选有效工具变量,并在低维和高维设定下对因果效应进行推断。此外,RobustIV还实现了高维内生性检验以及搜索与抽样方法,这是一种对工具变量选择错误具有鲁棒性的统一有效推断方法。controlfunctionIV则针对非线性结果模型,基于控制函数方法对因果效应进行推断。我们通过两个公开的经济数据集以及应用于弗雷明汉心脏研究(Framingham Heart Study)的案例展示了这些软件包的功能。