Contractual Frictions and the Margins of Trade

A growing body of work has shown that the quality of national institutions that enforce written contracts plays an important role in shaping a country's comparative advantage. Using highly disaggregated bilateral and unique harmonized firm-level trade data across a large number of countries, this paper contributes to this literature by providing a comprehensive analysis of the mechanisms through which institutional frictions affect the pattern of aggregate trade flow, distinguishing the effects on the intensive and extensive margins. The analysis finds that contractual friction distorts countries' trade pattern beyond its effect on domestic production structure, by deterring the probability of exporting (the extensive margin) and export sales after entry (the intensive margin), particularly in industries that rely more heavily on relationship-specific inputs (more vulnerable to holdup problems). The analysis also finds that contractual frictions matter more for the intensive margin than the extensive margin of exporting. In addition, better contracting institutions increase the probability of survival of new export products in more contract-intensive industries. These results have important policy implications for developing countries that seek to boost export growth but many of which suffer from poor contracting institutions.


Policy Research Working Paper 8631
A growing body of work has shown that the quality of national institutions that enforce written contracts plays an important role in shaping a country's comparative advantage. Using highly disaggregated bilateral and unique harmonized firm-level trade data across a large number of countries, this paper contributes to this literature by providing a comprehensive analysis of the mechanisms through which institutional frictions affect the pattern of aggregate trade flow, distinguishing the effects on the intensive and extensive margins. The analysis finds that contractual friction distorts countries' trade pattern beyond its effect on domestic production structure, by deterring the probability of exporting (the extensive margin) and export sales after entry (the intensive margin), particularly in industries that rely more heavily on relationship-specific inputs (more vulnerable to holdup problems). The analysis also finds that contractual frictions matter more for the intensive margin than the extensive margin of exporting. In addition, better contracting institutions increase the probability of survival of new export products in more contract-intensive industries. These results have important policy implications for developing countries that seek to boost export growth but many of which suffer from poor contracting institutions. This paper is a product of the Development Research Group, Development Economics. It is part of a larger effort by the World Bank to provide open access to its research and make a contribution to development policy discussions around the world. Policy Research Working Papers are also posted on the Web at http://www.worldbank.org/research. The authors may be contacted at hmaemir@worldbank.org.

Introduction
Understanding the sources of comparative advantage lies at the heart of the international trade literature. While traditional theories have emphasized the role of technology and factor endowments, a growing body of work has focused on differences in institutional quality as a source of comparative advantage (Levchenko 2007, Nunn 2007). In particular, several studies have shown that countries with poor contracting institutions export relatively more in industries that are less susceptible to holdup problems, as measured by input concentration (Levchenko 2007) or contractual input intensity (Nunn 2007).
Although the effects of contracting institutions on trade patterns are now extensively studied, little is known about the exact mechanisms through which this effect operates. The present paper fills this gap by providing a comprehensive analysis of the mechanisms through which institutional frictions affect aggregate export flows. In particular, we decompose the effects of institutional quality on aggregate exports into the two standard margins of trade, namely the entry into exporting (extensive margin) and the volume of export after entry (intensive margin).
Evaluating the causal effect of institutions on trade is notoriously challenging because of endogeneity issues. Specifically, institutional quality may evolve in response to increased export activity. Furthermore, institutions both shape and are subject to other country characteristics that can independently boost export activity. Against this background, we identify the effect of institutions by exploiting crosscountry differences in institutional quality together with cross-industry variation in contract intensity.
In particular, we study how the interaction between country-specific measures of contract enforcement and sector-specific indicators of contract intensity affect the export pattern. We establish the causal effect by including a large set of fixed effects, and we control for the traditional sources of comparative advantage such as physical and human capital endowments and overall development in order to address potential omitted variable biases.
To isolate the effects of institutions on the intensive and extensive margins of trade, we follow a two-stage structural estimation procedure as in Helpman et al. (2008) and Manova (2013). In the first stage, we estimate the effect of institutional quality on the probability of exporting. Then, in the second stage, we estimate the effect of contracting institutions on the value of exports. To control for firm selection into exporting, the predicted probability of exporting from the first stage serves as an additional control in the second stage.
We provide evidence that contracting institutions matter for countries' export activity both at the intensive and extensive margins. We find that countries with better contractual institutions export more in products that are more contract-intensive, which is in line with Nunn (2007) who documents the same result with aggregate cross-sectional data. While Nunn (2007) focuses on the impact of institutions on the total value of exports, we document that the trade-specific effect of institution operates through both the extensive and the intensive margins of export. More specifically, we find that better contracting institutions increase export at the extensive margin (entry into export market, the number of product varieties exported and the number of export destinations) and at the intensive margin (volume of export after entry). Nonetheless, factor endowment, and especially human capital, still plays a quantitatively more important role than institutions in shaping comparative advantage.
In addition to disentangling the effect of institutions on the intensive and extensive margins of trade, we also test the closely related hypothesis that institutional quality affects export survival rates. We find that better institutions increase the survival rate of new export products in the more contract-intensive sectors.
Finally, for each of these relationships, we investigate disparities between regions at different levels of development and robustness of results to regional sub-samples. Developing countries benefit more than their developed counterparts along the intensive margin, and vice versa. The importance of institutions along both margins holds for both within and across region trade.
Our paper contributes to a recent but growing literature that focuses on the relative contributions of the intensive and extensive margins of trade in explaining the sources of comparative advantage. It is closely related to the contribution of Manova (2013) who studies the role of financial development in explaining comparative advantage and examines the relative importance of intensive and extensive components. While Manova assesses how the impact of financial development varies across sectors depending on the degree of financial dependence and asset tangibility, we depart from her analysis by taking interest in how institutional quality differentially affects different industries based on their institutional/contract-intensity.
In another related contribution, Kim et al. (2017) have disentangled the effect of institutions on trade into the intensive and extensive margins. Their focus, however, is on the institutional quality of the importing countries while our focus is on the effects of exporters' domestic institutions.
The rest of the paper is organized as follows. Section 2 reviews the literature on the link between institutions and the pattern of trade. Section 3 specifies the empirical models and describes the estimation techniques. Section 4 provides definitions of the variables used in the study and the sources of data. Section 5 contains the analysis and interpretation of results, and Section 6 concludes.

