Buying a home is now more affordable than renting in most places, but there could be changes on the way.

According to the ATTOM Data Solutions 2017 Rental Affordability Report, which analyzed data from 540 counties nationwide, buying a home is the more affordable housing option in 66 percent of the markets, up from 58 percent last year. However, the potential for rising interest rates this year could put up barriers to buying a home and keep potential homeowners renting.

Here’s what you need to know about the current real estate market and what to look for as the year goes on.

Buying beats renting most of the time

Buying is often recommended over renting in the long term because your mortgage payments build equity in your home – which you’ll eventually own – while your rent only goes toward maintenance and your landlord’s wallet. However, in today’s real estate market the monthly costs of buying are also preferable to renting.

According to the report, the total monthly cost for a median-priced home in the U.S., including insurance, taxes and the mortgage payment, is more affordable than the equivalent rental costs for a three-bedroom property in 354 of the 540 analyzed counties. Several major cities are located in those 354 counties, including Chicago, Phoenix and Las Vegas.

Even when renting is an affordable option, buying a home is often more affordable. Anderson County, TN, for example, is one of the most affordable rental markets listed in the report, requiring 25.1 percent of an average wage for housing costs each month. Yet buying in this county only requires 16.4 percent of average wages, making it much more affordable.

Where renting is more affordable

According to the report, renting is more affordable than buying in just 186 analyzed counties, including counties featuring major cities like Los Angeles and Seattle. However, in many of these areas the costs for either option are so high that renting is only slightly more cost-effective.

For example, the report found it’s more affordable to rent than buy in most counties of both New York City and San Francisco, two of the most notoriously expensive rental markets in the country. The cost to buy a median-priced home in Kings County (Brooklyn), New York and San Francisco County, California approach or exceed 100 percent of average wages. While this isn’t the case in every market, a combination of high overall housing costs, lack of inventory and stagnant wages in these areas make housing decisions much more difficult.

Housing costs are rising faster than wages

These numbers are troubling because traditional budget advice says you should spend no more than 30 percent of your income on housing. Unfortunately, housing now demands an average of 38 percent of a resident’s income across the country, according to the report

On top of this, the report notes that the costs of both buying and renting a home are rising faster than wages in the majority of the 540 analyzed counties. Home prices rose 5.7 percent in the last year and rental costs rose 4.2 percent, while wages have only increased 2.2 percent since the second quarter of 2016. This means higher home costs and less money to pay them.

With the possibility of interest rate increases in 2017 and the question of how the real estate market will react under a new president, those ready to buy now should try and close their deals soon. For those unsure, it’s time to reach your decision: do you want to continue renting this year or settle down in a home? Some experts predict more rental availability in 2017, which could lower costs, but you should do your best to bring your housing costs down to 30 percent of your budget regardless of which option you choose. Whether it’s a 30-year mortgage or a one-year lease, you don’t want to be stuck paying more than you can afford.