First-time homebuyers will have better luck in some spots than others.

New homebuyers are far better off purchasing a home in many towns in the middle of the country, and far worse off in many cities in California, according to an analysis released this week by financial website SmartAsset.com. The site examined data on housing affordability for people living in the area (as measured by the ratio of median household income over five years to ownership costs over five years, including closing costs, mortgage payments, insurance and taxes), ease of getting a mortgage and the stability of the housing markets in cities with populations of 300,000 or more.