Do terms of trade improve export sophistication in Africa? New empirical evidence and transmission channel

Can gains from international trade allow for a modernization of the export structure in Africa? Answering this question is the main objective of this study. In other words, it is to analyze the impact of terms of trade on export sophistication. The study covers a sample of 46 African countries over the period 2002-2014. Ordinary Least Squares and System GMM estimates show that terms of trade positively affect export sophistication. The result remains robust to the inclusion of additional variables, to the use of economic complexity index as an alternative index of sophistication. Moreover, our results show that the effect differs according to the countries' production structure. Indeed, the export of oil products has no effect on sophistication while the export of goods has a weak effect on the export upgrading. In addition, exports of manufactured goods have a positive and very significant effect on export sophistication. Our analyses allow us to identify two main channels through which terms of trade are likely to influence export sophistication: the channel of productive investment and the channel of exchange rate devaluation.


Introduction
The economic development literature of the 1970s long considered development and growth as a process of structural transformation of the productive structure, whereby resources were shifted from low-productivity activities to higher-productivity activities (Chenery and Taylor, 1968;Ocampo and Ros, 2011). Prebisch-Singer's thesis focuses on the difference in income elasticity of demand between raw materials and manufactured goods 2 . Hirschman's model of unbalanced growth and Kaldor's growth laws underline the particular properties of manufacturing industry. Recent literature has revived these ideas and placed structural transformation at the forefront of understanding economic growth and explains economic development as a learning process of producing and exporting more complex products 3 Hausmann, et al. 2007;Hidalgo and Hausmann, 2009;Spatafora, et al. 2012;Lectard and Rougier 2018;Saadi 2020;Fang et al. 2015 Zhu andFu 2013).
Increasing the productivity of exports is an issue of great importance for developing countries.
However, according to Hausmann et al (2007), it is not the quantity but "what you export that matters". Developing countries face more difficulties in improving their export basket (Harding and Javorcik, 2011). Therefore, it becomes very important to understand the factors that determine the sophistication 4 of a country's exports. Since the seminal work of Hausmann et al. (2007) on export sophistication, many studies have examined the determinants of countries' export sophistication 5 , showing the positive effects of income level, human capital, productive investment and foreign direct investment (Cabral and Veiga, 2010;Weldemicael, 2012;Spatafora et al. 2012;Zhu and Fu, 2013;Saadi 2020). However, work on the determinants of 2 Prebisch (1950) and Singer (1950) insist more on the risk of specialization in raw materials. 3 If a country's exports include a larger share of products that are technologically and productively more sophisticated or have higher value added, then that country is considered to have greater export sophistication. For example, the export of chips is considered economically different from the export of microchips. Thus, improving the export basket by increasing its sophistication has been considered a central issue by many governments and international agencies (Harding and Javorcik, 2011;Zhu and Fu, 2013). 4 Understood as the export of new products and better quality varieties of existing or new products (Lectard and Rougier 2018). 5 The analysis of export sophistication is a good indicator of the productive apparatus insofar as exports correspond to the part of the productive system subject to international competition. In other words, exports, by reflecting comparative advantages, demonstrate a country's capacity to add value to its productive system on international markets (Jouini 2016). export sophistication is still insufficient, particularly for developing countries, and needs to be improved (Zhu and Fu, 2013).
Export sophistication is considered the most relevant marker of the productive transformation of economies (Hausmann et al. 2007). According to Lectard and Rougier (2018), sophistication and diversification signal the emergence of new, more capital-intensive industries that are competitive enough to become exporters. More recent work provides evidence that they also bring a substantial advantage to developing countries in terms of production stability (Koren and Tenreyro, 2007;Camhano and Romeu, 2011) and democracy (Cuberes and Jerzmanowski, 2009;Kolstad and Wiig, 2014). Hidalgo and Hausmann (2009) argue that a country's development path is determined by its ability to the capacities needed to produce a variety of goods, in particular, more sophisticated goods. In Hidalgo and Hausmann's capability theory, economic development is not only a process of continuous improvement in the production of the same set of goods, but a process that requires the acquisition of more complex sets of capabilities to move towards new activities associated with higher levels of productivity. In other words, capabilities reflect (i) the totality of human and physical capital, the legal system, institutions, etc. that are necessary to produce a product; (ii) at the firm level, it is the "know-how" or work practices collectively held by the group of individuals making up the firm; and (iii) organizational capabilities that provide the capacity to train, manage, and operate activities involving large numbers of people (Felipe et al. 2012). Recent literature argues that sophistication is a good measure of a country's innovation performance. An increase in sophistication implies an improvement in productive capacity through the acquisition of new productive capabilities (Sweet and Maggio 2015).
Moreover, when we look at regions, we see that Africa is the area with the lowest level of sophistication. Figure A1 in the appendix shows the variation in economic sophistication from one country to another over the period 2000-2010. As we can see, Asian and European countries are the most sophisticated countries, while Africa is the region with the lowest level of sophistication, whose countries with the lowest index are Nigeria and Sudan. It also seems that the low level of sophistication of African countries is a brake on economic growth. Indeed, these countries seem to suffer from a double handicap concerning their productive and export structure: insufficient diversification coupled with too little sophistication (Jouini et al. 2016).
If export sophistication determines the growth and development model of countries, an interesting question arises: "What determines sophistication?
In addition to the work on sophistication, there is a parallel literature that argues that the terms of trade are a fundamental determinant of long-term economic performance. Misra and Hazell (1996) find that terms of trade have shown a positive tendency to increase production, which has contributed to reducing rural poverty. However, they also find that although the favourable terms of trade have facilitated the growth process by increasing private investment, they have had a negative effect on the rural poor by increasing the relative prices of the commodities they consume. Following them, Fry (1986) shows that the terms of trade increase productive investment in developing countries. Bleaney and Greenaway (2001) also argue that the terms of trade improve income and investment in SSA. Kemp (1966) shows that trade restrictions change the terms of trade and the relative profitability of investment at home and abroad.
The two lines of research outlined above offer two different perspectives on the determinants of comparative prosperity across countries. For this reason, they have generally been examined separately as competing alternatives. This paper goes beyond the current literature by bringing them together. In particular, it is the first study that empirically examines the effect of the terms of trade on export sophistication. The hypothesis underlying this study is that the positive effect of the terms of trade on export sophistication comes through its effects on productive investment and the exchange rate. In order to empirically test the effect of the terms of trade on sophistication, this study covers a sample of 46 countries over the period 2002-2014. Ordinary least squares and generalized method of moments estimates confirm our hypotheses. The results are robust to various sensitivity tests. This study is closely related to that of Lectard and Rougier (2018), which examines whether challenging comparative advantage has led to a more sophisticated and diversified export basket.
The rest of the document is organized as follows. Section 2 describes the econometric methods and data used to assess the causal effect of the terms of trade on sophistication. Section 3 presents the main results, followed by a discussion of the results of the robustness tests in section 4, followed by a discussion of the transmission channels in section 5. Finally, the last section concludes.

