Reproducible Research Repository
Reproducible Research Repository
  • Home
  • Repository
  • Collections
  • About
    Home / Repository / PRWP / RR_ASI_2025_505
PRWP

Reproducibility package for Foreign Demand Shocks And Domestic Value Added: Firm-Level Evidence From Viet Nam

2026
Get Reproducibility Package
Reference ID
RR_ASI_2025_505
Author(s)
Alessandro Barattieri, Anmol Agarwal, Aaditya Mattoo
Collections
World Bank Policy Research Working Papers
Metadata
JSON
Created on
Jan 13, 2026
Last modified
Jan 13, 2026
  • Project Description
  • Downloads
  • Overview
  • Reproducibility Package
  • Description
  • Scope and coverage
  • Disclaimer
  • Access and rights
  • Contacts
  • Information on metadata
  • Overview

    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’s 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.

    Reproducibility Package

    Scripts
    Readme Get Reproducibility Package
    Link: https://reproducibility.worldbank.org/index.php/catalog/440/download/1252/README.pdf
    Reproducibility package for Foreign Demand Shocks And Domestic Value Added: Firm-Level Evidence From Viet Nam
    File name
    RR_ASI_2025_505
    Zip package
    RR_ASI_2025_505.zip
    Title
    Reproducibility package for Foreign Demand Shocks And Domestic Value Added: Firm-Level Evidence From Viet Nam
    Date
    2026-01
    Dependencies
    Stata dependencies are listed in the ado folder.
    Instructions
    See README in reproducibility package.
    Notes
    Computational reproducibility verified by Development Impact (DECDI) Analytics team, World Bank.
    Source code repository
    Repository name URI
    Reproducible Research Repository (World Bank) https://reproducibility.worldbank.org
    Software
    Stata
    Name
    Stata
    Version
    18 MP

    Reproducibility

    Technology requirements

    Runtime: 3 hours

    Reproduction instructions

    To reproduce the findings in this study, please follow the steps below:

    1. Some datasets are restricted and require special permissions. Please refer to the README file for detailed instructions on data access.
    2. Run the following dofile in Stata:
      • 0_Master.do
    3. Outputs will be generated in the /Outputs and /Figures folders.
      Because 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.

    Data

    Datasets
    Classification by Broad Economic Categories (BEC)
    Name
    Classification by Broad Economic Categories (BEC)
    Note
    Source: United Nations Statistics Division
    Access policy
    Data is publicly available and included in the reproducibility package
    License
    CC BY 2.0
    License URL
    https://creativecommons.org/licenses/by/2.0/
    Data URL
    https://unstats.un.org/unsd/trade/classifications/bec.asp
    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
    UN Comtrade Database
    Name
    UN Comtrade Database
    Note
    Source: United Nations Statistics Division Users must go to the URL below, sign up and download the data following the instructions in the README.
    Access policy
    Data is publicly available but does not allow redistribution and it is not included in the reproducibility package.
    License URL
    https://comtradeplus.un.org/LicenseAgreement
    Data URL
    https://comtradeplus.un.org/
    Citation
    United Nations. (n.d.). UN Comtrade Database [Data set]. United Nations Department of Economic and Social Affairs, Statistics Division. https://comtradeplus.un.org/
    Underlying data from "The US–China trade war and phase one agreement"
    Name
    Underlying data from "The US–China trade war and phase one agreement"
    Note
    Source: The Peterson Institute for International Economics (PIIE) Users must go to the URL below and download the underlying data.
    Access policy
    Data is publicly available but does not allow redistribution and it is not included in the reproducibility package.
    License URL
    https://www.piie.com/terms-use
    Data URL
    https://www.piie.com/publications/working-papers/us-china-trade-war-and-phase-one-agreement
    Citation
    Bown, C. P. (2024). The US–China 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
    US Trade Census data
    Name
    US Trade Census data
    Note
    Source: United States Census Bureau Users must go to the URL below, sign up and download the data following the instructions in the README.
    Access policy
    Data access requires purchase or human approval and is not included in the reproducibility package.
    License URL
    https://www.census.gov/about/policies/privacy.html
    Data URL
    https://usatrade.census.gov/
    Trade in Value Added (TiVA) data
    Name
    Trade in Value Added (TiVA) data
    Note
    Source: OECD Data Explorer
    Access policy
    Data is publicly available and included in the reproducibility package
    License
    OECD Terms & Conditions
    License URL
    https://www.oecd.org/en/about/terms-conditions.html
    Data URL
    https://www.oecd.org/en/topics/sub-issues/trade-in-value-added.html
    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
    Replication data for From Final Goods to Inputs: The Protectionist Effect of Rules of Origin
    Name
    Replication data for From Final Goods to Inputs: The Protectionist Effect of Rules of Origin
    Note
    Source: openICPSR
    Access policy
    Data is publicly available and included in the reproducibility package
    License
    Creative Commons Attribution 4.0 International Public License
    License URL
    https://creativecommons.org/licenses/by/4.0/
    Data URL
    https://www.aeaweb.org/articles?id=10.1257/aer.20161151
    Citation
    Conconi, Paola, Manuel García-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–65. DOI: 10.1257/aer.20161151
    Viet Nam Enterprise Survey (VES)
    Name
    Viet Nam Enterprise Survey (VES)
    Note
    Source: General Statistical Office (GSO) in Hanoi, Vietnam Filename: 4analysis_2015_2021_April2024.dta Users may contact the General Statistical Office for data access. See the README for details.
    Access policy
    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].
    Viet Nam Customs Trade Data
    Name
    Viet Nam Customs Trade Data
    Note
    Source: General Statistical Office (GSO) in Hanoi, Vietnam Filename: firms_vnm_trade.dta Users may contact the General Statistical Office for data access. See the README for details.
    Access policy
    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].
    FDI Market Database
    Name
    FDI Market Database
    Note
    Source: FT Locations Data 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.
    Access policy
    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.
    Data URL
    https://www.ftlocations.com/contact/default/product/fdi-markets
    Citation
    FT Locations. "FDI Market Database [dataset]," https://www.ftlocations.com/contact/default/product/fdi-markets, 2022.
    Data statement

    Some data is restricted and has not been included in the reproducibility package. For more details, please refer to the README file.

    Description

    Output
    Foreign Demand Shocks And Domestic Value Added: Firm-Level Evidence From Viet Nam
    Type
    Working Paper
    Title
    Foreign Demand Shocks And Domestic Value Added: Firm-Level Evidence From Viet Nam
    Description
    Policy Research Working Papers (PRWP)
    Authors
    Author Affiliation Email
    Alessandro Barattieri World Bank abarattieri@worldbank.org
    Anmol Agarwal University of Virginia aa2bp@virginia.edu
    Aaditya Mattoo World Bank amatoo@worldbank.org
    Date of production

    2026-01-08

    Scope and coverage

    Geographic locations
    Location Code
    Asia ASI
    Keywords
    Domestic Value Added Trade Diversion Foreign Demand Shocks
    Topics
    ID Topic Parent topic ID Vocabulary Vocabulary URI
    F13 Trade Policy • International Trade Organizations F1 Journal of Economic Literature (JEL)
    F14 Empirical Studies of Trade F1 Journal of Economic Literature (JEL)
    F23 Multinational Firms • International Business F2 Journal of Economic Literature (JEL)
    F61 Microeconomic Impacts F6 Journal of Economic Literature (JEL)
    O19 International Linkages to Development • Role of International Organizations O1 Journal of Economic Literature (JEL)

    Disclaimer

    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.

    Access and rights

    License
    Name URI
    Modified BSD3 https://opensource.org/license/bsd-3-clause/

    Contacts

    Contacts
    Name Affiliation Email
    Alessandro Barattieri World Bank abarattieri@worldbank.org
    Reproducibility WBG World Bank reproducibility@worldbank.org

    Information on metadata

    Producers
    Name Abbreviation Affiliation Role
    Reproducibility WBG DECDI World Bank - Development Impact Department Verification and preparation of metadata
    Date of Production

    2026-01-08

    Document version

    1

    Back to Catalog
    The World Bank Working for a World Free of Poverty
    • IBRD IDA IFC MIGA ICSID

    © The World Bank Group, All Rights Reserved.