Cai Chen. The impact of 2018 tariffs on international trade. A Master’s Paper for the M.S. in IS . 05, 2020. 51 pages. Advisor: Arcot Rajasekar

Tariffs escalation in 2018 between the U.S. and China became a significant event in international trade. The tariffs and related retaliation caused massive trade losses in major countries and welfare losses in the world. However, as an emerging event happening recently, few studies focus on it and most studies pay attention on domestic effects on major countries. This study is aimed to explore the changes of international trade by applying the graph analytics method, which is widely used in network analysis and has comprehensive algorithms to detect the network structures. The data of commodities under class 85, one of the commodities influenced by tariffs, was extracted from the United Nations Comtrade database. The result indicates some changes between graphs and potential redirections, which could be influenced by tariffs.

Headings:

US-China Trade war

Tariffs

Graph Analytics

Graph Edit Distance

THE IMPACT OF 2018 TARIFFS ON INTERNATIONAL TRADE

by Cai Chen

A Master’s paper submitted to the faculty of the School of Information and Library Science of the University of North Carolina at Chapel Hill in partial fulfillment of the requirements for the degree of Master of Science in Information Science.

Chapel Hill, North Carolina May 2020

Approved by

______Arcot Rajasekar 1

Table of Contents

Table of Contents ...... 1 Acknowledgements ...... 2 1 Background and Motivation ...... 3 1.1 Background ...... 3 1.2 Motivation ...... 4 2 Literature Review ...... 7 2.1 Trade sanction and tariffs...... 7 2.2 Domestic effects on U.S. and China of tariffs escalation ...... 8 2.3 Global impacts of tariffs escalation ...... 10 2.4 Graph analytics in international trade ...... 11 3 Methodology ...... 12 3.1 Data Resource ...... 12 3.2 Methods and Algorithm ...... 14 4 Analysis and Results ...... 17 4.1 U.S. Import data ...... 17 4.2 Graph Creation ...... 18 4.3 Graph Structure comparison ...... 20 4.4 Graph edit distance (GED)...... 23 4.5 China’s exports ...... 24 4.6 Combined graphs include U.S. import and China’s export ...... 27 5 Conclusion ...... 32 5.1 Summary ...... 32 5.2 Discussion ...... 33 5.3 Limitation ...... 34 5.4 Future Work ...... 35 References ...... 36 Appendix ...... 41

2

Acknowledgements

I would like to express my very great appreciation to Dr.Rajasekar for his valuable and constructive suggestions during the planning and development of this research work. His willingness to give his time so generously has been very much appreciated. I would also like to thank Dr. Allen in the Economics department and Dr. Ballard-Rosa, Dr. Bapat, and Dr. Mosley in the politics department to provide me with valuable insights from their field and important suggestions to this paper.

My special thanks are extended to graduate student coordinator Lara Bailey for helping with overcoming the difficulties I met in writing the paper.

Finally, I wish to thank my parents and my boyfriend for their support and encouragement throughout my study.

3

1 Background and Motivation

1.1 Background

Start from 2018 when President Trump introduced billions of dollars in new tariffs on

Chinese imports, the trade war continues for more than one year between the United

States and China, one of the most important trade relations in the world. The mutual merchandise of the U.S. and China reached $576 billion in 2016 and China serves as the largest source of imports, second-largest merchandise trading partner, and third-largest export market for the US (Morrison, n.d.). After imposing the tariff, for import countries, the price will increase with tax and for the export country, the international market will shrink due to the increased prices of the products. The tariff enforcement exerts a large impact on the domestic economies of these two countries that have deeply connected in trades. In addition to this, this major event related to two biggest economies in the world might also trigger changes in trade relations with their partners and the whole global trade system.

United States Trade Representative (USTR) started an investigation on China in March

2018, finding that China uses foreign ownership restrictions to require or pressure technology transfer from U.S. companies to Chinese entities. Second, USTR also found

China imposes restrictions on U.S. companies’ investments and activities. Third, USTR found China directs systematic investment in the acquisition of U.S. companies. Fourth, 4

USTR found China conducts and supports unauthorized intrusions into the computer networks of U.S. companies. After the investigation, U.S. gradually imposed policies on the restriction of trade with China (Report to Congress On China’s WTO Compliance,

2019) .Based on Section 301 of the Trade Act of 1974, White house announced an additional tariff of 25% on $50 billion worth of Chinese imports containing industrially significant technologies. $34 billion became effective in July 2018 and the rest $16 billion became effective in August 2018. China retaliated by imposing a tariff on the same amount of $60 billion of U.S. exports at rates ranging from 5-10 percent. U.S. further imposed a tariff on $200 billion of Chinese imports with a 10% rate becoming effective in September 2018. Between October 2018 and Aril 2019, China and U.S. had an extended lull and reach a phase one agreement in December 2018 (Board of

Governors of the Federal Reserve System (U.S.) et al., 2019). From May 2019, U.S. had several announcements on imposing new tariffs and reducing tariffs along with China’s retaliation as well. As the beginning of the tariff issue, announcements and policies in

2018 serve as important factor to compare the performance of trade networks before and after the tariff imposed.

1.2 Motivation

Numerous previous studies analyzed the significant effect of tariff escalation between

U.S. and China, mostly focusing on the impact on the domestic economy and industries of U.S. and China. For the U.S. side, the tariff war losses of U.S consumers and firms are

$7,2 billion (Fajgelbaum et al., 2020). Li et al. pointed out that trade has a more negative effect on China than the US. Multiple papers state the effect on domestic merchandise, 5 consumption, and economy and most of them lead to negative effects. Some research have touched on the effect on the global economy and trading networks. Amiti et al.

(2019) stated that $165 billion of trade per year will continue to be redirected in the trade war to avoid tariffs. It has also disrupted other partner countries and the whole global economy, which influence the US, China, South-East Asia, and the EU and lead to no winner in this war (Pencea, 2019). However, overall few studies deeply analyze how this influences partners countries and how trade will be redirected. Analyzing the changes in whole global networks is crucial for international trade with a complex relationship among countries. Detailed analysis is needed for a better understanding of the changes happening in global trading systems.

