U.S. stocks swung in a choppy trading session Tuesday, as investors weighed a recent spate of strong earnings results against continued uncertainty over the impact of higher interest rates this year.

The S&P 500 added 0.1%, putting the index on track to rally for a third consecutive day. The blue-chip Dow Jones Industrial Average gained about 38 points, or 0.1%. The technology-heavy Nasdaq Composite hugged the flatline.

Major...

U.S. stocks swung in a choppy trading session Tuesday, as investors weighed a recent spate of strong earnings results against continued uncertainty over the impact of higher interest rates this year.

The S&P 500 added 0.1%, putting the index on track to rally for a third consecutive day. The blue-chip Dow Jones Industrial Average gained about 38 points, or 0.1%. The technology-heavy Nasdaq Composite hugged the flatline.

Major indexes have kicked off February on a wobbly note, extending some of the uneasiness that has characterized markets so far this year. On Monday, the S&P 500 closed out January with a 5.3% loss, its largest since March 2020. The Nasdaq fell even further, losing 9%.

Driving the selloff was growing anxiety among investors over how the U.S. stock market will hold up amid shifting Federal Reserve policy. The central bank last week signaled that it would begin raising rates in mid-March. That prompted traders to reshuffle their portfolios. Many dumped shares of highflying growth companies and shifted to stocks and funds that felt safer, such as dividend stocks.

The start of a new month has brought fresh earnings reports and economic data for investors to parse. Traders also say they are continuing to concentrate on how to position portfolios to account for higher interest rates ahead.

“We have relatively good economic conditions, in terms of much higher-than-normal GDP growth, a strong labor market and consumers and companies with strong balance sheets,” said Chris Zaccarelli, chief investment officer for Independent Advisor Alliance. “But you have those big headwinds of the Federal Reserve raising rates and reducing their balance sheet. I think investors are trying to decide what’s a good level … for buying some dips but also making sure they are prepared for potential volatility down the road.”

Mr. Zaccarelli said he currently prefers to reposition into higher-quality companies with “good profitability.” He said he’s found opportunities in sectors including financials and energy.

Money managers say they are looking closely at earnings for clues about how companies are navigating issues surrounding inflation and the supply chain. This week, some earnings reports have showcased strong results. Exxon Mobil gained 5.4% after it reported $23 billion in profit for 2021, its highest total since 2014.

Additionally, United Parcel Service rose nearly 13% after reporting a rise in quarterly profit. In Switzerland, UBS Group rose 8% after the bank lifted its financial targets and said it has the firepower to buy back up to $5 billion in shares this year.

Companies including Google parent Alphabet and Starbucks are set to post earnings after Tuesday’s market close.

The stock market entered correction territory as investors re-evaluate the market’s value after the Federal Reserve signaled plans to raise interest rates. WSJ’s Dion Rabouin explains. Illustration: David Fang

Fresh data released Tuesday showed U.S. manufacturing activity slowed last month. The Institute for Supply Management’s Manufacturing Report on Business PMI decreased to 57.6—a reading above 50 generally signals expansion—in January from 58.8 in December. The report showed that the Covid-19 Omicron variant and supply-chain impediments were among the issues that weighed on activity.

A separate report from the Labor Department said hiring and the number of worker resignations slowed in December from the month before.

Of the S&P 500’s 11 sectors, energy stocks posted the largest gain Tuesday. Industrials and materials stocks also rallied. Technology stocks declined, as Apple and Microsoft each lost 1% or more. Tech firms suffered the most during January’s selloff as rising interest rates threatened to weigh on their pricey valuations, which rely on expectations for growth far in the future.

“Tech came into the year very, very expensive, making it all the more vulnerable to an increase in rates,” said Seema Shah, chief strategist at Principal Global Investors. “It makes sense that it has had that selloff, but for tech you have to be a long-term investor and think about the trends going forward.”

In the bond market, the yield on the benchmark 10-year Treasury note rose to 1.795% from 1.780% on Monday. Bond yields and prices move in opposite directions.

The Fearless Girl statue in front of the New York Stock Exchange.

Photo: Spencer Platt/Getty Images

Overseas, the pan-continental Stoxx Europe 600 rose 1.3%. In Asia, Chinese markets were closed. Japan’s Nikkei 225 gained 0.3%.

Write to Caitlin McCabe at caitlin.mccabe@wsj.com and Will Horner at william.horner@wsj.com