UPDATE (Feb. 7, 12:22 p.m.): President Trump attacked the news media on Friday, Feb. 3, for supposedly underreporting acts of terrorism in Western countries. But, as this analysis from July of last year shows, attacks in the West are consistently overreported relative to similar attacks elsewhere.

When a man drove a truck through a crowd in Nice, France, on Thursday night, the act of mass violence set off another all-too-familiar cycle of outrage, mourning and political gamesmanship. Media outlets ran stories of tragedy and heroism; politicians vowed to keep their constituents safe; citizens mourned at candlelight vigils. The attacks drew international attention, including in the U.S., where President Obama spoke from the White House, just as he had after November’s attacks in Paris. “We see our kids in the faces of the young people killed in Paris,” Obama said the following month.

But this month has also seen attacks in Baghdad and Dhaka, Bangladesh, both of which Obama briefly mentioned in his address after the killings in Nice. Likewise, the attack in Paris was preceded by one in Beirut the day before. Yet those incidents received little attention — at least, until the subsequent attacks in France brought them into the spotlight — and the news media appeared to largely pass on covering these cities with the kind of live updates and in-depth human interest stories we saw after Paris and Nice.

It’s not hard to understand why Americans care about France and worry when it’s in danger. Despite the intervening ocean, France feels close to home; our nations are politically, economically and culturally intertwined to the point of kinship. But the extensive coverage of the attacks in Nice and Paris force us to question the boundaries of this kinship: Do we not see our kids in the faces of the young people killed elsewhere?

Mohamad Bazzi, a journalism professor at New York University and a former Middle East bureau chief for Newsday, sees these discrepancies as just a few data points in a larger pattern of American reporting, one with vast and often underappreciated consequences. In a phone conversation about how the media covers terrorist attacks across the world, Bazzi said: “The death toll in the West tends to be lower most of the time, but the coverage the West gets is an order of magnitude larger.”

Of course, there are problems with drawing such a conclusion from a handful of examples. For one thing, each attack claims a different number of lives. Bazzi acknowledged this, adding that the sophistication and coordination of the Paris attacks lent itself more readily to intensive, minute-by-minute coverage. But he stood by his larger claim.

Fortunately, we have the statistical tools to be more precise about Bazzi’s claim. After controlling for the number of injuries and fatalities, will we find that terrorist attacks on Western cities are more likely to be covered by the U.S. media than similar attacks elsewhere?

The Rand Database of Worldwide Terrorism Incidents contains data on 40,129 terrorist attacks that took place from 1968 to 2009. Each incident is logged with a date, location, the number of injuries and fatalities, and a brief description of the attack, among other details. One piece of information that’s missing: Did we care?

To answer this question, I consulted The New York Times’s Article Search API, which allows developers to query a tagged database of every article published since 1851. For each attack in Rand’s list, I checked whether there were any articles about it in the database. To do this, I queried for articles content-tagged with “terrorism,” geo-tagged with the city of the attack, and published on the day it took place or the following day. If I got any hits, I labeled that incident “newsworthy.”

This is, admittedly, a blunt measure of news coverage; it would make no distinction between, say, Paris and Beirut, which were both covered by the Times. Bazzi’s critique focuses more on the nature of the coverage, the “sidebars and human features and profiles of the victims and all the associated stories” that the U.S. media published after the Paris attacks. Still, if it’s true that we care less about terrorism in non-Western cities, we should find not only that major attacks receive less depth of coverage but also that minor attacks receive less coverage, period. My analysis homes in on this latter question: Does the location of an attack near the threshold of newsworthiness affect its coverage in U.S. media?

Or at least, in The New York Times. I use the Times as a proxy for the U.S. news media because I was unable to find any other publication that makes its archives as accessible to researchers.

I ran a logistic regression on this data, asking my computer to predict whether an attack was covered based only on (1) the number of injuries, (2) the number of fatalities and (3) the country where the attack took place. Sure enough, this third variable was — for some countries — a significant predictor of newsworthiness.

There were 31 countries with enough data to study. In 11 (Egypt, France, Greece, Israel, Italy, Lebanon, Pakistan, Saudi Arabia, the U.K., the U.S. and the West Bank/Gaza), a terrorist attack was statistically significantly more likely to be covered in the Times than an attack of the same magnitude that occurred elsewhere; in six (Afghanistan, Colombia, India, Iraq, Kashmir and Thailand), attacks were statistically significantly less likely to be covered.