Graph analytics is a non-traditional data analytics technic and is widely applied in analyzing relationships and networks. It has a good visualization and massive algorithms applied in different structure detection in mathematics and computer sciences. Traditional methods in studies of international economy and tariff effect are more about traditional regressions and time series models in economics. Some previous studies applied graph analytics in analyzing international trade. Zhu, Neel et al. (2014) applied graph analytics in international trading analysis via building a global trading graph. Guha et al. (2016) built a and applied the community detection algorithm to study global trade trends. Though the graph analytics has not been widely applied as a major tool in trade analysis, it shows the capability as a powerful tool to detect the trends and changes from a global perspective in all previous works. As it has not been considered as a tool to analyze tariff escalation, this paper is intended to apply it as the main tool to do analysis. 6

To fill the gap of little analysis on changes of global trading networks during the period of tariff escalation, the focus of this paper is to visually build the networks and detect changes in the networks by applying quantitative methods. The main quantitative method applied is graph analytics, which has been explored before in the international trade field.

Based on previous studies, there are several assumptions that this paper will focus on.

The first focus is the trade relation between the U.S. and China and the magnitude of the influence on their trade relation, including the amount of import from China. The second focus is on trade relations with global partners. The question is whether the tariff changes the relations between U.S/China and its partners and how it changes. There might be new partners appearing and old partners disappearing due to the tariff escalation. The third focus is on redirection. Redirection suspects that export country exports to non-banned areas and then the products are shipped from those non-banned areas to the final import countries with trade sanction. Previous studies speculated potential redirection after imposing tariffs (Amiti et al., 2019). Further tests on redirection and its details could provide more understanding of the network changes. A famous redirection case in international economics as a reference is the Belarus case that goods were redirected to

Belarus first and then shipped to Russia (Fritz et al., n.d.).

7

2 Literature Review

2.1 Trade sanction and tariffs

Trade Sanction refers to trade penalties imposed by one nation on other nations, and tariff is one important measure in trade sanction. It is part of economic sanctions, which could be distinguished into positive sanctions and negative sanctions. There are two countries involved in a sanction. One is the sender which imposes the sanction and the other is the target which receives economic punishment (Caruso, 2003). In the paper, the sender is

U.S. and the target is China. Previous research on sanctions has analyzed the influence on domestic consumption and the economy. Caruso et al. applied the gravity model in data between U.S. and 49 target countries and found that extensive and comprehensive sanctions largely and negatively influenced bilateral trade. As an important part of the sanction, the tariff is a tax on imports or exports between sovereign states, used to encourage or protect the domestic industry. Tariff is often viewed as losses for the whole welfare and particularly benefit losses for consumers. Although the producers and government could gain some surplus, the overall welfare decreases after imposing tariffs

(Krugman et al., 2005). It is often recognized as a negative effect from economic perspectives and liberalization of trade has more positive impacts (Poole, 2004).

However, economists have arguments on free trade and tariffs, some researchers also argue that free trade has some downsides to global developments. Free trade dominant by developed countries pressure developing countries to open the door and prevent them 8

from protectionism. This causes de-industrialization and slow growth in development

(Bieler et al., 2014). The effect of tariff in individual countries vary from one to another under different circumstance. Economists have argued the effect of tariff on the Great

Depression of the United States for decades. Most economists considered the effect is small while Crucini and Kahn (1996) argued that tariff exerts a significant effect on GDP even when trade accounts for a small share of output. Dardis and Cooke (1984) estimated the losses of U.S. because of high prices from tariffs. The consumer losses in 1080 ranged from $10 billion to $12 billion, and the higher prices cause the greatest proportion of the increase. Russia adopted heavy tariffs in 2013 and become one of the most protectionist countries in the world. Russia’s import ban along on agriculture along with depression beginning in 2014 stimulated agricultural productions (Liefert et al., 2019).

Narayanan and Sharma (2016) analyzed the tariff reduction in TPP and the implication in the Indian economy, showing that the mixed effect of reducing tariffs in TPP does not benefit India. Tariffs largely affect the global trading networks. Crucini and Kahn (1996) also pointed out that the escalation of tariff war undermines the international trade and investment. Tariff reduction in one production process influences the magnitude of trade in the whole industry (Hayakawa, 2014).

2.2 Domestic effects on U.S. and China of tariffs escalation

Regarding the trade war between U.S. and China, previous research focuses more on the domestic influence of the war towards U.S. and China. For the U.S. consumer and social welfare, the tariff war losses of U.S consumers and firms are $7,2 billion or 0.04% of

GDP after accounting for tariff gains, and the most negatively affected part is tradeable- 9 sector workers in heavily Republican counties (Fajgelbaum et al., 2020). Imported tariff was costing US consumers and the firms to import foreign goods an additional $3.2 billion per month (Amiti et al., 2019). Cavallo et al. (2019) also found U.S. retailers absorbing most tariff increases. Huang et al. (2019) found the companies’ financial performance went worse when engaging in trade relations with China after the tariff announcement. Besides the consumers’ and firms’ losses, some studies also point out that the industries which should benefit from tariff actually suffer losses. Flaaen and

Pierce (2019) analyzed the 2018-2019 tariffs’ effects on U.S. manufacturing sectors and concluded that they are associated with reductions in manufacturing employment and increases in producer prices, which is opposite to previous conclusions about more robust manufacturing sectors. Lots of studies (Board of Governors of the Federal Reserve

System (U.S.) et al., 2020; Caldara et al., 2020; Waugh, 2019) show the negative effect on U.S. industries, investments, and other sectors. From China’s perspective, Li et al.

(2018) pointed out that the trade has a more negative effect on China than the US, and also hurt most countries especially in GDP and manufacturing employment but benefit their trade. Yu (2019) considered that the Chinese economy will become a modern market economy with Chinese characters after trade war stimulus. Carvalho et al. (2019) analyzed the effects from both U.S. side and China’s side and concluded that both of them suffer huge losses but Chinese consumers and producers would bear most of the burden. The policy's impact from U.S. is also more effective than retaliation from China.

10

2.3 Global impacts of tariffs escalation

Some previous studies mentioned the impacts from a global perspective. The global welfare has decreased due to the tariff escalation. The trade war has disrupted other partner countries and the whole global economy, which influence the US, China, South-

