The story of the millennial generation leaving Vancouver in droves due to the cost of living is a myth, the latest census figures suggest.

It is, in fact, their older 30 and 40 something siblings who are packing up the kids and fleeing south of the Fraser.

The number of 25 to 34-year-olds living in the City of Vancouver increased 21 per cent between 2006 and 2016, the census data reveals. Surrey saw a 37 per cent increase in this age group over the same time period.

Burnaby, New Westminster and the North Shore also saw increases.

Vancouver is, however, losing its younger Gen Xers. The city lost almost 9,000 residents between the ages of 35 and 44 between 2006 and 2016, which amounts to a nine per cent drop.

Burnaby, Richmond, the North Shore and New Westminster also lost members of this age group, though the drop was less steep than in Vancouver.

Vancouver's loss is, at least in part, Surrey's gain. That city saw an 18 per cent increase in this age group over the same time period, gaining almost 11,000 people between 35 and 44.

These trends do not come as a surprise to Paul Kershaw of the University of B.C.'s School of Population and Public Health.

The city's real estate market and couples' biological clocks are what is driving them, he said.

Paul Kershaw of the University of B.C. says a combination of real estate prices and biological clocks are driving people in their 30s and 40s out of Vancouver. (Lauren Pelley/CBC)

"You'll have the 20-somethings who'll be excited to come to what is, in many respects, a vibrant city, lots of cool things to do here, and they'll be willing to make a go of it in a bachelor pad or a basement suite. And they do that in part by adapting starting their own homes and starting their families," he said.

"And then, they start running into their biological clocks."

When couples have their first child, some will choose to stay in a one or two-bedroom apartment, Kershaw said, but with a second child, it becomes more difficult due to the costs associated with a three-bedroom home.

Families choose to delay having a child or having a second child well into their 30s, which is part of what accounts for that demographic's movement out of Vancouver, Kershaw said.