This paper develops an approach for quantifying the importance of different sources of comparative advantage for country welfare. To explain patterns of specialization, I present a multi-country trade model that extends Eaton and Kortum (2002) to predict industry trade flows. In this framework, comparative advantage is determined by the interaction of country and industry characteristics, with countries specializing in industries whose specific production needs they are best able to meet with their factor endowments and institutional strengths. I estimate the model parameters on a large dataset of bilateral trade flows, presenting results from both a baseline OLS approach, as well as a simulated method of moments (SMM) procedure to account ...