We can estimate the relative likelihood of coverage for each country by calculating an “odds ratio.” For example, France’s odds ratio of 5.9 implies that an attack in France is 5.9 times as likely to be considered newsworthy as an attack of the same magnitude not in France. We shouldn’t read too much into the exact numbers, as the error bars are pretty wide. But the vast disparities, from 10.2 in Saudi Arabia to 0.1 in Colombia, cannot reasonably be blamed on statistical noise.

Michael Slackman, the international managing editor for The New York Times, pushed back on my results. “We have no ‘terrorism formula,’” he said in an email. “The context for ‘terror’ in the range of countries you listed — and over a four decade time span — is so varied that it seems impossible to make any kind of objective comparison or insightful conclusion.”

Slackman’s skepticism is warranted. The term “terrorism,” which my analysis regards as a discrete category, is of course highly influenced by political context. Considering that the Rand database includes a variety of groups, from Colombian rebels to jihadists like al-Qaida, we have to be careful when considering these results.

Indeed, Colombia’s claim to the lowest odds ratio of any country in this data set may be because of its longtime armed conflict. Terrorist attacks were quite frequent there during the period covered by the Rand data, and perhaps the regularity of these attacks made them less newsworthy in the eyes of the U.S. media. As Slackman suggests, we have to consider that the nature of attacks in a certain region — not just location — affects how that region is covered.

As another example, Saudi Arabia has the highest odds ratio in the data set. Saudi Arabia is a key ally of the U.S., certainly, but another factor may be in play here: There is a history of anti-Western attacks in Saudi Arabia, many targeting Americans. When I controlled for the presence of the word “American” in Rand’s attack description, Saudi Arabia’s odds ratio dropped to 5.7. This indicates that the outsize coverage of Saudi Arabian attacks could have as much to do with who their victims are as where they took place.

In addition to relevant country-specific contexts, Slackman is also right to be wary of the wide time span that this analysis covers. In particular, the political context for “terrorism” differs greatly for the periods before and after the Sept. 11 attacks; an attack taking place after Sept. 11, 2001, was 50 percent more likely to be covered by the Times than an attack of the same magnitude before Sept. 11. This could confound our results in countries where terrorism is concentrated on one side of the Sept. 11 attacks — for example, a shockingly small 22 of the 6,878 Iraqi attacks in the data set occurred before the 2003 U.S. invasion.

We can’t reasonably conclude, then, that location affects coverage, all else held equal; in the complex world of international terrorism, it is not possible to hold all else equal.

In a broader sense, though, Slackman’s criticism rings hollow to my ears. Whatever the cause, the numbers do bear out a discrepancy that reflects the expectations of nearly every journalist and academic I spoke to. If confounding variables like those mentioned above were doing all the heavy lifting, we’d see a scattered assortment of countries on either side of the coverage spectrum. Instead, the odds ratios are significantly correlated with GDP per capita.

Bazzi, for his part, believes the disparities are in large part due to an empathy gap, fueled by audience interest just as much as reporter focus. “Editors and producers advance the argument that they’re satisfying the needs of their audience — especially now, when all traffic can be measured, coverage can be catered quite quickly,” Bazzi said. He also argued, though, that the audience doesn’t dictate the coverage focus so much as preserve an existing coverage focus that it has come to expect. “Why did the audience get this way?” he asked.

Mónica Guzmán, vice chair of the ethics committee at the Society of Professional Journalists, said she agrees that both parties are responsible but stressed the role that journalists must play in breaking the cycle. “Many newsrooms like to think they cover all parts of the world equally, but they don’t, really,” Guzmán told me by email. “Unconscious biases abound, and maybe some conscious ones, too. … Great journalists take these challenges head on, and never assume they’ve conquered them.”

In the meantime, what can consumers of U.S. news do to push for more equitable coverage? “It’s hard to impose habits on people,” Bazzi said. “One quick fix for the audience is to go to sources in those countries. … If they see things in those local sources that they think should have been done by their usual American outlets, then they should bring that up.” Being conscious of and vocal about discrepancies, pressing U.S. sources to improve by asking them to confront their place in the feedback loop, may be our best hope to break the cycle.

Even with heightened scrutiny, though, this problem won’t resolve itself overnight. Slackman promised that the Times has “a deep and growing commitment to cover the world” — about this, I have no doubt. The paper has announced that it is making a $50 million investment in international coverage and distribution. But many readers are committed to seeking out equitable coverage, and still, peak Google search volume for “Beirut” fell short of 1 percent of the peak volume for “Paris” in the days following the attacks in those cities last year.

Intention is crucial, but it takes continued effort to change personal and institutional habits. “Let’s not kid ourselves,” Guzmán said. “This work is hard.”