The Reagan administration yesterday blamed supporters of deposed dictator Jean-Claude Duvalier for the violence in Haiti and said it had cut off all nonhumanitarian economic aid to the nation.

Roving gunmen killed more than 20 persons yesterday. In response, the Haitian government canceled that country's first democratic elections in 30 years.

Secretary of State George P. Shultz, interviewed on CBS-TV's "Face the Nation," said, "as far as we know, this is violence caused by the supporters of deposed dictator Duvalier." Shultz called the cancellation of the elections a "shame" and said the United States would continue to press for democratic elections.

"The United States has decided to remove all United States military assistance personnel from Haiti and to suspend all military assistance to Haiti," State Department spokesman Benjamin Justesen said last night in a statement.

"In addition, all nonhumanitarian economic aid programs to Haiti are being suspended and only humanitarian assistance will continue," the statement said.

The move, he said, comes "in view of the . . . actions of the national governing council of Haiti dissolving the provisional electoral commission and aborting all electoral legislation."

U.S. economic aid to Haiti totaled more than $100 million last year. It goes to a variety of projects from school lunches to financing the commission that was to supervise yesterday's elections.

The White House, in a statement issued yesterday afternoon, said President Reagan had been briefed on the Haitian situation by his national security adviser, Lt. Gen. Colin L. Powell. It called the situation "regrettable" and expressed concern for the safety of all Haitian citizens.

A delegation of 11 U.S. observers who had gone to Haiti to monitor the elections was to be evacuated last night by a U.S. Air Force plane. The White House statement said all members of the observer team were safe.