Jaerim Choi, Jiaying Gu, and Shu Shen, "Weak-instrument Robust Inference for Two-sample Instrumental Variables Regression", Journal of Applied Econometrics, Vol. 33, No. 1, 2018, pp. 109-125. The micro data used for the analysis were obtained from two sources -- Olivetti and Paserman (2015); Currie and Yellowitz (2000)) -- and can be downloaded from the following websites. https://www.aeaweb.org/articles?id=10.1257/aer.20130821 http://works.bepress.com/yelowitz/7/ All Tables and Figures (except Figure 5) of the paper were produced in R. Figure 5 is created using Stata version 14. The main R code, TSIV_function.R, carries out a) two-sample two-stage least squares, b) proposed two-sample Anderson-Rubin, c) proposed two-sample CLR, and d) proposed two-sample Kleibergen inference procedures. To replicate the Monte Carlo Simulations, please use the codes in the folder "simulations". The simulation tables will be saved to the subfolder "mktable" and the simulation figures will be saved to the subfolder "graph". To replicate the first empirical application, please use the codes in the folder "intergeneration". First, you have to download Olivetti and Paserman (2015)'s dataset available at https://www.aeaweb.org/articles?id=10.1257/aer.20130821. In their folder Olivetti_Paserman_AER/Olivetti_Paserman_Replication/final_data, you have to download original data in "fathers_collapsed" and "individual" and save those data in our folders. Then, you have to first run Table2_raw1.do, Table2_raw2.do, Table2_raw3.do, Table2_raw4.do, Table2_raw5.do, and Table2_raw6.do to convert raw data files of Olivetti and Paserman (2015) in the folder "intergeneration/raw_data" to cleaned csv format. To replicate the second empirical application, please use the codes in the folder "public". In this folder, you have to first run Table3_row.do and Table4_row.do to convert raw data files of Currie and Yellowitz (2000) in the folder "public/raw_data" to cleaned csv format. All data files are stored in ASCII (csv format). They are zipped in the file cgs-file.zip. Unix/Linux users should use "unzip -a". Please contact Shu Shen (shushen [AT] ucdavis.edu) if you have any questions regarding the codes. Tables: "simulations" Table1.R Creates Table 1: Properties of 95% Benchmark Confidence Sets "intergeneration" Table2.R Creates Table 2: Intergenerational Elasticities, 1870 - 1930 "public" Table3.R Creates Table 3: The Effects of Project Participation: Baseline Specification "public" Table4.R Creates Table 4: The Effects of Project Participation: Robustness Checks "simulations" TableA1.R Creates Table A.1: Coverage of 95% Robust Confidence Sets Figures: "simulations" Figure1.R Creates Figure 1: Size Comparison Figure2.R Creates Figure 2: Power Comparison (beta=0) Figure3.R Creates Figure 3: Power Comparison (beta=2) Figure4.R Creates Figure 4: Power Comparison Between AR and CLR FigureA1.R Creates Figure A.1: Size Comparison FigureA2.R Creates Figure A.2: Power Comparison (beta=0) FigureA3.R Creates Figure A.3: Power Comparison (beta=2) "intergeneration" Figure5.do, Figure5.csv Creates Figure 5: Father-Son-in-law Elasticities Data: intergeneration/raw_data fathers_collapsed folder Olivetti and Paserman (2015) raw data individual folder Olivetti and Paserman (2015) raw data public/raw_data reg1.csv Currie and Yellowitz (2000) raw data reg2.csv Currie and Yellowitz (2000) raw data