Essays on the macroeconomic effects of inequality