losses but also to higher wage inequality. In contrast, minimum wage policies reduce wage inequality in Ecuador, as observed in other countries, while also generating allocative inefficiencies.

This paper contributes to three strands of literature. First, it adds to the work on aggregate TFP and its relation to firm outcomes and dynamics. Seminal work by Restuccia and Rogerson (2008, 2013), Hsieh and Klenow (2009), Bartelsman et al. (2013), among others, have attributed differences in aggregate TFP to resource misallocation across firms. Papers including Hsieh and Klenow (2009,2014), Bartelsman et al. (2013), Midrigan and Xu (2014), Gopinath et al. (2017), and Restuccia and Rogerson (2017) have connected resource misallocation to specific market distortions constraining firm dynamics. Additionally, studies by Krueger (2013) and Hsieh and Olken (2014) have highlighted that these distortions not only deplete aggregate TFP but also yield anemic firm distributional patterns. This paper provides additional empirical evidence on drivers of resource misallocation and their contribution to poor aggregate TFP outcomes and lackluster firm distributional patterns in the case of Ecuador. Second, this paper contributes to the literature on firm dynamics and job flows. Papers, such as Haltiwanger et al. (2013, 2016) and Decker et al. (2014), have underscored the significance of young firms in accounting for most of the job flows and employment reallocation in the U.S. Their work complements Dunne et al. (1989), Davis and Haltiwanger (1990, 1992), Davis et al. (1996), Foster et al. (2001), and Becker et al. (2007), which find that employment reallocation is accompanied by output growth and capital reallocation. This paper finds that, in the context of a developing economy characterized by highly distorted markets, job creation by entrants is inefficient, and job destruction is largely explained by unproductive, older firms that continue to operate. Lastly, this paper contributes to the literature on the pivotal role of firm outcomes in explaining wage inequality. Papers such as Faggio et al. (2010), Barth et al. (2016), Berlingieri et al. (2017), Manning (2021), and Criscuolo (2020, 2021, 2022), among others, have documented that firms are important for explaining wage variation among workers. Furthermore, Criscuolo (2020, 2021, 2022) have studied potential drivers of misallocation that are linked to wage inequality outcomes for OECD countries. This paper builds upon this work by simultaneously linking drivers of misallocation to wage inequality in a developing economy, underscoring the relevance of non-wage labor costs and product market distortions for wage dispersion.

The paper is organized as follows: Section 2 describes the dataset leveraged for the different empirical analyses. Section 3 provides aggregate motivating facts about aggregate productivity and inequality trends in Ecuador. Section 4 documents productivity, market selection, and life cycle patterns of Ecuadorian firms. Section 5 studies the main channels and drivers of aggregate productivity growth in Ecuador. Sections 6 and 7 characterize firm distributional and job flow patterns, respectively. Section 8 assesses the role of firm dynamics on wage inequality in Ecuador. Last, Section 9 concludes.

# **2 Data**

This paper utilizes two firm-level datasets and one employee-level database to construct a comprehensive employer-employee matched dataset, facilitating a simultaneous examination of firm and labor outcomes. The first source is the Directory of Companies and Establishments (Directorio de Empresas y Establecimientos [DIEE]), a public database created by the Ecuadorian Statistics Institute (Instituto Nacional de Estadística y Censos [INEC]), which incorporates firm administrative data from the national revenue service (Servicio de Rentas Internas [SRI]) and firms’ employment data from the social security institution (Instituto Ecuatoriano de Seguridad Social [IESS]). The DIEE covers information for all formal firms registered with the SRI since 2012, totaling around 800,000 firms. However, it has limitations, providing only limited firm performance variables (sales and employment) and lacking data necessary for estimating value added and productivity, such as firms' costs.

The DIEE data is complemented with non-public firm administrative data obtained from the SRI, which encompasses the entire universe of formal firms in Ecuador. This second source includes key variables for estimating firm TFP, such as sales, gross production, costs, fixed assets, investment, employment, and materials at the firm level. The dataset also comprises relevant firm characteristic variables, including economic sector of activity, age, and geographical location, among others. The third source, the Labor and 5