Stocks rose on Friday, as strong earnings from big companies lifted the Dow Jones industrial average, but the broader Standard & Poor’s 500-stock index posted its first weekly loss of the year.

The Dow closed up 119.95 points, or 0.9 percent, at 14,000.57, its third-biggest daily gain this year. The S.& P. 500 rose 13.18 points, also 0.9 percent, to 1,515.60. The Nasdaq composite index rose 30.33, or 1 percent, to 3,161.82.

The S.& P. 500 and Nasdaq closed slightly lower for the week, while the Dow edged higher.

Bill Stone, chief investment strategist with PNC Wealth Management, said he expected stocks to hold up despite the volatility this week.

“You’re going to get bumps and bruises along the way, but we do believe things are actually getting better, so I think there’s underlying demand” for stocks, Mr. Stone said.