East Asia, and the EU and lead to no winner in this war (Pencea, 2019). Carvalho et al.

(2019) stated the world as a whole suffers losses on welfare, but he also found that some emerging markets will benefit from it by a shift in demand, such as Mexico and Brazil.

The shift in production and demand will influence other partners of these two big economies. To avoid tariff Approximately $165 billion of trade per year will continue to be redirected in the trade war. (Amiti, Redding & Weinstein, 2019)(Kepner & Gilbert,

2011). Flaaen et al. (2019) conducted to examine the tariff in washing machines and found the relocation of production across the border caused by the tariff on individual countries. The researchers have some findings on trader partners and redirections but not emphasize them. Most findings appear along with domestic effects and in general few research deeply analyze how this influences partner countries and how trade will be redirected. Paying more attention to analyzing the changes of whole global networks is crucial for international trade with the complex relationship among countries. Detailed analysis is needed for a better understanding of the changes happening on global trading systems during the tariffs.

11

2.4 Graph analytics in international trade

Graph theory firstly emerged in 1736 from Leonhard Euler and has gradually developed a completed theory with lots of studies on it. The graph-theoretic data structure of one of the main data storage structures in the computer science area, which is used based on structure and algorithm manipulation (Kepner & Gilbert, 2011) . The definition of the graph in varies from different researches. Graphs could be separated into an undirected graph and directed graphs. The edges of the directed graph have directions. A common and narrowed definition often refers to Directed Simple Graph and a more general concept to allow may be called Directed (Lists,

Decisions and Graphs, n.d.). Lots of areas applied graph analytics especially in biological science but it is still a new analysis method for international trade. There is some great analysis applying graph analytics as the tool to analyze international trade trends. Zhu, Neel et al. (2014) built the graph structure and applied the community core detection approach to track the trend of global trade networks under the rise of China in international trade. The community detection method detects both global and regional changes, indicating that the Asia-Oceania community disappeared and re-emerged over time. The leadership has switched from Japan to China. Guha et al. built a directed graph and also applied the community detection algorithm to study the global trade trends and found that the global trade networks are becoming more connected along with the increasing number of countries. Guha et al. also pointed out China’s entrance in WTO has influenced regional communities. Wang et al. (2019) developed a highly coordinated, multi-view, and visualized framework to explore the relationship between global trade network and regional instability by anomalies detection and network analysis. These 12

previous applications in trade networks are practical applications of network and graph analysis and present various functions and usage of this tool.

3 Methodology

This section describes the data resource and the procedures of selecting, extracting and filtering data. It also contains the methods applied to create the trading graphs and explore the differences in different graphs, to generate analysis on the impact of the tariff on U.S. trading relationships.

3.1 Data Resource

This paper uses publicly available data from UN Comtrade API, which is the pseudonym for the United Nations International Trade Statistics Database. The data extracted from

Comtrade is monthly trade value data between the United States and its import partners, which U.S. imports from.

From the timeline of U.S. tariff announcements, this paper selects one of the most significant parts of the tariffs, which are tariff imposed in July on $50 billion Chinese imports and in August on $16 billion Chinese imports. The U.S. further imposed a tariff on $200 billion Chinese imports in September. One month before this period and one 13 month after this period are selected to be compared and then explore the impact of tariffs during this period. Since the first investigation from United States Trade Representative

(USTR) in China started from March 2018(Bang-Jensen & Gutin, 2008) (Report to

Congress On China’s WTO Compliance, 2019(2019_Report.Pdf, n.d.)) and might signaled the beginning of trade war, the paper chooses March 2018 as the month before the tariff period. After the tariff imposed in September 2018, China and U.S. reached phase one agreement in December 2018 and the next tariff imposed is in 2019. Therefore the month after the tariff period is selected to be December 2018. For product lists impacted by the tariff in this period, the resource is from the USTR and is published in the U.S. Federal Register (Notice of Action and Request for Public Comment Concerning

Proposed Determination of Action Pursuant to Section 301: China’s Acts, Policies, and

Practices Related to Technology Transfer, Intellectual Property, and Innovation, 2018).

All products listed are with Harmonized System (HS) codes which show the detailed classification of commodities and could be mapped by the Comtrade database. As there is a limitation on extracting a large amount of data with full 6-digit HS codes, the paper extracted it based on 2-digit classification and choose commodities classified as 85 to focus on. Class 85 includes Electrical machinery and equipment and parts thereof; sound recorders and reproducers; television image and sound recorders and reproducers, parts and accessories of such articles. These are one of the major types of commodities influenced by tariffs.

One part of the data extracted from Comtrade includes monthly trade value between the

U.S. and its import partners in March 2018 and December 2018 specifically in 14 commodities with classification code 85. Another part of the data is the monthly trade value between China and its export partners in March 2018 and December 2018. Since

China’s monthly data is missing in Comtrade, the data is extracted through its partners as reporters. The TradeValue in Comtrade is recorded as CIF-type value for imports and

FOB-type value for exports. CIF-type includes the transaction value of the goods, the value of services performed to deliver goods to the border of the exporting country, and the value of the services performed to deliver the goods from the border of the exporting country to the border of the importing country. FOB means “Free on Board”, which specify the point the obligations, costs and risks shift from seller to the buyer. The tax is excluded in CIF-type and FOB-type.

3.2 Methods and Algorithm

Centrality and Community detection are originally planned to be the algorithm applied but from the data limitation above, they are hard to be implemented in incomplete dataset. The exploration of the data starts from explorative analysis. The explorative analysis basically applied simple line chart to demonstrate the trend of data. After the exploration, the first part is to build the directed graph based on package in python. A directed graph is made up by nodes connected by edges with directions, different from undirected graph which does not have directions on edges. Directed graph could be defined as the graph containing two basic principles:

(1) non-empty finite set V(D) of elements, called the vertices or nodes. 15

(2) Finite set A(D) of ordered pairs of distinct vertices, called arcs and often refers to

edges.

The directed graph is written as D = (V,A), with set V and arc set D. For an arc

(u,v), a pair of vertices, the first vertex u is its tail and the second vertex is its head. It also means that the arc (u,v) leaves u and enters v (Bang-Jensen & Gutin, 2008). This specifies the direction of an arc (u,v). In this paper, the vertices, also called the nodes, refer to countries which are U.S. and its partners. The arc, also called the edges refers to trade flow from export country to import country. To represent the trade value, the directed graph is a weighted directed graph with weight assigned to their edges

