Stocks rose Thursday after dipping briefly following Federal Reserve Chairman Jerome Powell’s remarks about shrinking the central bank’s balance sheet. Treasury yields advanced with the dollar, and West Texas crude continued its bull market surge past $52 a barrel.

The S&P 500 index rallied as gains in utilities, industrials and real estate shares overwhelmed weakness in retailers sparked by concerns about a sales slowdown and fears about the potential consequences of the ongoing partial government shutdown. Alcohol distributor Constellation Brands Inc. rebounded from Wednesday’s decline to lead the benchmark on positive comments from analysts at Goldman Sachs Group Inc. and Guggenheim Securities. Macy’s Inc. plunged 18 percent, making it the biggest decliner, after reporting disappointing seasonal sales and earnings.

“The stronger retailers keep winning; the weaker retailers not so much,” said Hank Smith, co-chief investment officer at Haverford Trust. “I do not think it is a reflection on the consumer. The consumer is strong right now.”