Related Literature
This paper is part of the growing body of empirical literature that explores the interactions between domestic institutions and international trade patterns. Nunn (2007) was one of the first to empirically demonstrate the importance of institutional quality as a source of comparative advantage. The author has shown that countries with better contracting institutions export relatively more in industries that are more vulnerable to holdup problems between producers and input suppliers, as measured by the share of inputs that are not sold on open markets. He emphasizes that products whose production relies heavily on inputs that are not sold on open markets are more exposed to the 'hold-up' problem. That is, the input supplier has the (potential) ability to halt (or threaten to do so) its supply at any point in time, which makes the producer of the final product vulnerable. There could also be other situations in which the input supplier is the vulnerable party. What matters is that the input has less value outside the relationship between the two parties than inside. As rational agents, the two parties need to enter into a contract in advance. For these two parties to engage in optimal levels of investment, there should be a reliable mechanism to enforce the contract they enter into. In other words, "when investments are relationship-specific, under-investment occurs if contracts cannot be enforced" and since "countries with better contract enforcement have less under-investment, they will have a cost advantage in the production of goods requiring relationship-specific investments" (Nunn 2007, p. 569). Levchenko (2007) developed an alternative measure of the extent to which holdup problems between producers and input suppliers affect the trade pattern. Levchenko (2007) argues that industries that rely heavily on a larger number of input suppliers are more vulnerable to holdup problems and are hence more sensitive to imperfect institutions. A substantial body of literature that followed these seminal papers confirms the role of institutions in explaining international trade patterns (see Nunn & Trefler (2014) for detailed review of the empirical literature).
Notwithstanding the growing body of evidence documenting the role of contracting institutions as a source of comparative advantage, our understanding of the underlying mechanisms is still rather limited. There are many potential ways that domestic institutions could affect trade patterns. For example, weak contract enforcement may simply affect firms' decision to enter into foreign markets by increasing the cost of relationship-specific intermediate inputs -increasing the threshold of exporting (extensive margin). In addition to restricting export entry, weak contract enforcement can also distort the level of firm exports as firms need efficient and cheap supply of intermediate inputs to expand their export sales (intensive margin). Such institutional deficiencies could also affect the survival of firms in foreign markets since new exporting firms could later discover that the cost of contract enforcement makes an important component of profitability calculations, as a result of which some of them may have to exit sooner than one would expect.
To understand the operating forces and underlying mechanisms, one needs a micro-founded theoretical framework and cross-country firm-level data. Manova (2013) developed a heterogeneous-firm model by building upon Melitz (2003) to explore the mechanisms through which credit constraints affect international trade patterns. She finds that credit constraints substantially reduce exports both at the extensive margin and at the intensive margin. Our study follows closely the work of Manova (2013) but differs at least in two main respects. First, while the author focuses on financial frictions, we take interest in how limited contract enforcement affects different industries based on their contract-intensity.
Second, we explore the trade effect by utilizing unique harmonized firm-level data that are ideally suited to studying these operating forces and mechanisms. Thus, this paper improves the understanding of the relationship between domestic institutions and the trade pattern at the firm level.
In another related contribution, Kim et al. (2017) have disentangled the effect of institutions on trade into the intensive and extensive margins. Kim et al. (2017, p. 4) assert that "The decision to trade at all is political ... [whereas the] decision of how much to trade, if one trades at all, is economic." Their estimates also show that the influence of (political) institutions on trade is stronger and more robust along the extensive margin than the intensive margin. However, while they focus on the quality of institutions in the partner countries, our focus is on the effects of exporters' domestic institutions.
Our paper is also related to the nascent literature that explores the effects of institutions on trade patterns and dynamics using firm-level data. Ma et al. (2010), using data from 28 countries taken from the World Bank's Enterprise Surveys, show that firms located in areas with better institutional quality export goods that are more contract intensive. Araujo et al. (2016) develop a model of trade with imperfect contract enforcement to study how the dynamics of exporting firms depends on the strength of the contracting institutions of the destination countries. Using panel data of Belgian firms, they find that producers selling to countries with good contracting institutions start their activities there with higher volumes. They also document that the quality of contracting institutions in the destination markets enhances exporter survival rate. A related paper by Aeberhardt et al. (2014), using firmlevel data from France, documents that better institutional quality improves the persistence of trade relationships for firms operating in industries with severe contracting problems. However, the existing firm-level studies have generally focused either on institutional differences within a single exporting country or across destination markets. We make use of the Exporter Dynamics Database, the first and the only database that provides detailed comparable information on the micro-structure of trade flows between countries across a large number of countries, to explore the effects of institutional differences across countries. This represents an advance with regard to the existing firm-level studies, which rely on a single exporting country.

