Skip to content

global-capital-allocation-project/exchange-rate-reconnect

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Replication code for Lilley, Maggiori, Neiman, Schreger: "Exchange Rate Reconnect"

==============

I. INTRODUCTION

This README describes the overall structure of the Replication packet for this paper. The code for our project is organized in two steps. First, we have a build file, which takes a number of publicly available price series and concordance files contained in data/raw and prepares them for analysis, saving the prepared version of this data in data/output. Second, we have an analysis file, where we take the output of these files and generate the tables and figures used in our paper. The uppermost directory of the replication folder therefore has the following seven objects:

i. README.md (the file you are reading right now)

ii. README.pdf (the file you are reading right now)

iii. code (a folder)

iv. data (a folder)

v. graphs (a folder for storing output figures)

vi. regs (a folder for storing output regression tables)

vii. instructions.txt (a guide to running the code)

II. INSTRUCTIONS

Step 1: Edit line 1 of code/Load_Globals.do so that the global variable user_dir points to your directory which contains this readme file

Step 2: Run code/Master.do. The master file will in turn

a) define the necessary globals 

b) run the build file [optional, takes 15 minutes to 1 hour, comment out this line to use the prebuilt output files]

c) run the analysis code to produce the figures and tables in the paper

III. PROPRIETARY DATA

Most results in the paper are replicable using solely public data, in which case the raw files can be found in the zip file on globalcapitalallocation.com. Tables and figures in the paper which contain references to "Morningstar" in the notes make use of proprietary data. The requirements for building this dataset are described in MNS_Data_Guide.pdf contained in the github repository global-capital-allocation-project/international-currencies-and-capital-allocation.

We provide the code, but not the data, which generates these results for the researcher's interest. The analysis code includes a check to see whether the necessary data files exist before executing each piece of analysis, in order to replicate as many results as possible without needing the full proprietary dataset.

IV. REFERENCES

Coppola, Antonio, Matteo Maggiori, Brent Neiman, and Jesse Schreger, “Redrawing the Map of Global Capital Flows: The Role of Cross-Border Financing and Tax Havens,” 2019.

Du, Wenxin, Joanne Im, and Jesse Schreger, “The U.S. Treasury Premium,” Journal of International Economics, 2018, 112, 167–181

He, Zhiguo., Bryan Kelly, and Asaf Manela, “Intermediary asset pricing: New evidence from many asset classes”. Journal of Financial Economics 2017, 126, 1–35.

Gilchrist, Simon and Egon Zakrajšek, “Credit spreads and business cycle fluctuations,” American Economic Review, 2012, 102 (4), 1692–1720.

Maggiori, Matteo, Brent Neiman, and Jesse Schreger, “International Currencies and Capital Allocation,” Forthcoming in Journal of Political Economy, 2019.

Miranda-Agrippino, Silvia, and Hélène Rey, “US Monetary Policy and the Global Financial Cycle,” NBER Working Papers (No. 21722). National Bureau of Economic Research

V. DATA DICTIONARY

