# Causal_Inference_book **Repository Path**: scientific-clown/Robins ## Basic Information - **Project Name**: Causal_Inference_book - **Description**: Stata code for part 2 (Chapter 11-17) of the book Causal Inference, by Miguel Hernán and James Robins. - **Primary Language**: 其他 - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 76 - **Created**: 2023-08-31 - **Last Updated**: 2023-08-31 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## 简介 - Causal Inference Book > **Book:** Hernán MA, Robins JM (2020). **Causal Inference: What If**. Boca Raton: Chapman & Hall/CRC. ![](https://images.gitee.com/uploads/images/2020/0228/175928_beb2892e_1522177.png) > 「**因果推断**」最近很火,让我们很是 **恼火**!   今天要介绍的这本书叫 **《Causal Inference: What If》**,是统计学大牛 J. Robins 和 Hernán 共同完成的一本颇具影响力的书。这本书已经面世好几年的时间了,目前放在他们主页上的是最新修订版。两位作者非常慷慨,直接在自己的主页上放了书稿的 PDF 原本。 来自不同领域的学者们也对这本书给予了很大的支持。提供了这本书部分章节的实现代码,包括 Stata, R, Python, SAS。 其中,Stata 实现过程由 Eleanor Murray 提供。 第 1-10 章重点讲述一些基本概念,通过大量的简单实例和图形的方式,深入浅出地介绍了因果推断中的核心概念和方法。第 11-18 章讲述了各种各样用于进行因果推断的模型,包括工具变量法 (IV)、倾向得分匹配分析 (PSM)、调节效应、结构方程等。第 19-25 章介绍了较为复杂的情形,如面板数据、 动态处理效应、反馈效应等。 为了便于大家学习这本书里面的内容,我们从作者的主页以及 Github 仓库上,把所有相关的资料都下载下来并整理成了目前的码云仓库,以便于国内用户访问。 ## 书稿、数据和程序 - Hernán MA, Robins JM (2020). Causal Inference: What If. Boca Raton: Chapman & Hall/CRC. [[PDF在线浏览]](https://quqi.gblhgk.com/s/880197/eQHgb0bnGgYeafcp),[[作者书稿主页]](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/) - **Stata 实现过程:** Chp 11-17 各章的 Stata 实现代码来自 [Eleanor Murray - Github](https://github.com/eleanormurray/causalinferencebook_stata)。 - **R, Python, SAS 实现过程 :** 请访问 [[作者书稿主页]](https://www.hsph.harvard.edu/miguel-hernan/causal-inference-book/),包括书中第 11-17 章中所用的数据和实现过程。 ## 使用方法 进入码云仓库后,点击橘红色【克隆/下载】按钮,即可将仓库中所有文件下载到本地电脑中。 在 Stata 中打开【_Main.do】文档后,按提示执行命令即可打开各章对应的 dofiles。   ![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/Lianxh_装饰黄线.png) > Stata连享会   [主页](https://www.lianxh.cn/news/46917f1076104.html) || [视频](http://lianxh.duanshu.com) || [推文](https://www.lianxh.cn/news/d4d5cd7220bc7.html) || [知乎](https://www.zhihu.com/people/arlionn/) || [Bilibili 站](https://space.bilibili.com/546535876) ![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/连享会-草料主页-一码平川600.png)   ## 1. 连享会课程 > **免费公开课:** - [直击面板数据模型](https://lianxh.duanshu.com/#/brief/course/7d1d3266e07d424dbeb3926170835b38) - 连玉君,时长:1小时40分钟,[课程主页](https://gitee.com/arlionn/PanelData),[B 站版](https://www.bilibili.com/video/BV1oU4y187qY) - [Stata 33 讲](https://lianxh.duanshu.com/#/brief/course/b22b17ee02c24015ae759478697df2a0) - 连玉君, 每讲 15 分钟. [B 站版](https://space.bilibili.com/546535876/channel/detail?cid=160748) - [Stata 小白的取经之路](https://lianxh.duanshu.com/#/brief/course/137d1b7c7c0045e682d3cf0cb2711530) - 龙志能,时长:2 小时,[课程主页](https://gitee.com/arlionn/StataBin) - 部分直播课 [课程资料下载](https://gitee.com/arlionn/Live) (PPT,dofiles等)   > ### ⛳ [课程主页](https://www.lianxh.cn/news/46917f1076104.html) [![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/lianxhbottom01.png)](https://www.lianxh.cn/news/46917f1076104.html) [![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/lianxhbottom02.png)](https://www.lianxh.cn/news/46917f1076104.html) [![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/lianxhbottom03.png)](https://www.lianxh.cn/news/46917f1076104.html) > ### ⛳ [课程主页](https://www.lianxh.cn/news/46917f1076104.html) ![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/Lianxh_装饰黄线.png)   ## 2. 资源分享 ### 视频公开课 - [连享会码云:100多个精选计量项目](https://www.lianxh.cn/news/944a69d75cec9.html) | [新浪视频](https://weibo.com/tv/show/1034:4479228373303338) - [五分钟 Markdown / Markdown 幻灯片](https://gitee.com/arlionn/md) | [新浪视频](https://weibo.com/tv/show/1034:4484204327796746) - [连老师给你的-听课建议](https://www.lianxh.cn/news/69706e871c9ad.html) - [直击面板数据模型](http://lianxh-pc.duanshu.com/course/detail/7d1d3266e07d424dbeb3926170835b38) - 连玉君,时长:1小时40分钟,[B 站版](https://www.bilibili.com/video/BV1oU4y187qY) - [Stata 33 讲](http://lianxh-pc.duanshu.com/course/detail/b22b17ee02c24015ae759478697df2a0) - 连玉君, 每讲 15 分钟. [课程主页](https://gitee.com/arlionn/stata101),[课件](https://gitee.com/arlionn/stata101),[B 站版](https://space.bilibili.com/546535876/channel/detail?cid=160748) - [Stata小白的取经之路](https://gitee.com/arlionn/StataBin),龙志能,上海财经大学,[去听课](https://lianxh.duanshu.com/#/brief/course/137d1b7c7c0045e682d3cf0cb2711530) ### Stata - [连享会推文](https://www.lianxh.cn) | [直播视频](http://lianxh.duanshu.com) - **计量专题课程**: [Stata暑期班/寒假班](https://gitee.com/lianxh/text) | [专题课程](https://gitee.com/arlionn/Course) - Stata专栏:[最新推文](https://www.lianxh.cn) | [知乎](https://www.zhihu.com/people/arlionn/) | [CSDN](https://blog.csdn.net/arlionn) | [Bilibili 站](https://space.bilibili.com/546535876) - Books and Journal: [计量Books](https://quqi.gblhgk.com/s/880197/hmpmu2ylAcvHnXwY) | [SJ-PDF](https://quqi.gblhgk.com/s/880197/eipgoUi6Gd1FDZRu) | [Stata Journal-在线浏览](https://www.lianxh.cn/news/12ffe67d8d8fb.html) - Stata Guys:[Ben Jann](http://www.soz.unibe.ch/about_us/personen/prof_dr_jann_ben/index_eng.html) ### Data - [CSMAR-国泰安](http://www.gtarsc.com/#/datacenter/singletable) | [Wind-万德](https://www.wind.com.cn/Default.html) | [Resset-锐思](http://www.resset.cn/databases) - [常用数据库](https://www.lianxh.cn/news/0b65fd5165c2c.html) - [人文社科开放数据库](https://www.lianxh.cn/news/6f06c914acde8.html) - [徐现祥教授-IRE-官员交流、方言等](https://www.lianxh.cn/news/8c9f81a5f19ee.html) - [知乎-Data](https://www.zhihu.com/question/20179699/answer/681756635) ### Papers - 学术论文复现 - [论文重现网站](https://www.lianxh.cn/news/e87e5976686d5.html) - [Google学术](https://ac.scmor.com/) | [统一入口:虫部落学术搜索](http://scholar.chongbuluo.com/) | [微软学术](https://academic.microsoft.com/home) - [iData - 期刊论文下载](https://www.cn-ki.net/) - [ CNKI ](http://scholar.cnki.net/) | [百度学术](http://xueshu.baidu.com/) | [Google学术](https://scholar.glgoo.org/) | [Sci-hub ](http://www.sci-hub.cc/), [2](http://sci-hub.ac/), [3](http://sci-hub.bz/), [4](http://sci-hub.ac/) - Stata论文重现: [Harvard dataverse][harvd] | [JFE][jfe] | [github][git1] | [Yahoo-github][yahoogit] - 学者主页(提供了诸多论文的原始数据和 dofiles):[Angrist][Ang1] || [Daron Acemoglu][acem] || [Ross Levine][ross] || [Esther Duflo][Duflo] || [Imbens](https://scholar.harvard.edu/imbens/software) || [Raj Chetty](http://www.rajchetty.com/) [harvd]:https://dataverse.harvard.edu/dataverse [jfe]:http://jfe.rochester.edu/data.htm [Ang1]:http://economics.mit.edu/faculty/angrist/data1/data [acem]:http://economics.mit.edu/faculty/acemoglu/data [ross]:http://faculty.haas.berkeley.edu/ross_levine/papers.htm [duflo]:http://economics.mit.edu/faculty/eduflo/papers [git1]:https://github.com/search?utf8=%E2%9C%93&q=stata&type= [yahoogit]:https://search.yahoo.com/search;_ylt=AwrBT8di2LBZqyEAuG9XNyoA;_ylc=X1MDMjc2NjY3OQRfcgMyBGZyA3lmcC10LTQ3MwRncHJpZAMEbl9yc2x0AzAEbl9zdWdnAzAEb3JpZ2luA3NlYXJjaC55YWhvby5jb20EcG9zAzAEcHFzdHIDBHBxc3RybAMwBHFzdHJsAzE0BHF1ZXJ5A3N0YXRhJTIwZ2l0aHViBHRfc3RtcAMxNTA0NzYxODcz?p=stata+github&fr2=sb-top&fr=yfp-t-473&fp=1   --- >#### 关于我们 - **Stata连享会** 由中山大学连玉君老师团队创办,定期分享实证分析经验。[直播间](http://lianxh.duanshu.com) 有很多视频课程,可以随时观看。 - [连享会-主页](https://www.lianxh.cn) 和 [知乎专栏](https://www.zhihu.com/people/arlionn/),500+ 推文,实证分析不再抓狂;[Bilibili 站](https://space.bilibili.com/546535876) 有视频大餐。   > ⛳ **`lianxh` 命令发布了:** > 随时搜索连享会推文、Stata 资源,安装命令如下: >   `. ssc install lianxh` > 使用详情参见帮助文件 (有惊喜): >   `. help lianxh`   ![](https://fig-lianxh.oss-cn-shenzhen.aliyuncs.com/横条-远山03-窄版.jpg)