Today, almost half of all US jobs require a drug test, and it turns out that companies that test their employees hire more black people. But that’s not a result that reflects well on Americans.

Abigail Wozniak, a Notre Dame labor economist, has developed a model to show how the rise of employee drug testing in the United States has affected different populations. What she found surprised her: In states where testing is prevalent thanks to supportive laws, black employment increased between 7% and 30%, and wages for black workers increased by between 1.4% and 13%.

That’s surprising because in America’s often-misguided war on drugs, black people tend to suffer disproportionately—just look at the statistics on arrests and the controversy over “stop and frisk” policing tactics. There’s plenty of evidence that black and white Americans use illicit drugs at roughly the same rate, though white Americans are more likely than black Americans to abuse alcohol:

National Survey on Drug Use and Health

But despite that, according to studies cited in the paper, there’s wide overestimation of black people’s drug use in the US by everyone from police to hiring managers to young black people themselves.

And that’s why Wozniak thinks drug testing increased black employment: Without the testing, employers went by their gut biases. But when testing became common and showed that black applicants were not actually using drugs, hiring rates for black applicants went up. Wozniak concludes that this is evidence of discrimination against black workers before testing, driven by some combination of racialized belief and ignorance. One other interesting finding from the study is that absent drug testing, employers tend to hire white women instead of black men.

Opinion polls Wozniak notes show increasing approval of employee drug testing among black people and unskilled workers, and growing disapproval of testing among older and more educated workers, which she said indicates that the people who benefit from such policies understand that, on some level.

This research is only a “first look” at these relationships, and Wozniak says more work needs to be done to understand labor market discrimination and how to fix it. She’ll be grappling with that problem soon enough—next month, she starts a term as a senior labor economist on the White House Council of Economic Advisers.