If companies founded by Stanford graduates formed an independent nation, it would be the 10th largest economy in the world, according to a new study by two Stanford professors.

University graduates have created an estimated 5.4 million jobs and generate annual revenues of $2.7 trillion, based on responses to the 2011 Alumni Innovation Survey, sponsored by the venture capital firm Sequoia Capital.

Among its other findings:

The university imports talent to the Bay Area, attracting students from around the nation and world who stay here and create companies.

Almost one-third of all engineering-based entrepreneurs who graduated after 1990 formed their companies within 20 miles of the Palo Alto-based campus.

California is home to about 18,000 firms created by Stanford alumni, generating annual worldwide sales of about $1.27 trillion and employing more than 3 million people.

The study, “Stanford University’s Economic Impact via Innovation and Entrepreneurship,” analyzes the results of a large survey of Stanford alumni and faculty conducted in 2011 by Charles Eesley, an assistant professor in the Stanford School of Engineering, and computer scientist William F. Miller of the Stanford Graduate School of Business.

Although the university is well known as a breeding ground for entrepreneurs, this is the first study to quantify the sheer scale of the university’s economic impact.

Conclusions were based on about 30,000 responses of Stanford degree-holders and faculty from the 1930s to present.

They attributed the success, in part, to classes specifically designed to develop entrepreneurs, such as the Design School’s “LaunchPad,” the Business School’s “Creating a Startup,” and the Engineering School’s “Spirit of Entrepreneurship.”

In 1909, Stanford grad Cyril Elwell founded Federal Telegraph — the first major high-tech company to be formed in what became Silicon Valley. Since then, alumni have founded tech giants like Google, Hewlett-Packard and Cisco Systems, as well as a stream of new startups that feed the region’s innovation pipeline.

Now Stanford-affiliated companies generate revenue that accounts for almost half of the total sales reported by Silicon Valley’s largest firms.

There also is a growing diversity among those companies’ founders. The proportion of companies founded by grads who were non-U.S. citizens climbed from 29 percent in the 1950s to 42 percent in the 2000s. Women comprised 5 percent of company founders in the 1950s, jumping to 29 percent in the 2000s.

In the 1950s, electronics, communications and publishing were the top industry categories. During the 1990s and the height of the dot-com boom, more than 30 percent of the firms founded were in software or Internet industries with another 14 percent in communications. In the 2000s, there is increasing interest in energy and cleantech — over nine percent of firms are classified as energy related, up from 3 percent in the 1970s.

The study also looked at so-called “social innovation” by Stanford graduates and faculty. It estimates that more than 30,000 nonprofit organizations have been created, such as the microfinance organization Kiva, The Special Olympics and Acumen Fund, which supports entrepreneurs in developing economies.

Lisa M. Krieger is a science writer for the Bay Area News Group, covering research, scientific policy and environmental news from Stanford University, the University of California, NASA-Ames, U.S. Geological Survey and other Bay Area-based research facilities. Lisa also contributes to the Videography team. She graduated from Duke University with a degree in biology. Outside of work, she enjoys photography, backpacking, swimming and bird-watching.

In a video clip recorded by a student, a psychology instructor at Orange Coast College told her class that the election of Donald Trump was “an act of terrorism” – prompting an official complaint from the school’s Republican Club.

Homegrown tech entrepeneurs and educators from West Contra Costa County participate in an Hour of Code event Wednesday at the Richmond Police Activities League aimed at getting more African-Americans, Latinos and minorities into the tech field, as part of Computer Science Education Week, from Dec. 5 to 11.