Blacks consistently favored President Carter over Sen. Edward M. Kennedy (D-Mass.) in four early primaries, giving the incumbent as much as 68 percent of their votes in Florida, a new analysis said yesterday.

The Joint Center for Political Studies, a nonprofit, nonpartisan research group that monitors black participation in politics sampled the vote in Florida, Alabama, Illinois and New York. Only in New York, where the vote split among blacks was 52 percent to 48 percent, did Kennedy come close to winning a majority of the black vote.

An analysis prepared by the center after the 1976 election showed that blacks gave Carter more than 90 percent of their votes in the general election and provided him with his margin of victory over then-President Ford.

Although Carter has collected endorsements from many black elected officials this year, supporters of Kennedy had counted on much of the black citizenry to support their candidate.

In Illinois, blacks who voted in the Republican primary heavily favored Rep. John B. Anderson, giving him 59.2 percent of their votes to 17.2 percent for Ronald Reagan and 9.4 percent for George Bush.

Rep. Thomas R. Harkin, once one of President Carter's staunchest Iowa supporters, has decided to run against the president as a favorite-son candidate in his congressional district's convention next week.

Harkin, who endorsed Carter in 1976 and this year, is taking the action because he feels Carter has not lived up to administration promises before Iowa's January caucuses to make sure farmers would not be unfairly hurt by Carter's Soviet grain embargo, according to a spokesman.

Corn prices have dropped from 30 cents to 35 cents a bushel since then. Many farmers have been forced to sell at the depressed price to pay off loans and finance spring plantings.

In an interview in Sacramento yesterday, Kennedy said he would not rule out use of nuclear weapons to protect American lives.

But he also said he could not imagine ordering a "first strike" involving nuclear weapons against the Soviet Union.

Aides said Kennedy's response was a longstanding policy. However, one aide said the subject has not come up previously.

Kennedy sidestepped the question of whether he might support a naval blockade against Iran as a means of resolving the hostage crisis. "I'm still hopeful that diplomatic measures will not be abandoned and that somehow through that process that we can gain [their] release," he said.