Living in a large metropolitan area can be very expensive. The cost of housing can be especially daunting.

One of the toughest financial decisions you will need to consider when moving to a big city is: Should you rent, or should you buy a place to live?

Home ownership is often seen as part of the American dream but in large metro areas the high cost of home prices can be a big deterrent. And increasingly high rental costs are also making it difficult for many families to afford to live in larger cities.

More from USA Today:

Real estate market exclusive: Here are top cities to buy and sell homes

Some Nashville homes are too close for comfort

The January Effect: Another too-good-to-be-true bit of investing advice

Nationally, it is more affordable to own a home with a mortgage than it is to rent, according to the Urban Institute, a non-profit social and economic policy research think tank.

A median-income family spends 28 percent of its income to pay the median rent for a 3-bedroom house, according to the research organization. That compares to spending 25 percent of your income for a monthly mortgage payment — principal, interest, taxes and insurance — on a median-price home bought with a 30-year fixed rate of 3.97 percent and a 3.5 percent down-payment. That is reduced to 22 percent of income if you put down a 20 percent down payment. (The median is the midpoint value where there are an equal number of values above and below.)

But the affordability equation between renting and owning can vary widely across the country. As interest rates rise, the affordability issue is becoming more of a problem for more cities, says Bing Bai, research associate for the Urban Institute's Housing Finance Policy Center.

In a new study, the research center found that it is actually more affordable to rent than to own in 16 of the 33 largest metropolitan areas.

The study looked at large metropolitan statistical areas (MSA's) for home purchase and rental affordability and calculated the "rent gap" – the difference between the cost of owning and renting.

The city with the largest rent gap, or where it is more affordable to rent than to own, is the San Francisco area.

The West Coast city has a whopping rent gap of 43 percent: A median-income family in the area would spend 80 percent of its income to pay the monthly mortgage on a median-price home with a 3.5 percent down payment. That compares to the family spending 37 percent of its income on the median rent for a 3-bedroom house. The homebuyer would be paying an additional 43 percent of its income toward housing when compared to a renter.

"But even though it is cheaper to rent in San Francisco that does not mean it is still affordable for many people," said Sarah Strochak, research assistant for the Housing Finance Policy Center. It just means that a greater portion of your income would be going to housing costs when owning a home than when renting.

The median rent for a 3-bedroom house in the area runs $3,450 a month.

The trend is similar in many other large West Coast cities, but not as extreme as in San Francisco. Here are the 16 metropolitan statistical areas where it is more affordable to rent than to own, as determined by the Urban Institute's rent gap calculations:

San Francisco, Calif.: 42.5%

San Jose, Calif.: 19.1%

Seattle, Wash.: 8.6%

San Diego, Calif.: 7.0%

Sacramento, Calif.: 6.5%

Los Angeles, Calif.: 5.0%

Portland, Ore.: 5.0%

Riverside-San Bernardino, Calif.: 4.2%

Las Vegas, Nev.: 2.5%

Phoenix, Ariz.: 1.8%

Baltimore, Md.: 1.7%

Denver, Colo.: 1.5%

Washington, D.C.: 1.5%

St. Louis, Mo: 0.5%

Dallas-Fort Worth, Texas: 0.3%

Charlotte, N.C.: 0.1%

One thing to consider before abandoning the idea of owning a home in one of these areas is that the study does not take into account any tax benefits you would receive from home ownership.