软件应用 | 用 R 语言做因果推断?你少不了这些包
因果推断(Causal Inference)的新兴研究范式从有效识别变量间因果关系开始兴起。世上万事万物,有因就有果,有果必有因。数据科学家们曾尝试各种“实验设计”,对潜在结果进行建模,使数据呈现因果效应。这其中也包括计量经济学家们,他们用引入反事实理论框架来定义因果,用随机化实验的思想去识别因果, 用断点回归(RDD)、双重差分(DID)、倾向值匹配(PSM)等方法求得因果关系的净效应。
R语言中,有很多包支持我们做因果推断分析。
本期,我们再次从R官网出发,梳理出涉及因果推断的程序包,也部分列出断点回归、双重差分相关程序包等等。
因果推断
Causal Inference
1)bcf包:适用于贝叶斯回归树模型的因果推断;
https://cloud.r-project.org/web/packages/bcf/index.html
2)causalweight包:基于逆概率加权的因果推理估计方法,适用于估算因果中介中的平均治疗效果、直接和间接效果的方法;
https://cloud.r-project.org/web/packages/causalweight/index.html
3)CausalImpact包:基于贝叶斯结构时序模型的因果推断;
https://cloud.r-project.org/web/packages/CausalImpact/index.html
4)cin包:神经科学的因果推断;
https://cloud.r-project.org/web/packages/cin/index.html
5)cit包:因果推断检验,一种基于可能性假设检验方法;
https://cloud.r-project.org/web/packages/cit/index.html
6)CMatching包:用聚类数据进行因果推断的匹配算法;
https://cloud.r-project.org/web/packages/CMatching/index.html
7)FLAME包:一种快速大规模近乎精准匹配的因果推断方法;
https://cloud.r-project.org/web/packages/FLAME/index.html
8)inferference包:存在干扰的因果推断方法;
https://cloud.r-project.org/web/packages/inferference/index.html
9)iWeigReg包:因果推断和数据缺失问题的改进方法;
https://cloud.r-project.org/web/packages/iWeigReg/index.html
10)konfound包:量化因果推断的稳健性;
https://cloud.r-project.org/web/packages/konfound/index.html
11)MatchIt包:参数因果推断的非参预处理,包括倾向得分匹配;
https://cloud.r-project.org/web/packages/MatchIt/index.html
12)MatchLinReg包:结合匹配和线性回归进行因果推断;
https://cloud.r-project.org/web/packages/MatchLinReg/index.html
13)mwa包:时空事件数据中的因果推断;
https://cloud.r-project.org/web/packages/mwa/index.html
14)noncompliance包:二元工具变量模型下存在处理不依从的因果推断;
https://cloud.r-project.org/web/packages/noncompliance/index.html
15)pcalg包:绘图模型和因果推断方法;
https://cloud.r-project.org/web/packages/pcalg/index.html
16)qtlnet包:QTL网络的因果推断;
https://cloud.r-project.org/web/packages/qtlnet/index.html
17)qualCI包:关于结果定性和有序信息的因果推断;
https://cloud.r-project.org/web/packages/qualCI/index.html
18)RISCA包:基于队列分析中的因果推断和预测;
https://cloud.r-project.org/web/packages/RISCA/index.html
19)sbw包:平衡性权重的因果推断和非完整数据的结果评估;
https://cloud.r-project.org/web/packages/sbw/index.html
20)simcausal包:使用因果推理应用程序模拟纵向数据;
https://cloud.r-project.org/web/packages/simcausal/index.html
21)wfe包:因果推理的加权线性固定效应回归模型,包括分层随机实验、双重差分等。
https://cloud.r-project.org/web/packages/wfe/index.html
断点回归
Regression Discontinuity Designs
1)rdd包:断点回归估计;
https://cloud.r-project.org/web/packages/rdd/index.html
2)rddapp包:断点回归设计应用;
https://cloud.r-project.org/web/packages/rddapp/index.html
3)rddensity包:基于密度间断的操纵检验;
https://cloud.r-project.org/web/packages/rddensity/index.html
4)rddtools包:断点回归设计工具箱;
https://cloud.r-project.org/web/packages/rddtools/index.html
5)rdrobust包:断点回归设计中可靠的数据驱动统计推断。
https://cloud.r-project.org/web/packages/rdrobust/index.html
双重差分
Difference in Differences
1)did包:多个时期和组的处理效果,一种差分方法;
https://cloud.r-project.org/web/packages/did/index.html
2)pampe包:比较干预影响和非干预影响,来评估干预效果;
https://cloud.r-project.org/web/packages/pampe/index.html
3)ATE包:使用平衡协变量推断平均处理效应。
https://cloud.r-project.org/web/packages/ATE/index.html
注:以上涉及因果推断的R语言包可能未穷尽列出,有兴趣者请关注R语言官网获取更多内容。