Stocks shook off a wobbly start and ended higher on Wall Street Thursday, as several earnings reports from big U.S. companies came in better than analysts had expected.

New data showed U.S. unemployment claims declined last week and sales of previously occupied U.S. homes rose sharply. House Speaker Nancy Pelosi said progress was being made in negotiations over a possible stimulus package.

Health care companies, banks, and communication services stocks accounted for most of the gains, which helped the S&P 500 recoup its losses from a day earlier.

On Thursday:

The S&P 500 rose 17.93 points, or 0.5%, to 3,453.49.

The Dow Jones Industrial Average gained 152.84 points, or 0.5%, to 28,363.66.

The Nasdaq composite added 21.31 points, or 0.2%, to 11,506.01.

The Russell 2000 small-cap index climbed 26.48 points, or 1.7%, to 1,630.25.

For the week:

The S&P 500 is down 30.32 points, or 0.9%.

The Dow is down 242.65 points, or 0.8%.

The Nasdaq is down 165.55 points, or 1.4%.

The Russell 2000 is down 3.55 points, or 0.2%.

For the year:

The S&P 500 is up 222.71 points, or 6.9%.

The Dow is down 174.78 points, or 0.6%.

The Nasdaq is up 2,533.40 points, or 28.2%.

The Russell 2000 is down 38.22 points, or 2.3%.