Almost 40,000 active for-profit companies trace their roots to Stanford University, and if they formed an independent country, it would be the world's 10th-largest economy, according to a study, Bloomberg reported.

The companies' combined annual sales of about $2.7 trillion have generated an estimated 5.4 million jobs since the 1930s, according to the study released last month by Charles Eesley, an assistant professor in management science and engineering, and William Miller, an emeritus professor of public and private management, at the college near Palo Alto, Calif.

The entrepreneurial community at Stanford played a key role in attracting future business founders to the school, Miller said. In the past decade, 55 percent of alumni who started companies said they chose Stanford specifically because of its entrepreneurial environment, according to the study.

The university first offered classes in small business and entrepreneurship after World War II. Stanford graduates have also created about 30,000 nonprofit organizations.

The study doesn't name the companies that participated and offers only a partial list of those that didn't respond, including Hewlett-Packard Co., Cisco Systems Inc., Yahoo Inc. and Google Inc. These companies aren't figured into the methodology. Read more.