March 2018
We develop a quantitative framework for exactly decomposing trade patterns into economically meaningful components. We derive price indexes that determine comparative advantage across countries and sectors and the aggregate cost of living. If firms and products are imperfect substitutes, we show that these price indexes depend on variety, average demand or quality, and the dispersion of demand or quality-adjusted prices, and are only weakly related to standard empirical measures of average prices, thereby providing insight for elasticity puzzles. Of the cross-section (time-series) variation in comparative advantage, 50 (90) percent is accounted for by variety and average demand or quality, with average prices contributing less than 10 percent.