Just a fortnight ago, judging by the conventional wisdom conveyed in the nation's mass media, John B. Anderson was a waning wonder, a candidate on a downward side.

Today, Anderson is a corpse revived -- the beneficiary of a lot of good luck and a campaign of mouth-to-mouth resuscitation initiated by the Carter White House and sustained by the news media.

If nothing else, these two weeks demonstrate how quickly mass media conventional wisdom can change. Not that Anderson is yet seen as a serious challenger for the presidency -- he is not, and may never be. But he is now perceived as a genuine factor in the presidential election, a certified political spoiler. This week, the media are treating Anderson repectfully, and no doubt raising his public standing in the process.

For Anderson, nothing is more important than the appearance of plausibility and, in an American election campaign, only the news media can convey appearances. David Garth, Anderson's campaign director and media advisor, admitted as much in an interview yesterday. "When you have 10 days of stories like we've just had," Garth said, "the momentum gets going."

Garth said something else to the point. "Some days you eat the bear," as he put it, "some days the bear eats you."

In the last days of August, the bear was definitely feasting. "The best thing Anderson could do for his own reputation and for the ideals of his first followers is withdraw," wrote syndicated columinist Gary Wills at the end of last month. Newsweek ran a full-page report headlined "John Anderson's Troubles," concluding that he had a lot of serious ones. In the beginning, wrote Boston Globe columnist Robert L. Turner, Anderson himself was his campaign's biggest asset; "Now he is in danger of becoming its principle liability."

This tone was echoed on the network news programs, the most powerful conveyor of appearances. When Anderson overhauled his staff, dropping three senior aides and bringing in Garth as campaign director, the NBC Nightly News ended its report on the shakeup like this: "Three top aides don't resign on the same day from a healthy campaign."

Media gloom about Anderson's prospects was reinforced in public and private polls, as Garth acknowledged yesterday. In the balmiest days of last spring, Anderson got more than 20 percent in some national polls; by late August he was barely at 15 percent. A Hartford Courant poll in April put Anderson in a dead heat with President Carter in Connecticut; both had 32 percent to Ronald Reagan's 28. A new Courant poll in late August gave Reagan 36, Carter 35, Anderson 15.

By late August the polls had become an item of more than simple curiosity. The League of Women Voters had announced that for Anderson to be invited to its series of candidate debates, he would have to have 15 percent in the national polls. That figure became a benchmark for the news media against which Anderson's declining prospects could be measured.

No doubt Carter's handlers sensed that Anderson was fading -- a development they had anticipated hopefully for months. Perhaps they were tempted to convert this perception into a new political reality.

Whatever its motivation, the Carter camp chose these same days of late August to re-launch a crusade it had abandoned -- a crusade to push John Anderson out of debates among presidential candidates this fall.

When the White House first indicated in May that Carter wouldn't debate Anderson, Anderson was still relatively strong in the polls, and criticism of the president's position was widespread. On June 10 Carter himself eased up, saying he might agree to debate both Reagan and Anderson after all.

Then on Aug. 26 the White House again proposed that the first debate be a one-on-one. Carter-Reagan contest, excluding Anderson. This gave birth to a "debate" issue -- an issue so perfectly suited to television that Fred Silverman or Roone Arledge could have invented it.

Television loves a good, clean fight, unclouded by ambiguity. And here it came -- would Anderson be allowed in or kept out? The stakes were clear, the battle lines stark, and the outcome would have to be a yes or a no. Perfect for TV.

So Anderson found himself on the network news shows just about every night beginning Aug. 26. The stories were not necessarily flattering -- in the beginning they often mentioned that Anderson was having troubles, particularly on his Aug. 28 staff shakeup. Network reporters kept making remarks like, "Many voters simply don't think he can win," as CBS put it on Sept. 1.

But Anderson was very much in public view, and every time he came on the screen he carried a subliminal message: Jimmy Carter is afraid to let this man debate. Marshall McLuhan himself couldn't measure the precise impact of that message, but it had to be significant.

While the great debate fight continued, Lady Luck blew on John Anderson's dice. On Sept. 5, the Federal Election Commission ruled that Anderson's candidacy was the equivalent of a third-party race and thus would be eligible for federal funds if the candidate won at least 5 percent of the popular vote in November. This decision should permit Anderson to borrow several million dollars from commercial banks, to solve or at least ease his persistent money problems.

Two days later the New York State Liberal Party's policy committee recommended that the party endorse Anderson for president, giving him a choice spot on the ballot in November alongside Sen. Jacob Javits.

Anderson was becoming more respectable again, and the media coverage reflected the change.

Some of it was simply bandwagonism -- things were going Anderson's way, so the media did too.

Some of it was a phenomenon that reporters understand well but outsiders rarely do, that might be called the balance wheel effect. Reporters covering Anderson had been saying and writing negative things about his campaign for many days. Because most of them are professionals who are not emotionally committed, they welcomed -- perhaps subconsciously -- an opportunity to say something nice for a change. That was "balanced" reporting.

And the great debate fight was an invitation to the nation's editorial writers to weigh in; they accepted the invitation in droves. Overwhelmingly, editorialists perceived a question of fairness, or a challenge to the openness of the American political system. With rare exceptions across the land, the editorial pages endorsed Anderson's participation.

One of the strongest endorsements came from The New York Times, whose editorial page is read by more editors of other newspapers -- and more producers of television news -- than any other. The Times couched its endorsement in terms of Anderson's platform, a document that wasn't taken too seriously by much of the media, including the network news shows. The Times praised the Anderson platform's seriousness, saying it provides "another, practical reason for including him" in the debate.

Tuesday the League of Women Voters formally agreed. John Anderson was already toasting his political fingers in a warm glow of newly favorable publicity which seemed to begin over the weekend. Monday night's network news was downright friendly to the independent. Tuesday night's was even better. The network reporters were again describing him as a serious candidate -- for example, Bob Jamieson of NBC:

"Anderson is convinced that the decision by the League of Women Voters means his campaign has made it even without the president's participation in Baltimore . . . ."