(AP) -- U.S. stocks closed modestly higher Friday, giving the market its third straight week of gains.
Consumer staples and health care stocks were among the biggest risers as investors assessed the latest company earnings and economic news.
After several weeks speculating about the implications of a slowdown in China and the timing of an interest rate increase by the Federal Reserve, traders are squarely tuned into company earnings as they hunt for insight into how the global economy is doing.
"That's what the market is focused on," said Quincy Krosby, a market strategist at Prudential Financial. "Are we seeing a pickup in demand overseas and in the United States, and if so, which sectors? That's what this is about."
General Electric rose 3 percent, the most in the Dow Jones industrial average, after the industrial conglomerate reported earnings that beat analysts' forecasts.
The Dow rose 74.22 points, or 0.4 percent, to 17,215.97. The Standard & Poor's 500 index gained 9.25 points, or 0.5 percent, to 2,033.11. The Nasdaq composite added 16.59 points, or 0.3 percent, to 4,886.69.
The tech-heavy Nasdaq is up 3.2 percent this year. The Dow and S&P 500 are still negative. The Dow is down 3.4 percent, while the S&P 500 is off 1.3 percent.
The three major stock indexes began the day slightly higher, then wavered after midday. The indexes slipped into the red at times before drifting back into positive territory.
Investors appeared to brush off some discouraging economic data, including a Federal Reserve report indicating that U.S. manufacturing production fell for the second straight month in September. A separate Labor Department report showed that employers advertised fewer job openings in August and kept hiring flat. The job market has weakened the past two months, reflecting slower global economic growth.
All told, nine of the 10 sectors in the S&P 500 rose. Health care and consumer staples stocks each gained about 1 percent. The industrials sector declined 0.2 percent.
General Electric reported a decline in third-quarter profit, but strong performances from its core units helped the company top Wall Street expectations. GE rose 95 cents, or 3.4 percent, to $28.98.
Mattel climbed 6 percent after analysts at Oppenheimer published a research note highlighting the toymaker's core brands as a bright spot. The report came a day after Mattel reported disappointing third-quarter results. Mattel gained $1.36 to $23.89.
Traders hammered Quanta Services after the contracting services company lowered its third-quarter profit and revenue outlook, citing project delays and a tough market. The stock plunged 28.5 percent, losing $7.47 to $18.74.
Third-quarter earnings are forecast to contract overall as falling energy prices and weak global demand start to eat into profits.
Among companies in the S&P 500 that have already reported third-quarter results, earnings declined 5.1 percent from a year ago, the first drop in earnings growth since the July-September period in 2009, according to S&P Capital IQ.
"When all is said and done we'll probably be looking at earnings that are flattish for the quarter," said David Lefkowitz, an executive director and equity strategist at UBS. "But excluding the energy sector, we're looking for 6 percent growth, which is consistent with what we saw earlier this year."
The earnings season hits a peak next week with scores of major companies scheduled to report results including Morgan Stanley, Boeing, General Motors, McDonald's and Microsoft.
In Europe, the FTSE 100 index of leading British shares was up 0.6 percent, while Germany's DAX rose 0.4 percent. France's CAC 40 gained 0.6 percent. In Asia, South Korea's Kospi inched down 0.1 percent, while Hong Kong's Hang Seng rose 0.8 percent. The Shanghai Composite in mainland China was up 1.6 percent. Japan's benchmark Nikkei 225 added 1.1 percent, aided by expectations that the country's central bank will come up with more stimulus measures this month or next.
In energy futures trading, Benchmark U.S. crude added 88 cents to close at $47.26 in New York. Brent crude, used to price international oils, rose 73 cents to close at $50.46 a barrel in London.
U.S. government bond prices didn't budge. The yield on the 10-year Treasury note held at 2.02 percent. The euro was little changed at $1.1349 while the dollar edged up to 119.49 yen.
In metals trading, gold fell $4.40 to $1,183.10 an ounce, silver declined five cents to $16.11 an ounce and copper lost two cents to settle at $2.40 a pound.