Residents of the least popular cities were driven by affordability concerns and desire for newer housing stock, an analysis found