Republicans’ relentless attack on the Affordable Care Act certainly contributed to changing opinion. So did the botched rollout of the federal government’s health insurance marketplace, healthcare.gov, and rising premiums.

But that doesn’t fully account for the fundamental shift. In “Post-Racial or Most-Racial: Race and Politics in the Obama Era,” (University of Chicago Press), Michael Tesler, an assistant professor of political science at the University of California, Irvine, argues that “the declining support for government health insurance during Barack Obama’s presidency was driven by racially conservative defections.”

Drawing from the 2012 American National Election Study, Professor Tesler found that only one-fifth of the most “racially resentful” whites (measured by their responses to questions about the causes of racial inequality and discrimination) supported health insurance provided by the government, compared with half of the least racially resentful.

Much of the opposition is set off directly by President Obama’s race, Professor Tesler says. In similar surveys from 1988 to 2008, before Mr. Obama became president, support for government health insurance among racially resentful whites was considerably higher.

Opposition is also fueled by the sense that blacks would gain more; 56 percent of respondents to a poll in 2010 commissioned by Stanford and The Associated Press said the Affordable Care Act would “probably cause most black Americans to get better health care than they get today.” Only 45 percent said the same thing about whites.

The dynamic doesn’t apply just to health care. Professor Tesler finds similar racial patterns in support of raising top marginal tax rates and in favor of the fiscal stimulus package of 2009. Fewer than 20 percent of the most racially resentful whites thought the stimulus was a good idea, compared with more than 60 percent of the most racially liberal.

Mr. Obama’s race probably intensified such misgivings, but they have been there all along, shaping politics and policy for a very long time.