Diabetes isn’t just a physical disease — it can also affect a person’s cognitive, emotional and mental health. People with diabetes are more likely to experience depression and the anxiety and anger that often accompany it. The reason, a new study from Iowa State University shows, has to do with what’s going on in their brains.

People with diabetes or prediabetes, the slightly elevated blood glucose levels that can lead to diabetes, came into the lab and looked at positive, negative or neutral images. They were hooked up to two kinds of monitors. One involved electrodes placed under the eyes, to measure a person’s startle response. The other was an EEG, which tracks electrical activity across the scalp to see what’s going on in the brain.

People with higher levels of insulin resistance may be more reactive to negative things in life.

There were telling differences in people with diabetes or prediabetes. First, they had a greater startle response to the negative images they viewed; the startle or flinch response is a reflex, so it’s not within our conscious control.

“People with higher levels of insulin resistance were more startled by negative pictures,” said researcher, Auriel Willette, in a statement. “By extension, they may be more reactive to negative things in life. It is one piece of evidence to suggest that these metabolic problems are related to issues with how we perceive and deal with things that stress all of us out.”

Another difference was that when their brains were at rest, people with diabetes or prediabetes had more right brain activity, a pattern linked to negative emotions and depression, and their levels of the stress hormone, cortisol, also indicated chronic stress.

The findings suggest that people with diabetes may react more strongly to negative events, making it harder for them to change lifestyle habits associated with stress. Co-author Tovah Wolf had noticed in her clinical practice as a dietitian that patients' reactions to stressors varied a lot. That can affect their ability to change habits and live healthier lifestyles.

“For people with blood sugar problems, being more stressed and reactive can cause blood sugar to spike,” said Wolf. “If people with prediabetes and diabetes are trying to reverse or treat the disease, stressful events may hinder their goals. Frequent negative reactions to stressful events can lead to a lower quality of life and create a vicious cycle that makes it difficult to be healthy.”

The findings offer a new piece to the puzzle as to why diabetes and depression so often go together. If you’re dealing with depression, speak to someone — treatment is possible. But the new study may also offer some comfort, since it demonstrates that if you are feeling depressed, it has physical underpinnings and certainly isn’t just “in your head.”

The study is published in Psychosomatic Medicine.