Three years ago, an unmarked police car tailed Richard Jackson into an alley behind his home on Chicago's West Side and pulled him over. Jackson, a black Navy veteran, had become used to being stopped by police for what he believed was no reason since returning to Illinois from the military in 2012.

But this time was different. After an officer ran his driver's license, then said he was free to go, Jackson pointedly asked what he had done wrong. The officer, who is white, said Jackson had cut him off, which Jackson denied. The officer then issued Jackson citations for failing to yield at a left turn and stop sign, which Jackson also denied.

Although the officer did not allude to Jackson's race, the veteran believed that was why he was stopped. He successfully fought the two citations and filed a complaint with the Chicago police.

Richard Jackson filed a complaint after a 2016 traffic stop. Richard Jackson

"With this racial profiling — I'm not just going to roll over," Jackson, 36, said.

The Chicago police did not respond to a request for comment.

Jackson's encounter with the Chicago police reflects the experiences of people of color across the country, who describe being stopped and searched by officers without a good reason. Like Jackson, many believe their race played a role.

Now, Stanford University researchers have compiled the most comprehensive evidence to date suggesting there is a pattern of racial disparities in traffic stops. The researchers provided NBC News with the traffic-stop data — the largest such dataset ever collected — which points to pervasive inequality in how police decide to stop and search white and minority drivers.

Using information obtained through public record requests, the Stanford Open Policing Project examined almost 100 million traffic stops conducted from 2011 to 2017 across 21 state patrol agencies, including California, Illinois, New York and Texas, and 29 municipal police departments, including New Orleans, Philadelphia, San Francisco and St. Paul, Minnesota.

The results show that police stopped and searched black and Latino drivers on the basis of less evidence than used in stopping white drivers, who are searched less often but are more likely to be found with illegal items. The study does not set out to conclude whether officers knowingly engaged in racial discrimination, but uses a more nuanced analysis of traffic stop data to infer that race is a factor when people are pulled over — and that it's occuring across the country.

"Because of this analysis, we're able to get to that anecdotal story to say this is really happening," said Sharad Goel, an assistant professor in management science and engineering at Stanford and a co-author of the study.

Police pull over about 20 million drivers across the United States each year, according to researchers. And while the extreme cases grab the spotlight, such as the fatal police shootings after traffic stops of Walter Scott in South Carolina, Samuel DuBose in Cincinnati and Philando Castile in suburban Minneapolis — all black men — most end without anyone getting hurt. Still, for drivers of color who are stopped by police, the suspicion that racial bias played a role can linger.

"There's no longer the idea of Officer Friendly, who might help you understand why they pulled you over. Now, it's about using racial profiling to control people and place fear in them," said David Lowery, founder of the Living & Driving While Black Foundation in Chicago, an advocacy group calling for an end to racial profiling.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

"Then, you've got money tied up into this," he added. "Who can write the most tickets? Who can put the most people in jail and into the court system? It’s no longer about a simple traffic stop for safety."

The Stanford study sliced the data in three distinct ways to search for evidence of racial bias:

Police stops: A "veil of darkness" test was done to analyze whether black drivers are being pulled over at a higher rate during the day than at night, when officers would have a harder time distinguishing race from a distance. After adjusting for the variation in sunset times across the year, researchers found a 5 to 10 percent drop in the share of stopped drivers after sunset who are black, suggesting black drivers are being racially profiled during the day.

A "veil of darkness" test was done to analyze whether black drivers are being pulled over at a higher rate during the day than at night, when officers would have a harder time distinguishing race from a distance. After adjusting for the variation in sunset times across the year, researchers found a 5 to 10 percent drop in the share of stopped drivers after sunset who are black, suggesting black drivers are being racially profiled during the day. Police searches: Researchers reviewed the rate at which drivers were searched and the likelihood that those searches turned up illegal drugs and guns. There was evidence that the bar for searching black and Latino drivers is lower than that for white drivers, even though white drivers were more likely to have contraband. Across states, contraband was found in 36 percent of searches of white drivers, compared to 32 percent for black drivers and 26 percent for Latinos.