Data and methodology
The purpose of this paper is to present the data used in this study on the one hand, and the methodology on the other.

Data
The objective of this study is to assess the effects of the terms of trade on export sophistication on a sample of 46 African countries over the period 2002-2014. The objective of this subsection is to make a presentation of the data used.

a-Measurement of export sophistication
The export sophistication indicator developed by Hausmann et al (2007) measures the associated income level of all products in a country's export basket. Hausmann et al. (2007) refer to this indicator as "EXPY". Andreoni (2011) considers EXPY as an indirect measure of a country's trade-based productive capacities. In particular, the sophistication of a country's exports is an approximation of its productivity frontier, as the firm heterogeneity model maintains that only the most productive firms are able to export (Melitz, 2003). The reasoning behind sophistication is that a particular product integrates a certain level of technology, human capital, management, and other factors related to production, and these integrated factors can be reflected in the income level of the countries that export that product. In other words, the sophistication of a given product is a function of the productive capacities required to produce that product (Andreoni, 2011). Products mainly exported by rich countries tend to embody high levels of technology, human capital and management, as it is these characteristics that enable high-wage producers in rich countries to be competitive in these products, provided there is no trade intervention (Lall et al., 2006). Generally speaking, for a country exporting a given product, the higher its average income level, the more sophisticated the product. In this sense, the productive capacities of this country can be revealed by the sophistication of its export basket. In this regard, a country is said to have greater export sophistication if its export basket contains a greater share of more sophisticated products. In other words, its export basket is more like that of a typical rich country. Authors such as Lall et al (2006) developed an index of "export sophistication 6 " before Hausmann et al (2007). However, this is much less used in the literature compared to the EXPY index of Hausmann et al. (2007). It follows an approach similar to that of Hausmann et al. (2007) to quantify the sophistication of a country's export basket by the associated income level of its exported products.
It is important to note that the EXPY index should not be considered as a simple reflection of a country's technological level. A developing country's ability to produce and export (relatively) sophisticated products implies that it has mastered both the hardware (e.g., technology and facilities) and software (e.g., management) required by these products (Page, 2012). As noted earlier, what is revealed by the sophistication of a country's export basket is the country's overall productive capacity (Andreoni, 2011). In other words, EXPY, as a performance-based indicator, captures the overall capacities required for the production of a given export basket.
Development can therefore be seen as a process of transformation to produce goods associated with a higher level of income, which is a process of accumulation of new productive capacities 7 .
As mentioned above, Hausmann et al. (2007) proposes a more refined version of the sophistication index of Lall et al. (2006) which defines a level of wealth/productivity for a country's entire export basket. In this context, a product is sophisticated when it requires a sufficiently high level of development to be exported. Export sophistication then reflects the productivity associated with each product and is captured through the average income level of the countries that export that product. More specifically, Hausmann et al. (2007) define an index of export sophistication for which expected productivity is determined by productive skills and the number of investors engaged in finding new production costs .
Starting from the premise that greater similarity with the export basket of rich countries means greater export sophistication, the construction of the EXPY index is a two-step process, leading from sophistication at the product level to sophistication at the country level. First, each traded product is assigned a certain level of income, which reflects the sophistication of that PRODY product. The PRODY of product k in year t is defined as follows: 7 Apart from research and development, another indicator of the technological level of a product is the unit price. For example, Kaplinsky and Santos-Paulino (2005) distinguish between innovative and non-innovative products by the evolution of unit prices, which is based on a kind of Schumpeterian hypothesis according to which increasing unit prices reflect high barriers to entry and increasing innovation and decreasing unit prices reflect low barriers to entry. However, the decrease in unit prices may be the result of cost-reducing innovation or of different rates of innovation between products. If costs fall more than prices, then lower unit prices do not necessarily reduce profits. On the other hand, many factors other than innovation can affect unit prices, such as non-technological barriers to entry, policy distortions, and changes on the demand side (Lall et al. 2006). , , The numerator is the share of product k in the total exports of country i, and the denominator is the sum of this share in all countries exporting product k. The weight of GDP per capita is simply the revealed comparative advantage (RCA) of each country in this product, which reflects the network structure of country specialization. Therefore, PRODY is the average GDP per capita of all exporting countries, weighted by each country's RCA. It should be noted that the RCA used as a weight in the PRODY formula is different from Balassa's (1965) classical RCA, because the RCA in the PRODY formula has been normalized so that the sum of the weights equals one.
Subsequently, sophistication at the product level is transformed into sophistication at the country level, i.e. EXPY, according to the importance of each product in the country's total exports.
The EXPY of country i in year t is calculated as follows: , , , The "PRODY" product sophistication indicator is the subject of three major criticisms. The first criticism concerns the use of income information to calculate the level of sophistication of a product, which generates a circularity according to which "rich countries export products from rich countries 8 " (Hidalgo, 2009;Hidalgo and Hausmann, 2009). The second criticism concerns the consideration of quality differentiation within products. Schott (2004) distinguishes between inter-product sophistication and intra-product sophistication. The first refers to differences in sophistication (e.g., embedded technology) between different product categories while the second reflects differences in quality within a given product category and is not taken into account by PRODY. The third criticism can be seen as an extension of the second.  The purpose of this paper is to analyze the effects of terms of trade on the EXPY of African countries, which are relatively homogeneous in terms of income level. Thus, the problem of circularity tends not to matter here, and PRODY and EXPY are sufficient and qualified for the purposes of this paper. 9 For more details on the criticisms of this index see Teng (2019). 10 Hausmann et al (2007) point out that PRODY should be calculated on the basis of a consistent sample of countries, as PRODY is highly correlated with a country's income level.   Figure 2 presents the correlation between the sophistication of economies and the terms of trade. As we can see, the relationship between these two variables is positive. The data come from the WDI. according to which, when GDP per capita increases, consumption preferences change (Aghion and Howitt, 1992;Fiorillo, 2001). The potential risks of diversification decrease with increasing income and export diversification increases with increasing GDP per capita (Imbs and Wacziarg, 2003). Thus, GDP per capita growth has a positive influence on export sophistication in low-income countries. By construction, the measure of export sophistication is highly correlated with the income level of exporting countries. This is why these measures of sophistication tend towards a pattern in which high-income countries export the products exported by other high-income countries, and vice versa for low-income countries.
-trade openness Openness: which represents trade openness and is approximately by the sum of exports and imports of goods divided by the value of GDP. In order to improve a country's ability to compete for trade, a first step is to remove the main national barriers to the development of international business and to improve local conditions for business 11 . All of these constraints imply transaction costs on exports, leading to lower export competitiveness and less diversification.
Indeed, according to Faini (2004), the decline in export profitability (due to tariff barriers and associated transaction costs) will only allow a relatively limited number of firms to reach export markets. Trade openness can therefore play a key role in the process of economic sophistication because countries that are more open can benefit from technology diffusion (Keller, 2010). Data are from the WDI.
-FDI Developing countries are striving to escape dependency on primary products and diversify their exports. One of the strategies to broaden the composition of exports is to encourage FDI inflows (Weldemicael 2012). FDI could have direct and indirect effects on export sophistication. The direct effect is that domestic firms and companies participating in joint ventures with foreign firms are likely to export sophisticated products to the international market (Weldemicael 2012). Several studies show that the increasing sophistication of Chinese exports is largely productive firms self-select in export markets (Wagner, 2007). FDI affects the complexity of exports. By facilitating the transfer of knowledge, technology and management skills, FDI can promote the production and export of more complex goods and services by destination countries (Eck and Huber, 2016;Hausmann, 2016).

