Any middle-class adult older than 25 has heard more than once that “rent is just throwing your money away,” so strong was the conventional wisdom in favor of buying a place to live.

Then came the Great Recession and some harsh lessons about the risk of borrowing a lot of money to buy a house or condo.

But as it turns out, rent is still throwing your money away.

Last year more than 2,700 new apartment rental units were added across the Twin Cities market, and nearly 5,000 more will be by the end of this year, and yet Marquette Advisors in Minneapolis said the apartment vacancy rate actually declined in the third quarter. It’s still under 3 percent.

That means rents have been going up. And that’s making buying a house an even better deal.

One way to think of the rent vs. buy decision is what the online real estate company Zillow calls its break-even horizon. It’s the time it takes to make up for the initial higher cost of buying, for transaction costs and the like, and start saving money by owning vs. renting.

In the Twin Cities, as of June, it was just 2.8 years.

In another analysis, Zillow reports that homeowners in the Twin Cities this summer could expect to pay 14 percent of their monthly incomes on their mortgage payments, dramatically less that the historical average in the Twin Cities.

Renters, meanwhile, could expect to pay 26.4 percent of their monthly incomes on their rent payments, which is 36.4 percent more than renters here historically had to pay.

The Zillow home value index for the Twin Cities is up nearly 25 percent from the postrecession bottom, but Zillow economist Skylar Olsen said in a conversation last week that the housing market appears to be entering a period of price stability.

“With low mortgage rates, it’s certainly still a good time to buy,” she said. “Mortgages are very affordable, certainly relative to renting.”

The only way to make renting vs. buying a close call on the rent-versus-buy calculator of Trulia, another online real estate firm, is by assuming the buyer stays in the house only three years, doesn’t deduct mortgage interest on his or her taxes and has an expensive 6 percent mortgage.

Assuming a high tax bracket, staying at least seven years and paying a mortgage interest rate much closer to the 3.875 percent Bremer Bank quoted last week, and it’s 55 percent cheaper to buy in the Twin Cities than rent.

It’s a similar story in much of the rest of the country. Yet homeownership rates have continued to fall since the Great Recession, most recently at 64.4 percent for the nation as a whole, a 19-year low.

There isn’t one easy explanation for why that’s happening, although declining rates of homeownership are commonly attributed to the reluctance of people younger than 35 to buy houses.

In the Twin Cities the homeownership rate among those so-called millennials is 48 percent, according to Zillow, higher than the national rate but still well below the close to 82 percent rate of local baby boomers.

The difficulty millennials have in saving for a 20 percent down payment — partly because they pay so much in rent — is part of the explanation, said Zillow’s Olsen. She suspects that the homeownership rate among millennials will rise as they increasingly settle down.

What’s interesting to her is what’s happened to ownership rates among Gen Xers, the generation just older. Unlike millennials, they weren’t too young to miss out on becoming homeowners during the Great Recession.

That’s when people now middle-aged found out that another adage they heard a lot when growing up — your home is your best investment — turned out to be a whole lot of nonsense.

In the Twin Cities, house values as tracked by Zillow are still 13 percent below their 2006 peak. And for a lot of middle-aged people, the wounds haven’t healed.

But while the idea that houses were a sure source of easy wealth was wrong before, the idea that homeownership represents a frightening risk is wrong now. Yes, housing prices do move, sometimes a great deal, but data suggest that over the long term prices tend to go up a bit faster than the rate of inflation.

And it’s important to note that people can still make themselves richer by owning a house even if prices barely budge. An interesting study in 2013 by Harvard University researchers looked back at the wreckage in the housing market and concluded that owning a house still helps build wealth for lower-income people.

That’s because aspiring homeowners have to save their money to make a down payment. To keep the house, they have to make the mortgage payments. And while it seems like it takes forever to make a real dent in the mortgage balance, it does work to build a family balance sheet. It’s an automatic savings plan.

The authors noted that it seems easy to make a case for lower-income people to rent and invest their savings in assets that easily outperform a house, “but in practice renters rarely accumulate any wealth. This seems traceable to the difficulties households face in trying to save, absent either a clear goal or an automatic savings mechanism.”

But accumulating some savings isn’t the same as trying to get rich from a real estate deal. It makes no more sense for consumers to speculate in real estate now than it did in 2006, and as Olsen put it, “thinking like that leads to trouble.”

So when’s a good time to buy? It’s when you need a place to live and can stay awhile.