Researchers reviewed the rate at which drivers were searched and the likelihood that those searches turned up illegal drugs and guns. There was evidence that the bar for searching black and Latino drivers is lower than that for white drivers, even though white drivers were more likely to have contraband. Across states, contraband was found in 36 percent of searches of white drivers, compared to 32 percent for black drivers and 26 percent for Latinos. Impact of marijuana legalization: After the legalization of recreational marijuana in Colorado and Washington state, there has been a reduction in searches of both white and minority drivers. But the search rate remains twice as high for minorities, a trend also noted in a 2017 Stanford study.

Stanford's research is based on numbers provided by state and city agencies, but not all police departments track that data or are willing to release it. While the majority of states responded to the Stanford group's public records requests and offered at least some traffic stop data, four states said they didn't have information on drivers' race and 15 failed to say whether they collect any data at all.

Cheryl Phillips, who launched the Stanford Open Policing Project in 2014, said the patchwork of responses highlights how government agencies "don't make this a priority."

Illinois, which requires officers to document every traffic stop, has been at the forefront of the practice since it began doing so in 2004. Rachel Murphy, a staff attorney for the American Civil Liberties Union of Illinois, said the effort has been effective in drawing attention to the need for more police accountability.

"Not only does it provide transparency for the public, but it also is a tool for departments to show the public that they're committed to eradicating racial disparities and ensure their own policies aren't contributing to these racial disparities," she said.

In response to a January report by the ACLU of Illinois that found racial disparities in police stops, Chicago police said the numbers failed to note the high volume of crime and calls for service made in the predominantly minority neighborhoods where police also conducted the most stops.

James Pasco, executive director of the Fraternal Order of Police, the largest police organization in the country, said police officers are trained to stop drivers based on behaviors and not what a person looks like. Often, when a driver is pulled over from behind, his or her race is obscured, he said.

While Pasco hadn't seen the latest Stanford study, he said racial-bias-related studies in general might not consider whether minorities do more driving in some areas compared to white drivers, and that police officers patrol higher-crime areas that also have larger minority populations, and therefore, more minority drivers.

"We're conscious of that potential bias, to train against it, recruit against it, and promote against it," Pasco said. "Very few of the researchers have ever been out in a patrol car in the middle of the night and know what it's like."

Still, transparency around traffic stop data can be a first step toward reforms, civil rights advocates say.

In St. Paul, which employs more than 600 officers, numbers for traffic stops as well as 911 calls and traffic crashes are released each year. St. Paul police spokesman Steve Linders said the move is part of a directive that Police Chief Todd Axtell issued in 2016.

Linders said the department has used its numbers, which include breakdowns by race and location, to "make sure traffic stops are based on facts instead of implicit bias."

"There are inequities in traffic stops. It's fact. Our data shows that," he added.

Among the department's latest initiatives: Officers' traffic-stop data is shared with them so they can better understand the drivers they're pulling over and why. All employees are mandated to go through implicit bias training annually. And last year, a mental health unit was formed to go out on calls and review cases to prevent situations from escalating.

Linders said that the department has yet to see any measurable decrease in stops that appear to be based on bias, but stressed that officers are "doing their jobs with professionalism, compassion and public safety at the top of their minds."

Goel, the co-author of the Stanford study, said he hopes law enforcement agencies will look at their own numbers and recognize racial disparities as well as potential remedies. One option is to have police patrol high-crime neighborhoods but not necessarily stop drivers for a relatively minor offense, such as failing to signal or for a broken light.

"It's important stops are done quantitatively, rigorously, and to make sure it's not based on bias," he added.

Jackson, who joined the military at 18 and is now an immigration officer, said he hasn't been pulled over since the last time in 2016 near his home. The complaint he filed with Chicago police's Internal Affairs Division was closed after his citations were thrown out — without addressing any of his concerns about racial profiling.

Still, he has no regrets about speaking up to the officer who stopped him.

"I gave up too much time in my life to fight for this country to have my rights trampled on," Jackson said. "If that means I get shot, killed, honestly, then that's what's going to happen. But I'm going to make sure my rights are not violated."