A new national survey of law enforcement officers found that the vast majority feel their jobs are harder than ever before, after the police-involved shootings of black Americans over the past several years.

The nationally representative survey of close to 8,000 police officers, released Wednesday by the Pew Research Center, provided some data to back up assertions made by leading law enforcement figures, including the F.B.I. director James Comey, that the publicity surrounding such episodes has discouraged the police from confronting suspects.

The survey found that 72 percent of respondents said their colleagues are “now less willing to stop and question suspicious persons”; that 86 percent thought police work had become harder because of high-profile incidents like the killings of Mike Brown in 2014 and Alton Sterling in the summer of 2016; and that 93 percent of police officers think their colleagues now worry more about personal safety.

The survey, conducted between May 19 and Aug. 14 of last year, also highlighted a sharp distinction between the attitudes on race by white and black police officers, a chasm that experts said mirrored broader divides within American society.