{"type":"script","doc_desc":{"producers":[{"name":"Reproducibility WBG","abbr":"DECDI","affiliation":"World Bank - Development Impact Department","role":"Verification and preparation of metadata"}],"prod_date":"2026-01-08","version":"1"},"project_desc":{"authoring_entity":[{"name":"Alessandro Barattieri","affiliation":"World Bank","email":"abarattieri@worldbank.org"},{"name":"Anmol Agarwal","affiliation":"University of Virginia","email":"aa2bp@virginia.edu"},{"name":"Aaditya Mattoo","affiliation":"World Bank","email":"amatoo@worldbank.org"}],"title_statement":{"title":"Reproducibility package for Foreign Demand Shocks And  Domestic Value Added: Firm-Level Evidence From Viet Nam","idno":"RR_ASI_2025_505"},"data_statement":"Some data is restricted and has not been included in the reproducibility package. For more details, please refer to the README file.","software":[{"name":"Stata","version":"18 MP"}],"scripts":[{"title":"Reproducibility package for Foreign Demand Shocks And  Domestic Value Added: Firm-Level Evidence From Viet Nam","date":"2026-01","notes":"Computational reproducibility verified by Development Impact (DECDI) Analytics team, World Bank.","instructions":"See README in reproducibility package.","file_name":"RR_ASI_2025_505","zip_package":"RR_ASI_2025_505.zip","dependencies":"Stata dependencies are listed in the ado folder."}],"repository_uri":[{"name":"Reproducible Research Repository (World Bank)","uri":"https:\/\/reproducibility.worldbank.org"}],"production_date":"2026-01-08","abstract":"Recent shifts in global trade patterns have received a lot of attention, but the implications of these shifts for domestic value added in exports (DVAR) have so far been overlooked. This paper documents substantial increases in Viet Nam\u2019s aggregate DVAR since 2018, reversing a long declining trend. Analysis using matched firm-level and customs data reveals that idiosyncratic US demand shocks had large positive effects on firm-level DVAR and output. Firms respond to the shocks by exporting more to both US and non-US markets, and their labor productivity increases, both that are consistent with the economies of scale. Firms also increase their use of domestic materials and reduce reliance on imported materials, suggesting sensitivity to implicit rules of origin. Finally, the paper highlights the role of firm ownership, with non-Chinese owned firms driving the increase in domestic value added.","geographic_units":[{"name":"Asia","code":"ASI"}],"keywords":[{"name":"Domestic Value Added"},{"name":"Trade Diversion"},{"name":"Foreign Demand Shocks"}],"topics":[{"id":"F13","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"Trade Policy \u2022 International Trade Organizations","parent_id":"F1"},{"id":" F14","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"Empirical Studies of Trade","parent_id":"F1"},{"id":" F23","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"Multinational Firms \u2022 International Business","parent_id":"F2"},{"id":" F61","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"Microeconomic Impacts","parent_id":"F6"},{"id":" O19","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"International Linkages to Development \u2022 Role of International Organizations","parent_id":"O1"}],"output":[{"type":"Working Paper","description":"Policy Research Working Papers (PRWP)","title":"Foreign Demand Shocks And  Domestic Value Added: Firm-Level Evidence From Viet Nam"}],"language":[{"name":"English","code":"EN"}],"disclaimer":"The materials in the reproducibility packages are distributed as they were prepared by the staff of the International Bank for Reconstruction and Development\/The World Bank. The findings, interpretations, and conclusions expressed in this event do not necessarily reflect the views of the World Bank, the Executive Directors of the World Bank, or the governments they represent. The World Bank does not guarantee the accuracy of the materials included in the reproducibility package.","license":[{"name":"Modified BSD3","uri":"https:\/\/opensource.org\/license\/bsd-3-clause\/"}],"contacts":[{"name":"Alessandro Barattieri","affiliation":"World Bank","email":"abarattieri@worldbank.org"},{"name":"Reproducibility WBG","affiliation":"World Bank","email":"reproducibility@worldbank.org"}],"datasets":[{"name":"Classification by Broad Economic Categories (BEC)","license":"CC BY 2.0","license_uri":"https:\/\/creativecommons.org\/licenses\/by\/2.0\/","uri":"https:\/\/unstats.un.org\/unsd\/trade\/classifications\/bec.asp","note":"Source: United Nations Statistics Division","access_type":"Data is publicly available and included in the reproducibility package","citation":"United Nations Statistics Division. (n.d.). Classification by Broad Economic Categories [Data set]. United Nations. https:\/\/unstats.un.org\/unsd\/trade\/classifications\/bec.asp"},{"citation":"United Nations. (n.d.). UN Comtrade Database [Data set]. United Nations Department of Economic and Social Affairs, Statistics Division. https:\/\/comtradeplus.un.org\/","name":"UN Comtrade Database","note":"Source: United Nations Statistics Division\nUsers must go to the URL below, sign up and download the data following the instructions in the README.","access_type":" Data is publicly available but does not allow redistribution and it is not included in the reproducibility package.","license_uri":"https:\/\/comtradeplus.un.org\/LicenseAgreement","uri":"https:\/\/comtradeplus.un.org\/"},{"access_type":" Data is publicly available but does not allow redistribution and it is not included in the reproducibility package.","uri":"https:\/\/www.piie.com\/publications\/working-papers\/us-china-trade-war-and-phase-one-agreement","license_uri":"https:\/\/www.piie.com\/terms-use","note":"Source: The Peterson Institute for International Economics (PIIE)\nUsers must go to the URL below and download the underlying data. ","name":"Underlying data from \"The US\u2013China trade war and phase one agreement\"","citation":"Bown, C. P. (2024). The US\u2013China trade war and phase one agreement [Data set]. Peterson Institute for International Economics. https:\/\/www.piie.com\/publications\/working-papers\/us-china-trade-war-and-phase-one-agreement"},{"uri":"https:\/\/usatrade.census.gov\/","access_type":"Data access requires purchase or human approval and is not included in the reproducibility package.","name":"US Trade Census data","note":"Source: United States Census Bureau\nUsers must go to the URL below, sign up and download the data following the instructions in the README.","license_uri":"https:\/\/www.census.gov\/about\/policies\/privacy.html"},{"uri":"https:\/\/www.oecd.org\/en\/topics\/sub-issues\/trade-in-value-added.html","license_uri":"https:\/\/www.oecd.org\/en\/about\/terms-conditions.html","license":"OECD Terms & Conditions","access_type":"Data is publicly available and included in the reproducibility package","note":"Source: OECD Data Explorer","name":"Trade in Value Added (TiVA) data","citation":"OECD. (n.d.). Trade in Value-Added (TiVA) Database [Data set]. Organisation for Economic Co-operation and Development. https:\/\/www.oecd.org\/en\/topics\/sub-issues\/trade-in-value-added.html"},{"name":"Replication data for From Final Goods to Inputs: The Protectionist Effect of Rules of Origin","note":"Source: openICPSR ","citation":"Conconi, Paola, Manuel Garc\u00eda-Santana, Laura Puccio, and Roberto Venturini. 2018. \"From Final Goods to Inputs: The Protectionist Effect of Rules of Origin.\" American Economic Review 108 (8): 2335\u201365.\nDOI: 10.1257\/aer.20161151","license":"Creative Commons Attribution 4.0 International Public License","license_uri":"https:\/\/creativecommons.org\/licenses\/by\/4.0\/","uri":"https:\/\/www.aeaweb.org\/articles?id=10.1257\/aer.20161151","access_type":"Data is publicly available and included in the reproducibility package"},{"name":"Viet Nam Enterprise Survey (VES) ","note":"Source: General Statistical Office (GSO) in Hanoi, Vietnam\nFilename: 4analysis_2015_2021_April2024.dta\nUsers may contact the General Statistical Office for data access. See the README for details.","access_type":"Data access was granted directly to the study authors by the data managers. It was obtained with a custom data license that does not allow for redistribution and it is not included in the reproducibility package.","citation":"Vietnam General Statistical Office. (2025). Viet Nam Enterprise Survey (VES) [dataset]."},{"note":"Source: General Statistical Office (GSO) in Hanoi, Vietnam\nFilename: firms_vnm_trade.dta\nUsers may contact the General Statistical Office for data access. See the README for details.","name":"Viet Nam Customs Trade Data","access_type":"Data access was granted directly to the study authors by the data managers. It was obtained with a custom data license that does not allow for redistribution and it is not included in the reproducibility package.","citation":"Vietnam General Statistical Office. (2025). Viet Nam Customs Trade Data [dataset]."},{"note":"Source: FT Locations\nData were obtained by the authors from fDi Markets (Financial Times) under a commercial license that does not allow republication. Users may contact the authors for access details. See the README for details.","uri":"https:\/\/www.ftlocations.com\/contact\/default\/product\/fdi-markets","access_type":"Data access was granted directly to the study authors by the data managers. It was obtained with a custom data license that does not allow for redistribution and it is not included in the reproducibility package.","name":"FDI Market Database","citation":"FT Locations. \"FDI Market Database [dataset],\" https:\/\/www.ftlocations.com\/contact\/default\/product\/fdi-markets, 2022."}],"reproduction_instructions":"To reproduce the findings in this study, please follow the steps below:\n1. Some datasets are restricted and require special permissions. Please refer to the `README` file for detailed instructions on data access.\n2. Run the following dofile in Stata:\n   - `0_Master.do`\n4. Outputs will be generated in the `\/Outputs` and `\/Figures` folders.\nBecause the restricted datasets are not included in the package, the `\/Outputs` and `\/Figures` folders contains outputs produced by the replicators. These files can be used to review and verify the results presented in the paper.","technology_requirements":"Runtime: 3 hours"},"tags":[{"tag":"DOI"},{"tag":"Open Code"},{"tag":"Restricted Data"}],"schematype":"script"}