Data and Code for: Measuring Geopolitical Risk
收藏资源简介:
<b>Overview</b><br><br>This archive contains the files to reproduce the results in "Measuring Geopolitical Risk" as well as any additional documentation referred in the paper. <br><br>Each directory is self-contained. For each directory, download all the files in order to run the necessary scripts. Instructions are given in the README files.<br>Updated data can be found on the geopolitical risk index webpage, which can be found at the following url: https://www.matteoiacoviello.com/gpr.htm<br><br> For questions or comments, please contact iacoviel@gmail.com<br><br><br><br><br><b>Data Availability Statement</b><br><br>All the data used in this paper are provided in this repository, with the exception of the Compustat quarterly firm-level data, which can be downloaded from https://wrds-www.wharton.upenn.edu/pages/ with a registered account.<br><br><b>Software used</b><b><br></b> The codes here run and have been tested either on Stata/MP 16.0 (for *.do files), on Matlab R2019/A (for *.m files), on R Version 4.04 (for *.R files), and on Anaconda 3 (for *.py, *.ipynb files). Most codes run in seconds/minutes on a personal laptop with 16GB ram, with the exception of the R code to estimate disaster episodes, which takes about 2 days using the standard settings from the Nakamura et al (2013) paper (nIter = 50,000, nRuns = 40). <br><br><br><br><br><b>Directory list and list of main input files - if any - in each directory</b><br><br>1. Monthly Geopolitical Risk Data Used in the Paper (<b>data_paper</b>)See README.txt file in the directory for details<br>data_gpr_export.dta (Stata format)<br>data_gpr_export.xls (Excel format)<br><br>2. Replication of Section I: Tables 1-2, Figures 1-8, Appendix Tables A.3-A.6, and Appendix Figures A.1-A.4 and A.10-A.14 (<b>figures_paper</b>) <br>(requires Stata)<br><br>See README.txt in the directory for details<br><br>input file: run_figures_tables.do<br>3. Replication of Section III : VAR Evidence - Figures 9-10 and Appendix Figures A.5-A.7 (<b>var_results</b>)(requires Matlab)<br><br>See README.txt in the directory for details<br>input file: run_all.m<br>4. Replication of Section IV : Country-Specific GPR and Disaster Probability and Quantile Regressions - Tables 3-4 (<b>disaster_regressions</b>)(requires Stata)<br>See README.txt in the directory for details<br>input file: run_replication_country_gpr.do<br><br>5. Replication of Section V : Firm-Specific Geopolitical Risk - Table 5, Figure 11, Appendix Table A.7, and Appendix Figure A.9 (<b>firm_regressions</b>)(requires Stata)<br>See README.txt file in the directory for details.<br>input file: run_replication_firm_shuffled.do<br><br>(Note that replication of the results here requires downloading firm-level balance sheet data through Compustat/WRDS. See firm_documentation below for instructions on how to build the firm_level.dta file)<br><br>6. Auxiliary Material (Section V): Construction of Industry-Specific Exposure to Geopolitical Risk - Appendix Figure A.8 (<b>industry_regressions</b>)(requires Stata)<br><br>See README.txt file in the directory for details.<br>input file: run_replication_industry.do<br><br>7. Auxiliary Material: Documentation on how to Build the firm_level.dta file (<b>firm_documentation</b>)See README_BUILD.txt file in the directory for details.<br><br>8. Auxiliary Material (Section II): Tabulations of Daily Narrative GPR Data from The New York Times <b>(narrative_index)</b>See README.txt file in the directory for details.<br><br>9. Appendix: Details on the Construction of the Human GPR Index (<b>human_index</b>)See README.txt file in the directory for details.<br><br><br>10. Appendix: Audit of Articles Belonging to the GPR Index Described in Appendix Table A.3 (<b>audit_coded</b>)See README.txt file in the directory for details.<br><br><br>11. Appendix: Granger Causality Tests --- Appendix Table A.8 (<b>granger_causality</b>)(requires Stata)<br><br>See README.txt file in the directory for details.<br><br>input file: run_granger_test.do<br>12. Appendix: Replication of Textual Analysis in Appendix Tables A.1 and A.2 (<b>text_analysis</b>)(requires Matlab, including text analytics toolbox, and Stata for generating the formatted tables in the appendix)<br><br>See README.txt file in the directory for details.<br>input files: run_find_grams_textanalytics.m and run_app_tables_1_2.do <br>13. Auxiliary Material: Estimation of the Country Disaster Events from 1900 through 2019 (<b>disaster_estimation</b>)(requires R)<br><br>See README.txt file in the directory for details.<br><br><br>14. Auxiliary Material: Stata File with Firm-Level Geopolitical Risk Data (<b>firm_level_gpr</b>)See README.txt file in the directory for details.<br><br><br>15. Auxiliary Material: Search Queries for News-Based GPR Index (<b>news_searches</b>)See README.txt file in the directory for details.<br><br>16. Auxiliary Material: Search Queries for Firm-Level GPR Index (<b>firm_level_searches</b>)(requires Anaconda)<br><br>See README.txt file in the directory for details.<br><br><br><br><br><br>
<b>概述</b> 本档案包含可复现《地缘政治风险测度》(Measuring Geopolitical Risk)论文结果的全部文件,以及论文中提及的所有补充文档。 每个目录均为独立完备的单元,如需运行所需脚本,请下载对应目录下的全部文件,详细操作说明参见各目录内的README文件。 更新后的数据集可访问地缘政治风险指数官网获取,网址为:https://www.matteoiacoviello.com/gpr.htm 如有疑问或建议,请致邮iacoviel@gmail.com <b>数据可用性声明</b> 本论文所用全部数据均已收录至本仓库,仅Compustat季度企业层面数据除外,该类数据需通过沃顿研究数据服务平台(WRDS,网址:https://wrds-www.wharton.upenn.edu/pages/)注册账户后下载获取。 <b>所用软件环境</b> 本仓库内的代码已完成适配测试,其中*.do格式文件可在Stata/MP 16.0环境下运行,*.m格式文件适配Matlab R2019/A环境,*.R格式文件适配R Version 4.04环境,*.py与*.ipynb格式文件适配Anaconda 3环境。多数代码在配备16GB内存的个人笔记本电脑上仅需数秒至数分钟即可运行,仅用于估计灾害事件的R代码例外:按照Nakamura等人2013年论文的标准设置(nIter=50000,nRuns=40)运行时,耗时约需2天。 <b>各目录清单及主要输入文件(如存在)列表</b> 1. 论文所用月度地缘政治风险(Geopolitical Risk,简称GPR)数据(<b>data_paper</b>):详细说明参见对应目录内的README.txt文件。包含文件:data_gpr_export.dta(Stata格式)、data_gpr_export.xls(Excel格式)。 2. 第I部分复现:表格1-2、图1-8、附录表格A.3-A.6及附录图A.1-A.4、A.10-A.14(<b>figures_paper</b>):需使用Stata运行,详细说明参见对应目录内的README.txt文件。输入文件:run_figures_tables.do。 3. 第III部分复现:向量自回归(VAR)实证分析——图9-10及附录图A.5-A.7(<b>var_results</b>):需使用Matlab运行,详细说明参见对应目录内的README.txt文件。输入文件:run_all.m。 4. 第IV部分复现:国别层面地缘政治风险(GPR)、灾害概率与分位数回归——表格3-4(<b>disaster_regressions</b>):需使用Stata运行,详细说明参见对应目录内的README.txt文件。输入文件:run_replication_country_gpr.do。 5. 第V部分复现:企业层面地缘政治风险——表格5、图11、附录表格A.7及附录图A.9(<b>firm_regressions</b>):需使用Stata运行,详细说明参见对应目录内的README.txt文件。输入文件:run_replication_firm_shuffled.do。注意:复现该部分结果需通过Compustat/沃顿研究数据服务平台(WRDS)下载企业层面资产负债表数据,构建firm_level.dta文件的操作说明详见下文的<b>firm_documentation</b>目录。 6. 辅助材料(第V部分):行业层面地缘政治风险敞口构建——附录图A.8(<b>industry_regressions</b>):需使用Stata运行,详细说明参见对应目录内的README.txt文件。输入文件:run_replication_industry.do。 7. 辅助材料:firm_level.dta文件构建指南(<b>firm_documentation</b>):详细说明参见对应目录内的README_BUILD.txt文件。 8. 辅助材料(第II部分):《纽约时报》每日叙事型地缘政治风险(GPR)数据统计表格(<b>narrative_index</b>):详细说明参见对应目录内的README.txt文件。 9. 附录:人工标注地缘政治风险(GPR)指数构建细节(<b>human_index</b>):详细说明参见对应目录内的README.txt文件。 10. 附录:附录表格A.3中提及的地缘政治风险(GPR)索引相关文章审核编码(<b>audit_coded</b>):详细说明参见对应目录内的README.txt文件。 11. 附录:格兰杰因果检验——附录表格A.8(<b>granger_causality</b>):需使用Stata运行,详细说明参见对应目录内的README.txt文件。输入文件:run_granger_test.do。 12. 附录:附录表格A.1、A.2的文本分析复现(<b>text_analysis</b>):需使用搭载文本分析工具箱的Matlab环境,附录格式化表格的生成需使用Stata。详细说明参见对应目录内的README.txt文件。输入文件:run_find_grams_textanalytics.m与run_app_tables_1_2.do。 13. 辅助材料:1900年至2019年国别灾害事件估计(<b>disaster_estimation</b>):需使用R语言运行,详细说明参见对应目录内的README.txt文件。 14. 辅助材料:企业层面地缘政治风险数据Stata文件(<b>firm_level_gpr</b>):详细说明参见对应目录内的README.txt文件。 15. 辅助材料:新闻类地缘政治风险(GPR)指数搜索词集(<b>news_searches</b>):详细说明参见对应目录内的README.txt文件。 16. 辅助材料:企业层面地缘政治风险(GPR)指数搜索词集(<b>firm_level_searches</b>):需使用Anaconda环境运行,详细说明参见对应目录内的README.txt文件。




