Despite all the detailed polls and expert punditry that attempt to foretell who will win the presidential election, one predictive measure is largely missing from the discussion: The importance of presidential optimism. America has been through the wringer in recent years and faces a tough outlook. Populist resentments swirling among voters are a reminder that the benefits of our anemic economic recovery have not been spread evenly. Thus, there is a natural temptation for a candidate to tell it like it is.

But my recent research indicates that optimism is an essential characteristic of successful presidents. Using an advanced computer-based technique, I analyzed the principal speeches and memoirs of the post-World War II presidents and compared their use of language to a mass of contemporaneous post-war literature.

Mind you, these leaders had plenty to moan about: wars, riots, financial crises, political setbacks, natural disasters. Yet what I found was that presidents expressed sentiments of hope and optimism significantly more often than the nation they were leading.

Dwight Eisenhower, for example, displayed optimism, warmth, and an engaging smile while inwardly harboring fatigue, fears, and doubts and occasionally displaying bursts of temper to his intimates. About the invasion of North Africa in 1942, he wrote:

Optimism and pessimism are infectious and they spread more rapidly from the head down than in any direction…I firmly determined that my mannerisms and speech in public would always reflect the cheerful certainty of victory—that any pessimism and discouragement I might ever feel would be reserved for my pillow.

Other presidents behaved similarly. Ronald Reagan won the White House on the campaign theme of “Morning in America” and is remembered for his sunny smile and sense of humor. Bill Clinton suffered the Republican Revolution of 1994 and impeachment hearings in 1998, yet emerged with surprisingly high popularity ratings. In the latest Economist, Barack Obama presents a strongly upbeat assessment of America today and reminds us that the United States is the most powerful, respected, and prosperous country in the world. Even the dour Richard Nixon and buttoned-down Jimmy Carter expressed more optimism than the contemporary writings of their eras.

Why do presidents voice optimism even when they are daunted, exhausted, and disheartened? Because they know that hopelessness is demotivating. Americans won’t follow a pessimist. If a president wants to overcome national problems, she or he must mobilize others to deal with it. Optimism is an instrument of influence and leadership. As retired four-star U.S. Army General Colin Powell has said, “Optimism is a force multiplier.”

So what does history tell us when examining the current presidential campaign? One candidate, Donald Trump, has employed dark and ominous language much more often than his rival, Hillary Clinton.

Their respective convention acceptance speeches offer a particularly vivid contrast.

In his speech at the Republican convention in July, Trump said: “Our convention occurs at a moment of crisis for our nation. The attacks on our police, and the terrorism in our cities, threaten our very way of life. Any politician who does not grasp this danger is not fit to lead our country.” Throughout the speech, Trump emphasized rising crime, illegal immigration, foreign policy failures, negligence, and what he alleged is a rigged system.

By contrast, Clinton’s acceptance speech was more positive and reaffirming. Clinton used such phrases as “good times that filled us with joy,” “stronger together,” and “we are not afraid.” Clinton also said, “Don’t let anyone tell you that our country is weak. We’re not. Don’t let anyone tell you we don’t have what it takes. We do.”

Martin Seligman, a professor at University of Pennsylvania, studied hundreds of presidential campaign speeches from 1948 to 1984. He found that “the more optimistic candidate won nine of the ten elections.” Moreover, the size of the electoral victory was positively associated with the degree of the candidate’s optimism. He later expanded the study to cover all presidential elections from 1900 to 1984 and found that the more optimistic candidate won in 18 of 22 elections.

“In all elections in which an underdog pulled off an upset,” Seligman concluded, “he was the more optimistic candidate…with landslides won by candidates who were much more optimistic than their opponents.”

Thus we can conclude that, even if he were to defy history (and his current huge polling deficits) and win the presidency, Trump would be wise to adopt a sunnier persona if he truly hopes to “Make America great again.”

Robert Bruner is professor and Dean Emeritus at the University of Virginia’s Darden School of Business and a Faculty Associate at UVA’s nonpartisan Miller Center for Public Affairs. This essay is part of the Miller Center’s First Year Project.