(The Root) -- Racial antagonisms tend to increase when powerful and influential spokespeople advance mean-spirited arguments or messages that deflect attention from the actual source of their problems. They do this by highlighting real or perceived privileges that minorities and immigrants receive.

These messages tend to resonate more during hard economic times. Average citizens do not fully understand the complex forces that have increased their economic woes -- the slowing of economic growth and the declines in annual real family income, changes in the global economy and the rise in wage dispersion. They are looking for answers as they cope with their own anxieties.

However, it is remarkable that despite the economic crisis that plagued Obama's first term in office, and despite some anti-immigrant expressions and a few messages with subtle racial undertones during the Republican primaries, American race and ethnic relations have not notably deteriorated.

According to Pew Research Center surveys, there was a modest decline in anti-immigrant sentiment (pdf) between 2007 and 2012. There was also no change in white views regarding black progress, and only a slight change in their views on whether discrimination against blacks is rare today.

Likewise, overall, American opposition to the use of preferences to improve the position of minorities has hardly changed between 2007 and 2012, although there was a notable decline in such sentiments among white Republicans and independents, and a notable increase among white Democrats. Finally, the racial gap regarding views of interracial dating, which has diminished substantially since 1987 (e.g., the proportion of whites who accept interracial dating has almost doubled since 1987), slightly decreased between 2007 and 2012.

Thus, based on the respected Pew Research polling, one can hardly argue that there has been a noteworthy change in American race relations between 2007, before Obama took office, and 2012, the last year of his first term of office. I think this is quite remarkable given the terrible economic crisis, which could have resulted in a significant deterioration of race relations in this country.

When people are uptight and worried about their jobs or financial situation, history has shown that demagogic leaders often seek political gain or media attention by using negative populist messages to shift the focus from the real source of our problems onto blacks, other people of color and immigrants, often leading to a demagogic mobilization of racism against these groups.

But President Obama very effectively used positive messages to bring racial and ethnic groups together, not divide them. As Gov. Deval Patrick of Massachusetts pointed out, Obama is committed to being the president of all Americans, and he is very aware of efforts to place him in a narrow box. Such efforts included attacks by people such as Rush Limbaugh, Glenn Beck and Iowa Republican Rep. Steve King, who argued that Obama favored blacks at the expense of whites, as well as Tea Party rallies where people held signs that Obama was against white people.

I believe that these kinds of attacks failed to gain any traction because of Obama's careful public statements about addressing the concerns of all Americans. Even when Obama talked publicly about the Trayvon Martin killing, his statement was careful not to inflame racial tensions but, rather, to appeal to Americans' consciences on the need to do some "soul-searching" and investigate every facet of this tragedy.

This is typical of the president's efforts to unite, not divide, the county. And this approach was clearly evident in the memorable words of his second-inauguration speech: "We recognize that no matter how responsibly we live our lives, any one of us, at any time, may face a job loss or a sudden illness or a home swept away in a terrible storm. The commitments we make to each other -- through Medicare and Medicaid and Social Security -- these things do not sap our initiative; they strengthen us. They do not make us a nation of takers; they free us to take the risks that make this country great."

I personally believe that such unifying messages are particularly effective during this period of high social anxiety as the nation struggles to recover from one of the worst economic crises in our history. In terms of racial and ethnic relations, Barack Obama is the right president during these hard economic times because social tensions are indeed high.

William Julius Wilson is the Lewis P. and Linda L. Geyser University Professor at Harvard University.