Like many aspects of immigration, the H-1B program, which allows skilled foreign workers to be hired in the United States, inspires controversy.

In this presidential election campaign alone, Donald Trump’s contradictory remarks echo a longstanding debate about the program. Initially, Trump argued that immigrants educated at top American colleges should not be kicked out after graduation because “we absolutely have to be able to keep the brain power in this country.” However, he later issued a statement that H-1B workers are “imported from abroad, for the explicit purpose of substituting for American workers at lower pay.”

So which is it? Do H-1B workers contribute to the economy by performing jobs that Americans are unwilling or unable to do, or do they steal jobs from U.S. workers and push down wages?

Daniel Aobdia, an assistant professor of accounting information and management at Kellogg, investigated these questions within a specific industry: H-1B workers hired as auditors.

His team found that these workers, most of whom attended U.S. schools, tend to take jobs in less desirable offices or that require highly specialized skills, suggesting that they complement—rather than displace—U.S. workers. In addition, the researchers found no evidence that hiring more H-1B workers lowered wages at those offices.

“They’re not hired to take the jobs of Americans,” Aobdia says. “They go where the Americans are reluctant to go.”

However, Aobdia cautions this may not be true for foreign-educated H-1B visa holders working in the U.S., many of whom are employed by outsourcing firms, and who make up a large percent of those with H-1B visas.

A Trove of Data

The H-1B program works as follows: Each year, the program issues temporary work visas to up to 65,000 foreigners trained in “specialty occupations” such as engineering, medicine, and law. Another 20,000 visas are available for those with at least a master’s degree from an American university. Employees at certain institutions such as universities and government research agencies do not count toward the overall cap.

“They are hired because you need qualified workers and you don’t have enough of them.”

The cap has been temporarily raised in the past but is now nearly the same as it was when first introduced more than two decades ago, and the number of applicants far exceeds it. Therefore, visas are awarded by lottery, and are fully allotted in a matter of days after the filing period starts on April 1 each year. Given this reality, the primary concern of many foreign students educated at top U.S. universities is not whether they will obtain well-paying jobs, but whether they can obtain employer-sponsored visas.

In theory, the visa program rules should prevent companies from paying H-1B workers less than their American counterparts. Employers are not allowed to offer an H-1B applicant a salary that is lower than similar employees’ pay or the “prevailing wage” for that job in that location. But the standards for determining prevailing wages are shaky, and companies can take advantage of loopholes, such as hiring the person through a third-party service. In addition, increasing the supply of workers might drive down everyone’s pay over time because employers have more potential employees to choose from and thus do not have to offer high salaries or raises to attract and retain staff.

Aobdia, who teamed up with Anup Srivastava of Dartmouth College and independent researcher Erqiu Wang, wanted to understand the true effect of highly skilled immigrant workers. They turned to the auditing industry, which allowed them to combine three sets of publicly available data—audit documents, which include information regarding the auditing office that performed the work and its fee; the characteristics of that audit office’s clients; and the details of the H-1B applications that office submitted.

They examined 16,997 H-1B applications from dozens of offices belonging to the six biggest public accounting companies in the U.S. from 2001 to 2012. To find out which types of offices hired H-1B workers, the researchers looked for links between “immigration intensity” within an office—the number of applications submitted or in progress, adjusted for the estimated size of the office—and other characteristics of individual offices, such as the types of clients they served, the quality of life in their city, and the office’s reputation.

To find out whether hiring more immigrants drove down the entire office’s wages, the team analyzed the starting salaries offered to the H-1B workers, as reported in the visa applications. The researchers investigated whether offices that hired more H-1B immigrants offer lower salaries, while controlling for other factors affecting wages.

Filling Gaps in the Workforce

The team found that H-1B workers tended to play two roles.

First, they were more likely to be hired by offices that might have difficulty attracting U.S. workers—for example, offices that were smaller, served fewer prestigious clients, or were in less desirable locations.

Along the same lines, H-1B applications were more common among offices that had recently made mistakes on an audit, which likely damaged their reputation. “Those offices start hiring more immigrants,” he says.

Secondly, the companies hired H-1B applicants for specialized work. Offices whose clients required complicated accounting or had higher foreign income tended to apply for more visas, perhaps because these employees offered skills such as speaking another language. And more H-1B workers were hired in areas of the country with a relatively high proportion of immigrants. This pattern might have arisen because companies in those areas are more welcoming of immigrants or local foreign-born clients want to interact with other immigrants.

As for an effect on wages, “we don’t find anything,” Aobdia says.

The offices that sent in more H-1B applications did not offer lower salaries. Additionally, if employers were hiring H-1B workers to suppress pay, one might expect those offices to take advantage of the savings to charge their clients less and gain a competitive edge. However, the researchers did not see this pattern either; in fact, offices with more immigrants tended to charge more.

In short, these employers are not hiring H-1B holders in order to save money, says Aobdia, himself an immigrant from France. “They are hired because you need qualified workers and you don’t have enough of them.”

A Matter of Education

Recall, however, that most of the H-1B workers in Aobdia’s study were likely educated in the U.S. Trends may differ for immigrants educated abroad. The overall supply of foreign-educated workers is much larger than that of U.S.-educated workers, perhaps making it easier for their employers to abuse the system.

Take, for instance, outsourcing firms, whose workers are often educated abroad, and who are at the center of recent criticism of the H-1B program. Organizations such as Walt Disney Company and Southern California Edison have been accused of replacing U.S. workers with H-1B visa holders working for outsourcing firms. Indeed, the Economic Policy Institute finds that Southern California Edison outsourced its information technology (IT) to a firm that paid its H-1B workers 36 to 41 percent less than Edison paid its American IT employees.

Trump’s contradictory comments might therefore hold a grain of truth. Some companies may abuse the program by using foreign-educated H-1B workers as “cheap labor,” but the economy could benefit from allowing more U.S.-educated workers to stay in the country after graduation.

The U.S. should not apply blanket policies to these two categories of workers, Aobdia says. “People have taken a very black and white view of immigrants.”

Editor’s note: Daniel Aobdia is currently a Senior Economic Research Fellow at the Public Company Accounting Oversight Board (PCAOB). This research was conducted before that affiliation, and the views expressed here are his own and do not necessarily represent those of the Board, individual Board members, or staff of the PCAOB.