The United States merchandise trade deficit dipped 17 percent in April to $6.9 billion, its second best showing since 1983, as U. S. purchases of foreign cars and petroleum products fell, the government reported.

More than half the U. S. deficit -- $4 billion -- was with Japan, which has been accused by the Bush administration of stonewalling in negotiations to provide a long-term improvement in the transpacific trade imbalance. By contrast, the United States ran a $1.4 billion trade surplus with Western Europe.

"The country's trade deficit appears on a roll -- a roll downward," said Commerce Secretary Robert A. Mosbacher. "I cannot be more pleased with the latest report . . . I'm as confident as I can be that a pattern of improvement is emerging that could result in our country's deficit reducing to the low 90s in billions of dollars by the end of the year."

But private analyst noted a dark side to the improved trade showing. They said the decline in the trade deficit reflects a sluggish economy marked by consumers buying fewer cars and by factories using less oil rather than an improvement in the U. S. competitive position in the world.

"There's no room for complacency on trade. We still have a big problem in competing," said Lawrence Chimerine, president of Radnor Consulting Services of Norristown, Pa.

In another sign that the economy is slowing down, the Labor Department said yesterday that retail prices rose a moderate 0.2 percent in May after an upward spurt earlier in the years that fueled fears of inflation. A slackening of inflationary pressure bolsters the Bush administration's argument that the Federal Reserve Board should lower interest rates, giving the economy a shot in the arm. {See story Page D1}.

Most analysts, who had expected this year's trade deficit to meet or exceed last year's level of $109 billion, have been surprised by the good showing in the first four months of the year.

"We are in much better shape on trade than I thought at the beginning of the year," said Allen Sinai, chief economist of the Boston Co., which lowered its estimate for the yearly trade deficit to about $90 billion.

The National Association of Manufacturers also estimated the trade deficit would be about $90 billion to $100 billion for the year.

"It may be a great year for the trade deficit if you can say a $90 billion trade deficit is a great year," said David Blond, senior international trade forecaster in the Washington office of DRI-McGraw Hill, an economic forecasting firm.

The trade numbers are particularly important for administration economic planners, who are counting on a continued strong export showing to keep the country from sliding into a recession.

Surging exports have been responsible for one-third of the country's economic growth over the past three years, according to economists, and with the domestic economy slowing down, overseas sales loom more important this year. Exports were estimated to be responsible for half the nation's growth during the first three months of the year, with the strong economies of Japan and West Germany helping to pull in American exports.

Although April's $32.3 billion in exports fell 3.5 percent from March, it still remained higher than the monthly averages for 1989 and for the first four months of 1990. Foreign sales of airplanes, which had dipped in March, spurted in April, as did exports of consumers goods.

But overseas sales of U.S.-made electronic data-processing equipment and other office machinery lagged. Stephen Cooney, director of international investment at the National Association of Manufacturers, said the biggest component in the $1.2 billion fall in U.S. exports is a $500 million drop in computer sales "from an abnormally high March level." Farm exports also declined.

Nonetheless, Cooney concluded that "U.S. manufacturing export performance is still getting better and bolstering our weak domestic economy."

The falloff in imports was twice as great as the drop in exports, dipping to $39.2 "billion in April as sales of foreign cars and oil, each decreased by $1 billion. Even though the U. S. dependency on foreign oil is growing, the lowered sales reflected decreases in both the volume of imports and the price of petroleum.

Aside from the surplus with Western Europe, the United States ran deficits with most of the rest of its major trading partners. With the continuing dependency on imported oil, the deficit with OPEC nations totaled $1.4 billion, down $400 million from March. The deficit with Japan with $800 million, down $200 million. The deficit with China was $600 million, the same as March, while the deficit with South Korea rose to $400 million from an even trading relation in March.