"My people didn't elect me to come down here to be a rubber stamp for any president," says North Dakota's Sen. Mark Andrews, "even one they like as much as President Reagan."

Next door in South Dakota, Sen. James Abdnor is being more blunt than that. The Reagan administration, he says, is guilty of "out-and-out betrayal" of the American farmer.

For Republican farm-state senators swept into office six years ago in some measure because of Ronald Reagan's popularity, party loyalty is becoming an exception to the rule. Like their counterparts in the House, Republican senators seeking reelection in the Farm Belt next year are busy walking -- if not running -- away from the policies of the Reagan White House.

The signs of that independence have been clear for months. Last February's battle over the confirmation of Edwin Meese III as attorney general offered one striking example. After months of delay, the Senate was poised to act on the nomination but Democrats maneuvered to link the nomination with emergency farm-credit legislation. The maneuver could only succeed in a Democratic-controlled Senate if Republicans would help out. A few farm-state Republicans, Andrews included, provided the help.

Because of the ramifications of that maneuver, some North Dakota farmers are better off. And so is Andrews. Since then, the senator has been watching the farm-credit money pour into North Dakota: $168 million in operating loans, 2 1/2 times the state's original allocation. "Now that ain't bad," says Andrews as he trumpets the news to his constituents.

Andrews' tactics do not fit the textbook definition of how to legislate. Nor do they endear him to the White House or what he calls "red hot Republicans" in North Dakota.

But they illustrate political survivalism, circa 1986. By distancing themselves from Reagan administration policies, even defying them at times, Andrews and other farm-state Republicans are attempting to stave off a GOP wipeout in the party's historic midwestern core that could lead to a return of the Senate to Democratic control.

On the surface, the arithmetic seems grim for Senate Republicans, whose margin of control hinges on a region of the country where the economy is reeling and administration policies are perceived to be aggravating the problem.

The party goes into next year's Senate elections at a disadvantage because it will be defending 22 seats, compared with 12 for the Democrats. Moreover, its margin of control is thin to start with: 53 to 47. A shift of no more than four seats could tip control back to the Democrats after only six years of Republican stewardship.

Seven of the 22 GOP seats that are up next year are in the midwestern Farm Belt, and there is some doubt about the outcome in most of them. It is at least theoretically possible that Farm Belt losses alone could deliver the Senate back into the hands of the Democrats.

Except for Majority Leader Robert J. Dole (R-Kan.), all of the farm-state senators up for reelection next year are first-term members elected on the crest of the Reagan tide in 1980 -- Abdnor, Charles E. Grassley of Iowa, Robert W. Kasten Jr. of Wisconsin, Don Nickles of Oklahoma, Dan Quayle of Indiana and Andrews.

In 1980, Reagan was highly popular in the Farm Belt, with coattails long enough to deliver the rural Midwest to the Republicans. But collapse of the farm economy, coupled with Reagan's lack of enthusiasm for government support programs, has made his administration a political liability for many of these same Republican lawmakers.

In the same way as House Republicans, Senate Republicans are reading the books for parallels with 1958, when the GOP was headed by another popular, second-term president with unpopular farm policies. In the Republican debacle that year, the GOP lost 23 House seats and four midwestern Senate seats -- precisely the number of Senate seats it would take to give the Democrats control in next year's elections.

The difference between 1958 and 1986 can be found in the distance -- measured by inches in some cases, miles in others -- that all of the farm-state Republicans are putting between themselves and their president this year. Even the most critical remain loyal to Reagan personally. But they are often indistinguishable from Democrats in their complaints about specific administration policies.

Some, like Andrews and Grassley, are all-purpose mavericks, challenging Reagan policy on issues ranging from defense to taxes. Others, such as Abdnor, confine their apostasy to farm issues.

But, to varying degrees, all have gone to extraordinary lengths to carve out separate identities capable of withstanding a backlash against the Reagan administration or Republicans in general. This includes defying the administration when it conflicts with constituents' priorities, with the 1985 farm bill a prime example.

Some, like Andrews, joined Dole in supporting a farm-bill compromise. But he had a price even then: new subsidies for sunflower production, which is big in North Dakota. Others balked all the way, voting against Dole's compromises.

"In 1958, farm-state Republicans were caught in the middle and didn't know what to do," said Norman Ornstein, a congressional scholar at the American Enterprise Institute. "But you don't have one of them this year giving a second thought to where their loyalties lie," he added.

"They're lining up their own issues . . . not letting the national agenda drive their own efforts," said Tom Griscom, executive director of the National Republican Senatorial Committee, the campaign group for Senate Republicans.

If Andrews is among the most rebellious of the group, Abdnor, from neighboring South Dakota, is probably the most loyal on paper, voting with the administration 88 percent of the time last year, according to Congressional Quarterly. Andrews, by contrast, voted with the administration 61 percent of the time, according to the publication.

But no one, Andrews and Grassley included, has criticized administration farm policies in sharper tones than Abdnor.

Reagan supporter though he may be, Abdnor does not spare the president. "I don't think the man understands what rural America is all about," he said recently.

Whenever the White House gets a little too close, Abdnor creates some distance. The day after word got out in late September that Reagan would appear at a Washington fund-raiser on Abdnor's behalf, Abdnor raised his voice at a Joint Economic Committee hearing to accuse the White House of a lack of understanding of rural problems. Then, a couple of days before the event itself, Abdnor was on the circuit in South Dakota lambasting the administration's position on the farm bill.

"White House Will Support Sen. Abdnor," read the headline in the Sept. 25 edition of the Aberdeen, S.D., American News. "Abdnor Criticizes White House Ag Policy," read the headline in the paper's Sept. 26 edition.

Andrews is no less agile at juggling his Republican loyalties and his own political needs.

Andrews says he would welcome a visit by Reagan to North Dakota before next year's election, just as he would have welcomed a visit by Jimmy Carter or any other president. Asked how he explains his support for Reagan as president, he says, "I tell them what I said when Jimmy Carter was president. I tell them the president is getting some bum advice from his staff." That staff, he said, wouldn't "know a steer from a heifer."

Pressed about his differences with Reagan on policy matters, Andrews says he remains true to the Republican platform they shared in 1980, reeling off issues such as reduction of budget deficits, where Reagan has strayed farther from the fold than Andrews.

Independence has already paid off for some of the farm-state seven.

Grassley, who yields to few Democrats in relentless pursuit of Pentagon excesses, has become almost a folk hero in Iowa, as secure as any Republican of reelection despite the fact that his state is among the most economically depressed of any in the Farm Belt.

Abdnor is considered to be the most vulnerable of the group. He faces possible opposition in a primary from Republican Gov. William J. Janklow, as well as a general election challenge from Democratic Rep. Thomas A. Daschle. But he has recently pulled up in polls after a spate of early campaign advertising focusing on him and his record, according to campaign sources.

Andrews, who may be challenged by Democratic Rep. Byron L. Dorgan, was running 30 points behind in polls but has closed the gap to about 10 points and is seen as a good bet for reelection.

But Andrews, like all the rest, is taking no chances. All he has to do is look across the aisle of the Senate for a reminder of what happens to farm-state Republicans who are not vigilant. Sitting there is Sen. Quentin N. Burdick (D-N.D.), who was elected to Congress in the Democratic sweep of 1958. He's been there ever since.