Replication Code: The Effects of the 2021 UK Graduate Visa on International Student Visa Grants and Course Selection

Published: 2 March 2026| Version 1 | DOI: 10.17632/xcy47pvy7j.1
Contributor:
Sean Brophy

Description

Instructions This folder contains all files required to replicate "The Effects of the 2021 UK Graduate Visa on International Student Visa Grants and Course Selection." The replication package is organised into two parts: (A) dataset construction from raw sources, and (B) analysis replication from the pre-built dataset. Researchers who wish to replicate the analysis only should proceed directly to Part B. Researchers who wish to reconstruct the dataset from raw sources should begin with Part A. Software Requirements Stata 17 or later (earlier versions may work but have not been tested). The following user-written packages are required: reghdfe, ftools, outreg2, honestdid. Install using: ssc install reghdfe; ssc install ftools; ssc install outreg2; net install honestdid, from("https://raw.githubusercontent.com/mcaceresb/stata-honestdid/main/"). Approximate runtime for the full analysis do-file is 30 minutes on a standard desktop computer. Folder Structure code/construction/ Do-files for constructing the dataset from raw sources (Part A). code/analysis/ Main replication do-file for estimating all models (Part B). data/raw/ Raw source data files downloaded from public repositories (Part A). Empty in the distributed package; researchers must download raw files themselves. data/clean/ Pre-built replication dataset ready for analysis (Part B). output/ Directory where tables (.txt, .doc) and figures (.png, .gph) are saved. Data Availability Statement All underlying data sources are publicly available. UK Home Office Immigration Statistics are published quarterly at gov.uk. World Bank World Development Indicators are available through the World Bank DataBank. The Oxford COVID-19 Government Response Tracker is archived on GitHub. Bank of England statistical series are available through the Bank’s Statistical Interactive Database. Individual-level visa application data are not accessible to academic researchers under UK government statistical disclosure policies.

Files

Steps to reproduce

Part A: Dataset Construction from Raw Sources (Optional) Run the do-files in code/construction/ in the order indicated by their numerical prefix. Before running, set the global macro "rawdir" at the top of each file to point to the data/raw/ directory. Country name harmonisation across datasets is handled within each do-file. 01_visa_import.do: Imports and appends all five visa category Excel files (education, occupation, extensions, settlement, citizenship). Harmonises country names to World Bank conventions. Creates comprehensive_visa_master.dta. 02_world_bank_merge.do: Imports GDP per capita and unemployment rate from WBstats.xlsx. Merges with visa data. Creates comprehensive_visa_with_wb.dta and the HWI treatment classification (GDP per capita < $10,000 or unemployment > 7%). 03_covid_import.do: Imports Oxford COVID-19 Government Response Tracker. Collapses daily data to quarterly frequency. Creates covid_quarterly_processed.dta. 04_covid_merge.do: Merges quarterly COVID data with visa dataset. Creates comprehensive_visa_with_wb_covid.dta. 05_inflation_merge.do: Imports inflation data from CSV and merges. Updates comprehensive_visa_with_wb_covid.dta. 06_diagnostics.do: Runs diagnostic checks on the merged dataset. Creates FINAL DATASET.dta. 07_exchange_rate_merge.do: Imports Bank of England Sterling ERI and merges with final dataset. Creates all analysis variables (treatment interactions, alternative thresholds, timing indicators, event study variables, course-level indicators). Saves the analysis-ready Graduatevisa_final.dta. Part B: Analysis Replication Open code/analysis/Graduatevisa_replication.do. Set the global macro "datadir" at the top of the file to the path of the data/clean/ folder. Run the entire file. All tables and figures will be saved to the output directory specified by the "outdir" global. Output Mapping The replication do-file is organised into six sequential parts: Part 1: Setup and baseline means. Country classification table (Table A2). Part 2: Main regression models. Visa category DDD (Table 2) and course-level DDD (Table 4), with corresponding levels specifications (Tables A3, A4). Part 3: Robustness and sensitivity tests. Alternative thresholds, sample restrictions, temporal sensitivity (Table 3, Panels A and B). Part 4: Continuous treatment interactions (Table 3, Columns 1–2). Part 5: Event study regressions and HonestDiD sensitivity analysis (Appendix Tables A5, A6; Appendix Figures A1, A2). Part 6: All figures. Trend plots (Figure 1), differential plots (Figure 2), event study plots (Figure 3).

Categories

Labor Economics

Licence