The reason women aren’t graduating from science, technology, engineering and math doctoral programs stems from the fact that they’re the minority.

When it comes to science, technology, engineering and math (STEM) graduate programs, a new study revealed that women are in a class of their own. Indeed, the fewer females who enter a doctoral program at the same time, the less likely any one of them will graduate within six years, according to research by post-doctoral researcher Valerie Bostwick and Bruce Weinberg, professor of economics at Ohio State University.

The study, which examined 2,541 students enrolled in 33 graduate programs at six Ohio public universities between 2005 and 2016 revealed that where there’s just one woman in a new class, she’s 12 percentage points less likely to graduate within six years than her male classmates. “What we found suggests that if there are few or no other women in your incoming class, it can make it more difficult to complete your degree,” said Bostwick.

Data shows that this problem is likely widespread: “Although the number of STEM PhDs rose from about 18,000 in 2006 to more than 27,000 in 2016, the proportion of doctorates awarded to women remained at around 40%,” according to a study published in Nature last year.

That’s different than what’s going on in other fields too: According to Statista, in 2018, an estimated 95,000 women will receive doctoral degrees while just 85,000 men will. The American Enterprise Institute reports that in 2016, women earned the majority of doctoral degrees for the eighth straight year, outnumbering men in grad school 135 to 100 — but the fields in which women enter are arts and humanities, education, health sciences, public administration and social and behavioral sciences.

In order to determine the fields women drop out of, Bostwick and Weinberg used new data that shows when and if students drop out of programs and linked transcript records from all public universities in Ohio to data from the UMETRICS projects, which provides information on students supported by federal research grants. Bostwick said, “It has been nearly impossible to quantify the climate for women in male-dominated STEM fields. But our data give us a unique opportunity to try to measure what it is like for women in STEM.”

Weinberg told Moneyish that in order to remedy the issue of females dropping out, the most direct thing to do would be to try and recruit more interested and qualified women into programs and try to avoid classes with very low shares of women. “I think the deeper answer is for people to be more sensitive to the women in their programs and making the environment more female friendly would help,” he said.

Among the programs studied, Bostwick and Weinberg found that the average incoming class of doctoral programs included about 17 students, 38% of which were female. In typically male programs like chemical engineering, computer science and physics, the average number of women who joined a class in any particular year was less than five. “The study shows the importance for women of having a support system of other women in their entering class. But if there were more women than average in the program, that graduation gap goes away,” said Weinberg.

But why exactly do women drop out of post doctoral classes? The study indicates that research funding and grades likely play a part. If female students were less likely to obtain research funding than their male peers, that could be an important reason why they’re failing to finish and results showed that women had slightly lower grades than men when they were in male-dominated classes. And the Harvard Business Review listed sexism, unequal pay and less access to prestigious work as reasons the STEM sector is losing female talent.

The Economics and Statistics Administration published a report in 2017 that found women filled 47% of all jobs in the United States but held only 24% of STEM jobs. The same report revealed that women with STEM degrees are less likely than their male counterparts to work in a STEM occupation.

As for ways to keep the female retention rate up, industrial engineering lecturer Paula Jensen says parents should begin to encourage their daughters to remain open to careers in STEM fields. “Invite questions and listen for those questions that show interest in the world, such as ‘Why is the sky blue?’” and find mentors who are female engineers, doctors or scientists,” she said. Engineer Andrea Brickey, an associate professor of mining engineering and management at the South Dakota School of Mines & Technology said, “Be conscious of your own biases. You might not have fond memories of math and science classes, but be careful about how you describe your experiences and feelings about the subjects.”

“It may be hard to feel like you don’t belong when you don’t see other women around you. There may be subtle discrimination. We don’t know. But it highlights the fact that women need support, particularly if they are the only ones entering a doctoral class,” said Bostwick.