Passengers stretching their legs on a short excursion as they wait for the release of the ship MV Akademik Shokalskiy, which was trapped in the ice at sea off Antarctica in 2013. (Andrew Peacock/AFP/Getty Images)

Getting more women into science and math jobs is a challenge across the world. Worldwide, 74 percent of STEM — science, technology, engineering and math — employees are male. The imbalance is biggest in fields such as computer science and physics, and smallest in life sciences and medicine.

But as countries become wealthier and more focused on gender equality, something interesting happens: The number of women earning degrees in science, technology, engineering and math drops, according to a new study.

Researchers at the University of Missouri looked at data on 475,000 people across 67 countries, examining how well subjects did in school and where they ended up working.

They found that boys' and girls' achievements in STEM subjects were “broadly similar.” But they also found that science was more likely to be boys' best subject.

“Girls, even when their abilities in science equaled or excelled that of boys, often were likely to be better overall in reading comprehension, which relates to higher ability in non-STEM subjects. As a result, these girls tended to seek out other professions unrelated to STEM fields,” David Geary, professor of psychological sciences in the University of Missouri’s College of Arts and Science, told the World Economic Forum.

A chart from Geary's study

Another interesting thing about the data: Wealthier countries, with more gender equality, tend to do a worse job getting women into STEM fields. (The report's authors call this a “gender-equality paradox.") European countries, particularly in northern Europe, had a relatively low percentage of women going into the sciences. In the Middle East and Turkey, the rates were much higher.

Researchers theorize this is because women in Europe and the United States have more freedom and options.

“In countries with greater gender equality, women are actively encouraged to participate in STEM; yet, they lose more girls because of personal academic strengths,” Geary said. “In more liberal and wealthy countries, personal preferences are more strongly expressed. One consequence is that sex differences in academic strengths and interests become larger and have a stronger influence on college and career choices than in more conservative and less wealthy countries.”

Another possibility? Jobs are more stable in wealthier countries, so salary differences between fields matter less.

“STEM careers are generally secure and well-paid, but the risks of not following such a path can vary,”  Gijsbert Stoet, professor in psychology at Leeds Beckett University in England, told the World Economic Forum. “In more affluent countries, where any choice of career feels relatively safe, women may feel able to make choices based on noneconomic factors. Conversely, in countries with fewer economic opportunities, or where employment might be precarious, a well-paid and relatively secure STEM career can be more attractive to women.”

But their research suggests there are other pipeline problems, too. Women make up 20 percent of engineering school graduates, but only 11 percent of engineers. Twelve out of every 100 women graduate with a bachelor's degree in a STEM major, but just three accept work in a STEM field after graduation.