The study found that how well students integrated socially in their new environment was associated with changes in their heart-rate variability (differences in the length of time between heartbeats).

“Other research has shown that individuals with a lower heart-rate variability are at increased risk for the development of poor health, including greater risk for cardiac diseases,” lead study author Jean-Philippe Gouin said in a press release. “Therefore, decreases in heart-rate variability are bad for you.”

The students with less social integration had lower heart-rate variability, while those who made more friends over the five months saw their heart rate variability increase, even after controlling for individual differences in extraversion. This was a relatively short time period, of course, but low heart rate variability over years could put lonely people’s hearts at risk.

Plenty of other studies have linked a lack of social interaction to heart problems. The Swedish Survey of Living Conditions, which surveyed more than 17,000 people, found that those with the fewest social contacts were at a 50 percent higher risk for dying of cardiovascular disease. And once someone has a heart problem, friends improve her chances of survival. In one study, women with suspected coronary artery disease were more than twice as likely to be alive after two years if they had a wider social circle, and also had lower rates of hypertension and diabetes. And in an American Heart Association study, after a heart attack, patients with low social support were more likely to have depressive symptoms and report low quality of life.

As Gouin’s study suggests, lower heart-rate variability could be one thing that accounts for the connection between social isolation and poor heart health. Another possibility is stress—stress is linked to heart disease, as well as many other conditions. Social support might help mitigate stress, and protect the body somewhat from its negative effects. In one small study, when children hung out with their best friends during a stressful situation, they had lower levels of the stress hormone cortisol (which, in high levels over time, increases the risk for heart disease). The participants in Gouin’s study didn’t have their best friends in their city, but they still saw results with the presumably more casual connections they were able to make in five months.

The factors that go into heart-disease risk create a tangled web, but life’s web is tangled too. The health of the heart is inextricable from the health of the rest of the body, and a person is inextricable from his environment. And for your heart, it seems, it’s better to have people in that environment than not to.