Fertility decisions and endogenous residential sorting