Getting a job in academia is notoriously difficult. But the odds are especially bad for aspiring professors who didn’t earn their PhDs from a select few universities, according to a new study published in the journal Science Advances.

Researchers at Harvard and the University of Colorado, Boulder looked at full-time faculty in history and business departments in US colleges, and at computer science faculty in the US and Canada, between 2011 and 2013, co-author Aaron Clauset tells Quartz. They examined where the professors had earned their PhDs, and created a ranking system of the most prestigious schools in each subject, based on how successful their graduates were in finding jobs. They analyzed 16,316 assistant, associate and full professors across 242 schools.

Overall they found a fourth of the institutions accounted for about three fourths of tenure-track faculty. For example, 18 universities produce half of US and Canadian computer science professors, 16 universities produce half of US business professors, and eight universities account for half of US history professors. They chose these three fields to get a range, from humanities to scientific fields, and demonstrate that exclusive institutions dominated across the board, Clauset says. Here are rankings of the schools with the graduates deemed most desirable for faculty positions in various fields. Desirability is based on a methodology that accounts for the range of institutions that hired graduates from that university:

Top computer science schools:

Stanford

University of California, Berkeley

MIT

Caltech

Harvard

Cornell

Carnegie Mellon

Princeton

Yale

University of Washington

Top business schools:

Stanford

MIT

Harvard

UC Berkeley

Rochester

Chicago

Cornell

Northwestern

University of Michigan

Columbia

Top history schools:

Harvard

Yale

UC Berkeley

Princeton

Stanford

Chicago

Columbia

Brandeis

Johns Hopkins

University of Pennsylvania

The odds of even being admitted to these schools’ PhD programs is very low. Stanford’s business school PhD program received 731 PhD applications, and 25 people enrolled. While it may be true that these schools attract better job market candidates because of their academic rigor, the narrow pipeline could also hamper innovation throughout these fields, Clauset says. For example, if a new idea originates at Stanford, it’s more likely to gain traction throughout academia because Stanford graduates become faculty everywhere. But if an idea originates in a low-prestige university, that idea is less likely to see any attention, because it’s far less connected to the rest of academia.

“This is independent of whether the ideas are good or not,” Clauset says. “These are structural factors that shape the success of ideas.”

Additionally, those attending a prestigious university for a PhD probably won’t stay there—82% of doctoral graduates are hired by less prestigious universities than the one they attended, Clauset says. Six percent of people stay at the institution where they earned their PhD, and the remaining 12% move up.

Clauset is one of that elite 12%, having risen from the University of New Mexico’s computer science PhD program to a faculty position at the University of Colorado, Boulder, ranked 56 on the list. Another is Michael Horn, who earned his computer science PhD from Tufts University but is currently an assistant professor in learning science and computer sciences at Northwestern University. Northwestern is ranked 42 in computer science prestige, while Tufts doesn’t even make the top 60. Both Clauset and and Horn studied very niche subjects, so they fit a specific mold of what the higher-ranked universities were looking for.

For aspiring professors, Clauset advises writing high-profile papers to be published, while Horn suggests asking a leading professor from a higher-ranked university to serve on your dissertation committee, working with a well-respected advisor regardless of the university’s rank, and finding internships outside your own institution.