President Reagan visited his recuperating political adviser, Edward J. Rollins, in George Washington University Hospital yesterday and emerged with a prediction that Republicans would do well in today's midterm elections.

White House spokesman Larry Speakes summed up Reagan's apparent feeling in a word: "hopeful." Rollins, who is recovering satisfactorily from a mild stroke, said he thought that Republican losses in the House were unlikely to exceed 20. Some administration officials were even more optimistic, putting the figure at 15 or fewer.

The White House expectation for the Senate was that Republicans would lose at most two seats and could wind up losing none at all.

Reagan, who has been kept isolated from the press during most of the campaign, answered a few curbside questions after coming out of the hospital.

The president said Rollins was "very optimistic" about the outcome of the election. When a reporter asked the president how many House seats would be a major loss for the GOP, Reagan said: "Only if we lost all of them."

Rollins told the president in their hospital conversation that a 20-seat loss would be a good showing for the Republicans, considering the political impact of the high unemployment rate.

In his curbside remarks Reagan answered a televised Democratic campaign message by former senator Edmund S. Muskie of Maine, who charges that the Reagan slogan of "stay the course" means helping a privileged few.

"He's singing a tired old song that they wrote, and there's absolutely no truth about what they've been saying," Reagan said, "and he knows better than anyone that there's no truth in what he's saying about Social Security."

The president wasn't asked about the Social Security issue, but Speakes branded as an "outright lie, probably perpetrated by the Democrats" a report in the newspaper USA Today that administration officials are drafting an alternative to what they say they fear will be a recommendation by a bipartisan study group for a tax increase to keep the system solvent.

Reagan spent a relaxed day on the eve of the election. He attended a weekly issues luncheon, where both the campaign and the upcoming visit of Italian Prime Minister Giovanni Spadolini were discussed, and then returned to the residential quarters of the White House after visiting Rollins.

Today, Reagan -- who already has voted by absentee ballot in California -- is scheduled to have lunch with Sen. Paul Laxalt (R-Nev.), the president's closest friend in Congress. Administration officials denied reports that he will ask Laxalt at today's lunch to become Republican Party chairman, replacing Richard Richards.

Such a development could occur later, one official said. But he added, "The deal hasn't been made."

On the eve of the election, Republican survey trackings have made the White House especially optimistic about the Senate, including three of the five western states which Reagan visited last Thursday and Friday.

The administration expects to retain GOP incumbents in Wyoming and Utah, lose a challenge to a Democratic incumbent in Montana and pull off an upset in Nevada, where Republican candidate Chic Hecht has pulled ahead of incumbent Democratic Sen. Howard W. Cannon since the Reagan visit.

"If Hecht wins, there's no question that the president put him over the top," Rollins said.

The administration is worried about the other state which the president visited, New Mexico, where incumbent Republican Sen. Harrison H. Schmitt is in trouble. White House officials now say they believe that Schmitt is likely to lose, but they haven't written off the race.