The United States observed its national holiday this year in a curious mood. Most Americans sense slippage in the preeminence this country enjoyed through the postwar period. But there is a shallowness of consensus, a fragmentation of opinion respecting what to do about not being first.

The evidence of slippage lies everywhere. In 1972, the United States lost its lead as the country with the highest standard of living in the world. Its growth rate is down 25 percent in the past decade. It is no better than average among industrial countries when it comes to inflation. Investment -- the best gauge of the future -- is way below what it is in Germany and Japan.

To stiffer competition from other industrialized countries, there is joined the difficulty of having to deal increasingly with an increasingly intractable Third World. The United States depends for oil on the likes of Saudi Arabia, Libya and Nigeria. The most successful developing countries outperform this country in such basic items as shipbuilding and auto assembly. The boycott on manufactured goods to Iran is being broken, in main, by India.

In the security field, the Russians not only maintain a larger army and bigger defense budget. They are not only tipping the balance of nuclear forces in their favor. They are also showing a capacity to use force where it counts.

Where it counts these days is the Persian Gulf. The United States did nothing to stop the move of the chief regional power, Iran, from allied to hostile status. It failed to deter the Soviet invasion of Afghanistan, and is now dickering about terms for accepting Moscow's puppet regime. Pakistan is already moving slowly toward accommodation with Moscow. So Russia has emerged as the predominant power in the vortex of world politics.

Public awareness of these troubles finds expression in all the polls. In the past -- after Sputnik in 1958, for example -- the mere sound of footsteps engendered a turn of speed by this country. Some continue to believe that the sense of impending decline will automatically foster a turnaround. The White House, for example, keeps saying that the "Vietnam complex is over."

My own sense is that, this time, challenge will not necessarily stimulate response. The new element, the factor that breaks the familiar cycle, is public opinion. Insofar as there is a consensus at all, it develops around primitive concepts almost irrelevant to the national troubles. Moreover, majorities tend to sit uncertainly among a multitude of different minorities.

The majority seems to believe the United States should spend more on defense. But higher defense appropriations have passed Congress as percentage rises in the total budget. And there is disagreement on specific weapons systems.

A considerable public doubts the need for any increase in defense spending. Opposition to effective measures for reducing dependence on imported oil constitutes a majority by iteself. There seems to be hardly any support for what the country truly needs most in the foreign field -- an increased capacity to project political influence abroad.

Most of the country favors economic growth. Judging by Congress at least, a majority of them believe that tax cuts represent the best way to ensure higher output. But important constituencies favor public works and more social welfare programs. A highly sophisticated group feels a general tax cut at this time will only fuel more inflation. A considerable minority rejects growth in favor of the principle that "small is better."

Developing significant consensus in these conditions seems to me almost impossible. The emergence of President Carter and Gov. Reagan as the nearly certain nominees of their parties expresses not a failure of the system, but a true translation of how much the majority prefers nice men to effective measures. With either one in the White House, the next few years shape up as a time of transition to something better. Probably the best that can be said for Mr. Carter is that for him the time of transition will inevitably be limited.

Maybe bolder leadership could make a difference. But probably there is required something that cuts much deeper, something that affects the totality of opinion -- a jolt that breaks the spirit of division and irresolution that is always the hallmark of a great power on the edge of decline.