Massachusetts boasts the nation's best business environment for science and technology, according to a prominent think tank.

The nonpartisan Milken Institute highlighted Massachusetts' strength in research and development, powered by the state's many colleges and universities, and said an outsize share of venture capital money flows to Massachusetts companies. Though California claims more total dollars, Massachusetts leads the country in venture capital funding as a percentage of gross state product, according to Milken's calculations.

Milken ranks states every other year; Massachusetts has been No. 1 since 2002.

"Not only does it have the tremendous concentration of universities and all that suggests and implies, it's the retention of talent that's incredibly important," said report coauthor Kevin Klowden. "Yes, there's brain drain, but the overall educational attainment of the workforce is incredibly high."

The California-based think tank cited recent legislative moves as evidence of Massachusetts' commitment to science and tech, including new investments in the University of Massachusetts Medical School and limits on noncompete agreements.

Milken's analysis did identify an area of concern for Massachusetts — and it wasn't the state's unsuccessful bid for Amazon's second headquarters.

"We're taking a bigger-picture view," Klowden said.

The trouble spot identified by Milken is college debt, which can push high-paying science and technology jobs beyond the reach of students from low-income families.

"For Massachusetts to maintain its No. 1 rank, the state will need to find ways to expand access to education for the overall population," the Milken report said. "The average 2016 graduate in Massachusetts has $31,563 of debt, and 60 percent of students will have at least some debt. Maintaining a competitive high-tech workforce will require higher education not only to teach viable work-related skills, but also to avoid excluding the bottom of the income bracket."

Other New England states scored highly in Milken's analysis. New Hampshire ranked ninth; Connecticut, Rhode Island and Vermont all earned spots in the top half.