Feeling blue could land you in the red.

Increasingly prevalent mental health conditions like anxiety and depression have “a large and significant negative effect” on retirement savings, according to recent research from Cornell University and the nonprofit Medica Research Institute.

Mental health problems are linked to an up to 24% lower likelihood of having retirement accounts and up to a 47% greater likelihood that married folks will withdraw from retirement accounts, the study published in the journal Health Economics found. Depression and anxiety were also associated with single households holding close to $15,000 less in retirement savings accounts and married couples holding nearly $42,000 less.

A recent shift from defined benefit pension plans (in which employers guarantee a monthly benefit upon retirement) toward defined contribution plans (which require more active management from the individual) indicates newer generations will wield “greater responsibility managing money for retirement,” study co-author and Cornell professor Vicki Bogan told Moneyish.

“And if there is a mental health issue that’s influencing people’s decision to participate, how much money they put in, their withdrawal — it can negatively impact their retirement savings in a way that can have severe consequences for their socioeconomic status,” she said.

The findings, she added, identify that “these mental health issues actually influence people’s decisions and choices” when it comes to defined contribution plans.

Depression affects more than 6.5 million in the 65-and-over crowd, according to the Substance Abuse and Mental Health Services Administration. About 25% of older Americans deal with some type of mental health issue.

Though Bogan and co-author Angela Fertig’s research didn’t address the specific mechanism through which mental health problems influence retirement savings, previous research indicates they may affect risk aversion and the rate at which people “discount” future utility.

The study results emphasize “the importance of employer management policy and government regulation of these accounts to help ensure households have adequate retirement savings,” Bogan and Fertig conclude.