Stocks ended higher on Thursday after a choppy day of trading in which investors struggled with uncertainties about the economy and the shifting political scene in Washington.

The Nasdaq Composite index rose 38.54 points, or 1.72 percent, to close at 2,282.02. The Dow Jones industrial average edged up 16.91 points, or 0.15 percent, to 11,122.42. The benchmark Standard & Poor's 500 added 4.12 points, or 0.32 percent, to 1,293.17.

"There is a bit of a seesaw going," said Charles Lemonides, chief investment officer at M&R Capital Management, which oversees about $275 million, as the major indexes bobbed around break-even during the session. "More than anything, I think we are just seeing the market adjust to the recent volatility in the market over the past few weeks."

Wall Street weighed an announcement from Vermont Sen. James Jeffords that he was bolting the Republican party in a move that hands Democrats control of the Senate and threatens President Bush's conservative agenda. The market was trying to decipher what the move means for the various committees that control legislation affecting sectors like health care or energy, analysts said.

The impact of the power shift in the Senate "will be industry by industry," said Stanley Nabi, chairman of the investment policy committee at Credit Suisse Asset Management.

"It is negative to pharmaceuticals. This is one industry that will be impacted, but it will not have an impact across the board," said Nabi, whose firm manages about $100 billion.

But analysts said the market's fluctuation mostly came amid unease over the health of the economy. Investors were trading cautiously ahead of a speech Federal Reserve Chairman Alan Greenspan was scheduled to deliver Thursday night before the Economic Club of New York. 

"The next quarter or two are going to be weak. We already know that. What we want to hear from the Fed chairman tonight is that the fourth quarter is going to bring recovery," White said. "The reason we have been rallying (recently) is on the hopes and dreams of the fourth quarter." 

Adding to investors' nervousness about the economy was weak housing and employment news. The Commerce Department reported that new home sales posted their largest decline in four years in April as rising layoffs made Americans feel less secure about making big-ticket purchases. 

And, the Labor Department said that new claims for state unemployment insurance rose more sharply last week than analysts expected. 

The economy and politics aside, stocks still managed to post gains late Thursday. Microsoft rose $2.02 to $71.72, and General Motors advanced $1.41 to $56.59. 

Meanwhile, the slowing economy hurt makers of semiconductor equipment, which reported late Tuesday that customer orders for April dropped 41 percent from March. Triquint Semiconductor plunged $4.22 to $20.59. 

Analysts said politics pulled down pharmaceutical and energy shares, sectors that typically benefit from a Republican Congress. Merck dropped $1.50 to $72.50, while Enron fell $1.19 to $54.16. 

Advancing issues traded evenly with decliners on the New York Stock Exchange, where volume was 1.1 billion shares, compared with 1.13 billion on Wednesday. 

The Russell 2000 index, which measures the performance of smaller companies stocks, rose 3.04 to 510.40. 

Overseas markets were mixed Thursday. Japan's Nikkei stock average finished the day down 1.2 percent. In Europe, Germany's DAX index rose 1.0 percent, Britain's FT-SE 100 advanced 0.3 percent, and France's CAC-40 gained 0.5 percent.

The Associated Press and Reuters contributed to this report.