Empirical Specification
In this section, we describe the empirical models and estimation procedures. In this regard, we closely follow Manova (2013). The basic model we use to estimate the effects of institutions on export is given by: where X jist is a measures of trade flow from country j to country i in sector/industry s in year t; Q jt is the institutional quality of country j in year t, and z s is the contract-intensity of industry s; α j , α i , α s and α t are the exporter, importer, industry and time fixed effects; α 0 is the constant term and ε jist is the idiosyncratic error term; and Z is a vector of additional control variables including traditional sources of comparative advantage (such as physical capital, human capital and natural resource endowments -K jt , H jt and NR jtalong with their interactions with the corresponding factor intensities -k s , h s and n s ) as well as those variables at the heart of the gravity equation (exporter GDP, importer GDP and the distance between them), and γ the vector of corresponding coefficients.
In the baseline specification where we are interested in measuring the total effect of institutional quality on trade, captured by ∂X jist ∂Q jt = β 0 +β 1 z s , the left-hand-side (LHS) variable X jist is the total value of exports. As we are particularly interested in the effect on the pattern of trade (and not in the volume effect) of institutional quality, our parameter of interest is β 1 . As our first testable hypothesis, we expect that β 1 > 0. That is, the effect of institutions on exports is increasing in the institutional-intensity of the industry. Put differently, improving institutions leads to a more than proportionate expansion of exports in the institution-intensive sectors -establishing institutions as a source of comparative advantage.
It should, however, be noted that estimating this model leads to dropping a large number of obser- where ρ jist is the probability of country j exporting product s (a product within industry s) to country i in year t, and X jist is the value of exports.
Proper identification of the intensive margin in Equation 1 requires that at least one element of the vector Z in Equation 2 is a variable that affects the decision to export but not the level/intensity of export (i.e., is a determinant of fixed costs but not variable costs of exporting). Following Helpman et al. (2008) and Manova (2013), we utilize three country characteristics for this purpose: number of days, number of legal procedures and the monetary cost of starting a business. If β 1 > 0 in Equation 2, then better institutions increase the probability of a country entering the export market of an institutionallyintensive product more favorably than they raise the probability of exporting an institutionally lessintensive product.
Regarding the estimation techniques, we proceed as follows. For the sake of comparison, we begin constitute a non-random sample of the population of all country pairs. As Manova (2013) shows this falls short of correcting for bias arising from firm-level selection into exporting. As a result, the one-step Heckman approach does not fully correct for selection-bias, and this is why we opted for the sequential procedure of estimating Equation 2, and then extracting some pieces of information from there, and finally estimating Equation 1. As per this procedure, theρ jist we get from Equation 2, is the source of two pieces of information we need in order to disentangle the extensive margin from the intensive.
We then consider other alternative definitions of, and therefore ways of disentangling, the extensive margin from the intensive. The first definition takes the number of varieties exported -also referred to as the scope of export -as an indicator of the extensive margin. Correspondingly, we take the (average) value of export per variety -the export deepening dimension -as the indicator of the intensive margin.
Accordingly, we re-estimate Equation 1 by replacing the LHS variable with E jist -the number of HS-6 product varieties within an ISIC-Rev.2 3-digit classification -andx jist -the average exports per variety -for estimating the influence of institutions on the extensive and intensive margins, respectively.
In a similar manner, we disaggregate the effect of institutions on total export into effects on the number of destinations and on the value of export per destination. Here, counting the number of destinations means that we have to collapse the importer dimension of the data. Substituting the number of destinations (D jst ) and average export per destination (x jst ) for X jist in Equation 1, in turn, and dropping the i sub-identifier across the board yields equations for the extensive and intensive margins, respectively.
After testing the basic hypothesis that β 1 > 0 in Equation 1, we carry on to examine if institutional quality is quantitatively more important than factor endowments in explaining comparative advantage by solving for the standardized beta coefficients, and comparing the coefficients of the interaction terms in the same equation. Parallel comparisons are also undertaken for each margin. Finally, by interacting the term z s Q jt in Equation 1 with OECD -a dummy variable that assumes a value of 1 for OECD members and 0 otherwise -we test if the influence of institutions on the pattern (and margins) of trade differs for countries at different levels of economic development.
As Besedeš & Prusa (2011) argue, the role of the extensive margin could unduly be overemphasized if one ignores the duration of export relationships, especially for developing countries. While we agree to the importance of the duration/survival aspect of export relationships, we conjecture that institutional quality has a positive impact on export/exporter survival rate. If there is a support for the claim that institutional quality positively affects export survival rates (and does more profoundly so for institutionintensive products) in addition to its positive effect on the extensive margin, it means that their fear is, at least partly, counterbalanced in a way. To test this claim, we re-estimate Equation 2 by redefining ρ jist to stand for survival rate, operationalized as the probability of exporting a positive value in two consecutive years, t-1 and t: i.e., ρ jist = P r(X jist > 0|X jist−1 > 0, ...).
It would be unfair to end the methodology section without mentioning an important methodological challenge. As has rightly been recognized, endogeneity is a major concern given that trade has the potential to influence institutional quality. Indeed, Levchenko (2013) provides evidence of causalitythough weak -running from exporting in institution-intensive sectors to improvements in institutional quality (see also Hochman et al. 2013). In spite of some differences, the instruments used to address endogeneity are generally weak/poor, and exclusion restrictions are debatable. Besides being weak instruments, variables such as legal origin and shared languages are time-invariant and could not serve that purpose in the current setting (they suit cross-sectional analysis). Although not a panacea by itself, the use of panel data -through enabling the exploitation of both temporal and spacial dimensionshas the potential to mitigate the problem. At the minimum, it addresses one source of endogeneity: unobserved heterogeneity (component of the error term potentially correlated with included regressors).
In this regard, by exploiting both between and within country variations using panel data, our study presents some potential improvement over earlier studies. 2 Moreover, if institutions explain comparative advantage, improvement in institutional quality of a country is expected to affect what this particular country exports. And, this is a stronger indication of the role of institutions than the difference between export items of a cross-section of countries at a given point in time. We have also tried our estimations with one-year or two-year lagged values of institutional quality, and the results are robust. As we are looking into the effect of institutions in general, and not a particular aspect of it which can be traced easily, the attempt to supplement the panel regression analysis with an event study -à la Manova (2008) -has not been successful.
Before we take these hypotheses to the data (Section 5), we devote some paragraphs to the description of data and their sources.

