The uneven impact of climate change is actually helping corn and soybean farmers in the Upper Midwest.

Higher temperatures and heavier precipitation have increased yields for corn and soybeans in much of Minnesota, Iowa and the Dakotas, according to a statistical analysis conducted at the University of Minnesota. The study highlights the disparate effects of climate change, even within a region.

Soybean yields have improved in the Western Hemisphere and North Africa thanks to the changing climate, but have suffered in Eastern Europe. Even as corn harvests have benefited in Minnesota, they have suffered in Illinois, Indiana and Ohio.

Corn yields in Minnesota are up 2.8% and soybean yields are up 8% based on the study’s models, said Deepak Ray, a researcher at the Institute on the Environment at the U and lead author of the study.

“It was totally a surprise,” Ray said. “I was expecting there would be winners and losers, but I was expecting the Upper Midwest to be a loser.”

The study’s authors, who controlled for improved farm technology and management, built a data set of yields for 10 major crops and weather over decades across the globe to figure out what effect the changing climate has had.

In much of the world, the effect has been negative. Global palm oil, barley, rice and wheat yields have fallen. Soybean yields in Western Europe have dropped 22% and corn yields in Eastern and Northern Europe have dropped by 25% as a result of climate change, according to the study.

Global corn yields have held steady despite the declines in Europe, thanks to improving conditions in South America, but soybeans have been a big winner across the world. Global soybean yields are up 3.5% as a result of a climate change, the study said. Much of that benefit falls to farmers in the Upper Midwest.

Sorghum, which in the U.S. is mostly grown in Great Plains states, has also enjoyed increased yields thanks to climate change, the study said.

Wheat yields have suffered in the Upper Midwest compared to a hypothetically cooler climate, but the crop has been overtaken by corn and soybeans in much of Minnesota, so the negative effects aren’t widely felt.

“If you look at wheat for Minnesota, you see a negative effect, but wheat is not as important,” Ray said. “For corn and soybeans it has been great.”

Whether the changes to the climate will continue to benefit farmers in Minnesota and Iowa is another question, Ray said.

“At present we are sitting in a very nice climatic condition,” he said. “I don’t know if that will change.”