(Chartrand, 1977). The weight is trade value and is added to each edge in the graph.

Networkx is a python language package developed by Hagberg, Schult and Swart and was released in April 2005. It has core functions to represent many types of networks and do both explorative and algorithmic analysis on networks. Besides, it could read different format with high flexibility in python (Hagberg et al., 2008). It is easy to access and have all basic function to construct and analyze the graph, so it is applied in this paper as the basic tool of graph analytics.

The second part of the graph analytics is comparing two graphs build from data in March

2018 and December 2018. They are firstly compared by basic graph structure such as numbers of nodes and edges, order, and degree. Then the Graph edit distance method

(GED) is applied to compare the similarity between these two graphs. It shows the 16 minimum costs of transforming one graph to another based on nodes, edges, attributes, and graph structure. The costs are from node substitution, node deletion, and node insertion. The GED is defined and calculated as following (Abu-Aisheh et al., 2015):

(1) Let g1 = (V1,E1,µ1,ζ1) and g2 = (V2,E2,µ2,ζ2). g1 and g2 are two grap

(2) the graph edit distance between g1 and g2 is defined as:

퐺퐸퐷(푔1, 푔2) = min ∑ 푐(푒푖) 푒1,⋯,푒푘∈훾(푔1,푔2) 푖=1

Where c denotes the cost function measuring the strength c(푒푖) of an edit operation 푒푖 and

γ(g1,g2) denotes the set of edit paths transforming g1 into g2. In networkx package, the distances are measured by setting different comparison conditions of two nodes. In this paper, the conditions include the default of the function and the differences between trade value of the two months.

17

4 Analysis and Results

The results contain several parts. Firstly, the paper compares the data from March 2018 to

December 2018 based on some explorative analysis and provides an overview of the data.

Secondly, the graphs are built based on U.S. Import data in March 2018 and December

2018. Then the paper compares the two graphs via graph structure comparison and GED method to explore the similarities and differences between the two graphs. Thirdly, the graphs built based on China’s export data in March and December are compared to detect trade redirection. Finally, the paper includes a combined graph based on both U.S. import data and China’s export data to further analyze the trade redirection possibilities.

4.1 U.S. Import data

The trade value of the US imports from China in March 2018 is $11,568,753,396 and in

December 2018 is $13,713,257,291. This shows the whole trade value of commodities from china with classification code 85 increased from March to December. The total trade value amount of import commodities with code 85 increased from $29,433,863,981 to $29,968,431,344, and imported commodities with code85 from China accounted for

39.3% in March and 45.8% in December. Contrary to the purpose of tariffs which is used to reduce the export from China, the results show little effects the tariffs exert on their trade relations. To further track the trend more clearly, the trade values of imports of 18 commodities with code 85 from March to December are shown in Figure 1. The whole trend indicates that there are no significant decreases from the period of tariff imposed

(July, August, and September) and the only drop in the trend is from October to

December. The tariff imposed on commodities imports belonging to class 85 might not achieve the expected effects.

Figure 1: Trade Value of U.S. imports from China (class code 85): March - December

Trade Value (US$) 1-Oct, $16.59 $18.00 1-Sep, $15.60 $16.00 1-May, $11.90 1-Nov, $14.96 $14.00 1-Jun, $11.94

Billions 1-Aug, $12.99 $12.00 1-Dec, $13.71 $10.00 1-Jul, $12.04 1-Mar, $11.57 1-Apr, $11.01 $8.00 $6.00 $4.00 $2.00 $0.00 1-Mar 1-Apr 1-May 1-Jun 1-Jul 1-Aug 1-Sep 1-Oct 1-Nov 1-Dec

Source: United Nations International Trade Statistics Database (UN Comtrade)

4.2 Graph Creation

The preliminary graphs based on data in March and December are showed in Figure 2 and Figure 3. To be simplified and readable, the figure does not show the trade value between each pair of nodes. It presents the U.S. and all its import partners in the two months. The central node is the U.S. and all nodes connected with it are import partners of the US. There are over 100 import partners of U.S. both in March and December, which means U.S. has a large trading network with most countries in the world. This is a 19 directed graph, so all edges are with directions from export country to import country to indicate the trade flows. More attributes could be added on both nodes and edges.

Figure 2: Graph of trade relation between U.S. and its import partners in March

20

Figure 3: Graph of trade relation between U.S. and its import partners in December

4.3 Graph Structure comparison

The two graphs have small differences in structure. First, the orders of the graphs which is the total number of vertices in the graph are compared. The order of the graph in March is 148 and of the graph in December is 155, showing a mild increase. The total number of 21 edges increased from 147 to 154, from March to December, which means the trade relation of the U.S. became slightly more complicated in December than in March. Then the node similarity is tested to specify the difference. Some nodes appear in December but not in March, which illustrates that they are new partners of U.S. compared to March.

This list includes 21 new countries such as Nepal, Aruba, and Tajikistan, showing in

Table 1. They might be added as new partners due to the tariff, but there are other possible reasons as well. Deep studies of their newly built trade relations need to be done.

The trade relations between these emerging partners and China are also worthwhile to study. If they import a large volume of commodities #85 from China and export to U.S., it is reasonable to suspect trade redirection. This paper further tests this part in 4.6. There are 14 countries also showing in the graph of March and not in the graph of December.

Countries in the list such as Libya could be influenced by other factors including unstable political conditions. The list is shown in Table 2.

22

Table 1: U.S. import Relations in December but not in March

United States of America Azerbaijan United States of America Bahamas United States of America Congo United States of America Dem.Rep. of the Congo United States of America Dominica United States of America Faeroe Isds United States of America Gambia United States of America Grenada United States of America Guinea United States of America Mozambique United States of America Nauru United States of America Nepal United States of America Aruba United States of America Sint Maarten (Dutch part) United States of America Marshall Isds United States of America Papua New Guinea United States of America Anguilla United States of America Sao Tome and Principe United States of America Tajikistan United States of America Tokelau United States of America United Rep. of Tanzania

Table 2: U.S. import Relations in March but not in December

