[This very question was addressed by] a famous paper by John Knowles and Petra Todd that looked at the conviction rate, by race, of vehicles searched from traffic stop data in Maryland.
The premise of the paper is this:
Suppose you see that police in some jurisdiction are stopping and searching cars driven by African-American (black) drivers just as often as Caucasian (white) drivers even though only 10% of the population is black. [In Maryland 63% of cars stopped were driven by African-American drivers, while only 18% of all cars on the road were driven by African-Americans along I-95] This stopping and searching of cars then is disproportionately focused on black drivers and is evidence of racial profiling, stopping and searching cars precisely because they are being driven by black drivers. Even if it is the type of car itself, say, that is the reason for the search, if that type of car is disproportionately driven by black drivers it could still be considered racial profiling. But what if police officers are using their wealth of knowledge and experience to judge which cars to search regardless of the race of the driver, and it just so happens that this leads to half the cars searched being driven by black drivers? In other words, what if officers are quite good at detecting illegal activity and that this activity has disproportionate racial participation. How could you tell the difference between discriminatory behavior, searching drivers because of race regardless of likelihood of illegal activity, and good policing, searching only cars with a high likelihood of illegal activity?
Well if it is the former, what we would expect is a higher number of unsuccessful searches among those performed on cars driven by blacks than among those driven by whites because blacks are being stopped due to race and not evidence of illegal activity. This is precisely the test Knowles and Todd did with the Maryland traffic stop and search data. It turned out that though the searches were disproportionate, the conviction rates from those searches were not. There was no lower a conviction rate among black drivers that were searched than among white drivers. So while racial profiling might be the reason for the search it is not, in this case, evidence of racial prejudice. Now, as I said before, there is a bigger question about whether, even if this is true, racial profiling is justified and should be allowed. You are welcome to discuss this in the comments, but I am going to leave it as an open question.
On a related note: my study of racial discrimination in the NFL has a similar design. I looked at whether the outcomes of players in the NFL were consistent with their draft position and found that non-white players systematically outperformed their draft position while white players underperformed relative to what their draft position would predict. This is evidence, then, that NFL teams discriminate against non-white players when they draft players into the league. [Note that the action here is not in the first and second round stars but the in the outcomes of the many players taken the the later rounds] Why? That is an open question, but I believe that teams find white stars more marketable (at the time the white Ed McCaffrey was a huge media darling in Denver while the statistically better black Rod Smith was not). I did find some suggestive evidence that teams pay a real price for this behavior where teams that were more egregious in their racial preference fared worse in terms of the their record.
Now a caveat that I did not highlight then is that this assumes a race-blind criminal justice system (or a class neutral one - which ours is certainly not - because of the high correlation between race a class in this country). However, if the incentive of the police officer is to get convictions then this is not a condemnation of police but of the court system.
It would be very interesting to see if subsequent conviction rates justified the stops in this case, but sadly we cannot really say anything about whether these stops are justified. Which is a shame, for we really ought to know.