Essays in the economics of housing and labor markets