United States of America Burundi United States of America Gibraltar United States of America Kiribati United States of America Kuwait United States of America Libya United States of America Rep. of Moldova United States of America Montenegro United States of America Montserrat United States of America Pitcairn United States of America Rwanda United States of America Saint Helena United States of America Saint Vincent and the Grenadines United States of America San Marino United States of America Uganda

23

4.4 Graph edit distance (GED)

Graph edit distance is applied based on different conditions and parameters. The function with the default parameter applied gained the minimum cost of 14.0. The condition has two parts. For each pair of nodes, the trade value in December is less than twice of the trade value in March, or the trade value in March is less than twice of it in December.

Both these two parts represent the difference is less than twice and the two nodes could be considered as equal in the algorithm. The results of GED based on these two parts are both small and less than 20, indicating that the trade relation from March to December did not experience significant changes. This paper further looks at the path of editing the graph to transform, which also shows that most edges stay stable and few editing and deleting operation are executed from graph of March to graph of December.

From the results above, the two graphs have some slight differences in nodes and edges, and some new partners along with trade relations emerged during this time. Some previous partners disappeared during this time and the reasons might be various. The overall differences are not significant from both the perspective of explorative analysis and GED under the condition set, which means for China and most partners of the U.S. their trade values of commodities 85 did not change much during this time.

24

4.5 China’s exports

This paper also compares the graphs of China’s exports built on China’s export data in

March and December. The graphs created are listed in Figure 4 and Figure 5.

Figure 4: Graph of trade relation between China and its export partners in December

25

Figure 5: Graph of trade relation between China and its export partners in December

For data structure, they have slight differences in graph order. Graph in March has order

103 and graph in December has order 97, which means the number of export partners decreased by 6. There are some new relations emerging in December but not appearing in

March, showing in Table 3. There are some relations existing in March but disappearing in December, showing in Table 4. 26

Table 3: China’s export Relations in December but not in March

China Comoros

Table 4: China’s export Relations in March but not in December

China Botswana China Dominican Rep. China Greenland China Luxembourg China Nigeria Saint Kitts and China Nevis TFYR of China Macedonia

To verify the assumption of trade redirection, the paper analyzes it in two ways based on

Table 1 and Table 3. Firstly, if new relations appear in both Table 2 (U.S. new import relations in December) and Table 3, it is reasonable to suspect that the new relationship for both China and the U.S. might be used for redirection. China exports to the emerging partners, and U.S. imports from them. There is only one emerging partner for China in

December: Comoros. The relation does not appear in Table 1, so it is not new relations for both countries. The paper further verifies US import data from Comoros from March to December, but unfortunately, the US did not have trade relations with Comoros in these two months.

Similarly, the paper verifies trade value between US emerging partners in December and

China. The trade value between U.S. emerging partners in December (Table 1) and China 27 is listed in Table 5. Among all U.S. emerging partners, four of them have trade relations with China. The trade value between China and Azerbaijan largely increased from

$17,599,107 in March to $59,887,772 in December. The large increase is an important indicator and therefore it is speculated that trade redirection could be the reason behind the increase. To further figure out the reasons behind the large increase, analysis of trade relations between China and Azerbaijan is required.

Table 5: China’s export value to the emerging import partners of U.S. in December

rtTitle Mar Dec Azerbaijan 17599107 59887772 Mozambique 6903625 7285149 Sao Tome and Principe 79568 18185 United Rep. of Tanzania 15081874 23451031

4.6 Combined graphs include U.S. import and China’s export

Finally, this paper combines U.S. import relations graph and China’s export relations graph together. These combined graphs in March and December are shown in Figure 6 and Figure 7.

28

Figure 6: Combined graphs with U.S. import and China’s export relations in March

The upper part of Figure 8 are countries only import from China but do not export to the

United States; The middle part includes countries connected with both U.S. and China, which illustrates that they import from China and also export to the U.S. for commodities under class 85. The lower part contains counties whonly export to the U.S. but do not import from China. 29

Figure 7: Combined graphs with U.S. import and China’s export relations in December

Most export partners of China are import partners of the United States in commodities

#85 trading. Only seventeen partners in March and fifteen partners in December are excluded from this. They are showed in Table 6. There are six countries originally to be only partners of China in March but to leave in December. Botswana and Greenland were 30 neither China’s nor US partners in December. Azerbaijan, Mozambique, Sao Tome and

Principe and United Rep. of Tanzania became US partners in December. Azerbaijan became U.S. new import partners and had a large amount of trade value shown in Table

6, compared to other three. The result in Table 5 shows China’s export to Azerbaijan, an emerging import partner of the US, largely increased from March to December. The combined graphs comparison further verifies this conclusion and speculate Azerbaijan as a potential trade redirection country.

Table 6: Countries that are China’s export partners but not US import partners

Mar Dec US imports in Dec Angola Angola Azerbaijan 217869 Botswana EU-28 EU-28 Benin Benin State of Palestine State of Palestine Greenland Guyana Guyana Kyrgyzstan Kyrgyzstan Madagascar Madagascar Mozambique 9703 Sao Tome and Principe 6964 Zimbabwe Zimbabwe United Rep. of 5925 Tanzania Samoa Samoa Zambia Zambia Comoros Rep. of Moldova Montenegro Uganda

31

Almost half of U.S. import partners are not China’s export partners. 62 countries are only

US import partners in March and 75 countries are only US import partners in December.

Countries that were in the list of only US partners in Mar and leaved this list in December are shown in Table 7. They also did not have trade relations with China in December, which means they leaved the relations with both the US and China. They are not potential trade redirection countries.

Table 7: Countries which are in the list of only US partners in Mar and leave this list in

December

country Burundi Gibraltar Kiribati Kuwait Libya Montserrat Pitcairn Rwanda Saint Helena Saint Vincent and the Grenadines San Marino

32

5 Conclusion

5.1 Summary

From the US import graphs, China’s export graphs and combined graphs, some changes and findings could be detected for the trade networks of the US and China in commodities under class 85. Overall, the trade value of commodities under class 85 between the US and China was not heavily affected by tariffs. From the graph structure and GED method, US import graphs do not experience a large change from March to

