{"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-07-01","version":"1"},"project_desc":{"authoring_entity":[{"name":"Jean-Christophe Maur","affiliation":"World Bank","email":"jmaur@worldbank.org"},{"name":"Lionel Fontagne","affiliation":"Paris School of Economics","email":"lionel.fontagne@psemail.eu"},{"name":"Anthonin Levelu","affiliation":"Joint Research Center (European Commission)","email":"anthonin.levelu@ec.europa.eu"},{"name":"Nadia Rocha","affiliation":"Inter American Development Bank","email":"nadiaro@iadb.org"},{"name":"Gianluca Santoni","affiliation":"Paris School of Economics","email":"gianluca.santoni@psemail.eu"}],"title_statement":{"title":"Reproducibility package for Beneath the Surface: Deep Trade Agreements and the Potential of a Deeper AfCFTA","idno":"RR_AFR_2026_640"},"data_statement":"All data sources are publicly available, but not all are included in the reproducibility package.","software":[{"name":"R","version":"4.6.0"},{"name":"Stata","version":"19 MP"},{"name":"Python","version":"3.14.6"}],"scripts":[{"title":"Reproducibility package for Beneath the Surface: Deep Trade Agreements and the Potential of a Deeper AfCFTA","date":"2026-07","notes":"Computational reproducibility verified by Development Impact (DECDI) Analytics team, World Bank.","instructions":"See README in reproducibility package.","file_name":"RR_AFR_2026_640","zip_package":"RR_AFR_2026_640.zip","dependencies":"R dependencies are listed in the file renv.lock. Stata dependencies are listed in the ado folder."}],"repository_uri":[{"name":"Reproducible Research Repository (World Bank)","uri":"https:\/\/reproducibility.worldbank.org"}],"production_date":"2026-07-01","abstract":"This paper examines what makes some trade agreements more effective at promoting trade than others, and applies this question to the case of the African continent. To address it, we use a clustering algorithm to classify worldwide trade agreements into three categories and estimate their trade effects within a structural gravity framework. This allows us to rank PTA clusters according to their estimated trade effects as Shallow, Medium, and Deep.\nWe then use feature-attribution methods and counterfactual policy combinations to identify the provisions and policy configurations most strongly associated with Deep classification, and apply this approach to the African Continental Free Trade Agreement (AfCFTA). Although the AfCFTA, which entered into force in 2019, is intended to harmonize existing regional agreements into a single continent-wide framework, it is classified as Medium in our baseline. Our general-equilibrium counterfactual analysis shows that, if implemented as a Deep agreement, the AfCFTA would generate substantial additional trade gains, along with an average GDP gain of 0.7% for the African economies in our sample. The classification analysis further indicates that tighter disciplines on trade-defense instruments, stronger legal enforceability, and visa-related provisions are among the policy dimensions most closely associated with Deep agreements.","geographic_units":[{"name":"Africa","code":"AFR"}],"keywords":[{"name":"African Integration"},{"name":"Deep Ptas"}],"topics":[{"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":" F15","uri":"https:\/\/www.aeaweb.org\/econlit\/jelCodes.php?view=jel","vocabulary":"Journal of Economic Literature (JEL)","name":"Economic Integration","parent_id":"F1"}],"output":[{"type":"Working Paper","description":"Policy Research Working Papers (PRWP)","title":"Beneath the Surface: Deep Trade Agreements and the Potential of a Deeper AfCFTA"}],"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":"MIT License","uri":"https:\/\/opensource.org\/license\/mit"},{"name":"World Bank IGO Rider","uri":"https:\/\/github.com\/worldbank\/metadata-editor\/blob\/main\/WB-IGO-RIDER.md"}],"contacts":[{"name":"Jean-Christophe Maur","affiliation":"World Bank","email":"jmaur@worldbank.org"},{"name":"Reproducibility WBG","affiliation":"World Bank","email":"reproducibility@worldbank.org"}],"datasets":[{"name":"Classifications on Economic Statistics","note":"Source: United Nations Statistics Division (UNSD). HS classification concordance between millesimes.\nFile location: \"data\/class\".\nFile names: HS 2012 to HS 2002 Correlation and conversion tables.xls; HS2012-17-BEC5_08_Nov_2018.xlsx.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/unstats.un.org\/unsd\/classifications\/Econ","citation":"UNSD. (2023). Classifications on Economic Statistics [dataset]. United Nations Statistics Division. https:\/\/unstats.un.org\/unsd\/classifications\/Econ. ","license":"Direct Access"},{"name":"UN Comtrade: United Nations Commodity Trade Statistics Database ","note":"Source: United Nations Statistics Division.\nFile location: \"data\/COMTRADE\".\nFile names: country_cnum_iso3_TP2024.dta; sitc_export_2digit_isic_group.zip; sitc_export_2digit_isic_iso.zip; sitc_import_2digit_isic_group.zip; sitc_import_2digit_isic_iso.zip.\nAs data are not included in the package, a variable list is provided in the reproducibility package for users who want to replicate the analysis. In addition, the metadata used to download the file is included in the folder COMTRADE. ","access_type":"Data is publicly available, but does not allow redistribution and is not included in the reproducibility package. ","uri":"https:\/\/comtrade.un.org\/","citation":"United Nations Statistics Division. (n.d.). UN Comtrade: United Nations Commodity Trade Statistics Database [dataset]. https:\/\/comtrade.un.org\/. Accessed on [add month\/year].","license_uri":"https:\/\/comtradeplus.un.org\/LicenseAgreement","license":"UN COMTRADE LICENSE AGREEMENT"},{"name":"Country Identifiers Data","note":"Source: Compiled by the authors from World Bank and FAO country identifier data.\nFile location: \"data\/CTY\".\nFile names: TP_FAO_cty.dta; TP_FAO_cty_year.dta; WBdata_gdp.dta; WBregio.dta; WBregio_toolkit.dta; codes_iso_cnum.dta; continent.dta; country_codes_comtrade.csv; income_class_2018.dta; temp_cty_name.dta.","access_type":"Data is included in the reproducibility package.","license":"Custom license","citation":"Authors' compilation. 2026. Country Identifiers Data [dataset]. Based on the World Bank and FAO."},{"name":"World Bank Deep Trade Agreements Database","note":"Source: World Bank. Includes vertical and horizontal versions of the Deep Trade Agreement (DTA) database.\nFile location: \"data\/DTA\".\nFile names: 01. DTA Information.do; DTA 1.0 - Horizontal Content (v2).xlsx; DTA 2.0 - Vertical Content (v2).xlsx; PTA_Policy_Areas.dta; classification of provisions (v2).xlsx; uk_agree_to_be_fixed.dta; year_series.dta.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/datatopics.worldbank.org\/dta\/table.html","citation":"Mattoo, A., N. Rocha, and M. Ruta. (2020). World Bank Deep Trade Agreements Database [dataset]. World Bank. https:\/\/datatopics.worldbank.org\/dta\/table.html","license_uri":"https:\/\/www.worldbank.org\/en\/about\/legal\/terms-of-use-for-datasets","license":"Creative Commons Attribution 4.0 International License (CC BY 4.0)"},{"name":"FAO Food and Agricultural Trade Dataset","note":"Source: Food and Agriculture Organization of the United Nations (FAO). Agriculture trade data.\nFile location: \"data\/FAO\".\nFile names: Concordance_H3_to_I3.zip; JobID-48_Concordance_H3_to_I3.CSV; [Content_Types].xml; prod\/2024\/FAOSTAT_data_3-26-2024_country.csv; prod\/2024\/FAOSTAT_data_3-26-2024_item.csv; prod\/2024\/FAOSTAT_data_3-26-2024_item_group.csv; prod\/2024\/Value_of_Production_E_All_Data.zip; trade\/2024\/FAOSTAT_data_3-26-2024_element.csv; trade\/2024\/FAOSTAT_data_3-26-2024_item.csv; trade\/2024\/FAOSTAT_data_3-26-2024_partner.csv; trade\/2024\/FAOSTAT_data_3-26-2024_reporter.csv; trade\/2024\/Trade_DetailedTradeMatrix_E_All_Data.zip.\nDirect download: https:\/\/bulks-faostat.fao.org\/production\/Trade_DetailedTradeMatrix_E_All_Data.zip","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/www.fao.org\/faostat\/en\/#data\/TCL","citation":"Food and Agriculture Organization of the United Nations. (2025). Food and Agricultural Trade Dataset [dataset]. FAO. https:\/\/www.fao.org\/faostat\/en\/#data\/TCL. ","license_uri":"https:\/\/www.fao.org\/contact-us\/terms\/db-terms-of-use\/en\/","license":"FAO Statistical Database Terms of Use"},{"name":"The CEPII Gravity Database","note":"Includes the gravity variables (GRAVITY folder) and the shared-language variable (LANG folder) used in the analysis.\nFile location: \"data\/GRAVITY\": Gravity_V202211.zip; gravity.zip; gravity_toolkit.dta.\nFile location: \"data\/LANG\": dicl_database.csv; language_FT.dta.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/www.cepii.fr\/cepii\/en\/bdd_modele\/bdd_modele_item.asp?id=8","citation":"Conte, M., P. Cotterlaz, and T. Mayer. (2022). The CEPII Gravity Database [dataset]. CEPII Working Papers 2022-05. https:\/\/www.cepii.fr\/cepii\/en\/bdd_modele\/bdd_modele_item.asp?id=8. ","license":"Etalab Open License 2.0","license_uri":"https:\/\/www.etalab.gouv.fr\/licence-ouverte-open-licence\/"},{"name":"World Development Indicators","note":"File location: \"data\/OTHERS\".\nFile names: Cluster_list_2024.xlsx; country_classification.xlsx; id_agree_bilat_all.dta.","access_type":"Data is publicly available and included in the reproducibility package.","license":"Creative Commons Attribution 4.0 International License (CC BY 4.0)","uri":"https:\/\/datatopics.worldbank.org\/world-development-indicators\/the-world-by-income-and-region.html","citation":"World Bank. 2026. World Development Indicators [dataset]. https:\/\/datatopics.worldbank.org\/world-development-indicators\/the-world-by-income-and-region.html.","license_uri":"https:\/\/www.worldbank.org\/en\/about\/legal\/terms-of-use-for-datasets"},{"name":"SPMAP: Stata World Maps","note":"Source: Stata files (spmap package) used to create world maps.\nAccess date: [add access month\/year].\nFile location: \"data\/STATAMAP\".\nFile names: coord_mercator_world.dta; idfile.dta.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/www.stathelp.se\/en\/spmap_world_en.html","citation":"Pisati, M. (2007). SPMAP: Stata World Maps [dataset]. https:\/\/www.stathelp.se\/en\/spmap_world_en.html.","license":"Direct Access"},{"name":"CEPII Trade and Production Database","note":"File location: \"data\/TARIFFS\": tariffs_from_tradeprod.dta.\nFile location: \"data\/TradeProd_CEPII\": TPe_V202201.dta; TPe_V202401.dta. These files are not included in the package due to size restrictions. Go to the link below, download the TPe_V202401.zip in the Stata folder, unzip it, and place it in the appropriate folder. In the archives, go to TPe_V202201.zip, download, and unzip it in the correct location. \nFile location: \"data\" (package root): TradeProd_Data_Toolkit_2024.dta.","access_type":"Data is publicly available, but due to size restrictions, some files are not included in the reproducibility package.","uri":"https:\/\/www.cepii.fr\/cepii\/en\/bdd_modele\/bdd_modele_item.asp?id=5","citation":"Mayer, T., G. Santoni, and V. Vicard. (2023). The CEPII Trade and Production Database [dataset]. CEPII. https:\/\/www.cepii.fr\/cepii\/en\/bdd_modele\/bdd_modele_item.asp?id=5. ","license_uri":"https:\/\/www.etalab.gouv.fr\/wp-content\/uploads\/2018\/11\/open-licence.pdf","license":"Etalab Open License 2.0"},{"name":"UNIDO Annual Manufacturing Trade Database","note":"Source: United Nations Industrial Development Organization (UNIDO). Manufacturing trade data.\nFile location: \"data\/UNIDO\/2024\".\nFile names: 0057D63F58238AC9765821DB5D46C067976B.zip; indstat2024.dta.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/stat.unido.org\/data\/table?dataset=mtd#data-browser","citation":"UNIDO. (2025). Annual Manufacturing Trade Database [dataset]. https:\/\/stat.unido.org\/data\/table?dataset=mtd#data-browser. ","license_uri":"https:\/\/stat.unido.org\/terms-and-conditions","license":"Creative Commons Attribution 4.0 International License"},{"name":"OECD International Transport and Insurance Costs of Merchandise Trade (ITIC)","note":"Source: Organisation for Economic Co-operation and Development (OECD). Transport cost data.\nFile location: \"data\/trade_costs\".\nFile names: OECD_transport_costs.zip.","access_type":"Data is publicly available and included in the reproducibility package.","uri":"https:\/\/www.oecd.org\/en\/data\/datasets\/international-transport-and-insurance-costs-of-merchandise-trade-itic.html","citation":"Organisation for Economic Co-operation and Development. (2024). International Transport and Insurance Costs of Merchandise Trade (ITIC) [dataset]. OECD Data. https:\/\/www.oecd.org\/en\/data\/datasets\/international-transport-and-insurance-costs-of-merchandise-trade-itic.html. ","license_uri":"https:\/\/www.oecd.org\/en\/about\/terms-conditions.html","license":"OECD Terms & Conditions"},{"name":"Product Concordance","note":"File location: 1.data\/FAO\/Concordance_H3_to_I3.zip; JobID-48_Concordance_H3_to_I3.csv. ","access_type":"Data is publicly available and included in the reproducibility package","citation":"World Integrated Trade Solution. 2024. \"Product Concordance\" [dataset]. https:\/\/wits.worldbank.org\/product_concordance.html. Access date: December 2024.","uri":"https:\/\/wits.worldbank.org\/product_concordance.html","license_uri":"https:\/\/www.worldbank.org\/ext\/en\/legal\/terms-conditions","license":"Creative Commons Attribution 4.0 International License (CC BY 4.0)"},{"name":"Cluster List and Bilateral Identifiers of Trade Agreements","access_type":"Data is included in the reproducibility package","note":"File location: 1.data\/OTHERS\/Cluster_list_2024, id_agree_bilat_all.","citation":"Authors' compilation. 2024. Cluster List and Bilateral Identifiers of Trade Agreements [dataset]. Based on the predicted clustering of trade agreements and on the World Bank's Deep Trade Agreements Database."}],"reproduction_instructions":"To reproduce the findings of this study, a new user should: \n1. Get access to the data not included in this reproducibility package. See data section. \n2. Adjust the root directory path in `FLMRS_replication.py`.\n3. Set the stata_path and r_path variables in `FLMRS_replication.py`.\n4. Run `FLMRS_replication.py`.","technology_environment":"Paper exhibits were reproduced on two computers with the following specifications:\n\u2022 OS: macOS\n\u2022 Processor: Apple M4 Pro.\n\u2022 Memory available: 24 GB\n\u2022 Software version: Stata 19 MP, R 4.6.0, Python 3.14.6\n","technology_requirements":"Run-time: 9 hours."},"datacite":{"creators":[{"givenName":"Jean-Christophe","familyName":"Maur","nameType":"Personal","affiliation":[{"name":"World Bank","affiliationIdentifier":"https:\/\/ror.org\/00ae7jd04","affiliationIdentifierScheme":"ROR","schemeUri":"https:\/\/ror.org"}]},{"givenName":"Lionel","familyName":"Fontagne","nameType":"Personal","affiliation":[{"name":"Paris School of Economics","affiliationIdentifierScheme":"ROR","schemeUri":"https:\/\/ror.org"}]},{"givenName":"Anthonin","familyName":"Levelu","nameType":"Personal","affiliation":[{"name":"Joint Research Center (European Commission)","affiliationIdentifierScheme":"ROR","schemeUri":"https:\/\/ror.org"}]},{"givenName":"Nadia","familyName":"Rocha","nameType":"Personal","affiliation":[{"name":"Inter American Development Bank","affiliationIdentifierScheme":"ROR","schemeUri":"https:\/\/ror.org"}]},{"givenName":"Gianluca","familyName":"Santoni","nameType":"Personal","affiliation":[{"name":"Paris School of Economics","affiliationIdentifierScheme":"ROR","schemeUri":"https:\/\/ror.org"}]}],"titles":[{"lang":"en","title":"Reproducibility package for Unpacking Depth: Deep Trade Agreements And The Potential Of A Deeper Afcfta"},{"title":"RR_AFR_2026_640","titleType":"Other"}],"publisher":"World Bank","publicationYear":"2026","types":{"resourceType":"Reproducibility package","resourceTypeGeneral":"Other"},"url":"https:\/\/reproducibility.worldbank.org\/index.php\/catalog\/study\/RR_AFR_2026_640","language":"en"},"tags":[{"tag":"DOI"},{"tag":"Open Code"},{"tag":"Open Data"}],"schematype":"script"}