A new study confirms what doctors have long asserted — cold weather is a risk factor for heart attacks. But the risk doesn't stop with the cold. Low atmospheric pressure and the associated wind, rain and lack of sunshine also make heart attacks more likely, it seems.

The study, published Wednesday in JAMA Cardiology, looked at 3 million weather data points on the days corresponding with almost 275,000 heart attacks in Sweden. It covered a 15-year-period, from 1998 to 2013. Swedeheart, Sweden’s online cardiac registry, and the government’s expert weather institution, the Swedish Meteorological and Hydrological Institute, provided the extensive data.

Dr. David Erlinge, head of cardiology at Sweden’s Lund University and lead author of the study, said this is the largest-scale study he’s aware of on the effect of weather on cardiac events.

“People have been talking about weather and heart attacks for about 100 years,” he said. “With our robust data, we can separate out many more factors than just the cold.”

The study found that days with below-freezing temperatures (32 degrees Fahrenheit) had the highest incidence of heart attack. As temperatures rose closer to 40 degrees, heart attack rates went down. The north of the country, which has more snow and wind than the south, had generally higher rates.

But a deeper look at the data suggests that weather fluctuation could be the bigger factor. In the northern part of the country, the coldest region, heart attack cases did not correlate with temperature, but rather with increases in wind and snow. Looking at the whole country, the data specifically on the cold weather season, January to March, didn’t show a meaningful association with increased heart attack.

The finds indicate "an adaptation to long winters and low temperatures,” the study says.

Dr. Craig Thompson, director of interventional cardiology at NYU Langone Health, said it’s generally believed that cold weather is a risk factor for heart attack because it can constrict the arteries. He was not surprised to hear that overall, colder weather was associated with heart attacks.

“It seems abnormal weather is the issue,” Thompson said. “Cold snaps when it should be warm and so on. When the weather changes in a harsh manner, that overcomes the adaptability factor.”

He said he’d like to see further studies looking at areas with more variety of climate, such as tropical locations or places in the U.S. that have a wider range of weather than Sweden.

Other studies have shown that it can be people's behavior in the cold that contributes to heart attacks, particularly, shoveling large amounts of snow when they do not usually engage in strenuous physical activity.

The average age of people in the study was nearly 72, and Erlinge said cold and inclement weather is mainly a cause of concern for people who are already at risk of heart attack. They should be careful during the cold by wearing warm clothes or staying indoors if necessary, he said.

Lack of sunshine, not just cold, can increase heart attack risk.

“Many older people move to warm, sunny places in retirement,” he said. “Our study indicates that that is a good idea.”