-Financial development
Represented here by domestic credit to the private sector. Financial development facilitates technological innovations through its role as an intermediary. Banking sector development increases the affordable funds available for private sector investment in many developing countries. Literature has shown that there is a positive correlation between financial development and the sophistication of economies (Saadi 2020;Fang et al. 2015).
-Internet access The effects of Internet access on development have been discussed at length in the literature.
Several works have shown the positive effect of Internet access on economic growth (Choi and Yi, 2009;Choi 2010). Internet access also has a positive influence on foreign direct investment and trade (Choi, 2003;Lin, 2015;Clarke and Wallsten, 2006;Choi, 2010). All these elements are important factors in the increasing complexity of economies. Lapatinas (2019) shows that internet access has a positive effect on the sophistication of product exports. Internet access is measured by the share of individuals using the Internet in the total population. The data are from the World Bank World Development Indicator (WDI).

Methodology
In order to assess the effect of the terms of trade on export sophistication, we estimate the following model: Where: , i t EXPY : represents the export sophistication indicator for country i at period t. , i t Tot : is the terms of trade indicator for country i in period t. , i t X : is a vector that represents all the control variables described above (FDI, openness, Internet, domestic credit, and GDP per capita). Several studies have also introduced the lagged dependent variable into the EXPY equation (Weldemicael 2012;Lectard and Rougier 2018). The introduction of the lagged dependent variable reflects the fact that a country's productive structures are affected by its own history and are therefore difficult to change 12 . The use of a lagged dependent variable as a regressor makes the model dynamic and involves some important econometric issues. The presence of the lagged dependent variable as an explanatory variable invalidates standard static panel regression because of "dynamic panel bias" (Nickell, 1981).
After eliminating country-specific fixed effects by the first difference, the dependent variable shifted by the first difference This raises the problem of endogeneity, and static estimation will provide biased and inconsistent results. The bias is subject to an order of 1/T and tends to disappear if the time dimension approaches infinity 13 (Baltagi, 2008).
To resolve this dynamic panel bias, the literature recommends the use of GMM estimates in systems (Lectard and Rougier 2018;Weldemicael 2012;Saadi 2020Hartman et al. 2017Vu 2019). The use of GMMs in systems (Arellano and Bover, 1995;Blundell and Bond, 1998), which is an improved version of GMMs in difference (Arellano and Bond, 1991), is considered the most relevant 14 (Blundell and Bond, 2000).
Suppose that , i t X groups together all our explanatory variables (variables of interest and control variables), besides our model can be written in the following form : This gives: The first difference is that this equation is written as follows: and Hall (2011) argue that the addition of exogenous explanatory variables can reduce bias, provided that the time dimension T is large. However, as shown by Judson and Owen (1999), the bias only decreases from 50% of the real value to 20%, which remains a significant level, if the time dimension increases significantly from 5 to 30. Given that the database for this chapter has only 20 time points/years, this bias is considered a problem. 14 One of the main advantages, cited by these authors among others, of the Generalized Moment Method is that it resolves the endogeneity bias for all the explanatory variables and not only for the variable of interest because it allows the instrumentalization of several explanatory variables, contrary to external instrumental variable methods, such as those proposed by Anderson and Hsiao (1982), which allow the endogeneity of a single variable to be treated.
The first difference writing of the reduced form of the models eliminated the country-specific effect i µ and thus the time-invariant omitted variables. However, in overcoming this shortcoming, another major problem emerges: the correlation between the error term in To avoid this simultaneity bias, as well as that of inverse causality, the potentially endogenous explanatory variables in difference are instrumented by their lagged values in level, under the hypothesis of the absence of autocorrelation of the errors in the equation in level and that of the low exogeneity of the explanatory variables.
These so-called moment or orthogonality conditions are as follows: Arellano and Bond (1991) tried to improve the GMM first difference estimator by calculating it in two steps. A first estimation is made under the assumption of the absence of correlation of the errors and their homoscedasticity. The vector of residuals from this first estimation is used to estimate in a convergent way a variance-covariance matrix of the errors, in a second estimation step. At this second stage, the hypothesis of the absence of correlation between the errors and their homoscedasticity is verified. This makes the two-step first difference GMM estimator more efficient than the single-step first difference GMM estimator (Roodman 2009a;2009b).
In addition to the loss of information involved in estimating the first-difference 15 model, Blundell and Bond (1998) show that the first-difference, one-step or two-step GMM estimator may lack robustness, due to the quality of the level instruments, which are often weakly correlated with their difference value. This happens especially when the individual dimension "N" of the panel is relatively larger than its time dimension "T" (Roodman (2009a;2009b). Blundell and Bond (1998) solved this problem of instrument quality by combining the use of level instruments with difference instruments. This amounts to simultaneously estimating two equations: one representing the variables in difference and the other taking them up in level.
Once this is done, the variables in the difference equation will be instrumented by their values in level and, at the same time, the variables in the level equation will be instrumented by their values in difference, under the hypothesis of their quasi-stationarity, which amounts to assuming that the correlation between the explanatory variables of the level equation and the individual effect does not vary over time.
The system of equations is written as follows:  Blundell and Bond (1998) show that the GMM system estimator is more efficient and robust than the first difference GMM estimator. Moreover, as for the first-difference GMM estimator, the two-step system GMM estimator is more asymptotically efficient than the one-step system GMM estimator.
Regarding the instruments of our regressions, we assume that all explanatory variables are likely to be endogenous, since we are dealing with macroeconomic variables, which may have a double sense of causality with export sophistication. Thus, we instrumentalize the first differences of the explanatory variables by their values lagged by at least one period in level (Roodman 2009a;2009b). As for their level values, we use the most recent first difference values. As all the instruments are generated from the model itself, the level and difference lagged variables of the GMMs in system are internal instruments. One of the main concerns of econometric analysis is the difficulty of finding a valid exogenous variable to instrument the endogenous variable, called the external instrument. A valid instrumental variable must be correlated with the endogenous variable, not correlated with the error term. However, it is quite difficult to find variables that meet these conditions. The use of lagged variables as the internal instrument gets around this difficulty.
The estimation of GMM in a valid system is established under several conditions: First, in order to obtain a consistent estimate on the lagged dependent variable, which is used as the explanatory variable, the error term must have a serial correlation of the first order but not of the second order. That is, the Arellano-Bond autocorrelation test for the first-order serial correlation, AR(1), must reject the null hypothesis, while the test for the second-order serial correlation, AR(2), must not reject the null hypothesis.
The second condition is the exogeneity and validity of the instruments. Hansen's overidentification test examines the null hypothesis of joint validity of the instruments 16 . Thus, to obtain a valid result for Hansen's test, as suggested by Roodman (2009b), the number of instruments must be less than the number of groups (in our case, the number of countries).
Without careful control, it is easy to break this rule of thumb in the estimation of GMMs in system, because all lags from first or second order can in theory be used as instruments in GMMs in system. This problem is particularly serious in large time dimensions, since the number of instruments is quadratic in the time dimension (Roodman, 2009b). Thus, the validity of the GMM in-system estimator is conditioned by the quality of the selected instruments (Hansen-test), as well as the second order non-autocorrelation of the errors in the difference equation (AR2). Table 1 shows the results of estimating the terms of trade-sophistication relationship using ordinary least squares. It can be seen that whatever the specification chosen, the coefficients associated with the terms of trade are positive and statistically significant at the 1% level.

Baseline results
Column (1) (1) and (2). As for our control variable, we note that the coefficient associated with the trade variable is positive and statistically significant. This result reflects the fact that an improvement in the trade openness of a unit leads to an increase in export sophistication of about 4%. Trade openness allows countries to take advantage of technology diffusion and produce more sophisticated goods (Keller 2010). This result is in line with those obtained by Makhlouf et al (2015), which shows that trade openness plays a key role in export diversification in developing countries.
In column (4), we introduce internet access as a control variable. Once again, the coefficient associated with terms of trade is positive and statistically significant at the 1% level. As for the role of the internet, our results show that the coefficient associated with this variable is positive and significant at the 1% level. This reflects the fact that an increase in the Internet access favours the export of sophisticated products. This result is in line with those obtained by Lapatinas (2019) who shows that internet access improves the sophistication of products in both developed and developing countries. Moreover, a fairly abundant literature shows that internet access has a positive and very significant effect on productivity (Oliner et al., 2007;Gust and Marquez, 2004) and trade (Lin, 2015;Blum and Goldfarb, 2006).
In column (5) Although the OLS estimation gives us results that allow us to assert that terms of trade promotes the sophistication of economies, it is nevertheless true that these results suffer from certain limitations, one of the most important of which is the failure to take endogeneity into account.
To correct this bias, we have re-estimated our model using the generalized method of moments.
The results of these estimates are presented in Table 2.  When we look at our results, we find that whatever the specification, the terms of trade have a positive and statistically significant effect at 1%. In fact, this result demonstrates that an increase in the terms of trade improves export sophistication. The increase in the terms of trade, by increasing the profitability of exports allows an improvement in the sophistication of exports.

GMM results
This result is consistent with that found in Table 1. With respect to our control variables, they are found to be statistically significant and of the expected sign. Moreover, we can see that the coefficient of the lagged dependent variable is positive and statistically significant at 1% whatever the specification. This result suggests that the phenomenon of the sophistication is an extremely slow process and therefore very dependent on past values. A policy aimed at greater export sophistication is therefore a long-term policy.

Sensitivity tests
In order to test the robustness of our results, we will first introduce additional variables likely to explain the sophistication of exports. In a second step, we will change the measure of export sophistication. Finally, we will analyse our results in relation to the production structure.

Additional variables
In column (1) of Table 3, in addition to the variables previously included, we introduce as an additional variable the human capital captured here by the secondary school enrolment rate.
With respect to our variable of interest, we find that it is positive and significant at the 1% level in all specifications. This result thus reflects the fact that an improvement in the terms of trade by promoting the profitability of exports leads to an improvement in sophistication. As for our control variable, our results show that human capital is positively and significantly related to export sophistication. Thus, an increase of one unit of human capital leads to an improvement in sophistication of about 4%. Indeed, countries with better human capital tend to learn and master the production of complex products faster . On the other hand, a more educated workforce also promotes the ability to produce complex goods (Zhu and Fu 2013;Hausmann et al. 2014).
In column (2), we introduce the population growth rate as a control variable, which here represents the country size. This variable is positive and statistically significant at 10%. An increase in the population growth rate leads to an improvement in export sophistication. This result is consistent with those obtained by Kočenda and Poghosyan (2018) who analyze the determinants of export sophistication in developed and developing countries. They find that population size positively affects export sophistication. In column (3), we include the inflation rate as an additional variable to capture the effects of instability in the macroeconomic environment on export sophistication. Our results show that a one-unit increase in inflation translates into a decrease in export sophistication of about 5 percent. A highly unstable macroeconomic environment creates an environment of uncertainty that discourages investors (Jarreau and Poncet 2012).
In column (4), we introduce a geographical variable, namely the Landlocked. We note that this variable is negative and statistically significant at the 1% level. This thus reflects the fact that the landlockedness of countries has a negative effect on export sophistication. Indeed, the literature shows that the isolation of countries reduces the quantities exported and slows down trade (Radelet and Sachs 1998;Anderson and van Wincoop 2004;Weldemicael 2012). In columns (5) and (6) In column (7), we introduce government expenditures. The results show that the coefficient associated with government expenditures is negative and statistically significant at the 1% level.
This therefore reflects the fact that an increase of one unit in government spending leads to a decrease in sophistication of about 1.12%. In fact, the increase in government spending is manifested by a crowding out effect on private investment, which leads to a decrease in product sophistication. This result is consistent with those obtained by Lapinas (2019), who also finds a negative effect of government spending on export sophistication. Finally, in the last column, we introduce a proxy variable for industrial policies. We find that the coefficient associated with this variable is positive and statistically significant at 1%. This result thus reflects the fact that an increase in industrial policies tends to increase the sophistication of exports. This result is contrary to those found by the United Nations (2013) which showed that industrial policies tend to increase concentration in oil producing countries.

Alternative measure of export sophistication
At this level, we will use the economic complexity index of Hausmann and Hidalgo (2009) which is developed using data disaggregated at the product level. This indicator reflects the availability of productive capacities that allow a country to produce more sophisticated goods.
In other words, economic complexity represents a country's level of knowledge and technological progress from the manufacturing to the export phase. The results when we use the ECI are contained in Table 4 below. Table 4 above presents the results of the relationship between terms of trade and economic complexity 17 . From this table, we can see that the relationship between these two concepts is positive and statistically significant at the 1% level. According to Bleaney and Greenaway (2001), an increase in the terms of trade leads to an improvement in income and investment in Sub-Saharan African countries. Thus, the terms of trade, by promoting increased income and investment 18 , also improve economic complexity. As for our control variables, namely FDI, trade openness, internet access, domestic credit, and income level. We note that they are positive and statistically significant in the different specifications. This reflects the fact that an increase in these variables contributes to an improvement in economic complexity. These results are consistent with work that examines the determinants of economic complexity (

Terms of trade and sophistication: does the production structure matter?
In order to specify the relationship between terms of trade and sophistication according to production structure, our sample is divided according to whether the country is oil, commodity, and manufactured goods exporter. For example, a country is considered an oil exporter if its share of oil exports exceeds its share of merchandise and manufactured exports (Alimi and Aflouk 2017). We thus proceed to specify the other two groups of countries, namely merchandise and manufactured exports. We then construct three dummy variables that are 1 if the country belongs to one group and 0 elsewhere 19 . Table 5 presents the results of the terms of trade-export sophistication relationship when looking at the structure of production. Column (1) of this table gives the results when the country is an oil exporter. We note that in this case, the coefficient of the terms of trade is positive and statistically significant at 10%. With regard to oil exports, we find that the coefficient associated with this variable is negative and statistically insignificant. Thus, a greater export of oil products does not allow these countries to improve the sophistication of their exports. Indeed, openness in these countries allows them to exploit even more their comparative advantages in their natural resources, which does not allow them to achieve greater sophistication.
In column (2), we introduce the commodity exporters.. The results show that the coefficient associated with good export is positive and significant at the 10% level. The increase in exports in commodity exporting countries leads to an improvement in export sophistication although the intensity is low. Column (3) of the table gives the results when considering countries exporting manufactured products. When we look at the variable "exporter of manufactured goods", we find that the coefficient associated with this variable is positive and statistically significant at1%. An increase in the export of manufactured products by one unit leads to an improvement in sophistication of about 0.6 units. The increase in manufactured exports allows the country to improve its comparative advantages and consequently improves export sophistication.

Transmission channels
Variables such as per capita income and the quality of institutions can no longer account for the transmission of terms of trade effect on export sophistication because they are already included in the regression model. Therefore, the challenge is to find other variables that can explain how the terms of trade affect the sophistication of economies. To this end, we propose two possible transmission channels. The first channel is that of productive investment; the second is that of the exchange rate.
With respect to the productive investment channel, the hypothesis underlying this intuition is that an improvement in the terms of trade leads to an increase in productive investment. Bleaney and Greenaway (2001) have shown that an increase in the terms of trade is accompanied by an increase in income and productive investment. An increase in productive investment leads to an increase in the sophistication of economies (Fang et al. 2015;Saadi 2020). In addition, figure   6 below shows the positive correlation between productive investment and export sophistication. The second channel is the exchange rate channel, mainly exchange rate underdevaluation. The idea here is based on the fact that excessive exchange rate overvaluation negatively affects economic complexity (Luciano and Missio 2017). As noted above, a weaker national currency in an open economy stimulates investment because it makes goods cheaper and thus more competitive in foreign markets. This will lead to increased production and exports (Brito et al. 2018). The correlation between the exchange rate and the terms of trade is presented in table A1 in the appendix. It can be seen that there is a negative correlation between the terms of trade and the exchange rate.

Figure 6 correlation between productive investment and export sophistication
Our assumptions can be summarized as follows: (i) Productive investment channel: A rise in the terms of trade increases productive investment, which leads to an increase in sophistication.
(ii) Exchange rate channel: a rise in the terms of trade leads to a depreciation of exchange rates, which in turn leads to an improvement in sophistication.
The procedure adopted to test these two hypotheses is that adopted by Carmignani and Avom (2010) and Avom et al (2020).  (Baron and Kenny 1986). This method was used by Busse et al (2016) to examine the mediating effect of investment in the causality of FDI and trade to economic growth. This approach is useful for understanding the extent to which the terms of trade effect affects export modernization. However, it seems important to specify that the analysis of mediation assumes that the terms of trade are prior to the transmission channels (Avom et al. 2020).

a) -empirical verification of the reduced form
The first testable hypothesis can be nested in the basic version of the model (1). The regressor vector W now includes productive investment and the exchange rate and/or exchange rate depreciation. The model thus estimated is as follows : The approach adopted to calculate the devaluation is that of Rodrik (2007), which proceeds as follows :  (3).
Thus defined, is comparable from one country to another and over time. When it is greater than one, it indicates that the exchange rate is fixed so that the goods produced in the country are cheap: the currency is undervalued. When it is less than unity, the currency is overvalued (Rodrik 2007).
The results of the GMM estimates are presented in   Table   6 presents the results when we control the model with productive investment. As before, we find that the coefficient associated with the terms of trade variable loses significance while the coefficient associated with the productive investment variable is positive and statistically significant at 5%. Productive investment thus acts as a mediator between the terms of trade and EXPY.

