Consumer sentiment in the United States held to an elevated level in July despite a contentious political atmosphere and ongoing trade uncertainties.

The University of Michigan said Friday that its Index of Consumer Sentiment held its midmonth reading of 98.4, up from 98.2 in June and 97.9 a year ago.

“Economic confidence has been remarkably stable since the start of 2017, despite ongoing trade uncertainties,” said Richard Curtin, the survey’s chief economist. “The resilience displayed has been primarily due to a renewed sense of personal financial optimism.”

Recent surveys have recorded the most favorable net personal financial expectations since May 2003, according to Curtin.

That is good news for President Donald Trump. History shows that it is hard to unseat a sitting president when people have very positive feelings about their own financial well-being.

Candidates for the Democrat presidential nomination have argued that the economy under President Trump has only helped a small slice of mostly wealthy Americans. But surveys of consumers reveal widespread confidence in both household financial well-being and the direction of the economy.

There are, however, some warning signs in the survey. Consumers have begun increasing savings and reducing debt, precautionary measures that can be early signs of wariness about economic prospects and can become self-fulfilling predictors of economic sluggishness by reducing consumer spending.