AMERICANS are admirably optimistic about shaping their own future. One survey found that nearly three-quarters of Americans thought hard work was a “very important” component of success, while just 62% put it down to a good education and less than a fifth to coming from wealth. But the United States ranks poorly compared to other advanced economies when it comes to income inequality and social mobility. So what must an ambitious young American do to get rich?

A new study by Raj Chetty of Stanford University and a collective of other economists helps answer this question. By matching data from the Department of Education with 30m tax returns, Mr Chetty and his colleagues have constructed a data set that reveals to researchers both the income distributions of graduates of particular colleges, and how incomes vary depending on how rich the graduates’ parents were. The data show that attending an elite college is a good way of securing an upper-middle class lifestyle—graduates of Ivy League-calibre universities have roughly the same chance of breaking into the top 20% of the income distribution, regardless of family background. Paths to the upper-middle class exist for those who graduate from lesser-known universities too, since earnings can depend even more on what one studies than where. On average, graduates of lesser-known engineering colleges such as Kettering University and the Stevens Institute of Technology do just as well as those from the Ivy League.

But a good education alone cannot propel the merely upper-middle class into the ranks of the rich. Few engineers, nurses or pharmacists make it to the top 1%, which is dominated by bankers and other financiers. Recruiters in the financial industry place high premiums on pedigree. Here the Ivies play an outsize role; products of elite private universities such as Harvard and Yale are much more likely to end up on Wall Street. Moreover, data from Mr Chetty and colleagues show that it helps to start off rich in the first place.

This trend is even more pronounced at the very top of the income distribution. Between 1999 and 2004, just 2% of Princetonians came from the families in the lowest 20% of earnings, while 3.2% came from families in the top 0.1%. The admissions process at top colleges is sometimes further skewed by the preferential treatment given to family members of alumni. Of Harvard’s most recently admitted class, 27% had a relative who also went to that “college near Boston” (pictured). That suggests that the simplest way to become extremely rich is by being born to the right parents. The second-easiest way is to find a rich spouse. If neither approach works, you could try to get into a top college—but remember that not all Princetonians become plutocrats.

“Mobility Report Cards: The Role of Colleges in Intergenerational Mobility” (Raj Chetty, John N. Friedman, Emmanuel Saez, Nicholas Turner, Danny Yagan; 2017)