December, but there are some old partners disappearing and new partners emerging during this time. Further interesting results are found after building China’s export graphs and combined graphs. Four US emerging import partners strengthened their partnership with China by importing more commodities under class 85. Azerbaijan largely increased the number of imports by more than 40,000. The paper further finds that Azerbaijan which was the only import partner of China in Mar became the export partner of the US in December and exported a large number of commodities to the US in December.

Azerbaijan is speculated as a potential trade redirection and trade transit station. The other three partners are also likely to be influenced by tariffs and therefore the changes are showed in graphs above.

33

5.2 Discussion

The research questions that this paper tries to answer mainly include several parts as stated in 1.2. The first part is about the trade relations between the U.S. and China during the tariffs and the result is shown in 4.1. The second part is how this influences their import or export partners. The finding demonstrates that some partners disappear and some partners appear but the reasons behind the changes are still unclear. The last part is to identify redirection which is meaningful in international trade analysis. The paper has analyzed some potential redirection to emerging partners but further verification is required from an international economics perspective.

This paper is a preliminary exploration of the application of graph analytics on international trade studies. Graphs built based on international trade data are well manipulated in networkx tools with appropriate visualization. The basic graph structure analytics in networkx could be easily applied to this project to explore the graph. The

GED method could also be applied but the running time is a little bit long, which took at around 30 minutes to 60 minutes to run the GED method once. For further showing the paths of calculation and all costs during the calculation of GED, the running time is much longer. This might lead to problems and running errors when applying to a larger graph, such as the graph including not only trade relations with the U.S. but also relations between these partners. From basic graph structure comparison to distance algorithms, the graph analytics methods are practical and fast to retrieve important features of international trade networks to do the comparison. Moreover, the graph provides better visualization than traditional data storage format and could be adjusted by any operation 34 in graph analytics. With more partner relationships added to the graph, more complicated algorithms could be applied such as and community detection to further search and retrieve the graph information. It is a promising methodology to be applied in trading network analysis and needs more studies on it.

5.3 Limitation

There are certain limitations to this paper. The first limitation is limited data extractions.

Comtrade API has a certain limitation on data extraction, so it is hard to get all 311 countries’ trade relation data as expected. The connection breaks when a large amount of data is extracted. The extraction limitation also slower the process because only a small piece of the data could be extracted each time. Besides, the data extracted did not contain the trade relations between partners, which leads to a lack of complexity of the graph and a lack of more comprehensive analysis, such as centrality and community detections algorithm. The data extracted only has trade value as the attribute added to trade relations. Attributes such as gross weight and quantities of all imports are missing in the data extracted from API. More attributes on edges, the trade relations, will also be helpful to better measure the GED and understand the changes between graphs. Another significant limitation is the selection of the month might be biased. The paper only compares data in March and December due to data limitation but all months during the tariff policies could be influenced differently. To show a comprehensive comparison and changes in graphs before and after tariff, more monthly data could be included.

35

The second limitation is the weak connection between the graph changes and the impact of the tariff. The graph analytics could certainly identify changes in global trading networks but could not associate it with tariff policies. Other factors and issues might also influence the global trading networks and have not been eliminated from the graph.

Traditionally economic research uses controlled variables in regression to eliminate the effects of other factors that are not suitable to be applied to graph analytics. Controlling the variables might be a vital issue in graph analytics used to identify changes.

5.4 Future Work

Further studies could focus on several directions. From the dataset perspective, this paper only extracted data with commodities under class 85, but USTR documented full 6-digits classification on taxed commodities. Extracting data based on more detailed digits will lead to more accurate analysis. Besides, if extracting more countries, attributes and trade relations are practical, more complex graphs could be built and more traditional graph analytics algorithms could be applied, including centrality and community detection.

From the economics perspective, verifying results from economics theory is needed in this topic. Further studies could also utilize data in other months during tariffs and follow similar methods in this paper. From the methodology perspective, if the graph is relatively large and comprehensive, other graph tools could be involved such as Spark and Javascript for visualization. Finally, regarding the redirection research questions, this paper focuses more on potential redirection to emerging partners of the U.S. and China, but the existing partners of both U.S. and China might also experience changes and become potential redirection transit stations. 36

References

Abu-Aisheh, Z., Raveaux, R., Ramel, J.-Y., & Martineau, P. (2015). An Exact Graph Edit

Distance Algorithm for Solving Pattern Recognition Problems: Proceedings of the

International Conference on Pattern Recognition Applications and Methods, 271–

278. https://doi.org/10.5220/0005209202710278

Amiti, M., Redding, S. J., & Weinstein, D. E. (2019). The Impact of the 2018 Tariffs on

Prices and Welfare. Journal of Economic Perspectives, 33(4), 187–210.

https://doi.org/10.1257/jep.33.4.187

Andres B. Schwarzenberg. Section 301 of the Trade Act of 1974. , .

Bang-Jensen, J., & Gutin, G. Z. (2008). Digraphs: Theory, Algorithms and Applications.

Springer.

Bieler, A., Hilary, J., & Lindberg, I. (2014). Trade Unions, ‘Free Trade’, and the Problem

of Transnational Solidarity: An Introduction. Globalizations, 11(1), 1–9.

https://doi.org/10.1080/14747731.2014.860319

Board of Governors of the Federal Reserve System (U.S.), Board of Governors of the

Federal Reserve System (U.S.), Reyes-Heroles, R., New York University,

Traiberman, S., Board of Governors of the Federal Reserve System (U.S.), & Van

Leemput, E. (2020). Emerging Markets and the New Geography of Trade: The

Effects of Rising Trade Barriers. International Finance Discussion Paper,

2020(1278). https://doi.org/10.17016/IFDP.2020.127 37

Board of Governors of the Federal Reserve System (U.S.), Flaaen, A., Board of

Governors of the Federal Reserve System (U.S.), & Pierce, J. (2019).

Disentangling the Effects of the 2018-2019 Tariffs on a Globally Connected U.S.

Manufacturing Sector. Finance and Economics Discussion Series, 2019(086).

https://doi.org/10.17016/FEDS.2019.086

Caldara, D., Iacoviello, M., Molligo, P., Prestipino, A., & Raffo, A. (2020). The

economic effects of trade policy uncertainty. Journal of Monetary Economics,

