NEW YORK (Reuters) - Global stocks and the dollar rebounded on Friday, buoyed at first by U.S. and Chinese data, but Federal Reserve Chair Janet Yellen later rattled investors when she said aggressive steps may be needed to address an economy whose potential is slipping.

An investor sits in front of an electronic board showing stock information at a brokerage house in Nanjing, Jiangsu province, China, September 27, 2016. REUTERS/Stringer

The dollar posted its largest weekly rise in more than seven months, with rebounding U.S. retail sales and a rise in producer prices last month indicating the economy had regained momentum in the third quarter after a lackluster first-half.

Stocks in Europe rose more than 1 percent and an index of global equities gained. But stocks on Wall Street pared gains to close just above break-even, while yields on longer-dated U.S. Treasuries ticked up, with the benchmark 10-year note edging above 1.8 percent.

Yellen, who posed her comments in Boston as questions that need more research, also suggested the U.S. central bank may allow inflation to exceed its 2 percent target.

Yellen’s remarks suggest she embraces the thinking of former U.S. Treasury Secretary Larry Summers who has said secular stagnation, or a lack of demand, is crimping global growth, said Jeffrey Gundlach, chief executive of DoubleLine Capital.

“I didn’t hear, ‘We are going to tighten in December,’” Gundlach told Reuters.

Peter Kenny, senior market strategist at Global Markets Advisory Group in New York, said Yellen has kept everyone guessing as to when the next rate hike will occur, which has led to an inconsistent and trendless trading pattern in equities.

“If the markets have a fit, they’re not going to hike. If the markets are going to have smooth sailing until December, ‘yes,’ we’ll hike,” said Axel Merk, president and chief investment officer of Merk Investments in Palo Alto, California.

“She’s going to look for every excuse not to hike rates.”

The Dow Jones industrial average .DJI closed up 39.44 points, or 0.22 percent, to 18,138.38. The S&P 500 .SPX rose 0.43 points, or 0.02 percent, to 2,132.98 and the Nasdaq Composite .IXIC added 0.83 points, or 0.02 percent, to 5,214.16.

For the week, the Dow fell 0.56 percent, the S&P 500 slid 0.96 percent and the Nasdaq slipped 1.48 percent.

The dollar index, which tracks the greenback against a basket of six major currencies, added 0.57 percent to 98.069 .DXY and was up 1.5 percent for the week.

Against the yen, the dollar rose 0.44 percent to 104.14 JPY=, while the euro fell 0.77 percent to $1.0971 EUR=.

Chinese producer prices and U.S. economic data had bolstered expectations earlier in the session that the Fed would raise interest rates in December.

U.S. producer prices rose in September to post their biggest year-on-year rise since December 2014, while retail sales gained 0.6 percent after a 0.2 percent decline in August.

In China, September producer prices unexpectedly rose for the first time in nearly five years and consumer inflation also beat expectations, easing some concerns about the health of the world’s second-biggest economy.

Disappointing Chinese trade data on Thursday had rattled investors and pushed global equity markets to three-month lows.

European shares tracked Asian markets higher and Wall Street initially jumped as strong results from JPMorgan and Citigroup lifted financial stocks. Shares later pared gains.

Shares of JPMorgan JPM.N, the biggest U.S. bank by assets, fell 0.32 percent after it beat forecasts for revenue and profit. Citigroup C.N rose 0.29 percent after earnings fell less than expected.

In Europe, the pan-regional FTSEurofirst 300 .FTEU3 index rose 1.33 percent to close at 1,341.54, while MSCI's all-country world index .MIWD00000PUS of equity markets in 46 countries rose 0.30 percent.

Oil slipped below $52 a barrel, giving up earlier gains, as abundant crude supplies outweighed tighter U.S. fuel inventories and plans by the Organization of the Petroleum Exporting Countries to cut output.

Global benchmark Brent LCOc1 settled down 8 cents at $51.95 a barrel. U.S. crude CLc1 slid 9 cents to settle at $50.35 a barrel.

U.S. Treasury yields rose, with the benchmark 10-year note US10YT=RR falling 19/32 in price to yield 1.8048 percent.

The benchmark 10-year German bund DE10YT=TWEB rose 2 basis points to 0.05 percent.