Growing up in a warm family environment is associated with feeling more secure in romantic relationships in your 80s, new study says.

“Happy wife, happy life,” so they saying goes. But according to a new study published in Psychological Science, a happy relationship might all begin with a happy childhood. Through a longitudinal study spanning more than six decades, researchers at Harvard Medical School found that men who grew up in caring homes felt more secure in romantic relationships in their 80s.

“Our study shows that the influences of childhood experiences can be demonstrated even when people reach their 80s, predicting how happy and secure they are in their marriages as octogenarians,” researcher Robert Waldinger of Harvard Medical School said in a statement. “We found that this link occurs in part because warmer childhoods promote better emotion management and interpersonal skills at midlife, and these skills predict more secure marriages in late life.”

Waldinger and Marc Shulz, a professor at Bryn Mawr College, collected data from 81 men who participated in a 78-year long study of adult development. Of the participants, 51 were part of a Harvard College cohort and 30 were part of an inner-city Boston cohort. All of the men completed regular interviews and throughout the course of the study at three different points in their lives: in adolescence, in middle age, and in their 70s and 80s.

To assess the participants’ early home environment, the researchers examined data collected when the participants were adolescents, including self-reported home life history, interviews with the participants’ parents, and developmental histories recorded by a social worker. These data were used to create a composite measure of family environment during childhood.

When the participants were between 45 and 60 years old, they completed interviews in which they discussed the challenges they faced in various aspects of their life, including their relationships, work, and physical health. The researchers then used notes from the original interviews to rate participants’ ability to manage their emotions in response to these challenges.

Finally, the participants, then in their late 70s and early 80s, completed an interview that focused on their attachment bond with their current partner. They were asked to talk about their marriages, including how comfortable they were depending on their partner and how they felt about providing support to their partner. These interviews provided data to establish an overall rating of participants’ security of attachment to their partner.

The results showed that participants who had a nurturing family environment in childhood were more likely to have secure relationships later in life, in part, because they were more skilled at regulating their emotions in midlife.

The study adds to previous research showing that the quality of people’s early home environments can have “far-reaching effects on wellbeing, life achievement, and relationship functioning throughout the lifespan,” says Waldinger.