109, 38–59. https://doi.org/10.1016/j.jmoneco.2019.11.002

Caruso, R. (2003). The Impact of International Economic Sanctions on Trade: An

Empirical Analysis. Peace Economics, Peace Science and Public Policy, 9(2).

https://doi.org/10.2202/1554-8597.1061

Carvalho, M., Azevedo, A., & Massuquetti, A. (2019). Emerging Countries and the

Effects of the Trade War between US and China. Economies, 7(2), 45.

https://doi.org/10.3390/economies7020045

Cavallo, A., Gopinath, G., Neiman, B., & Tang, J. (2019). Tariff Passthrough at the

Border and at the Store: Evidence from US Trade Policy (Working Paper No.

26396; Working Paper Series). National Bureau of Economic Research.

https://doi.org/10.3386/w26396

Chartrand, G. (1977). Introductory Graph Theory. Courier Corporation.

Dardis, R., & Cooke, K. (1984). The impact of trade restrictions on U.S. apparel

consumers. Journal of Consumer Policy, 7(1), 1–12.

https://doi.org/10.1007/BF00380287 38

Fajgelbaum, P. D., Goldberg, P. K., Kennedy, P. J., & Khandelwal, A. K. (2020). The

Return to Protectionism. The Quarterly Journal of Economics, 135(1), 1–55.

https://doi.org/10.1093/qje/qjz036

Flaaen, A. B., Hortaçsu, A., & Tintelnot, F. (2019). The Production Relocation and Price

Effects of U.S. Trade Policy: The Case of Washing Machines (Working Paper No.

25767; Working Paper Series). National Bureau of Economic Research.

https://doi.org/10.3386/w25767

Fritz, D. O., Christen, D. E., Sinabell, D. F., & Hinz, D. J. (n.d.). Russia’s and the EU’s

sanctions: Economic and trade effects, compliance and the way forward. 57.

Hagberg, A. A., Schult, D. A., & Swart, P. J. (2008). Exploring Network Structure,

Dynamics, and Function using NetworkX. 5.

Hayakawa, K. (2014). Bilateral tariff rates in international trade: Finished goods versus

intermediate goods. International Economics and Economic Policy, 11(3), 353–

370. https://doi.org/10.1007/s10368-013-0255-6

Huang, Y., Lin, C., Liu, S., & Tang, H. (2019). Trade Networks and Firm Value:

Evidence from the US-China Trade War (SSRN Scholarly Paper ID 3504602).

Social Science Research Network. https://papers.ssrn.com/abstract=3504602

Kepner, J. V., & Gilbert, J. R. (2011). Graph algorithms in the language of linear

algebra. Society for Industrial and Applied Mathematics.

Li, C., He, C., & Lin, C. (2018). Economic Impacts of the Possible China–US Trade War.

Emerging Markets Finance and Trade, 54(7), 1557–1577.

https://doi.org/10.1080/1540496X.2018.1446131 39

Liefert, W. M., Liefert, O., Seeley, R., & Lee, T. (2019). The effect of Russia’s economic

crisis and import ban on its agricultural and food sector. Journal of Eurasian

Studies, 10(2), 119–135. https://doi.org/10.1177/1879366519840185

Morrison, W. M. (n.d.). China-U.S. Trade Issues. 91.

Narayanan, B., & Sharma, S. K. (2016). An Analysis of Tariff Reductions in the Trans-

Pacific Partnership (TPP): Implications for the Indian Economy. Margin: The

Journal of Applied Economic Research, 10(1), 1–34.

https://doi.org/10.1177/0973801015617264

Notice of Action and Request for Public Comment Concerning Proposed Determination

of Action Pursuant to Section 301: China’s Acts, Policies, and Practices Related

to Technology Transfer, Intellectual Property, and Innovation, 83 Fed. Reg.

28710 (June 20, 2018)

Pencea, S. (2019). The Looming USA-China Trade War and Its Consequences. Global

Economic Observer, 1. https://ideas.repec.org/a/ntu/ntugeo/vol7-iss1-283.html

Poole, W. (2004). Free Trade: Why Are Economists and Noneconomists So Far Apart?

Review, 86(5). https://doi.org/10.20955/r.86.1-6

Rep. United States Trade Representative. (2019) Report to Congress On China’s WTO

Compliance (2019).

Wang, H., Lu, Y., Shutters, S. T., Steptoe, M., Wang, F., Landis, S., & Maciejewski, R.

(2019). A Visual Analytics Framework for Spatiotemporal Trade Network

Analysis. IEEE Transactions on Visualization and Computer Graphics, 25(1),

331–341. https://doi.org/10.1109/TVCG.2018.2864844 40

Waugh, M. E. (2019). The Consumption Response to Trade Shocks: Evidence from the

US-China Trade War (Working Paper No. 26353; Working Paper Series).

National Bureau of Economic Research. https://doi.org/10.3386/w26353

Yu, M. (2019). The Status of China’s Market Economy and Structural Reforms: The

Issues Behind the U.S.–China Trade War. Asian Economic Papers, 18(3), 34–51.

https://doi.org/10.1162/asep_a_00714

Zhu, Z., Cerina, F., Chessa, A., Caldarelli, G., & Riccaboni, M. (2014). The Rise of

China in the International Trade Network: A Community Core Detection

Approach. PLoS ONE, 9(8), e105496.

https://doi.org/10.1371/journal.pone.0105496

41

Appendix

Code for extracting the data from Comtrade:

#connect to Comtrade API library(rjson) string <- "http://comtrade.un.org/data/cache/partnerAreas.json" reporters <- fromJSON(file=string) reporters <- as.data.frame(t(sapply(reporters$results,rbind)))

get.Comtrade <- function(url="http://comtrade.un.org/api/get?"

,maxrec=50000

,type="C"

,freq="A"

,px="HS"

,ps="now"

,r

,p

,rg="all"

,cc="AG2"

,fmt="json"

) 42

