
This dataset was constructed by integrating multiple publicly available international databases to analyze the relationship between Moroccan foreign direct investment (FDI) and bilateral trade flows with African countries from 2007 to 2023.
🔹 Primary Data Sources Outward FDI (OFDI): OECD International Direct Investment Statistics (IDIS) – filtered for Moroccan outward investments to African countries. Trade Flows (Exports/Imports): World Bank’s World Integrated Trade Solution (WITS), based on UN COMTRADE data. GDP (Morocco and Partner Countries): World Development Indicators (World Bank). Geographic Distance: CEPII’s GeoDist database (distance between capital cities, in kilometers). Bilateral Investment Treaties (BIT): UNCTAD’s International Investment Agreements database – coded as binary (1 = treaty in force, 0 = no treaty). Common Language: CEPII’s Gravity dataset – coded as binary (1 = Arabic or French shared, 0 = otherwise). 🔹 Data Processing and Transformations Temporal Alignment: All variables were aggregated to annual frequency (2007–2023). Country Coverage: Limited to 48 African countries with consistent data availability. Unit Harmonization: Monetary values converted to constant 2015 million USD using World Bank deflators. Bilateral Pair Construction: Created Morocco–partner country dyads for each year. Missing Data Handling: Observations with missing key variables (OFDI, trade, GDP) were excluded. Remaining minor gaps were filled using linear interpolation (less than 2% of cells). Final Sample Size: 816 observations (48 countries × 17 years). This dataset is fully reproducible using the original sources and the transformation logic described above. A Python script detailing the merging and cleaning process is available upon request.