allmerged.dta
Variable Description
iso_country_code Three letter alphanumeric ISO country code.
date_q Integer representing quarterly date in Stata format.
F_B_x_Om_i_ni Flow of Assets, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_B_x_Om_ni_i Flow of Assets, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_DB_x_Om_i_ni Flow of Assets, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_DB_x_Om_ni_i Flow of Assets, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_DE_x_Om_i_ni Flow of Assets, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_DE_x_Om_ni_i Flow of Assets, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_D_x_Om_i_ni Flow of Assets, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_D_x_Om_ni_i Flow of Assets, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_E_x_Om_i_ni Flow of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_E_x_Om_ni_i Flow of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_OL_x_Om_i_ni Flow of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_OL_x_Om_ni_i Flow of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_O_x_Om_i_ni Flow of Assets, Other Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_O_x_Om_ni_i Flow of Assets, Other Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
F_R_x_Om_i_ni Flow of Assets, Reserve Assets, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_T_x_Om_i_ni Flow of Assets, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
F_T_x_Om_ni_i Flow of Assets, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_B_x_Om_i_ni Stock of Assets, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_B_x_Om_ni_i Stock of Assets, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_DB_x_Om_i_ni Stock of Assets, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_DB_x_Om_ni_i Stock of Assets, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_DE_x_Om_i_ni Stock of Assets, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_DE_x_Om_ni_i Stock of Assets, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_D_x_Om_i_ni Stock of Assets, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_D_x_Om_ni_i Stock of Assets, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_E_x_Om_i_ni Stock of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_E_x_Om_ni_i Stock of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_OL_x_Om_i_ni Stock of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_OL_x_Om_ni_i Stock of Assets, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_O_x_Om_i_ni Stock of Assets, Other Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_O_x_Om_ni_i Stock of Assets, Other Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
Q_R_x_Om_i_ni Stock of Assets, Reserve Assets, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_T_x_Om_i_ni Stock of Assets, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
Q_T_x_Om_ni_i Stock of Assets, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_B_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_B_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, Debt Securities, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_DB_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_DB_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, Debt Instruments, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_DE_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_DE_x_Om_ni_ni Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_D_x_Om_ni_ni Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_D_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Direct Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_E_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the iso_country_code; data source is the IMF BoP
f_OL_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the iso_country_code; data source is the IMF BoP
f_OL_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, Equity and Investment Fund Shares, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the iso_country_code; data source is the IMF BoP
f_O_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Other Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_O_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Other Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_codec; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
f_R_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Reserve Assets, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_T_x_Om_i_ni Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes only the country which matches the field iso_country_code; Destination country includes all countries which do not match the field iso_country_code; data source is the IMF BoP
f_T_x_Om_ni_i Flow of Assets as Percentage of Stock in prior quarter, Portfolio Investment, US Dollars; Cross-border; All currencies; Source country includes all countries which do not match the field iso_country_code; Destination country includes only the country which matches the field iso_country_code; data source is the IMF BoP
depvar Three letter alphanumeric ISO currency code, encoded as a string
cid Three letter alphanumeric ISO currency code, encoded as an integer.
d_e_eq_wgt Quarterly log exchange rate change, equally weighted against other G10 currencies. Negative values are appreciations of the base currency
lcu_per_usd_SPOT_eop Exchange rate, number of units of foreign currency purchaseable with one US dollar.
e Log exchange rate bilaterally with the US dollar.
d_e Change in log exchange rate bilaterally with the US dollar
d_treasury_premium Change in treasury premium, taken from Du, Im and Schreger (2018)
d_gf Change in the "global factor" of world asset prices constructed by Miranda-Agrippino and Rey (2018)
d_ln_vxo Change in the log implied volatility on the S&P100 stock index
d_log_spx Log return of the S&P500 index.
d_gz_spread Change in the U.S. corporate bond spread taken from Gilchrist and Zakrajšek (2012)
int_value_weighted_inve Intermediary returns from a value-weighted portfolio of holding companies of New York Federal Reserve primary dealers taken from He, Kelly and Manela (2017)
i_diff Interest rate differential between the country listed in the field iso_country_code and the average of all G10 countries
pi_q_diff Inflation differential (quarterly) between the country listed in the field iso_country_code and the average of all G10 countries
pi_y_diff Inflation differential (annual) between the country listed in the field iso_country_code and the average of all G10 countries
dy_q_diff GDP growth differential (quarterly) between the country listed in the field iso_country_code and the average of all G10 countries
dy_y_diff GDP growth differential (annual) between the country listed in the field iso_country_code and the average of all G10 countries
dc_q_diff Consumption growth differential (quarterly) between the country listed in the field iso_country_code and the average of all G10 countries
dc_y_diff Consumption growth differential (annual) between the country listed in the field iso_country_code and the average of all G10 countries
y_gap_diff Output gap differential between the country listed in the field iso_country_code and the average of all G10 countries
monthlymerged.dta
Variable Description
date_m Integer representing monthly date in Stata format.
iso_currency_code Three letter alphanumeric ISO currency code.
d_log_s_eq_wgt Quarterly log exchange rate change, equally weighted against other G10 currencies. Negative values are appreciations of the base currency
d_gf Change in the "global factor" of world asset prices constructed by Miranda-Agrippino and Rey (2018)
d_log_spx Log return of the S&P500 index.
d_ln_vxo Change in the log implied volatility on the S&P100 stock index
d_gz_spread Change in the U.S. corporate bond spread taken from Gilchrist and Zakrajšek (2012)
d_ebp Intermediary returns from a value-weighted portfolio of holding companies of New York Federal Reserve primary dealers taken from He, Kelly and Manela (2017)
d_treasury_premium Change in treasury premium, taken from Du, Im and Schreger (2018)
global_q_regression_plus.dta
Variable Description
date_q Integer representing quarterly date in Stata format.
f_B_x_Om_i_ni Purchases of foreign bonds as percentage of market value in prior quarter, US Dollars; Cross-border; All currencies; Source country is the United States; All destination countries. Data source is IMF BoP
lmns_f_B_x_Om_i_ni Purchases of foreign bonds as percentage of market value in prior quarter, US Dollars; Cross-border; All currencies; Source country is the United States; All destination countries. Data source is US Mutual Fund universe, Morningstar
split_q_regresssion_plus.dta
Variable Description
date_q Integer representing quarterly date in Stata format
depvar Three letter alphanumeric ISO currency code
d_e Quarterly log exchange rate change of the base currency listed in depvar against the US dollar. Negative values correspond to appreciations of the base currency. Data from Morningstar
d_e_eq_wgt Quarterly log exchange rate change of the base currency equally weighted against other G10 currencies. Negative values correspond to appreciations of the base currency. Data from Morningstar
d_broad_dollar Quarterly log exchange rate change of the US dollar equally weighted against other G10 currencies. Negative values correspond to appreciations of the US dollar. Data from Morningstar
f_B_x_ni_ni_niUSA Cross-border purchases of bonds not issued by country in depvar, in all currencies other than depvar, by US mutual funds, as a percentage of market value of holdings in prior quarter. Data from Morningstar
f_B_x_Om_ni_iUSA Cross-border purchases of bonds issued by country in depvar, by US mutual funds in all currencies, as a percentage of market value of holdings in prior quarter. Data from Morningstar
f_BC_x_i_i_ni Cross-border purchases of foreign corporate bonds issued by country in depvar, in the currency of depvar, as a percentage of market value of holdings in prior quarter. Data from Morningstar
f_BC_x_ni_i_ni Cross-border purchases of foreign corporate bonds issued by country in depvar, in any currency not corresponding to depvar, as a percentage of market value of holdings in prior quarter. Data from Morningstar
f_BS_x_i_i_ni Cross-border purchases of sovereign bonds issued by country in depvar, in the currency of depvar, as a percentage of market value of holdings in prior quarter. Data from Morningstar
f_BS_x_ni_i_ni Cross-border purchases of foreign sovereign bonds issued by country in depvar, in any currency not corresponding to depvar, as a percentage of market value of holdings in prior quarter. Data from Morningstar
F_bet_B_Om_Om_Om_OmUSA Inflows into US mutual funds which hold bonds, weighted by the market values of all bond holdings in prior reporting quarter as a share of AUM. Data from Morningstar
F_B_w_i_i_iUSA Domestic purchases of bonds issued in the USA in US dollars. Data from Morningstar
F_B_w_ni_i_iUSA Domestic purchases of bonds issued in the USA in all currencies other than the US dollar. Data from Morningstar
F_BS_w_i_i_iUSA Domestic purchases of sovereign bonds issued in the USA in US dollars. Data from Morningstar
F_BC_w_i_i_iUSA Domestic purchases of corporate bonds issued in the USA in US dollars. Data from Morningstar
F_BC_w_ni_i_iUSA Domestic purchases of corporate bonds in the USA issued in all currencies other than the US dollar. Data from Morningstar
F_BO_w_i_i_iUSA Domestic purchases of other bonds in the USA issued in US dollars. Data from Morningstar
F_BO_w_ni_i_iUSA Domestic purchases of other bonds in the USA issued in all currencies other than the US dollar. Data from Morningstar
F_E_x_Om_i_niUSA Domestic purchases of equities of US companies. Data from Morningstar
global_q_regression_plus_qtile.dta
Variable Description
date_q Integer representing quarterly date in Stata format.
depvar Three letter alphanumeric ISO currency code, encoded as a string
d_broad_dollar Quarterly log exchange rate change for the US dollar, equally weighted against other G10 currencies, negative values are appreciations of the US dollar
qtile_type Characteristic by which the US mutual fund universe is split into quintiles
qtile_num Quintile rank of subset of mutual funds
f_* See corresponding definition in allmerged.dta. Flow measure defined by the subset of mutual funds in that quintile.

About

Replication code for "Exchange Rate Reconnect"

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages