A recent study points out a so-called “gender-equality paradox”: there are more women in STEM in countries with lower gender equality. Why do women make up 40 percent of engineering majors in Jordan, but only 34 percent in Sweden and 19 percent in the U.S.? The researchers suggest that women are just less interested in STEM, and when liberal Western countries let them choose freely, they freely choose different fields.

We disagree. It’s no surprise that women are less “interested” in fields where they will be paid less money for work that will be less valued, and where men are skeptical that these gender biases even exist.

Rather than reveal a paradox, this research helpfully illustrates that the barriers that keep women out of government or the boardroom may not be the same barriers that keep them out of science.

From cradle to classroom, a wealth of research shows that the environment has a major influence on girls’ interest and ability in math and science. Early in school, teachers’ unconscious biases subtly push girls away from STEM. By their preteen years, girls outperform boys in science class and report equal interest in the subject, but parents think that science is harder and less interesting for their daughters than their sons, and these misconceptions predict their children’s career choices.

Later in life, women get less credit than men for the same math performance. When female STEM majors write to potential PhD advisors, they are less likely to get a response. When STEM professors review applications for research positions, they are less likely to hire “Jennifer” than “John,” even when both applications are otherwise identical—and if they do hire “Jennifer,” they pay her $4,000 less. Women of color face even greater challenges as racial and gender biases intersect.

These findings make it clear that women in Western countries are not freely expressing their lack of “interest” in STEM. In fact, the best predictor of college women’s choice of major is the amount of gender discrimination they perceive in that major, not how “math”-y or “science”-y it is. Cultural attitudes and discrimination are shaping women’s interests in a way that is anything but free, even in otherwise free countries.

“Gender-equality paradox” research misses those social factors because it relies on a broad measure of equality called the Gender Gap Index (GGI), which tracks indicators such as wage disparity, government representation and health outcomes. These are important markers of progress, but if we want to explain something as complicated as gender representation in STEM, we have to do more than compare paychecks and count seats in parliament. We have to peek into people’s heads.

Fortunately, we have ways to do that. The Implicit Association Test (IAT) is a well-validated tool for measuring how tightly two concepts are tied together in people’s minds. The psychologist Brian Nosek and his colleagues analyzed over 500,000 responses to a version of the IAT that measures mental associations between men/women and science, and compared results from 34 countries. Across the world, people associated science more strongly with men than with women.

But surprisingly, these gendered associations were stronger in supposedly egalitarian Sweden than they were in the U.S., and the most pro-female scores came from Jordan. We re-analyzed the study’s data and found that the GGI’s assessment of overall gender equality of a country has nothing to do with that country’s scores on the science IAT.

That means the GGI fails to account for cultural attitudes toward women in science and the complicated mix of history and culture that forms those attitudes—for instance, did you know that one of the oldest universities in the world was founded by a Muslim woman?––so while it may be good at identifying the countries where a woman can win an election, it’s bad at identifying the ones where she’ll be welcome in a physics department.

Luckily, cultural attitudes are not laws of nature, and both of us are living proof that good mentors can help students break free from gendered expectations. One of us is man who chose to major in psychology––where 76 percent of bachelor’s degrees go to women––after a teaching assistant told him, “hey, you’re good at this.”

The other is a woman who fell in love with math thanks to a father who, after teachers told his daughters “math is for boys,” designed his own (freely available) math curriculum. Every morning he sat down with his daughters, printer paper and magic markers in hand, to explore the beauty of math in fun, low-key sessions. We both owe our academic careers to mentors who didn’t assume to know our interests and abilities based on our genders.

The stakes are high. If we believe that Western countries are close to achieving gender equality, and that any remaining gender disparities are due to differences in abilities and interests, we risk making those disparities both acceptable and permanent.

And that would hurt men as well as women. Recent research shows that girls have actually outperformed boys in all subjects in school for 100 years. Should we assume that boys will just never be as smart or interested in school as girls are? Of course not. Everyone understands boys can succeed in school just as much as girls, given the right environment. We should offer women the same understanding: given the right environment, they can succeed in STEM just as much as men.