MEXICO CITY — Rival drug gangs battle over territory. The murder rate rises and helpless residents implore the government to restore order. The government sends soldiers to keep the peace.

But instead, the violence gets worse.

The story was repeated many times during the six-year term of President Felipe Calderón, who began his presidency at the end of 2006 by sending troops into his home state, Michoacán. Now a statistical analysis of homicide rates in 18 regions of Mexico during that time confirms that the arrival of soldiers failed to reduce the number of murders in 16 of those areas. In some of the most notable cases, including the border cities of Ciudad Juárez and Tijuana and the Pacific resort city of Acapulco, the murder rate soared in the year after soldiers were put on the streets, according to a new study published on the website of The American Statistician.

The study, “Did the Military Interventions in the Mexican Drug War Increase Violence?” strongly suggests that the arrival of troops leads to an increase in homicide rates in the short term, or at best, no improvement, said Valeria Espinosa, one of the study’s authors, a quantitative analyst at Google who completed a Ph.D. in statistics at Harvard in 2014.

To estimate the effect of the military intervention, the study compared the regions where there were interventions with similar regions where no troops were sent. Ms. Espinosa and her co-author, Donald B. Rubin, a Harvard professor of statistics, also defined the regions they studied as the central city and surrounding municipalities because drug violence often migrates to neighboring areas when soldiers begin patrolling cities.