Consumers are becoming more confident about the U.S. economy's prospects, a new survey shows.

As economists try to handicap the odds of a recession later this year, a key driver of growth is holding up: consumer confidence.

What's lagging is economists' confidence in the quality of the government's recent economic data, following the longest shutdown in U.S. history. 

A closely watched index of consumer sentiment published by the University of Michigan rose to a reading of 95.5 in February from 91.2 the prior month. Economists had, on average, projected an index reading of 93.5, according to the data provider FactSet. The report could help to assuage investors at a time when some Wall Street forecasters have warned of growing pessimism and disenchantment among consumers.

Economists said the February sentiment reading is consistent with some surveys and indicators showing that consumers are broadly optimistic -- typically a harbinger of higher spending and investment, which in turn leads to fatter corporate profits and further hiring, spending and business investment. It's the proverbial virtuous circle.

Yet the university's data look at odds with a separate report released earlier this week by the Census Bureau showing that retail sales in the U.S. fell by a seasonally adjusted 1.2% from the prior month, well below economists' estimate for a 0.1% increase. The report was so shocking to traders that it briefly roiled the S%P 500. 

Some economists now say that the data may have been skewed or distorted due to the recent government shutdown, which not only caused hundreds of thousands of government workers to miss paychecks and left many offices closed, in turn impacting business output and activity, but also may have thrown the Census Bureau's economic statisticians off kilter.

The retail sales report had been delayed as Census staffers scrambled to catch up after the furlough. Ian Shepherdson, chief economist at the forecasting firm Pantheon Macroeconomics, called the retail sales release "unbelievable." As in, literally unbelievable. 

The data were "very unlikely to be representative of the trend over the next few months," Shepherdson wrote in a report.

And following Friday's release of the University of Michigan data, Shepherdson wrote in a new report: "Reports of the death of the consumer have been greatly exaggerated."

Kevin Manning, a spokesman for the Department of Commerce, which oversees the Census Bureau, declined to comment on whether the caliber of the retail sales report was affected by the shutdown.

"Data collection and processing were delayed for this indicator release due to the lapse in federal funding from December 22, 2018 through January 25, 2019," he wrote in an e-mailed statement. "Processing and data quality were monitored throughout and response rates were at or above normal levels for this release." 

According to the University of Michigan, consumer sentiment increased as the shutdown came to an end, and as the Federal Reserve signaled it would likely pause its three-year campaign to boost benchmark U.S. interest rates from the near-zero levels that prevailed in the wake of the 2008 financial crisis.

"The early February gains reflect the end of the partial government shutdown as well as a more fundamental shift in consumer expectations due to the Fed's pause in raising interest rates," according to a press release from the University of Michigan.

Scott MacDonald, chief economist for Smith's Research and Gradings in White Plains, New York, said in a phone interview that the consumer sentiment reading should help assuage concerns that consumers might be discouraged by the stock market's drop in December, the fading stimulus from President Donald Trump's tax cuts and the ongoing trade war with China. Not to mention the government shutdown. 

"If the consumer's still happy, it means the economy is still in pretty good shape,"  MacDonald said. "There seems to be enough confidence for people to go out and order on Amazon (AMZN - Get Report) or go to the shopping malls."

Economists are still waiting for the Commerce Department's Bureau of Economic Analysis to publish its estimate of gross domestic product for the fourth quarter of 2018. That report was originally scheduled for release on Jan. 30, but has been pushed back to Feb. 28 because of the shutdown. 

For traders, the takeaway is that the latest economic data might not be as reliable as they would in other times, MacDonald said. 

"The market is stuck in a situation where they will have to wait till the next round of numbers" before fully understanding how the economy is performing. 

That is to say: Take the government data with a grain of salt.