Women of all ages and young men with certain mood disorders are most at risk of developing certain chronic diseases, new study published in the journal JAMA Network Open reports.

Researchers analyzed medical data from 40,360 adults in Olmsted County in the U.S. state of Minnesota, CNN reported.

The research team divided the participants into three age groups based on gender: 20, 40 and 60 years old. The participants were further divided into four groups: with anxiety, depression, anxiety and depression or without anxiety and depression.

Women in all three age groups and men in their 20s who had either depression or anxiety and depression had a significantly higher risk of developing chronic illness than participants without anxiety or depression.

Of the women in the study, women in their 20s were most likely to develop chronic illness if they had both anxiety and depression, with the risk increasing by more than 61% compared to participants without mental illness. Women in their 60s were found to be least likely to develop chronic conditions: if they only had anxiety, their risk increased by more than 5% compared with participants who had neither anxiety nor depression.

Among men in the study, men with anxiety and depression in their 20s were most likely to develop chronic illness: their risk increased by almost 72% compared with the control group, and men with anxiety in their 60s were least likely: their risk decreased by more than 8%.