When Sharad Goel first added his computational chops to an effort started by Stanford’s journalism program to analyze tens of millions of traffic stops for racial discrimination, he doubted that the researchers would see a clear problem. One year later, the assistant professor of management science and engineering says he was decidedly wrong.

The collaboration’s pilot study looks at 4.5 million traffic stops by the 100 largest police departments in North Carolina from 2009 through 2014, focusing on stops leading to searches. For the state as a whole, data showed that black and Hispanic drivers were searched at higher rates than white motorists even as detentions of those minority drivers uncovered contraband less frequently.

The discrepancies were exacerbated when the researchers applied an algorithm they designed that revealed what Goel says were lower thresholds for pulling blacks and Hispanics over, resulting in tens of thousands of additional stops of minorities. The analysis, he says, indicates widespread discrimination across virtually all departments.

Sometime this fall, the project intends to make public the data and analyses from a number of other states. Researchers began with North Carolina simply because the state keeps a thorough, centralized account of statewide traffic stops that is attainable through a public records request.

In some other states, data are often scattered among local departments, recorded with less information or otherwise harder to get. Tennessee, for example, said it would have to hire a third party, costing $7,125 to gather what Florida had mailed out on a disc within a few weeks of receiving the request, according to Vignesh Ramachandran, MA ’12, of the Stanford Computational Journalism Lab.

But with persistence, patience and pro bono legal advice, the project has amassed some 80 million records for analysis, which Goel hopes will give a needed window on one of the most common ways the public interacts with law enforcement. Each year, there are about 20 million traffic stops nationwide, and while there have long been complaints of double standards for driving while black or brown, hard data to back them have been scarce.

“We care so much about this issue—or we talk about it like we do,” Goel says. “But we don’t even know the basics about it empirically.”

Ultimately, Goel hopes the project, which recently won a $310,000 grant from the Knight Foundation, will open eyes within law enforcement to a problem he thinks many don’t appreciate exists. “I feel like when these police chiefs actually see there is discrimination, they would like to remedy the situation.”

Goel previously analyzed New York City’s “stop-and-frisk” policy toward pedestrians. He and his collaborators found that among those detained, African-Americans were significantly less likely than whites to have weapons. 

Further, they found that only a few of the many factors officers could cite as grounds for initiating a search were corroborated by their finding weapons. If the police had limited the stop-and-frisk operations to just three factors—a suspicious bulge, a suspicious object, or the sight or sound of criminal activity—they could have found more than half of all the weapons they did find with only 8 percent as many stops, the research concluded.

The results refute the common belief that there’s usually a trade-off between protecting civil liberties and enabling effective policing, says Stanford law professor David Sklansky, who has collaborated with Goel on big data analysis. Goel’s work showed that both are possible.