At a news conference this week, D.C. Police Chief Cathy L. Lanier offered an encouraging development regarding violent crime.

“I am happy to report that . . . we have reduced robberies almost 20 percent,” Lanier said to a smattering of applause, mostly from city employees. “Yes, you can clap. Robberies are down almost 20 percent. I know I clap when I hear that.”

But a Post analysis of police data shows the total number of robberies is up slightly, not down, compared with the same period a year ago. And the most dangerous robberies — those at gunpoint — have increased by more than 20 percent.

Further, the baseline of 2015 was already elevated — the District had experienced a spike in robberies involving guns and a historic surge in homicides that made crime a top public concern for the first time in almost a decade.

In an exchange following the news conference, D.C. police spokesman Dustin Sternbeck said Lanier had calculated crime rates for a very specific time period and was not making a year-over-year comparison, which is a more traditional method.

She counted crimes that have occurred between Dec. 11, 2015, when the District launched a robbery task force, and July 11, 2016, and compared those statistics with crimes committed during the seven-month period before the task force was created, he said.

“She was comparing the 215 days since the implementation of the task force to the prior 215 day,” he wrote in an email.

He said department statistics showed 2,263 robberies in the prior period and 1,860 in the latter, or a drop of about 18 percent.

That is rarely how police portray year-over-year trends, because there are seasonal variances in violence, with crime often spiking in major cities during summer months.

A comparison of robberies that occurred between Dec. 11, 2015, and July 11, 2016, against robberies during the same period one year earlier, the way D.C. police usually report such statistics, shows that robberies had increased by more than 3 percent.

But even calculated by the method Lanier chose, the data don’t reflect an “almost 20 percent” drop in robberies, at least based on publicly available statistics.

According to the D.C. police crime-mapping tool, the numbers are slightly different: 2,174 robberies to 1,855, or a drop of roughly 14 percent.

On Friday, Sternbeck said the discrepancy of 89 appeared to stem from a difference in the way the department tracks crimes internally, compared with the way that its mapping tool displays them publicly. If a crime is not associated with an address recognized by the city’s mapping software, it can be left out of the public database, he said. The police department’s website says the problem can result “in a small margin of error.”

Despite Lanier’s reassurances, community meetings in many parts of the city have been dominated by concerns about robberies. That may be because a larger percentage of robberies are taking place at gunpoint.

Since the robbery task force was formed in December, robberies that did not involve a gun were down almost 9 percent, compared with the same seven months the year before, from 1,148 to 1,049. Meanwhile, robberies with a gun were up almost 24 percent over the same period, from 642 to 795.

At another point in the news conference, Lanier suggested the decrease she cited in robberies was pegged to another starting point, sometime early this year, after robberies had spiked.

In January 2016, the city saw a 30 percent jump in the total number of robberies. Since then, total robberies have trended slightly below last year’s tally over the same period, thanks to a drop in robberies not involving guns.

At the same time, the rate of robberies at gunpoint has gone in the other direction. There was a double-digit increase of 11 percent in robberies with guns by the end of January, but those crimes are now up by more than twice that rate, year-to-date.

When asked at the news conference about Democratic National Committee staffer Seth Rich, who was killed two days earlier near his Bloomingdale home in what police have told the family may have been a robbery, D.C. Mayor Muriel E. Bowser (D) said it was not clear there was a link.

[Slain DNC staffer wanted to make a difference]

“Actually, Mr. Rich and robberies, it hasn’t been determined,” Bowser said, turning the microphone over to Lanier.

“Robberies, right now, are not up. We are almost down 20 percent,” Lanier said again. And year-to-date, “we are exactly even, and every week they have . . . dropped steadily from the beginning of the year,” she said.

[Watch news conference here: Lanier addresses crime rates at Minute 16 ]