Stocks closed mostly higher Thursday as gains in technology and industrial companies offset declines elsewhere in the market.

Health care stocks, banks and insurers were among the biggest losers as investors weighed company earnings reports. Traders also monitored developments in the international effort to keep a deadly new virus outbreak in China from spreading further and potentially hurting the global economy.

On Thursday:

The S&P 500 index inched up 3.79 points, or 0.1%, to 3,325.54.

The Dow Jones Industrial Average fell 26.18 points, or 0.1%, to 29,160.09.

The Nasdaq composite gained 18.71 points, or 0.2%, to 9,402.48, a record.

The Russell 2000 index of smaller company stocks rose 0.55 points, or less than 0.1%, to 1,685.01.

For the week:

The S&P 500 is down 4.08 points, or 0.1%.

The Dow is down 188.01 points, or 0.6%.

The Nasdaq is up 13.53 points, or 0.1%.

The Russell 2000 is down 14.62 points, or 0.9%.

For the year:

The S&P 500 is up 94.76 points, or 2.9%.

The Dow is up 621.65 points, or 2.2%.

The Nasdaq is up 429.87 points, or 4.8%.

The Russell 2000 is up 16.54 points, or 1%.