Pittsburgh is the most affordable city to live in, according to a new study, with median home prices below the national average.