President Carter late last week chose the subject matter for yesterday's foreign policy address and decided to draft it himself to erase the impression that his administration was deeply divided on national security policy, White House officials said yesterday.

Carter apparently headed off a showdown between factions inside his government by assuming personal control over the speech-drafting procedure, officials said. Spokesmen in various bureaucratic camps that had been competing for Carter's ear declared themselves satisfied with the final speech yesterday.

These declarations were accompanied by reports that the White House wanted an end to public bickering within administration ranks.

Referring obliquely to widespread reports of a deep split betwwen the "hard line" of Zbigniew Brzezinski's National Security Council staff and Cyrus Vance's more cautious State Department position, press secretary Jody Powell said yesterday: "If we had assigned a first draft to either State or the NSC, the press would have accused us of playing favorites."

According to Powell, Carter took recommendations for the speech from the heads of the State and Defense departments, the NSC and U.N. Ambassador Andrew Young to Camp David last weekend and wrote out the speech in longhand himself.

Officials in the White House, the State Department and the Defense Department emphasized yesterday that the Annapolis speech was couched largely in Carter's own words, and that little of it was taken directly from recommendations of others.

Therefore, several officials said, the speech should not be subjected to rigorous diplomatic analysis, but should be read as a general statement of the president's policy.

Several officials said the speech contained ambiguities, "oversimplifications" or "mistakes" in precse phrasing that might be misinterpreted by the Soviets or others, but insisted that the general thrust of the speech - and the government's policy - should be clear.

Powell indicated that Carter decided to devote yesterday's speech to Soviet-American relations last Friday after the appearance of a story in The Washington Post saying the administration had effectively frozen the strategic arms limitation talks for the time being.

The story was one of many press accounts in recent days suggesting deep divisions within the Carter administration on national security policy.

Early this week Carter aides told reports that the Annapolis speech would resolve the apparent disagreements within the government. Yesterday, White House spokesman asserted that it had done just that.

Public discussion of internal administration bickering has colored the behaviour of some key actors in the government, according to authoritative sources. For example, Brzezinski, who has been cast as the principal hardliner in the White House, went out of his way to propose a conciliatory insert into the president's speech noting the benefits of "improved trade and technological and cultural exchange" between the United States and the Soviet Union.

"Brzezinski doesn't like to see public acceptance of the image of him as the heavy," one source said.

Powell insisted yesterday that advertised differences among administration officials had been "severely exaggerated to the detriment of policy. The president was not compelled to negotiate between his advisers" in writing the speech, Powell added.

However, several senior officials yesterday indicated that they were concerned about internal disagreements, and they expressed relief that Carter's speech did not follow a harder line. "People were very worried," one top State Department official said.'It could have been much worse," said another.

The way Carter prepared the speech, his senior associates first saw a full draft of it at 6:30 Sunday night. Brzezinski, Vance, Young and Defense Secretary Harold Brown met with the president in the Cabinet Room at that hour to go over what Carter had written.

White House officials said yesterday that the speech did not change much as a result of the Sunday night meeting. This assertion could not be easily tested since the four men who met with Carter held their copies of the speech very closely, and apparently did not discuss it with aides.

The fact that the speech was primarily the product of Carter's own pen was cited by officials yesterday to explain some of the less-than-precise diplomatic usages in it.

For example, the key phrase in the speech - "The Soviet Union can choose either confrontation or cooperation" - was described yesterday by Powell as "a little bit of oversimplification if taken too broadly."

Professional diplomats noted that this phrase offered a stark choice to the Soviets - a strarker choice to the Soviets - a starker choice than Carter described elsewhere in the speech, which contained many references to alternatives of competition and cooperation, with no reference to confrontation. Then near the end of his address Carter drew the much harsher choice for Moscow.

One official said Carter must have felt competition and confrontation were the same thing.

Another manifestation of Carter's direct personal involvement in writing the speech was the extended comparison between the inherent strengths and confidence of American society and the ideological and economic weakensses of the Soviet system.

Carter, it is reliably said, sees this as a better argument for SALT agreements with the Soviets than anyarcane comparisons of megatonnage in the two countries' atomic arsenals. Soviet specialists, however, expressed concern that Carter's frontal attack on the Soviet system - unmitigated by any sign of respect for Soviet accomplishments - might be read as a provocation in Moscow.