{

string<- paste(url

,"max=",maxrec,"&" #maximum no. of records returned

,"type=",type,"&" #type of trade (c=commodities)

,"freq=",freq,"&" #frequency

,"px=",px,"&" #classification

,"ps=",ps,"&" #time period

,"r=",r,"&" #reporting area

,"p=",p,"&" #partner country

,"rg=",rg,"&" #trade flow

,"cc=",cc,"&" #classification code

,"fmt=",fmt #Format

,sep = ""

)

if(fmt == "csv") {

raw.data<- read.csv(string,header=TRUE)

return(list(validation=NULL, data=raw.data))

} else {

if(fmt == "json" ) {

raw.data<- fromJSON(file=string)

data<- raw.data$dataset

validation<- unlist(raw.data$validation, recursive=TRUE) 43

ndata<- NULL

if(length(data)> 0) {

var.names<- names(data[[1]])

data<- as.data.frame(t( sapply(data,rbind)))

ndata<- NULL

for(i in 1:ncol(data)){

data[sapply(data[,i],is.null),i]<- NA

ndata<- cbind(ndata, unlist(data[,i]))

}

ndata<- as.data.frame(ndata)

colnames(ndata)<- var.names

}

return(list(validation=validation,data =ndata))

}

}

}

#test library("rjson") s1 <- get.Comtrade(r="156", p=0, ps="201803", px="HS",freq="M")

#read countrycode countrycode=read.csv("D:/CaiMasterPaper/countrycode.csv")

44

#countrycode split due to the data extraction limitation code1=countrycode[1:30,1] code2=countrycode[31:60,1] code3=countrycode[61:90,1] code4=countrycode[91:105,1] code42=countrycode[106:110,1] code43=countrycode[111:120,1] code5=countrycode[121:135,1] code52=countrycode[136:150,1] code6=countrycode[151:165,1] code62=countrycode[166:180,1] code7=countrycode[181:190,1] code72=countrycode[191:205,1] code8=countrycode[206:215,1] code82=countrycode[221:240,1] code9=countrycode[241:270,1] code10=countrycode[271:285,1] code102=countrycode[285:300,1] code11=countrycode[301:305,1] code112=countrycode[306:311,1]

#loop to extract the data 45

#create the function

#repeat the loop on each split subset above partnercode <- code1 extract<-function(pcode){

listofusa<-list() #create the list to store all list

for(i in 1:length(pcode)){

usa <- get.Comtrade(r=pcode[i], p=156, ps="201812",freq="M")

listofusa[[i]]<- usa

}

return(listofusa)

} cn_mylist=extract(pcode=partnercode)

cn_mylist12_1=cn_mylist

#function of extract comcode==85

#repeat the loop on each split subset above code85<-function(mylist){

newdf=data.frame()

for(i in 1:length(mylist)){

countryi=mylist[[i]][["data"]]

newdf=rbind(newdf,countryi[countryi$cmdCode==85,])

} 46

return(newdf)

}

uslist=code85(mylist=cn_mylist12_1)

uslist3_1=uslist

#rbind all dataframe together

cnlist03=rbind(uslist3_1,uslist3_2,uslist3_3,uslist3_4,uslist3_42,uslist3_43,uslist3_5,usli st3_52,uslist3_6,uslist3_62,uslist3_7,uslist3_72, uslist3_8,uslist3_82,uslist3_9,uslist3_10,uslist3_102,uslist3_11,uslist3_112)

#write out df write.csv(cnlist03,file="cnlist12.csv")

Code for graph analytics (US imports as the example): import numpy as np import pandas as pd import networkx as nx import matplotlib.pyplot as plt from matplotlib.pyplot import figure uslist3=pd.read_csv("uslist_3.csv") 47 uslist12=pd.read_csv("uslist_12.csv") us_m3_I=uslist3[uslist3['rgDesc']=="Imports"] us_m12_I=uslist12[uslist12['rgDesc']=="Imports"] us_m3_I=us_m3_I.drop([1]) us_m12_I=us_m12_I.drop([0])

G3=nx.DiGraph()

G12=nx.DiGraph()

G3=nx.from_pandas_edgelist(us_m3_I,"ptTitle","rtTitle",["TradeValue"])

G12=nx.from_pandas_edgelist(us_m12_I,"ptTitle","rtTitle",["TradeValue"]) figure(figsize=(12,12)) pos=nx.spring_layout(G3) nx.draw(G3,pos,with_labels=True,node_color='lightblue',node_size=800) plt.show() figure(figsize=(15,15)) pos=nx.spring_layout(G12) nx.draw(G12,pos,with_labels=True,node_color='lightblue',node_size=800) plt.show() for v in nx.optimize_graph_edit_distance(G3, G12):

minv=v minv path=[] for v in nx.optimize_edit_paths(G3, G12,node_match=True,edge_much=True):

path.append(v) 48

for dist in nx.optimize_graph_edit_distance(G3, G12,edge_match=lambda a,b: a['TradeValue']*2>=b['TradeValue']):

print(dist) for dist in nx.optimize_graph_edit_distance(G3, G12,edge_match=lambda a,b: a['TradeValue']<=b['TradeValue']*2):

print(dist)

Code for combined graphs analytics: cnlist03=pd.read_csv("cnlist03.csv") cnlist12=pd.read_csv("cnlist12.csv") uslist3=pd.read_csv("uslist_3.csv") uslist12=pd.read_csv("uslist_12.csv") us3=pd.read_csv("US3.csv") us12=pd.read_csv("US12.csv") cnlist03=cnlist03[cnlist03['rgDesc']=="Imports"] cnlist12=cnlist12[cnlist12['rgDesc']=="Imports"] us_m3_I=uslist3[uslist3['rgDesc']=="Imports"] us_m12_I=uslist12[uslist12['rgDesc']=="Imports"] final03=pd.concat([cnlist03,us_m3_I]) final12=pd.concat([cnlist12,us_m12_I])

G3=nx.Graph()

G12=nx.Graph()

G3=nx.from_pandas_edgelist(final03,"ptTitle","rtTitle",["TradeValue"]) 49

G12=nx.from_pandas_edgelist(final12,"ptTitle","rtTitle",["TradeValue"])

#find the partners only have trade relations with one of these two us_edge=[] for node in list(G3.edges('United States of America')):

us_edge.append(node[1]) cn_edge=[] for node in list(G3.edges('China')):

cn_edge.append(node[1])

t6=[]

for edge in us_edge:

if edge not in cn_edge:

t6.append(edge) #countries only have trade relations with China