Four years ago today, he was being written off as a serious presidential candidate. Just one year earlier he had unsuccessfully challenged a president of his own party for the nomination and carried the fight all the way to the convention. There, he had delivered a stirring speech. In spite of his support for the national ticket, many of the president's loyalists blamed the challenger for that November's loss of the White House. Almost surely, it was agreed, he was too much of an ideologue ever to win a general election; the party and the nation would be looking for more of a middle-of-the- roader, right? It was a little sad, but his time had passed, the wise men agreed.

Almost everything above that was being said in late 1977 about Ronald Reagan is being said just as confidently in late 1981, by someone, about Edward Kennedy. It may be recalled that just three years after he had been authoritatively relegated to the taxi squad of national politics, a big primary field and a lousy economy made Ronald Reagan look very formidable.

Such comparisons do not much engage Edward Kennedy, coming up on 20 years in the United States Senate and his fourth Massachusetts re-election campaign. But in a recent interview, he hinted at another possible similarity between the conservative Republican president and himself, the liberal Democrat: "It was clearly evident to the American people in 1980 that Ronald Reagan had maintained his commitment to his values over a long period of time."

The nation's much-reported swing to the right does not include the Massachusetts senator. Asked of what he is most proud in his public career, Kennedy answers, with uncharacteristic emotion, "Being a voice for the voiceless and, I hope, a source of some strength for those who don't have powerful lobbyists and powerful interest groups representing them."

One such powerful and very represented, group is the New Right. The New Right despises Kennedy, but it needs him like the rest of us need oxygen. The direct-mail money machine of the New Right is fueled by hate, and Kennedy is the man-devil all prosperous paranoids love to hate. That is why the New Right, with no honest expectation of defeating Kennedy next year, regularly beseeches its fearful contributors to dig a little deeper. It helps to finance the next mailing to identify more sad souls who live on the twilight side of conspiracies.

The current attacks on Edward Kennedy are probably more intense in degree but not substantially different in kind from those to which his brothers, John and Robert, were subjected. There is something about Kennedys that sends right-wingers through the roof and to their checkbooks. Asked how he feels about all the attacks, Kennedy says: "I'm honored by them."

Recently the Federal Election Commission reported that in 1980, in the area of negative independent expenditures--money spent by groups and individuals to defeat a particular presidential candidate--10 times as much was raised and spent to defeat Kennedy as to defeat Reagan. The New Right, consistent with its philosophy, is ready to pay for the privilege of hating.

That 1980 Kennedy campaign, which began with such inevitability and overconfidence and even a palpable arrogance, changed the perceptions of many people about the candidate. It may also have changed Kennedy himself.

The popular judgment at the outset of his campaign was that Kennedy was a super politician and probably a less than super human being. After watching him lose and continue with good humor and tenacity, the majority of those who covered him came to feel that here was a man of some real character. He took the blame for the defeats and the mistakes. He did not, in the ancient tradition of losing candidates, blame his staff. He learned how to lose. What else he may have learned, we will have to wait until 1984 to find out. But unlike any other potential candidate, Kennedy knows what it's like to live with hate, and, given the sorry state of our politics, that may be his most valuable advantage over anyone else.