To understand the gaps, The Marshall Project obtained dozens of data sets from the Federal Bureau of Investigation and examined various combinations of killer and victim. Two types of “justifiable homicide” are noted: “felon killed by private citizen” or “felon killed by police officer.” (In a bit of circular logic, the person killed is presumptively classified as a felon, since the homicide could be justified only if a life was threatened, which is a crime.)

The data were processed to standardize key variables and exclude more than 200,000 cases that lacked essential information or were homicides by the police. The resulting data detail the circumstances of each death: any weapons used; information on the killer’s and victim’s race, age, ethnicity and sex; and how police investigators classify each type of killing (“brawl due to the influence of alcohol,” “sniper attack” or “lover’s triangle,” for example).

Little large-scale research has examined the role of race in “justifiable” homicides that do not involve the police. The data examined by The Marshall Project are more comprehensive and cover a longer time period than other research into the question, much of which has focused on controversial Stand Your Ground laws.

In the United States, the law of self-defense allows civilians to use deadly force in cases where they have a reasonable belief force is necessary to defend themselves or others. How that is construed varies from state to state, but the question often depends on what the killer believed when pulling the trigger.

“If there are factors — even if they’re stereotypes — that lead the defender to believe he’s in danger, that factors in, whether it’s a righteous cause or not,” said Mitch Vilos, a Utah defense lawyer, gun rights advocate and the author of “Self-Defense Laws of All 50 States.”