President Reagan, in a buoyant mood on the first day of a final campaign swing, jousted with hecklers and invoked the name and memory of John F. Kennedy today as he urged lifelong Democrats to vote Republican next Tuesday.

Reagan drew cheers and chants of "50 states" from a noisy crowd of several thousand supporters and boos from hundreds of opponents when he concluded his speech at an outdoor rally by quoting Kennedy when he left Masschusetts to assume the presidency in 1961.

In that famous speech Kennedy said that the enduring qualities of Massachusetts and its diverse heritage "are part of my life, my conviction, my views of the past and my hopes in the future."

On the first stop of a 10-state campaign tour, Reagan portrayed Raymond Shamie, the conservative Republican candidate for U.S. Senate in Massachusetts, as a self-made man who understands the problems of the poor and the young better than his Democratic opponent, John F. Kerry.

"Ray Shamie cares about the people of Massachusetts," Reagan declared. "He is the son of immigrants. He was not born to wealth and privilege. He became a high-tech pioneer."

The remark was a gibe at the inherited wealth of Kerry, whom Reagan did not mention by name.

In this traditionally Democratic city, Reagan portrayed his administration and his party as deserving of rank-and-file Democratic support. He repeated a familiar theme that the Democratic leaders of today had joined the "blame-America-first crowd" and favored higher taxes that hurt the middle class.

But there are growing indications that Reagan's coattails may not be long enough to pull Shamie to an upset victory Tuesday. A Boston Globe poll that will appear in the newspaper's Friday editions found Reagan leading Democratic presidential nominee Walter F. Mondale in Massachusetts by 10 percentage points while Shamie, damaged by past associations with the John Birch Society, trailed Kerry by 12 points.

Reagan, speaking in a hoarse voice on a bright, cold day here, seemed to enjoy himself as he worked the crowd into a shouting match with hecklers who broke into his speech with a chant of "No more years."

At one point the crowd responded with chants of "Long live the president" and "Mondale's a wimp." Said Reagan, "I'm not going to interrupt that."

At other times during the speech, as Reagan gave a self-congratulatory assessment of his economic record, the crowd chanted back, "Thank you."

Using his standard campaign speech, Reagan hammered at Mondale for a record he described as one of supporting higher taxes and a weaker national defense.

But Reagan misread a passage in his speech, saying of Mondale that "the American people don't want his tax cuts and he's not going to get his tax cuts."

Then Reagan realized what he said.

"Whoa, wait a minute," he continued. "I was talking tax increases. He Mondale never asked for a tax cut in his entire career. I'm the tax-cutter. Let's keep that straight."

Reagan continued his campaigning today for what his strategists believe could become a national electoral sweep with speeches in Rochester, N.Y., and Detroit.

At a shopping center rally in suburban Detroit attended by thousands of supporters, Reagan invoked the theme of his 1980 campaign against President Jimmy Carter and said:

"We're better off than we were four years ago. We're more secure than we were four years ago."

Before he left the White House this morning the president was asked whether he thought Mondale could overtake him, but he declined to answer directly, citing "a little superstition."

Asked the question again in another form, Reagan said: "Frankly, the polls scare me because I still think that a lot of people could be tempted into going their own way and not bothering to vote."

But Reagan's demeanor in his speeches today was confident, and his supporters seemed even more so. One sign held aloft in the Boston crowd today said: "Tuesday Night Football. Gipper 50. Mondale 0.