b) -empirical verification of the system of equations
To test the empirical validity of the second type of implications, we established a system of two equations as follows : Where Z is either productive investment or exchange rate devaluation, X and M are vectors of control variables, η and ν are random disturbances; β and c are vectors of coefficients to be estimated, and all other symbols are the same as in the previous equations. The explanatory variables are taken from the literature. The main feature of the system of equations (5) and (6) is that the terms of trade affect export sophistication through its effect on productive investment and exchange rate devaluation. We assume that the results of the estimates of the single equation discussed in the previous subsection suggest that the terms of trade variable is insignificant in the regression of export sophistication when productive investment and exchange rate devaluation are controlled for. It is for this reason that we do not introduce the terms of trade variable into equation (5). The results of the GMM estimation of this equation are contained in Table 7. The first column of the table shows the results when controlling with the exchange rate. The coefficient associated with this variable is negative and statistically significant at the 1% level.
This suggests that an exchange rate depreciation improves the modernization of exports. This result is confirmed when the devaluation is controlled for. It can be seen that a greater devaluation is associated with an improvement in export sophistication.
Equation (6) above examines the effect between the terms of trade on the variables considered as transmission channels. The results of the estimates of equation (6) indicate that the terms of trade are one of the main factors in productive investment and exchange rate devaluation, so that the terms of trade affect export sophistication through its effect on productive investment and exchange rate devaluation. Column 1 of the table 8 above shows the results of the effect of the terms of trade on the exchange rate and productive investment. It shows that an improvement in the terms of trade leads to a depreciation of the exchange rate. Column 3 presents the results of the terms-of-trade effect on productive investment. From this table, it can be seen that an increase in the terms of trade leads to an improvement in productive investment. All these results confirm our hypotheses that productive investment and exchange rate devaluation act as mediators that channel (part of) the effect of trade gains towards the modernization of exports.