Data
This section presents the description of the variables and the main data sources used in the paper.
Trade Data Trade data are obtained from two sources: BACI database and the World Bank Exporter Dynamics Database (EDD). We obtain trade flows (in thousands of US dollars) at the 6-digit HS2007 level from the BACI database, constructed by CEPII based on the UN-Comtrade data (Gaulier & Zignago 2010). Since the data on an important component of our main independent variable (contractintensity of industries) are available only at ISIC Revision-2 3-digit level, conversions are needed. To this end, we used the World Integrated Trade Solution (WITS) product concordance table 3 to convert data from HS2007 to ISIC-Revision 2. This is used as the dependent variable in the base model.
Other models employ the number of product varieties -the count of HS2007 6-digit products within an Industry-specific Measures Data on the contract-intensity of industries are from Nunn (2007). His measure of institutional intensity has two definitions. Both definitions refer to the weighted average of the proportion of relationship-specific inputs used in the production of the product concerned, where the weights are the value of the input relative to the value of all inputs. The difference is that whereas the first definition counts only inputs that are neither sold on exchange nor reference priced as relationshipspecific, the second one additionally includes inputs that are reference priced. Each of these definitions has two estimates: liberal and conservative. We used the first definition because it displays more variation (in terms of both range and standard deviation) than the second. Also, the correlation between liberal and conservative estimates is stronger for the first definition than for the second (0.9799 versus 0.8951). Between the two estimates of this preferred definition, the conservative estimate is given preference over the liberal one as the former has more variation than the latter (standard deviation and range of 0.209 and 0.828 as compared to 0.206 and 0.801, respectively). Nonetheless, all the four statistics (from the two definitions, and the two estimates per definition) are positively and (statistically highly) significantly correlated with one another, and the main results are robust to the use of alternative definitions. Data on other factor intensities (i.e., capital, human capital and natural resource intensity) of the industries are from Manova (2013). Table A.2 provides the average factor-intensities of the 28 industries used in the analysis. Table A.1 reports summary statistics for these variables. Our main independent variable is the interaction between institutional quality (a country-specific measure) and contract-intensity (an industryspecific measure).

