{'fraction_non_alphanumeric': 0.028329390215981073, 'fraction_numerical': 0.012836754941616424, 'mean_word_length': 5.242591710338257, 'pattern_counts': {'":': 0, '<': 19, '<?xml version=': 0, '>': 1, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Indirect and direct effects of the subprime crisis on the real sector: labor market migration

The bursting of the US housing bubble in the second half of 2008 triggered an almost unprecedented systemic crisis in the world economy. The financial collapse quickly overflowed into the real economy and caused, among other effects, a sharp fall in the flow of world trade. Using export data from Brazilian municipalities, we show that the subprime crisis had a more significant effect on production and employment in exporting cities than municipalities more devoted to the domestic economy. We find that the manufacturing and construction sectors of exporting cities were the most affected during the crisis. However, exporting municipalities with a substantial share of services activities were more resilient to the external crisis. This difference is significant and sheds light on the debate on the effects of the crisis on Brazilian regions and cities. Using a unique business management dataset that contains firm-to-firm controls, we also find spillovers in the labor market from exporting to domestic-oriented cities through job reallocation. Our results suggest that workers migrate from exporting municipalities to other non-exporting municipalities within the same firm economic group.


Introduction
International trade is influenced by several factors: multilateral agreements, protectionism, transportation costs, geopolitical conflicts, economic crises, among others. Financial breakdowns increase risk aversion, restrict international liquidity, and negatively impact the supply of external financing for trade in goods and services. Similarly, world crises harm global trade, which feeds the vicious cycle of economic contraction.
This paper analyzes the effects of the 2008-2009 US financial crisis on Brazilian municipalities' production, income, and financial conditions. We contribute to the literature in several dimensions. We first analyze whether the fall in the trade flow after the collapse of the subprime affected Brazilian exporting municipalities more than similar cities but otherwise more focused on the domestic market. We denominate this as the direct effect of the subprime crisis. This analysis is relevant for at least three aspects: (i) It allows a better understanding of the dynamics of economic activity in Brazilian cities following exogenous economic shocks; (ii) it helps to understand the capacity of municipalities to adapt to an adverse scenario; and (iii) it broadens the understanding of the degree of vulnerability of Brazilian cities to external instabilities.
We then analyze whether the subprime crisis effect dissipated on exporting municipalities or whether it had any (second-order) spillovers to domestic-oriented cities. We call this the indirect effect of the subprime crisis. We look at changes in the labor market using a unique business management dataset that contains firm-to-firm controls across different municipalities. 1 We compare domestic-oriented municipalities that controlled a larger quantity of firms located at exporting municipalities affected by the crisis vis-à-vis similar municipalities that had a fewer quantity. We find that the first experiences changes in the local labor market, suggesting a possible job reallocation of the same firm economic group across different municipalities. Such reallocation is less costly precisely because the existence of firm branches in both the origin and destination municipalities reduces contractual frictions when moving employees within these municipalities.
The subprime crisis gained global proportions following the bankruptcy of the investment bank Lehman Brother in the second half of 2008. 2 Stock markets plummeted, commodity prices fell substantially, and risk aversion measures reached record levels. Quickly, the wave of pessimism turned into a systemic crisis with repercussions on world production, employment, and the flow of trade. The liquidity pooling and the freezing of credit operations affected advanced and emerging economies, and global economic authorities made joint decisions to try to mitigate the adverse effects of the crisis. 3 1 In the dataset, we have information on the number of firms controlled in a specific municipality A by firms in another municipality B. The collection of all pairs A, B gives rise to a complex network of business management flows. 2 Subprime-rated customers were also known as NINJAS, an acronym for non-income, equity, and assetfree customers. 3 At the time, a possible detachment between the advanced and emerging economies was being discussed. This thesis gained notoriety from the 1990s when the per capita GDP of emerging economies grew at faster rates than advanced economies, which may have represented a change in global dynamics. However, this thesis was not confirmed, and there was a severe contraction of economies during this period.
Our work also has topical adherence to the COVID-19 crisis, as it was initially a negative foreign shock to Brazil, mostly from January to February 2020, affecting exports and imports. The COVID-19 global pandemic has profoundly affected the world economy. The public health measures of social isolation to contain the spread of the new virus had a devastating effect on the production, employment, and income of families and disrupted the global value chain's productive process. In Brazil, the interruption of production and the stoppage of non-essential services strongly affected economic activity. The COVID-19 resulted in a 9.7% retraction of the Brazilian GDP in the second quarter of 2020. Fortunately, the third quarter's economic indicators point to a recovery of the retail sales sectors' economy, but at a slow pace and below the precrisis productive level. Concerning the external sector, the pandemic crisis triggered changes in the Brazilian supply chains, such as a substantial reduction in imports due to domestic demand's shrinkage after March 2020. In contrast, the exchange rate's devaluation and the greater Chinese demand for food and essential items contributed to the excellent agribusiness sector export performance.
We observed more significant export variability in Brazil when compared to the world's performance during the crisis. During the 4Q2008 to the 1Q2009, the world gross domestic product (GDP) accumulated a fall of 10%. At the same time, Brazilian exports retreated 13. 3%. 4 This result can be attributed to several factors, such as: (i) more remarkable fall in exports due to the low economic growth of consumer markets and the greater world competition; (ii) lower demand for intermediate products, which led to a reduction in world imports; and (iii) a reduction in shipped quantity and commodity prices affected exporters' revenues, which were not offset by the devaluation of the Brazilian currency. From a regional perspective, the effect of falling exports on Brazilian municipalities did not occur uniformly. Firstly, more than 60% of Brazilian cities did not export in the period. Secondly, even in cities that exported part of their production, the degree of external dependence and crisis response/adaptation capacity was not uniform across regions. 5 More dynamic cities with a more complex economic structure could more easily adapt to this stressed period. 6 Overall, there was no change in the relative importance of Brazilian regions in terms of exports around the crisis: The South and Southeast regions were responsible for almost 70% of the total Brazilian exports in 2008 and 2009. In the same period, the Northern region had the largest fall in the number of exporting municipalities (−10.4%), while the Southern region was the most resilient, with only −0.5%.
Our results show that the subprime crisis harmed Brazilian municipalities with higher export vocation with greater intensity in terms of per capita GDP (direct effect). However, this effect was mitigated for exporting cities with a substantial share of services activities in their local economy before the crisis. Exporting municipalities with a significant share of services activities-besides having the traditional exporting activity of tradable goods-also specialize in non-tradable goods and, therefore, can be seen as municipalities with a complex and diversified local economic structure.
We also find that the overall job hirings in exporting municipality decreased following the onset of the subprime crisis relatively to similar non-exporting municipalities (direct effect). We also find that the manufacturing and construction sectors were the most negatively affected local economic sectors by the crisis. Such reduction was accompanied by an increase in the share of employment in the trade sector. The results persist for a window of two years after the shock. These findings suggest the deindustrialization of exporting municipalities due to the reduced foreign demand for goods after the crisis. In this case, municipalities had to adapt their local economic structure to reduce dependency on foreign demand. When we look at exporting municipalities with a higher share of services over GDP ratio, the deindustrialization, though still existent, is attenuated. Such finding is consistent because exporting municipalities that also had strong services activities could better replace their foreign customers/suppliers with domestic counterparts due to their more flexible economy.
We also document a tightening of the private sector's financial conditions in exporting municipalities relatively to those more reliant on domestic demand (direct effect). We show that total deposits and credit significantly decreased during the crisis, suggesting unemployed households withdrew available resources and reduced demand for credit. Also, we find that the employment time guarantee funds (FGTS-Fundo de Garantia de Tempo de Serviço) decreased, which could be explained by the increasing unemployment levels in exporting municipalities since the FGTS can only be withdrawn in specific circumstances, such as being fired.
We also find economically significant spillovers from exporting cities to nonexporting cities with many firms controlled in exporting municipalities (indirect effect). We find that the per capita hirings increased for non-exporting municipalities strongly linked to exporting municipalities relatively to those that were not. Interestingly, we find that the share of jobs in the manufacturing sector increased after the subprime crisis, while the trade sector decreased. The increase in the manufacturing sector is larger than the decrease in the trade sector in the first year following the crisis, suggesting an industrialization trend. This effect suggests a job reallocation of the same firm economic group across different firm branches in different locations. Precisely because exporting municipalities were in stressed situations with the sudden reduction in foreign demand, firms reallocated their workers to suit their needs. Such reallocation is less costly because it occurs within the same firm and is not subject to contractual fines.
We also document a series of robustness tests to further validate our results. Our first concern is that the treatment and control groups could be ex ante dissimilar concerning the analyzed outcomes. We perform parallel trends checks on every outcome of the model and show that we cannot reject the hypothesis of parallelity between the outcomes of the treatment and control groups before the crisis. Another concern that we address in our robustness test is the potential inconsistency of the municipality that produces the goods and the one that exports them. To address such concern, we remove municipalities that contain either a port or an airport and rerun our specifications. 7 Our results remain qualitatively robust to the exclusion of these cities.

Related literature
The literature relates two channels of transmission from economic crises to trade flows. On the one hand, economic downturns caused by financial crises reduce aggregate demand and restrict trade between countries. On the other hand, a financial collapse generates credit market paralysis and decreases foreign financing supply to domestic companies, especially for export-oriented activities. Our work connects with this literature, and we will innovate by proposing an analysis on the point of view of exports from Brazilian municipalities.
As far as we know, this article is a pioneer in assessing the impact of the subprime crisis on Brazilian cities and represents an analytical innovation in the face of the heterogeneity of the country's regions. During the most intense period of the crisis, international trade experienced a more substantial fall than the world's GDP. Levchenko et al. (2010) argue that the share of foreign trade retreated stronger than predicted by standard business cycle models. The sensitivity of world trade to the subprime crisis was five times stronger than the sensitivity of GDP to the same event (Blanchard et al. 2010;Behrens et al. 2013) elected falling demand for tradable goods as the primary driver of trade collapse for the Belgian economy. In Brazil's case, exports also retreated more sharply than the fall in GDP, and we had a change in both trading partners and the export agenda.
Still in terms of the effect of trade on economic activity, Behrens et al. (2013) estimated a dynamic panel model for 190 countries and found that events marked by intense financial stress may have a persistent negative effect on output. In addition, countries with low per capita income levels are twice as exposed to financial crises as higher-income countries. Pentecôte and Rondeau (2015) highlighted that the contagion effect of trade is positive in the presence of a demand shock. An important contribution of our paper is to broaden our understanding of changes in production and income at the regional level, following the outbreak of a financial crisis.
From the sector point of view, Ariu (2016) identified that exports of services by Belgian firms were more resilient to the 2008-2009 crisis than exports of goods and commodities. In the same direction, Borchert and Mattoo (2009) found that trade in services is more dynamic than the trade in products, as they are less cyclical and less dependent on external financing. Even though Brazil does not stand out in the global scenario as an exporter of technology and business services, we find that the Brazilian exporting municipalities with the largest share of services in GDP did not suffer the adverse effects of the international crisis like other cities. This may indicate that not only exportable services but also more domestic-oriented services are less cyclical and follow a different dynamic compared to commodity exports, such as commodities and durable goods.
Our paper also connects with credit shocks studies. Overall, a financial collapse widens risk aversion and reduces the supply of credit, notably for more outwardlooking activities (Amiti and Weinstein 2011;Chor and Manova 2012). Still on the subject, Bricongne et al. (2012) found that the effect of credit restriction depends on the company's size. As firms' exports also reflect supply conditions, these works are indirectly related to our paper. 8 In the most intense period of the crisis, for example, credit sources for Brazilian exports shrank and credit conditions (cost and maturity) worsened, reflecting the municipalities' export capacity. 9 Cortes et al. (2019) analyzed the effect of credit expansion via Brazilian public banks following the bankruptcy of Bank Lehman Brother in 2008 and identified some disadvantages of such interventions, such as the higher market concentration of companies benefiting from financing and efficient allocation problems. Coleman and Feler (2015) highlighted the role of public banks in sustaining economic activity. Bonomo et al. (2015) identified that this public credit was more directed to larger and older firms. These papers can help us explain how municipalities with a high share of GDP services quickly recovered after the crisis. The hypothesis is that the set of economic stimuli, such as credit from public banks, helped to rekindle aggregate demand by increasing household consumption.
The contagion effect and the extent of the crisis were also analyzed using the economy's degree of trade openness. Martin and Rey (2006) concluded that emerging countries more integrated with global trade are less susceptible to financial crises. In the more closed economies, the financial collapse is accompanied by declines in current transactions, income, and investments. However, this view is not unanimous. Some authors find an inverse relationship between the degree of economic openness and economic growth, especially in periods of severe economic crisis (Feldkircher 2014;Berkmen et al. 2012). This effect is even stronger the greater the share of manufactured goods in total exports. In a preliminary analysis, we see that this literature can help us analyze the effect of the crisis given the heterogeneity of Brazilian municipalities' degree of trade openness.
The propagation and amplification literature of shocks also plays an important role in our work. Most likely, in addition to the direct effect of the crisis on Brazilian municipalities' exports, we must consider the second-order effect on the economic sectors. Atalay (2017) finds that products from different industry sectors are complementary to each other and that sector shocks are a primary source of GDP fluctuation. Acemoglu et al. (2012) suggests that large aggregate fluctuations can originate in microeconomic shocks if there is an imbalance in the supply of inputs across sectors. Still on the subject, Boehm et al. (2019) studied the effect of the 2011 Japan earthquake (exogenous impact) on US subsidiaries of Japanese multinationals. The authors find a low substitution elasticity between domestic and imported supplies and concluded that the global supply chain is not fully flexible to accommodate cross-country transmission of shocks.

Data
We collect and match data on product, income, and exports of Brazilian municipalities from several Federal Government Agencies. Our sample has detailed 2006-2009 annual data at the municipal level. We work with two analysis windows: one for the most immediate period of the crisis (2007)(2008) and one for a more extended period (2006)(2007)(2008)(2009) to capture the short-and medium-term effects.
Also, we collect monthly financial statements from all bank branches in Brazil to give further empirical evidence of the financial effects of the crisis on Brazilian municipalities. Data come from the Estban (Estatística Bancária Mensal por Município), which is a dataset maintained by the Banco Central do Brasil. This dataset contains every bank branch's exact geographical location, enabling us to aggregate and construct municipality-specific financial indicators. In this paper, we use total private deposits, credit volume, and employment time guarantee funds (FGTS-Fundo de Garantia de Tempo de Serviço) to understand whether the crisis played any secondary role as expanding current account withdrawals and/or expanding FGTS redemptions to the case of dismissed employees. Throughout this section, we detail the origin of the indicators used and the data processing techniques.
The value-added information of gross domestic product (GDP), including its subsectors, comes from the Brazilian Institute of Geography and Statistics (IBGE). 10 The calculations and estimates follow the National Accounts System rules and allow consistency between regional and national results. We calculate the value-added of GDP at constant 2007 prices. In this paper, we use the per capita GDP as indicative of the degree of economic development of municipalities.
Another block of data concerns the hirings of formal employees. These workers are bound by the Labor Law Consolidation (CLT) regime and receive, on average, higher wages compared to workers without a formal contract. We obtain such information from the General Registry of Employees and the Unemployed at the Ministry of Labor (CAGED). We highlight that, for this case, there is information for all Brazilian municipalities disaggregated into at least 26 subsectors of the economy. In this paper, we aggregate these 26 subsectors into 5 subsectors: manufacturing, construction, trade, services, and farming.
Finally, data on municipal exports come from foreign trade statistics at the Ministry of Economy, Industry, and Foreign Trade and Services. 11 The database is fed with customs information and, before disclosure, undergoes a statistical processing analysis to ensure compliance with the methodological guidelines of the International Manual of Foreign Trade Statistics. 12 Data are disclosed in detail for each year at the municipal level, including FOB value exported and type of product traded based on a harmonized and standardized classification system of products. 13 One feature of exports documentation concerns the content of the declaration. The municipalities in the database represent the exporting company's tax domicile, which does not necessarily represent the goods' physical place. Such discrepancy becomes more frequent for large firms. While this information is important, we provide robustness results and show that such concern does not influence our conclusions.
As we can see in Table 1, there were, on average, 5564 municipalities between 2006 and 2009, with more than 50% located in only two regions: South (21.3%) and Southeast (30%). These regions are characterized by a higher Human Development Index (HDI), by having a larger number of employed persons as a total proportion of the population and being more economically dynamic. This greater strength can also be measured by per capita income and higher credit volumes.
When we look closely at these more prosperous regions, we identify something interesting. The value-added of services in the South and Southeast GDP is higher, despite having a smaller contingent of workers employed in this sector compared to other regions. This fact indicates that the services provided in these regions are more modern and complex, perhaps because they are more closely linked to the productive process of the industrial sector. 14 The North and Northeast regions had a larger contingent of workers in the service-related sectors. However, their value-added in GDP is lower compared to the more dynamic regions of the country. This discrepancy may have to do with the type of services, most likely associated with low value-added complementary activities.
Still concerning the labor market, the job share Herfindahl-Hirschman Index (HHI) points to a higher concentration of workers in a few sectors in the Northeast and North. This indicates that these places have low employment mobility alternatives, a fundamental point to cushion the effects of the external crisis on the local productive structure. The Midwest region, in turn, had the lowest degree of concentration of jobs (lowest job share HHI) among all regions analyzed. This is an indication of greater diversification of the economy in the center of the country, most likely associated with the advance of agribusiness, which has caused important changes in the local economic landscape of country towns. 15

Instrument to evaluate the direct effects of the subprime crisis
To instrument the level ex ante exposure to the subprime crisis of each municipality, we take its total exports share relative to the GDP in 2007 as a continuous treat- 13 The harmonized international classification system for goods established in 1998. 14 Here, we can cite financial intermediation services and engineering consultancy services, for example. New technologies have also induced firms to become more decentralized as demand for specialized outsourced services increases. 15 Agribusiness growth is usually accompanied by other complementary activities such as food industry, leather processing industry, and sugar and alcohol industry, for example.  (491) 199 (498) 171 (354) 442 (1717) 106 ( Figure 1a shows the distribution of exports/GDP of exporting municipalities in Brazil in 2007. We observe substantial differences in exposure levels across municipalities. This work explores such heterogeneity to identify the subprime crisis effect on Brazilian exporting municipalities' economic and financial outcomes. Figure 1b displays the average exports/GDP relative growth (reference is 2008) of municipalities in the lower (red) and higher (blue) median of the 2007 exports / GDP distribution. Municipalities strongly oriented to exports before the crisis (blue) experienced a more substantial fall in their exports relative to the local GDP than exporting municipalities that were more diversified (red), i.e., local economies serving the local and foreign demand as well. This evidence corroborates the identification of our shock: The demand shock originated from abroad, mostly from more developed countries that were affected by the subprime crisis, rather than a local demand shock. Figure 2 displays the geographical distribution of exports of Brazilian (a) municipalities and (b) states. There is a higher concentration of exporting municipalities in the South and Southeast. If we look further inland toward the Midwest, we can see that there are a large number of exporting municipalities in Mato Grosso, as a result of the expansion of agribusiness. From 2006 to 2009, the Midwest expanded grain production, especially soybean production. In the Northern region, we highlight some municipalities of Pará, for example, which have a high dependence on exports in mining and pulp activities.
On average, 33.8% of Brazilian municipalities exported goods between 2006 and 2009. Ten cities located in the most dynamic regions of the country concentrated about 24.2% of these transactions. 17 The main products in order of value exported were fuels, aircraft, and ores. Still during the sample period, 36% of the cumulative dollar export volume in the sample period was concentrated in only four countries, namely the USA, China, Argentina, and the Netherlands. Concerning the shorter sample window (2008-2009), exports from São Paulo (SP), São Jose dos Campos (SP), and São Bernardo do Campo (SP) retreated by more than 30%. Still about our most relevant municipalities, Parauapebas (PA) had no reduction in the volume traded in the most acute period of the crisis. This city exports iron ore and suggests that, even in the face of falling commodity prices in the international market, the export volume of this region has advanced, perhaps due to the increase in Chinese purchases. 18 In this period, not coincidentally, China became the largest Brazilian trading partner since 2009. In addition to Parauapebas (PA), three other municipalities exporting ore and oil commodities gained relevance. 19 Part of this performance is due to the Chinese Government's stimulus plan focusing on infrastructure to counteract the adverse effects of the global financial crisis. 20 Also, in the 2008-2009 biennium, we had a replacement in three of the Brazilian ten largest trading partners. 21 The UK, Belgium, and India gained importance, and the latter tripled the volume imported from Brazil in the period. Concerning our two largest trading partners, the USA reduced purchases by 43% and stopped trading with 62 Brazilian municipalities. On the other hand, China expanded its purchases from Brazil by 31% and expanded the number of trading partners in 31 cities. 18 During the 2008-2009 biennium, the total volume exported from Parauapebas (PA) to China increased by almost 130%. 19 Ouro Preto (MG), Itabira (MG), and Angra dos Reis (RJ). 20 It is noteworthy that there is a tendency to reduce the participation of manufactured goods in the export agenda after 2008, notably directed to advanced economies. Despite being a worldwide movement, the decline in exports of products with higher added value was more intense in Brazil than other economies. 21 Chile, Italy, and Russia.

Instrument to evaluate the indirect effects of the subprime crisis
The general idea here is to understand whether the crisis effect dissipated on the most exposed Brazilian municipalities-i.e., those that relied more on exports during this period-or if there was a spillover to other non-exporting municipalities. To analyze the indirect effect of the subprime crisis, we construct an instrument that measures the degree of inter-municipal dependency between a non-exporting municipality and an exporting municipality. When dealing with the indirect effects, we say that a municipality is non-exporter when the ratio of exports/GDP is in the lower median region.
We measure this spillover in terms of the degree of business management control between municipalities. The business management's strength from municipality A to B represents the number of firms that firms in A control in B. A large inter-municipal business management strength facilitates the reallocation of labor force across municipalities. For instance, if there is a negative shock in one municipality, firms can more easily reallocate employees from firm branches in that municipality to other locations due to lower contractual frictions. We collect such data from the Central Business Registry (Cempre), 22 which is maintained by the IBGE. Figure 3 portrays the network of inter-municipal business flows (number of municipality-to-municipality firm controls). Vertices represent Brazilian municipalities, and an edge linking A to B indicates the number of firms that municipality A controls from B. Vertex label sizes are proportional to the vertex degree in the network (number of neighbors). The larger is the vertex degree, the more it can potentially impact non-exporting municipalities in terms of facilitating inter-municipal withinfirm employee reallocations. We observe that the largest Brazilian centers have the highest potential for diffusing the subprime crisis to non-exporting municipalities, namely Brasília, Osasco, São Paulo, Rio de Janeiro, Fortaleza, Recife, Manaus, Porto Alegre, and Curitiba. 23 We construct a municipality-specific measure to exporting municipalities as follows: (1) in which i is any non-exporting municipality and j is an exporting municipality. The term w i j is the number of firms that municipality i controls in j, and N exports (i) is the set of exporting municipalities that i has nonzero business management control. The rationale is that the more municipality i controls firms in the affected exporting 22 Cempre constitutes a collection of datasets on the country's economic activity, gathering managerial and economic information from annual surveys in the areas of Industry, Construction, Trade, and Services, carried out by the IBGE, as well as from the Relationship Annual Social Information-RAIS, Ministry of Labor and Employment. 23 Though Osaco is not a capital in Brazil, it is located in the Greater São Paulo area. Data from Econodata suggest that there are more than 65,000 firms in Osasco (https://www.econodata.com.br/lista-empresasbrasil), giving a large potentiality of firm-to-firm control across different municipalities as suggested by the depicted network in Fig. 3.  Fig. 3 Network of business management flows. Vertices represent Brazilian municipalities, and an edge linking A to B indicates the number of firms that municipality A controls from B. Vertex labels convey the municipality's name followed by its state in parentheses. Vertex label sizes are proportional to the vertex degree in the network (number of neighbors). Vertex sizes are proportional to the municipality's 2007 annual GDP. Vertex colors denote the municipality's region: Southeast (purple), South (orange), Midwest (teal), North (red), Northeast (green). Edge colors are colored in an orange-to-red gradient proportionally to the number of firms that the origin municipality controls from the destination municipality. For the sake of readability, we only plot edges with weight larger than 1000. Singleton vertices are removed, and only the giant network component is depicted. (Color figure online) municipality j, the more it is indirectly exposed to the subprime crisis through the latter city. We sum over all exporting municipalities j to compose the aggregate municipality i's exposure to exporters. Figure 4 shows the geographical distribution of the "exposure to exports" variable (Equation (1)). Unlike the direct effect on exporting municipalities, the potential for indirect effects due to the crisis is much more diffused in quantitative terms. While there are 1870 exporting municipalities, 5179 municipalities have nonzero exposure to these exporting municipalities in terms of business management control. (The former controls at least one firm in the latter.) Most of the control comes from the Southeast region, the most developed in Brazil.

Econometric specification and results
This section reports our econometric specifications to understand the direct and indirect effects of the subprime crisis in Brazilian municipalities. We denominate as the direct effect the impact that Brazilian exporting municipalities experienced as a result of the decreased international demand arising from the global financial crisis. The indirect effect refers to the potential impact that non-exporting cities with economic links to exporting cities received.
We provide empirical evidence of the subprime crisis effects using a top-down approach. We first show that exporting municipalities' output (GDP) decreased. Then, we investigate through which channels this reduction took place. In this sense, we show that the labor market shrunk, became less specialized (deindustrialization), and more concentrated on low-skill jobs. Finally, we also show that the economic downturn also led to financial deterioration.

Direct effects
Following the Lehman Brother failure, we observed a substantial decrease in global economic activity. 24 Therefore, municipalities that relied more on international demand suffered more from the crisis than those municipalities with a domesticoriented economy (Dooley and Hutchison 2009;Spatareanu et al. 2018). We explore this predetermined feature to identify the subprime crisis effect on Brazilian municipalities using granular city-level data from Brazil.
To instrument the municipality's exposure level to the subprime crisis, we take its total exports share relative to the GDP in 2007 as a continuous treatment variable. We use the following baseline econometric model to estimate the effect of the subprime crisis on Brazilian exporting municipalities: in which i and t indexes municipality and time (yearly frequency), respectively. We use municipality fixed effects α i to absorb any time-invariant and municipality non-observable characteristics. The term α g(i),t represents dynamic time fixed effects used to ensure that we compare similar groups of municipalities in different aspects denoted by d(i). We compare subgroups of municipalities geographically nearby (same region) and with similar sizes (population), output levels (GDP), and sociodemographic inequality levels (human development index), but with different exposure levels to the subprime crisis. 25 The dependent variable y i,t in (2) is a municipality-specific outcome; Post t is a dummy variable used to identify the global financial crisis, taking the value of 1 when t ≥ 2008, and 0 otherwise; Crisis Exposure i is our municipality-specific instrument that estimates the municipality's ex ante exposure to the subprime crisis; and i,t is the standard error term. 26 Following Petersen (2009), we use two-way error clustering at the municipality and year levels.
Our coefficient of interest is β in (2), which can be interpreted as the effect (elasticity) of the subprime crisis on municipality-specific outcomes. Since the treatment is a continuous variable, we identify such effect by looking at the relative differences of the municipality's outcome with a level of ex ante of foreign exposure Crisis Exposure t comparatively to a municipality with null ex ante exposure to the crisis. For instance, if a municipality has 20% of ex ante exposure, then the effect of the subprime crisis on its outcome will be, on average, 0.2 · β% larger relative to municipalities without exposure. In this paper, we analyze several municipality-specific outcomes in the surroundings of the subprime crisis, such as labor, output levels, sectoral job concentrations and admissions, credit, deposits, and also volumes of the employment time guarantee funds (FGTS-Fundo de Garantia de Tempo de Serviço). We expect β < 0, which is consistent with the negative foreign demand shock that exporting municipalities experienced, while local domestic economies did not.
We also analyze which types of exporting municipalities are more affected by the crisis in terms of the local economy's organization. We separate local economies into those more oriented to services-which are non-tradable-and those more focused on manufacturing and agriculture activities-which are essentially (in most terms) 25 We also perform a series of robustness tests to further validate our identification strategy. For instance, we rerun our econometric specifications only with municipalities with nonzero exporting profiles before the crisis to alleviate further concerns about fundamental differences among municipalities in the treatment and control groups. 26 We do not add the marginal regressors Post t nor Crisis Exposure i because they are collinear with the municipality and dynamic time fixed effects, respectively. tradable. We expect that exporting municipalities with a local market structure more oriented to tradable items should be more affected by the negative foreign demand shock, precisely because these local economics were more reliant on foreign demand before the crisis. 27 To do so, we use the following econometric specification: in which Services Share i is the share of municipal GDP due to services activities ex ante to the crisis. The larger this share is, the lower is its dependency on tradable items. The coefficient γ in the triple interaction captures any differential effect of the crisis on the outcomes of exporting municipalities with the same level of ex ante exposure due to differences in the local economy (share of services to total GDP). We expect γ > 0 because an economy more oriented to services should be less affected by the sudden reduction of foreign demand for exports (in line with Ariu 2016; Borchert and Mattoo 2009).
Columns (1) and (3) in Table 2 show our coefficient estimates for Specification (2) using a centered and symmetric window at 2008 with lengths 1 and 2 years, respectively. We use the municipality's per capita GDP (in log level) as the dependent variable in these regressions. When we look at Columns (1) and (3), we see negative and statistically significant coefficients in both specifications, confirming our hypothesis that exporting municipalities were negatively affected by the subprime crisis (in line with Levchenko et al. 2010;Blanchard et al. 2010;Behrens et al. 2013).
Columns (2) and (4) in Table 2 show our coefficient estimates for Specification (3). When we add the triple interaction-post, treatment, and the municipalities' services share-we can factor out the subprime crisis average effect on exporting municipalities in terms of their local structure (tradable or non-tradable). Our results are significant for a two-year time window only (Column (4)). The post-treatment variable in Column (4) is much higher in magnitude than the baseline model in Column (3), suggesting that exporting municipalities focused on tradable items suffered more relatively to those exporting municipalities more reliant on non-tradables. For cities without services activities, a 1% increase in exports/GDP led to a decrease of 7.7% in the municipality's per capita GDP in the two-year time window following the subprime crisis. If we take our sample's per capita GDP mean of R$ 25,838, the subprime crisis reduced the per capita GDP by R$25, 838 · 0.077 = R$1990 in municipalities that were highly dependent on exports before the subprime crisis. For cities with the sample average in services share variable (0.378), this effect reduced to R$1638. To get a sense of the economic meaning of these values, the Brazilian minimum wage in 2008 was R$ 415. The dependent variable is the log of the city-level per capita GDP. Exports/GDP and services share are time-invariant and are fixed with values observed immediately before the crisis (in 2007). Post = 1 if t ≥ 2008. Coefficients represent elasticities. We use (i) municipality fixed effects to absorb municipalityspecific non-observables that are time-invariant and (ii) dynamic time fixed effects to compare subgroups of municipalities geographically nearby (same region) and with similar population (discretized in terciles), GDP (terciles), and human development index (terciles). We follow (Petersen 2009) and double cluster the errors at the municipality and year dimensions. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***p-value < 0.01 Therefore, a reduction of R$ 1638 to R$ 1990 means a decrease of about 3.94-4.80 minimum wages. In other words, a shock of income of was more than four times the minimum wage. The high concentration of income in Brazil, in which most Brazilians earn low wages gravitating toward the minimum wage, suggests that this effect is economically relevant. We now investigate through which channels the reduction in exporting municipalities' GDP took place. We first look at the labor market. Table 3 shows coefficient estimates for Specifications (2) and (3) in the same manner as before, but now we use the municipality's annual per capita job hirings (in log level). The negative and statistically significant coefficients for our post-treatment variable add a piece of evidence showing that the labor market shrunk in exporting municipalities following the sudden foreign demand reduction due to the subprime crisis. Looking at the triple interaction of post-treatment with services share, we find that the effect is stronger in exporting municipalities more reliant on tradable items. For cities without services activities, a 1% increase in exports/GDP caused a −8.6% reduction in the municipality's job hirings flow within a two-year time window. Given the sample's average city-level job hirings/population (11.8%), this effect translated to −8.6% · 11.8% = 0.01% less per capita job hirings. The dependent variable is the log of the number of job hirings/population in the municipality. Exports/GDP and services share are time-invariant and are fixed with values observed immediately before the crisis (in 2007). Post = 1 if t ≥ 2008. Coefficients represent elasticities. We use (i) municipality fixed effects to absorb municipality-specific non-observables that are time-invariant and (ii) dynamic time fixed effects to compare subgroups of municipalities geographically nearby (same region) and with similar population (discretized in terciles), GDP (terciles), and human development index (terciles). We follow (Petersen 2009) and double cluster the errors at the municipality and year dimensions. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***p-value < 0.01 The reduction in job creation may not have been uniform through different economic sectors. The sudden reduction in foreign demand for goods may have affected the local labor market structure in terms of job distribution over different economic sectors. One possibility is that the subprime crisis could have destroyed jobs in the manufacturing sector, leading these newly unemployed workers into jobs in the trade sector, potentially in low-skilled areas or even in new small businesses. Thus, the subprime crisis could have forced a rearrangement of the job distribution over exporting cities, leading to job migrations from heavily affected economic sectors to other less affected sectors.
To test this hypothesis, Table 4 reports our coefficient estimates for Specifications (2) and (3) when we use the municipality-level job shares per economic sector as the dependent variable (in log level). We report job shares for the manufacturing, construction, trade, services, and agriculture sectors for a one-(top panel) and two-year (bottom panel) time window centered at the subprime crisis. The manufacturing and construction sectors' job shares have substantially fallen after the crisis in exporting municipalities, which is consistent with the reduced foreign demand for goods and, therefore, lower income for the population and firms to invest in housing or new production facilities. In contrast, the trade sector employed more following the crisis. These effects suggest a shift from the manufacturing sector to the trade sector within Table 4 This table reports coefficient estimates of Specification 3 using different municipality-specific outcomes: the log of the number of job hirings in the manufacturing (Column (1)), construction (Column (2)), trade (Column (3)), services (Column (4)), and farming (Column (5) We use (i) municipality fixed effects to absorb municipality-specific non-observables that are time-invariant and (ii) dynamic time fixed effects to compare subgroups of municipalities geographically nearby (same region) and with similar population(discretized in terciles), GDP (terciles), and human development index (terciles). We follow (Petersen 2009) and double cluster the errors at the municipality and year dimensions. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***p-value < 0.01 the municipality's economic structure (Ariu 2016;Borchert and Mattoo 2009). It may be a sign that during this period, exporting municipalities faced a relatively stronger process of deindustrialization. The triple interaction-between our post-treatment variable and the municipality's services share-shows that cities with larger services shares had a weaker rearrangement of job shares across different economic sectors. We can observe such effect by verifying that the triple interaction always has the opposite sign to the post-treatment variable, meaning an attenuation of job migrations across different economic sectors for exporting municipalities more focused on non-tradable items. These results are robust regardless of the time horizon. 28 An interesting result is that job shares in the services and farming sectors did not change after the subprime crisis relatively to similar non-exporting municipalities. These results show the resilience of the agricultural and services sectors in terms of external shocks. They are consistent with the perception of less elasticity of food commodities and essential services. Our findings suggest that demand for these sectors was mostly domestic or could fill their reduced foreign demand with domestic markets.
We now analyze whether the observed job reallocation across different economic sectors reflected changes in the concentration of job shares of exporting municipalities relatively to non-exporting ones. Table 5 reports our coefficient estimates for Specifications (2) and (3) when we use the municipality-level job shares concentration index (in log level), measured by the Herfindahl-Hirschman Index (HHI). 29 We observe a positive and statistically significant coefficient both for one and two years after the crisis when we do not distinguish exporting cities in terms of their services share (Columns (1) and (3)). The results suggest that jobs within exporting municipalities became more concentrated after the crisis regardless of whether municipalities also had a strong economy in non-tradable goods and services (high services share).
Finally, we also provide empirical evidence of the financial effects of the subprime crisis on Brazilian exporting municipalities. For that, we resort to bank-branch-level data from the Estban (Estatística Bancária Mensal por Município) dataset, which contains information on financial statements of every bank branch in Brazil by municipality over time monthly. Such detailed information enables us to isolate supply effects from banks by performing a within-bank analysis. In this way, we can analyze how demand for credit, deposits, and FGTS responded to individuals and firms in exporting municipalities after the crisis vis-à-vis similar municipalities but without exposure to the crisis. 28 Part of the resilience of the manufacturing and construction sectors in exporting cities more reliant on non-tradable activities (high services share) is associated with countercyclical measures taken by the Brazilian government to address the crisis. Temporary tax cuts for industry, credit subsidies, interest rate cuts, and regulated price reductions were some of the fiscal and monetary decisions that help drive aggregate demand and support service activities. 29 To compute the HHI, we take the sum of squared shares of the five economic sectors discussed before (manufacturing, construction, trade, services, and farming). Larger HHI values indicate more concentration of job activities in the same economic sector (specialization), and lower HHI values indicate greater job diversification over different economic sectors. The dependent variable is the degree of concentration of job shares within municipalities (in log level), measured in terms of the Herfindahl-Hirschman Index (HHI). Exports/GDP and services share are timeinvariant and are fixed with values observed immediately before the crisis (in 2007). Post = 1 if t ≥ 2008. Coefficients represent elasticities. We use (i) municipality fixed effects to absorb municipality-specific nonobservables that are time-invariant and (ii) dynamic time fixed effects to compare subgroups of municipalities geographically nearby (same region) and with similar population(discretized in terciles), GDP (terciles), and human development index (terciles). We follow (Petersen 2009) and double cluster the errors at the municipality and year dimensions. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***pvalue < 0.01 We use the following econometric specification: in which b, i, and t index bank branch, municipality, and time (monthly frequency). We take as dependent variables the total municipal deposits from the private sector (include individuals and non-governmental firms), credit operations to the private sector, and the employment time guarantee funds (FGTS-Fundo de Garantia de Tempo de Serviço), which is an individual-specific social mandatory fund that firms must contribute in case there is a formal employment relationship with the worker. All variables are in log levels, in a way that we obtain elasticities in our estimations. The bank-time fixed effects permit us to control for any bank-specific supply shocks. Such dynamic fixed effects also provide the following interpretability for β, our coefficient of interest. It provides the differences in the bank-municipality outcome y b,i,t for that same bank but at municipalities with different levels of ex ante crisis exposures (exports/GDP). Similarly, we also add the triple interaction of our post-treatment variable with the services share to understand whether there is any observed heterogeneity in the bank-municipality outcome in exporting cities with strong non-tradable economies (loaded in the coefficient γ ). Table 6 reports our coefficient estimates for Specification (4) using the three abovementioned bank-municipality outcomes. We further find empirical evidence showing a tightening of the financial conditions in exporting municipalities relatively to those more reliant on domestic demand. In a 1-year horizon, we observe that deposits, credit, and FGTS decrease (negative and statistically significant coefficients). This behavior indicates that unemployed households withdrew available resources and reduced demand for credit during this period. The relative reduction in the FGTS may be due to the increase in exporting cities' unemployment levels, as we documented in our empirical evidence on labor markets. 30 When we expand the analysis horizon to two years, only the credit effect remains and the FGTS advances in percentage, suggesting signs of recovery of part of the destroyed jobs. Now, when we include triple interaction with cities with the largest share of services, credit and FGTS variables increase in the first year after the crisis. This result may be further evidence of the greater resilience of these municipalities to the effects of the subprime crisis if we consider the export channel.

Indirect effects
In the last section, we have seen that the subprime crisis affected exporting municipalities in several economic and financial dimensions. We have found empirical evidence that local development (per capita GDP) and overall job hirings decreased, while households and firms' financial conditions deteriorated. This section analyzes the potential second-order effects of this economic and financial deterioration of exporting municipalities.
We investigate whether non-exporting municipalities that were more linked with these exporting municipalities experienced any spillover (second-order) effects. We classify a municipality as non-exporting when its exports/GDP ratio in 2007 is in the lower median of the distribution, including those municipalities that did not export at that time. 31 We use the following econometric specification: in which i and t index non-exporting municipalities and time (annual frequency), respectively. We use the municipality-specific instrument Exposure to Exporters i , as defined in (1), to analyze potential second-order effects in non-exporting municipalities. The terms α i and α d(i),t are municipality and dynamic fixed effects, respectively, which are similar to the ones employed in regressions (2) and (3). Our coefficient of interest is β, which measures the average effect in a non-exporting municipality's outcome from being connected to an exporting municipality before the crisis. To mitigate selection bias and ensure similarity across treatment and control Table 6 This table reports coefficient estimates of Specification 4 using different bank-municipality-specific outcomes as follows: deposits from the private sector (Columns (1) and (5)), credit to the private sector (Columns (2) and (6)), and FGTS (Columns (3) and (6) frequency. Coefficients represent elasticities. We use (i) bank-time fixed effects to make within-bank comparisons across different municipalities and control for bank supply shocks and (ii) municipality fixed effects to absorb non-observable time-invariant characteristics. We follow (Petersen 2009) and double cluster the errors at the bank and time dimensions. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***p-value < 0.01 groups, the dynamic fixed effects α d(i),t force comparisons of municipalities within the same mesoregion, GDP, HDI, and population. It is worth noting that we make a slight change of this dynamic fixed effect when compared to our estimations of the direct effects of the crisis. Instead of comparing municipalities within the same state, we now compare those within mesoregions, which is a more saturated approach. The reason for this change is because the indirect effects are more diffused throughout Brazilian municipalities, enabling us to use a more robust specification. 32 Table 7 reports our coefficient estimates of Specification in (5). We use two dependent variables of non-exporting municipalities (in log levels): (i) per capita GDP in Columns (1) and (2) and (ii) per capita hirings in Columns (3) and (4). We first observe an increase in per capita hirings of non-exporting municipalities exposed to exporting municipalities both for 1 and 2 years. Since we use business management control over different municipalities, more exposed non-exporting municipalities have relatively more control of firms in exporting municipalities. In this way, due to the sudden reduction in foreign demand-which reflected in lower levels of local activity in exporting municipalities-highly connected non-exporting municipalities reallocated employees from these negatively affected exporting municipalities to other non-exporting municipalities in which they had firm branches. Firms reallocate the workforce because of the existence of firm branches in both the origin and destination municipalities, which reduce contractual frictions when moving employees within these municipalities. 33 Such job reallocation seems to have fueled higher economic development levels in these cities due to the positive coefficient, but the effect is marginally or not statistically significant. Now, we investigate which economic sectors received more hirings in non-exporting municipalities highly exposed to exporting municipalities. Table 8 shows coefficient estimates of specification in (5) when we break down hirings by the following economic sectors: manufacturing (Column (1)), construction (Column (2)), trade (Column (3)), services (Column (4)), and farming (Column (5)). Consistent with the deindustrialization of exporting municipalities directly exposed to the subprime crisis, there seems to be an increase in industrialization through more hirings in the manufacturing sector in non-exporting municipalities with less contractual frictions to reallocate employees across municipalities (more exposed to exporters). Such empirical evidence further supports the argument of a potential rearrangement of employees from firm branches located in exporting to non-exporting municipalities. 32 This becomes evident when we compare the geographical maps of the direct and indirect effects in Figs. 2 and 4, respectively. While the former has the existence of isolated municipalities preponderantly, the latter has several affected municipalities nearby. The existence of geographically isolated municipalities does not allow us to make within-mesoregion comparisons to analyze the direct effects of the crisis. 33 An alternative explanation is that firms could reduce the number of employees in exporting municipalities and hire in non-exporting municipalities. However, if this would be the case, there would be no reason to observe an increase in the workforce of non-exporting connected to exporting municipalities.

Fig. 5
Parallel trends check using the specification in (2) but with yearly dummy variables rather than the Post t dummy. The dependent variable is the share of job hirings to the local population. We analyze the time window from 2006 to 2011. The points represent the estimated β coefficients according to (2), and vertical bars represent 95% confidence intervals

Robustness tests
In this section, we provide a series of robustness tests to further validate our empirical results.

Parallel trends assumption
This paper uses a difference-in-differences approach to evaluate the effect of the global financial crisis on Brazilian exporting municipalities' outcomes (direct effects) and municipalities that economically depend on these exporting municipalities (indirect effects). A necessary condition in a difference-in-differences approach is that the trends observed in the control and treatment groups' outcomes are similar to those of the crisis. This section provides empirical evidence of the similarity between the treatment and control groups by running parallel trends checks on all the municipality-specific outcomes analyzed in Sect. 4.1. If municipalities with higher ex ante exposure to the crisis (treatment group) are similar to those with lower exposures (control group), their outcomes should evolve similarly before the subprime, i.e., parallel to each other. In addition, if the subprime crisis had any impact on municipality-specific outcomes, then we should observe a break in these trends following the event. Such divergence after the crisis, if any, is loaded in the β coefficient in (2), which precisely captures the crisis effect. Figure 5 shows the annual β coefficients, which we obtain by changing Post t in (2) for yearly dummies for the period 2006-2011. 34 We use the number of job hirings over the local population as the dependent variable in this example. 35 We observe a statistically insignificant coefficient before the crisis, indicating that the treatment and control groups' trends with respect to the municipality-specific outcome "job hirings over the local population" are similar. Moreover, the annual coefficients β become statistically different from zero after the crisis. The negative values indicate that the subprime crisis harmed the labor market of municipalities more oriented to exports. Table 9 reports parallel trend checks on every municipality-specific outcome employed in Sect. 4.1 through the period 2006-2009 (two years in the surroundings of the crisis). All coefficients are relative to the year 2006. We observe statistical insignificance of all coefficients in 2007, confirming parallel trends in the treatment and control groups. After the crisis, some coefficients become statistically significant either in 2008, 2009, or in both years. Therefore, any alternative stories of our results should also explain the beginning of the observed effects starting in 2008

Exports concentrated on ports or airports
One potential concern is that production for exporting may cross borders not through the municipality in which it was produced but instead through other municipalities, such as ports and airports.
Brazil contains 194 ports because it has large continental river meshes and extensive coastal line bordering the Atlantic ocean from its most Southern to the Northern region. Table 10 shows the geographical distribution of ports over its five regions broken by installation nature (private, public seaport, or other) and type (river or sea). Also, Brazil contains 38 airports spread around its states. Most of the airports are located in metropolitan regions, such as capitals.
In this exercise, we remove municipalities that contain either a port or an airport. By removing these municipalities, we are effectively mitigating the concern that production could be exported not only through the municipality, which effectively produced but by one that contains a port or an airport. In total, we remove 144 distinct municipalities from the regression. Table 11 shows the coefficient estimates of our regression. We observe that our results remain qualitatively the same.

Conclusions
Economic downturns reduce aggregate demand and restrict trade flow, leading to a drop in the number of goods shipped and landed. The collapse of the subprime in 2008-2009 harmed the world trade flow and affected both advanced and developing nations. This paper provides empirical evidence of how and to what extent it affected Brazil.
This paper uses a difference-in-differences approach to measure the direct and indirect impact of the subprime crisis in production, employment, and financial conditions of Brazilian municipalities. We collect and match several unique datasets that contain 35 We also provide parallel trends check for other outcomes employed in this paper as robustness tests.   Some municipalities contain more than a port All setup follows the guidelines in Table 2. Statistical significance levels: *p-value < 0.1; **p-value < 0.05; ***p-value < 0.01 very granular information on the smallest political and administrative unit in Brazil: municipalities. We find that exporting cities were more affected by the 2008-2009 crisis than municipalities with a domestic-oriented economy. The manufacturing and construction sectors shrunk, while the trade sector became expanded. These facts suggest the deindustrialization of exporting municipalities following the subprime crisis. However, when we consider cities with a high share of services in the economy, we observe a greater resilience of municipalities to the external crisis.
We also show that the indirect effects are relevant. In the aftermath of the financial crisis, with the negative shock on international trade, job reallocation occurs from export-led municipalities to cities focused on production for the domestic market, but that controlled many firms in affected exporting municipalities. These inward-oriented cities also end up with more per capita hirings, a more dynamic labor market, and increased industrialization levels.
We also test whether our results are robust by implementing several robustness tests. We test whether excluding cities with airports or ports, which function as conduits for exports, change the results. We find evidence that results remain qualitatively the same. We also test the similarity between our control and treatment groups to ensure that our difference-in-differences analyses are valid.
Future works may seek to analyze potential spillover effects of the crisis between the most central and the most dependent municipalities, i.e., investigate more the inand out-flows across Brazilian municipalities due to the subprime crisis. For instance, one can analyze to which type of municipalities workers migrated and correlate that with local economic and financial conditions.