Conclusion
New and recent literature on economic development and trade offers a new perspective on the role of export sophistication. However, the opportunity to integrate gains from international trade and export sophistication has been lacking. This study contributes to the literature on the developmental impact of terms of trade and provides new empirical tests of the effect of terms of trade on export sophistication in Africa. The study covers a sample of 46 African countries over the period 2002-2014. Using several estimation techniques including ordinary least squares and generalized method of moments, we find that the terms of trade have a positive and significant effect on export sophistication. Several sensitivity tests are conducted through the use of additional variables, using the economic complexity index as an alternative index of export sophistication. In addition, we also analyze the link between terms of trade and export modernization taking into account the production structure. Our results suggest that oil export has no effect on sophistication while commodity exports have a very small positive effect on export upgrading. On the other hand, our results show that manufactured exports have a positive and very significant effect on export sophistication. We identify and discuss two main channels through which the terms of trade are likely to explain sophistication: the channel of productive investment and the channel of the exchange rate depreciation.
To the extent that economic development is an ongoing concern of developing economies, our findings have several economic policy implications. African governments are struggling to find policies to improve their export and production structure. Our study shows that a policy aimed at increasing productive investment can help them achieve this goal. In addition, controlled devaluation should also enable governments to make their exports more competitive, which should lead them to further modernize their productive structure. This study further shows that improving the institutional framework, trade openness, foreign investment and investment in human capital can stimulate export sophistication. A special focus by governments on these elements would undoubtedly enable them to modernize their exports. Our study also provides a framework for future research. Future research in this area can help provide rigorous testing of other channels through which gains from international trade can contribute to export sophistication. Research can also focus on examining the impact of trade with the major trading partner on economic sophistication. future researches can further analyse the non-linear relationship between terms of trade and export sophistication. Finally, a sub-regional comparative analysis of the gains from trade on economic sophistication would be quite interesting.