Former representative Robert E. Bauman, who last July quit the race for the Republican congressional nomination in the 1st District of Maryland, went out in style in Tuesday's primary, a noncandidate with no campaign who came close to winning.

With absentee votes yet to be counted and the validity of one county's results still in doubt, Bauman refused to concede yesterday. Instead, he basked in the limelight and turned his acerbic wit on the unofficial winner, C. A. Porter Hopkins.

"I guess the only thing more humiliating for Hopkins would be to be defeated by a dead man," said Bauman, who according to one unofficial count came within 273 votes of victory and by a second count within 878 votes.

Hopkins spokesman Karen Myres retorted, "We're not embarrassed about anything. We won."

Bauman, the once rising star of the Republican right who was defeated in 1980 after admitting to problems of homosexuality and alcoholism, jumped into the race last spring to recapture the House seat he had held for seven years. But on July 29 he dropped out, accusing Hopkins of running a smear campaign against him. Hopkins vehemently denied the charge. Still, Bauman's name remained on the ballot because his withdrawal came after the official deadline.

During the press conference announcing his exit, Bauman said he was still the best candidate and asserted, "I intend to vote for myself."

Nearly 41 percent of the 1st District Republican voters in the primary joined him, according to one unofficial count. About 46 percent voted for Hopkins.

With the results still unofficial, Bauman and his supporters turned their attention to absentee ballots, to be counted today, and to Queen Anne's County, where voting machines apparently malfunctioned. Republican voters there were able to cast votes in either the U.S. Senate or U.S. House primary, but not in both. The problem was not solved until midday, election officials said. Bauman said he was considering filing a lawsuit to force a revote there.

Despite his avowal last July that he was out of politics for good, Bauman said if he was declared the winner he would run against Democrat incumbent Roy Dyson, the young state legislator who beat him in 1980.

"I'd consider it a voters' mandate," a jovial Bauman said. "And mandates are hard to come by, even slim ones like this."