(Photo by Introvert/Wikipedia)

For people looking to buy a home for the first time, the Bay Area may be one of the worst places to do so.

According to a new study by the personal finance website WalletHub, when accounting for a combination of cost of living, property crime rates and 25 other metrics, Berkeley was the worst city for new homeowners among 300 cities ranging in size.

Oakland was far down the list too at No. 297. Among other big cities, Oakland came in at 63rd of 64, only ahead of Detroit.

Plenty of other Bay Area cities rounded out the bottom of the list. Santa Rosa came in at 218, Antioch at 222, San Jose at 258 and San Francisco at 284.

Source: WalletHub

Other findings included that San Francisco, Sunnyvale and Santa Clara were among six cities tied for the highest cost of living in the country. The five cities with the lowest ratio of median home value to median annual rent can also be found in the Bay Area: Berkeley, Fremont, San Mateo, Santa Clara and Sunnyvale.

Besides cost of living and property crime rates, other factors included real estate tax rates, median home price appreciation, weather and job market.

The full study can be found at https://wallethub.com/edu/best-and-worst-cities-for-first-time-home-buyers/5564/.