Results
We are interested in the effects of institutions on overall trade flows, and the mechanism through which it operates. In this section, we first examine the effect of institutions on main outcomes of interest (probability of exporting, trade volume, product scope, export destination, and export survival rate) using country and industry level characteristics (Subsection 5.1). We then investigate our main hypothesis using more disaggregated data which come from the firm-level database (Subsection 5.2).
Even though the estimations in both subsections are done using alternative techniques, we wind up the section by presenting further robustness checks in Subsection 5.3.

Results from Disaggregated Bilateral Trade Data
Production versus Trade-specific Effect Better contracting institutions may influence not only exports, but also domestic production. We start by highlighting the importance of distinguishing between two effects of institutions: (i) the effect on domestic production, and (ii) the trade-specific effect -i.e., the effect on export pattern over and above the effect on domestic production pattern.
One way to understand the difference between the two is to think of a policy action implemented with the intention of making contracts more secure. This would reduce total trading costs thereby making it easier for non-exporting firms to embark on exporting and for those already exporting to scale up their operation. In addition, this policy action would also influence the incentive of incumbent firms to restructure their production and of potential firms to be attracted (more) towards a particular sector.
While the latter will also ultimately affect the pattern of trade, it is the former effect that reflects the direct and immediate trade-specific effect of the policy reform.
As the OLS estimate in the first column of Table 1 shows, the coefficient of the interaction term Rule of Law × Institutional-Intensity, which captures the effect of institutions on the pattern of trade, is 0.231 and statistically highly significant. However, part of this effect could represent the effect of improved institutions on domestic production which could subsequently boost exports. Column   Across all the columns, the likelihood of a country exporting a contract intensive product increases with its level of institutional quality. Similarly, the probability that a country exports a product that is intensive in human capital rises with the country's human capital endowment. Natural resource endowment has also a favorable effect on the probability of exporting resource-intensive manufactures (although it loses statistical significance in some cases). That is, the likelihood of exporting natural resource intensive products rises as the natural resource endowment of countries rises. On the other hand, physical capital endowment does not favor the chance of exporting capital intensive products over the less intensive ones. However, multicollinearity is likely to be behind the unexpected sign of physical capital endowment (more on this below). Consistent with expectations, the economic size of the exporter (as measured by its GDP, lnGDPE ) has a robust positive effect on the probability of trading.
Importer's economic size (lnGDPI ) has the expected positive sign, but its statistical significance is not robust. Similarly, the distance between exporter and importer has a robust effect of hampering trade.   More importantly, the variable of interest -institutions -retains its sign and significance across all specifications, with little to no change in magnitude.
Trade Volume Next, we turn to the effects of institutions on the intensive margin of export. The results are in Columns 1-3 of Table 3. Column 1 provides estimates after correcting for the conventional selection-bias by incorporating information on the likelihood of exporting from the results in Table 2.
It specifically saves the Inverse-Mills-Ratio (Heckman's correction term) from Column 1 of Table 2 and includes it as an additional regressor. The coefficient estimate of the effect of institutions on comparative advantage is larger here than the corresponding OLS estimate (compare 0.683 in Column 1 of Table 3 to 0.433 in Column 6 of Table 1). This suggests that estimating the effect of institutions on the trade pattern using data from those country-pairs that are actually trading -and ignoring the zero-tradeundermines the true effect of institutions. That is, the role of institutions is more pronounced in the population than in the trading sample of countries.
In Columns 2 and 3, we subsequently correct for bias due to selection into exporting emanating from underlying firm-heterogeneity. We do so using two of the techniques proposed by Manova (2013). The techniques we chose are the ones that rely on minimal distributional assumptions. We proceed as follows.
Common to both approaches, we first save the probability of exporting from the Probit model (Column   1 of Table 2), and then winsorize the top 1 percent and the bottom 1 percent of the probabilities in order to reduce the influence of extreme values. 5 In accordance with the first approach, we generate the inverse cumulative standard normal distribution z from the winsorized predicted probabilities, and include its polynomials (i.e., z, z 2 and z 3 ) as additional regressors (Column 2). In Column 3, we follow the second approach of grouping the winsorized predicted probabilities of exporting into 50 bins and including a dummy variable regressor for each of the resulting 50 groups.
As the results indicate, in both cases, the coefficients of interest are larger than the corresponding estimates from the OLS technique but smaller than the estimate from the model which corrects for the conventional (Heckman) selection bias. Most of the criticism in the literature has targeted the bias which would arise from ignoring the fact that the set of trading countries is a non-random sample from the population of countries in the world. Nonetheless, the estimate for the effect of institutions on the intensive margin of trade would still be biased unless we take into account the distribution of firm productivity (which drives firm selection into exporting) and include these additional controls. The results in columns 2 and 3 of Table 3     0.520 * p < 0.1, * * p < 0.05, * * * p < 0.01. Each regression includes unreported constant term as well as coefficients for a full set of dummies for exporter-importer pair, sector and year. Standard errors are clustered by exporter-importer pairs for all regressions. Columns 1, 4 and 7 control for the conventional Heckman-type selection bias; the rest additionally correct for firm selection into exporting, using either the polynomials of z -i.e., z, z 2 and z 3 -(Columns 2, 5, 8) or a dummy variable for each of the 50 bins formed on the basis of the probability of exporting saved from the first column of the Probit regression in Table 2 (Columns 3, 6, 9).
As for the control variables, the interaction term involving human capital has the expected positive sign, suggesting that the human capital intensity of a country's export increases with the human capital endowment of the country. This influence is also statistically highly significant. Likewise, the market size of the destination (importing) country, exporter's economic size and number of domestic establishments have significant expected effects on total exports. The sign and/or significance of the interaction between physical capital endowment and capital intensity is not robust to different specifications. As mentioned in relation to the probability of exporting earlier, a likely cause of this shakiness is multicollinearity. This suspicion is supported by the fact that the sector with the highest capital intensity -petroleum refineries -is also the sector with the highest human capital intensity (see the discussion above). Besides, excluding human capital restores the expected sign for the coefficient of physical capital with high statistical significance, without affecting our main conclusion. Natural resource endowment interacted with resource intensity has an unexpected sign.
In sum, the effects of institutional quality on the total volume of export, the probability of exporting Product Scope We next examine the effects of contractual institutions on the product scope of countries' export. In other words, we assess the role of institutions using alternative variety-based definitions of the two margins. This could also be seen as a further disaggregation of what we already called the intensive margin into product scope and deepening sub-margins.
Even though a country might have already been exporting an ISIC 3-digit product (say, ISIC 311), the change in the volume of export (conditional on exporting) may come partly from genuine intensification in a familiar product but partly from exporting a new product that still falls under ISIC 311.
While this could theoretically be overcome by using a higher level of product disaggregation, the fact that institutional and factor intensities are available only at the 3-digit level means that we have to look for other solutions. Hence, we take two alternative ways of disaggregating the volume effect into the extensive (scope) and intensive (deepening) effects. In the first approach, the extensive and intensive margins are defined, respectively, as the number of HS-6 product varieties within each 3-digit ISIC product group and the average value of exports per product variety. Later in the section, we will use destination-based definitions of the two margins.
Columns 4-6 and 7-9 of Table 3 summarize, respectively, the results for the (variety-based) extensive and the intensive margins from alternative estimation techniques. As can be seen from these results, institutions explain comparative advantage along both margins. That is, the contribution of better institutions to the number of varieties exported as well as to the average value exported per variety rises with the level of contract intensity of the sector. Another important inference can be made from the results in Table 3. By construction, the coefficients in Columns 4 and 7 of Table 3 add up to the corresponding coefficient in Column 1 of the same table. 7 Similarly for the other columns (Column 5 + Column 8 = Column 2 and Column 6 + Column 9 = Column 3). Thus, one can assess the relative importance of the scope and depth dimensions in contributing to the overall role played by institutions (or any other factor) in explaining the pattern of trade. Accordingly, about 56 to 58 percent of the effect on the intensive margin comes from the scope effect (enhanced export per variety) and the remainder comes from increase in the number of varieties exported.
In a similar manner, human capital contributes more to the export of human capital intensive products (as compared to less human capital intensive ones) along both margins. On the other hand, physical capital appears to have contrasting effects on the two dimensions. That is, while countries with superior physical capital endowment are inclined to experiencing greater average export per variety than those less-endowed and this difference rises with the capital intensity of the products, they tend to export fewer and fewer varieties as the capital intensity of the sectors rises. However, the effect of physical capital on the (variety-based) intensive margin is statistically insignificant and non-robust.
Both the number of product varieties exported and the average export earnings (per variety) of a country rise with the exporter's and trading partner's market/economic size as well as with the number of domestic establishments. Except for the probability of exporting, natural resource endowment appears to have a robust negative effect on the export of resource-intensive products. Perhaps, discovering more natural resources comes with specializing in the export of the raw materials themselves, thereby compelling resource-rich countries to cut back on the production and export of resource-intensive manufacturing products, possibly after a temporary effort to enter the market followed by short-lived trade relationships.
Export Destination Next, we use destination-based definitions of the extensive and intensive margins of trade: number of export destinations for the former and average export per destination for the latter. Even though the occurrence of zero-trade is limited, unlike the case of exports to individual destinations, we still control for the potential selection bias since not every country exports every ISIC-product in every year. Table 4 presents the regression results of this exercise. The first column under each of the headings total export, average export per destination, number of destinations (1, 3 and 5) displays estimates from the technique which controls for Heckman-type selection-bias. Columns 2, 4 and 6 correct for both sources of selection bias discussed earlier. In agreement with the results so far, institutional quality has the expected positive and disproportionately favorable influence on the exports of contract intensive products. Hence, the influence of institutions on comparative advantage prevails regardless of changing the level of aggregation -taking export to the world in lieu of export to each destination.
Moreover, institutional quality has the expected sign in both the extensive and intensive margins. Again, the contribution along the intensive margin dominates that along the extensive margin (0.402/0.409 = 0.98). Not only does the intensive margin dominate over the extensive one in magnitude, it is also robustly statistically significant to alternative estimation techniques. This is partly in contrast 7 Export = (Export/V ariety) × V ariety. ⇒ ln(Export) = ln(Export per Variety) + ln(V ariety).  to Lee (2017) who finds the extensive margin to be the more robust channel of influence (statistical significance) despite the intensive margin having greater contribution (magnitude).

Institutions versus Factor Endowments
The results so far establish that institutional quality is an important source of comparative advantage, and that the influence operates through affecting both intensive and extensive margins. Next, we assess how this influence of institutional quality fares in comparison with factor endowments -the traditional sources of comparative advantage.
To be able to compare the relative importance of the two sources of comparative advantage (institutions and factor endowments), we need to look at the standardized beta coefficients. To this end, we rerun the models estimated earlier (in Tables 3 and 4). The results are summarized in Table 5. The estimates under each column are from the estimation technique that corrects for selection bias using the dummy variable approach.
capital outperforms institutional quality in terms of the number of destinations (Column 6). The findings in Columns 4 and 5 are consistent with the original claim by Nunn (2007). Hence, the level of aggregation (suppressing the importer dimension) appears to be the driver of Nunn's claim.
In sum, although institutional quality is a robust source of comparative advantage, the traditional source and particularly human capital appears to be of greater importance. This result is in direct contrast with the finding of Nunn (2007). Eliminating the importer dimension (through aggregation) produces results that are closer to Nunn's.

Heterogeneous Effect
To assess whether the effect of institutional quality on trade flow differs between developed and less developed countries, we interacted our variable of interest (Rule of Law x Inst-Int) with a developed country dummy (OECD) and re-estimated our models. The estimation results are summarized in Table 6.
In terms of the effect on total export conditional on exporting, the return to institutional quality improvement for OECD exporters is significantly lower than the return for the non-OECD counterparts.
countries comes from the intensive margin. Hence, not only do developing countries have a larger room for improvement than their present level of institutional quality entails, but they would also achieve for every step they take in that direction. As the results in Table 6 show, developing countries could similarly expect more favorable benefits from physical and human capital accumulation.
Export Dynamics As stated in earlier sections, the effects of institutions on the extensive margin of trade should be taken with a grain of salt, in the face of short-lived export relationships -poor survival rates. That is, the statistical significance of the effects of institutional reforms on the extensive margin may mean little for policy makers if foreign market entrants exit the market within a year or two. This view, however, takes survival rate as exogenous -something that does not change with the reform. We argue that survival rate itself responds to institutional quality improvements. The data support our argument. As shown in Table 7, export (product) survival rate itself improves with institutional quality, and the improvement rises with the degree of contract intensity of the product/industry. That is, with better institutions, countries could not only be able to start exporting contract-intensive products (to new markets) but would also be able to survive the competition in these newly discovered products or markets. Furthermore, this holds true for both developed and developing country samples.

Evidence from cross-country firm-level data
The results presented to this point have used disaggregated product-level data to study the trade effects of institutional quality. A potential drawback of the product-level data used so far is that they do not provide information on the actual number of exporting firms. More specifically, we have (for instance) used the number of 6-digit HS product groups traded within a 3-digit ISIC sector as a measure of the extensive margin of countries exports. This could potentially bias the relative contribution of the intensive and extensive margins since the mapping between products and firms is unlikely to be one-to-one.
In what follows, we re-examine our results using a more granular trade dataset -the World Bank's Exporter Dynamics Database (EDD). The advantage of EDD is that it provides information on the actual number of exporting firms as well as export sales per exporter, which allows us to capture the extensive and intensive margins of exports more precisely.
The results are reported in Table 8. Results show that poor institutions restrict firm entry into foreign market as well as constrain the scale of firms' sales in foreign markets. Despite the fact that our analysis relies on a relatively smaller set of countries, our results reaffirm our earlier findings. Focusing on the models that account for selection-bias (Model (2) in the second, fourth and sixth columns of the table), we see that institutions have a favorable differential effect on the export of contractive-intensive products. Moreover, the effect materializes through both the intensive and extensive margins. Consistent with the results from aggregate data, more of the influence comes about through the intensive margin.

Robustness Checks
In this subsection, we conduct a variety of sensitivity analyses to check the robustness of our main results. We employ an alternative definition of institutional quality, re-estimate the relationship in sub-samples (within OECD, within non-OECD, within region and across region trade), and reassess the basic hypothesis with Poisson regression.
Contract Enforcement As our first robustness check, we re-estimate the relationships assessed earlier using an alternative measure of institutional quality -contract enforcement. The results for the extended model (with regional dummy variable interactions) are presented in Table 9. As the coefficients of the interaction between a country's contract enforcement and the sectoral contract-intensity measure indicate, there is a robust positive effect of institutional quality on export intensity that rises with the contract-intensity of sectors (in non-OECD countries). The same is true for OECD members, even though the effect is relatively smaller in the OECD sample. This confirms the results in Table   6. Moreover, and again in line with the findings in Table 6, the relatively lower return to contract enforcement in OECD (compared to non-OECD) countries holds in terms of trade volume and export value per variety, but not in terms of the number of varieties exported. According to the latter measure, OECD members tend to do better than their non-OECD counterparts though the difference is not statistically significant.   effect. Error terms are clustered by exporter-importer pairs. Selection-bias is corrected using the Inverse Mills Ratio and polynomials of z in Columns 1, 3 and 5, and using the dummy variable approach in Columns 2, 4 and 6.
Alternative Sample One might wonder whether the results are being driven by broad differences between developing and developed countries or whether the importance of contract enforcement can also be seen within each country group. In order to check this, we re-run the regressions on restricted samples. More specifically, we re-run regressions for trade among the OECD countries (i.e., where both the exporter and the importer are OECD members) and similar (separate) regressions for trade among non-OECD countries. Columns 1 and 2 of Table 10 present the results for these within OECD and within non-OECD trade, respectively. In Column 3, we merge the two samples to estimate the effect for the whole within-group trade, be it within OECD or within non-OECD country groups. In other words, we exclude the between/across region trade, i.e., trade between an OECD member and a non-member.
We subsequently estimate the role institutions play in this latter form of trade -between OECD and non-OECD -in the last column. Table 10 shows the effect of institutions on both the probability of exporting (Panel A) and the volume of export conditional on exporting. The effect of institutions on the extensive margin (probability of exporting) is positive and highly significant for within non-OECD (Column 2), within region (Column 3) and across region (Column 4) trades. The effect on within OECD trade (Column 1) loses statistical significance though at the margin (the p-value is 0.108). Our results are robust with regard to the effect on the intensive margin as well (Panel B ). The within OECD, within non-OECD or overall within region trade patterns are positively influenced by the quality of contracting institutions, and the effect favors the contractually more intensive sectors.
The importance of institutions for the across region trade pattern is statistically insignificant albeit at the margin (with a p-value of 0.124). In general, the role of institutions is essential for both the trade within and the trade between regions at different levels of development.
Alternative Estimation Technique The first robustness check is to estimate the relationship between the quality of institutions and pattern of export using a different estimation technique. Arguing that the use of log(export) as the regressand results in biased estimators, Silva & Tenreyro (2006) suggest the use of Poisson regression with the level of export -instead of log(export) -as the LHS variable.
As the results in Table 11 show, our results are robust to the use of this alternative technique.

Conclusion
Although the effects of institutions on the trade pattern are now extensively studied, little is known about the exact mechanisms through which this effect operates. In this paper, we disentangle the influence of institutions on trade into two margins: the probability of exporting (extensive-margin) and the volume of export conditional on exporting (intensive-margin).
Our findings both complement and extend the existing empirical literature on institutions and trade flows. Using highly disaggregated product-level and firm-level trade data, we confirm that institutional quality does have a robust and significant effect on international trade patterns. Specifically, we find that countries with better institutional quality export products that are intensive in contracts while those with poor institutions specialize in institutionally less-intensive products. This finding is robust to the use of alternative measures of institutional quality as well as different estimation techniques.
Nonetheless, the role of institutional quality does not supersede that of factor endowments in general and that of human capital in particular.
Our findings also point to the mechanisms through which this effect operates. We find that contractual institutions have effects through both extensive and intensive margins. In particular, the effects of institutional quality on the probability of exporting (extensive) and the volume of export conditional on exporting (intensive) matter most for products for which contracting is relatively difficult. These results are robust to using alternative definitions of the extensive and intensive margins. We corroborate this finding using more granular export data based on firm-level aggregates. We also find that, regardless of the definitions of margins that are used, the effect of institutional quality on the intensive margin is greater (in magnitude) than that on the extensive margin. We also find that institutional quality enhances the chance of exporting countries to survive in the market, and particularly for more contract-intensive products.
Moreover, we have examined if the influence of institutional quality on trade differs between country groups. The return to better institutions is higher in developing countries than in their developed (OECD) counterparts. This holds true for the intensive margin (value exported conditional on exporting or value of export per variety). In terms of the probability of exporting in more contract-intensive products or the number of product varieties exported, OECD countries benefit more than non-OECD countries. This is in contrast to our expectation that the extensive margin is likely to be more important in developing than in developed countries. However, we have analyzed the effect of institutions on trade over and above the effect on domestic production, which is an important channel behind the hypothesis.
The effects of institutions on the trade pattern established for the full set of countries are also affirmed for within-region and across-region trade patterns. The quality of contracting institutions has a statistically significant differential (positive) effect on the export of contract intensive products.
This conclusion generally holds for both extensive and intensive margins and for within OECD, within non-OECD, within region as well as across region trade.
In a nutshell, institutional quality is a robust source of comparative advantage. Its effect on the pattern of trade materializes through both the intensive and extensive margins -the intensive margin being quantitatively more important than the extensive.