It may seem crass to think of a bachelor’s degree simply as a financial investment. Yet, with the cost of US college tuition increasing rapidly—and interest rates on student loans following suit—it seems more and more sensible to consider the financial payback of a given school along with its academic prestige and the intangible qualities that give it character.

Payscale, a consultancy that specializes in employee compensation, recently released a report of the net 30-year return on investment of 1,070 American colleges and universities. Given a school, the report shows how much more each graduate can expect to make than somebody with a high school diploma, minus how much she paid for her degree. Here’s a list of the top five schools by ROI:

They are all engineering schools, but it’s not just because engineers make a great salary. To isolate the impact of each school, the report only looks at graduates who have earned bachelor’s degrees and did not go on to earn a master’s, PhD, or any other advanced degree. That rules out doctors, lawyers, and MBAs, but it doesn’t exclude many licensed engineers. If you take out the engineering schools, the list instead looks like this:

So does it make sense to go to an expensive school? Do you end up making more in the long run? The short answer is yes. Here’s a chart of the expected net 30-year return plotted against the total cost of a bachelor’s degree for each of the schools in the report. (Note: for public schools, only the in-state costs are represented.)

Though the points are pretty scattered, there’s clearly a trend: Spending more on school tends to mean making more after graduation. But that’s not the whole story. If you look closely at the scatterplot, you’ll see an unusual bald spot:

The reason is that there are actually two separate trends in this plot: 1) graduates of more expensive public schools tend to make more money, and 2) graduates of more expensive private schools tend to make more money. The bald spot shows up where the trends diverge:

The public school trend is steeper than the private school trend, meaning if a prospective student is looking at public schools, she’ll typically get a higher return on picking a slightly more expensive school than she would if she were choosing among private schools (provided the public schools are in her home state). Since public schools are subsidized, it only stands to reason.

But one important lesson from these data is that prestigious private schools do seem to be worth it. Excluding engineering schools, 46 out of the top 50 best undergraduate investments are private, including all eight of the Ivy League schools.

Then, of course, there are those unfortunate schools that don’t seem to be worth it at all for typical graduates. Here are the bottom five. The return on investment is negative in each case, meaning graduates would generally be better off with just a high school diploma than having paid to attend these colleges:

How to impress top schools: The secret to cracking the college essay