In two-thirds of the nation’s busiest housing markets, it’s more affordable to buy a house than to rent.

But in the Bay Area, that’s hardly the case.

Given the rapid appreciation of home prices here, it’s still a better deal to rent in eight of the region’s nine counties — even with the shocking increases in rents over the past few years. Only in Contra Costa County — where homes remain relatively affordable, especially in inland areas — is it more affordable to buy than rent.

Those are the conclusions of a new report that draws on 2016 fair-market rent data from the U.S. Department of Housing and Urban Development and wage data from the U.S. Bureau of Labor Statistics, along with public records for home sales in 540 U.S. counties. The report does not consider long-term financial advantages of home ownership, only what it takes to cross the first hurdle and simply buy a house.

“Home prices have become so high so quickly in the Bay Area that renting has become a better option,” said Daren Blomquist, senior vice president of Irvine-based Attom Data Solutions, which analyzed the numbers and wrote the report. “That’s not to say that renting is affordable, but it’s become a more affordable option in most of the Bay Area counties.”

How does he explain the trend?

“Nationally, home prices are consistently outpacing rent growth,” Blomquist said. “Prices for the most part have consistently outpaced wage growth as well during this housing recovery. And we’ve reached a point where that trend has created a sharp divide between the price of homes and what the average wage earner can afford.”

In the Bay Area in 2016, Santa Clara was one of only two counties where wage growth, up 6.8 percent, outpaced home appreciation, up 5.9 percent. (In Napa County, wages were up 5.2 percent, slightly outpacing home-price growth of 5.0 percent.)

But when home prices and wages are examined going back to 2012 — when the housing recovery took off in most of the region — prices get the upper hand, outstripping wages across the nine counties. In Santa Clara County, for instance, home prices have jumped an astounding 92 percent since the first quarter of 2012, while wages have risen just 16 percent. In Contra Costa County, home prices have jumped 113 percent while wages actually fell 4.0 percent.

On top of this, Blomquist added a bleak prediction: “With the prospect of rising interest rates, buying a home is going to become even less affordable than it has been, and I think that’s going to tilt the balance in favor of rent for a lot of people. In the Bay Area, the equation already is favoring renting. But rising interest rates will even further accelerate that trend.”

In fact, rents lately have begun to level off around the Bay Area.

That said, renting still poses a challenge for many wage earners. According to the new report, Marin County is the most rent-challenged county in the United States. The average weekly wage there is $1,243, but the median rent for a three-bedroom home in 2017 is $4,250 — requiring that the typical earner put about 77 percent of his or her gross pay toward rent for a home of that size.

When two or three people rent a home, as would generally be the case, the percentage falls, of course. Still, the numbers are a little unnerving for Bay Area renters.