A few days ago Pew Research analyzed the latest census data and announced that we are now in record-setting territory: More adult children live at home with their parents than anytime in American history. This prompted a fresh barrage of hand-wringing about (a) the lousy economy and (b) the problems this is causing for millennials.

I'll get to millennials and the economy in a bit, but first, here's a chart that provides a longer-term look at young adults living at home:

That's pretty odd, isn't it? If the economy were the driving force behind kids moving into their parents' basements, you'd expect to see these numbers go down during economic expansions and up during recessions. But that's decidedly what we don't see. The numbers went steadily up during both the Reagan and Clinton booms, with no trend change at all during the 1991 recession. Then the numbers fell from 1999 through 2005, which spans two expansions and one recession. Then they started up again, and kept going up even when the Obama expansion started to pick up some steam.

If the economy plays a role in this, it's sure hard to see. So what's really going on? Over at 538, Ben Casselman points us to Jed Kolko, who crunched a few numbers and concluded that it's mainly about marriage and kids:

Alongside recent swings in the housing and job markets, there have been profound long-term demographic shifts that are related to young adults' living arrangements….An especially important trend is that people are waiting longer today than in the past to get married and have kids — so the share of 18-34 year-olds who are married with kids has plummeted from 49% in 1970 to 36% in 1980, 32% in 1990, 27% in 2000, 22% in 2010, and just 20% in 2015. Unsurprisingly, married young adults and those with children are far less likely to live with their parents than single or childless young adults.

So what happens when you control for this, along with other demographic changes over the past few decades? Kolko: "Adjusted for demographic shifts, the share of young adults living in their parents' home was actually lower in 2015 than in the pre-bubble years of the late 1990s. In other words, young people today are less likely to live with their parents than young people with the same demographics twenty years ago were."

Kolko wisely recommends not trying to explain everything away with demographics: some of these demographic effects can interact with each other, while the causality of others might run in the opposite direction (maybe living at home makes you less marriageable material). Still, the declining marriage trend has been steady for nearly half a century and is obviously not the result of the Great Recession. Ditto for the other long-term demographic changes.

None of this is to say that the economy has nothing to do with living arrangements. Even adjusted for demographics, Kolko's chart still shows a small increase in adult children living at home starting around 2010. This is likely due to a triple whammy affecting millennials: (1) their incomes dropped during the Great Recession and still haven't fully recovered, (2) college grads are saddled with more debt than previous generations, and (3) the real cost of housing has increased nearly 10 percent over the past decade. Put all this together, and the average millennial today has less disposable income but faces higher rent than previous generations. This is a real problem, and it would be surprising indeed if it literally had no effect at all on the likelihood of 20-ish millennials living at home longer than they used to.

That said, the effect appears to be fairly small. The big driver of living at home in your 20s appears to be primarily demographic. The economy plays only a small role.