NEW YORK (AP) -- U.S. stock indexes finished barely higher Tuesday after a late slump erased most of an early gain. Technology companies recovered some of the losses they took a day earlier, but energy companies and banks slipped.
Strong gains for software company Red Hat and recoveries for big names like Apple and Facebook helped technology companies move higher. Cruise lines rose after Carnival had a stronger third quarter than analysts expected. Small-company stocks continue to set record highs.
With little corporate or economic news to focus on, investors turned their attention to a speech by Federal Reserve Chair Janet Yellen for clues about the Fed's thinking on interest rates.
Yellen told a conference of economists that the Fed is puzzled that inflation remains so low. While she and other policymakers still think inflation will eventually reach the Fed's 2 percent target, Yellen conceded that the Fed may need to change its assumptions.
Yellen also said the Fed should take care not to raise rates too slowly. JJ Kinahan, chief strategist for TD Ameritrade, said that was notable.
"That was a little bit stronger language than we've seen before," he said. Kinahan said investors have concluded over the last two weeks that the Fed will raise interest rates again in December, and Yellen's remarks did nothing to dispel that idea.
In Washington, Senate Republicans said they won't hold a vote on their latest health care bill because it did not have enough votes to pass. On Wednesday, the Trump administration plans to release an outline of its ideas on changes to the tax code.
With long negotiations likely just beginning, Kinahan said investors don't expect much to get done right away.
"For calendar year 2017, the market is giving Washington a pass on taxes," he said. "In 2018 that's not going to be the case."
The Standard & Poor's 500 index added 0.18 points to 2,496.84. The Dow Jones industrial average, which rose as much as 73 points during the day, lost 11.77 points, almost 0.1 percent, to 22,284.32 as McDonald's fell and Chevron went into a late slide.
The Nasdaq composite gained 9.57 points, or 0.2 percent, to 6,380.16 after a drop of 0.9 percent on Monday. The Russell 2000 index of smaller-company stocks gained 4.91 points, or 0.3 percent, to a record 1,456.86.
Carnival's third-quarter profit and revenue surpassed Wall Street's expectations. The cruise line raised its annual forecasts and said bookings and prices for next year are higher than they were at this time a year ago. Carnival gained $1.82, or 2.9 percent, to $65.32 and competitor Royal Caribbean Cruises rose $3.31, or 2.9 percent, to $117.19.
Open-source software maker Red Hat climbed $4.31, or 4.1 percent, to $110.07 after reporting a better-than-expected second quarter. Chipmaker Nvidia rose after it said several major Chinese companies, including e-commerce giants Alibaba and Baidu, will use its products in data centers and cloud computing platforms. It added 96 cents to $171.96.
Elsewhere, Apple picked up $2.59, or 1.7 percent, to $153.14 and Facebook rose $1.34 to $164.21.
The director of global sports marketing for athletic apparel maker Adidas was one of 10 people charged in what the U.S. government described as a scheme to match agents and advisers to college basketball players before they became NBA stars. Four assistant basketball coaches were arrested along with Adidas executive James Gatto. Adidas fell 2.4 percent in Germany.
Benchmark U.S. crude slid 34 cents to $51.88 a barrel in New York. Brent crude, the standard for international oil prices, gave up 58 cents to $58.44 a barrel in London. Chevron gave up 47 cents to $117.52 and Schlumberger fell 83 cents, or 1.2 percent, to $68.82.
Equifax announced the retirement of its chairman and CEO as the credit reporting agency tries to clean up a mess left by a data breach that exposed highly sensitive information about 143 million Americans. Richard Smith had been the company's CEO since 2005. The company said Smith won't receive his annual bonus or other benefits until Equifax finishes its investigation into the data breach it disclosed earlier this month. Two other company executives left on Sept. 15.
Equifax fell early on, but later recovered to finish 96 cents higher at $106.05.
Wholesale gasoline lost 2 cents to $1.70 a gallon. Heating oil retreated 1 cent to $1.85 a gallon. Natural gas remained at $2.92 per 1,000 cubic feet.
Bond prices declined. The yield on the 10-year Treasury note rose to 2.23 percent from 2.22 percent.
Gold lost $9.80 to $1,301.70 an ounce. Silver declined 26 cents to $16.88 an ounce. Copper fell 2 cents to $2.92 a pound.
The dollar rose to 112.17 yen from 111.61 yen. The euro fell to $1.1798 from $1.1846.
Germany's DAX rose 0.1 percent and the FTSE 100 in Britain fell 0.2 percent. France's CAC 40 rose less than 0.1 percent. Tokyo's Nikkei 225 lost 0.3 percent and the Hang Seng of Hong Kong gained less than 0.1 percent. The South Korean Kospi declined 0.3 percent.