A recent study by a Harvard Ph.D. student using insights gleaned from Google searches suggests that racism had a profound impact on the 2008 election.

Seth Stephens-Davidowitz, a Harvard Ph.D. candidate, analyzed Google searches from 2004-2007, charting the frequency of racially charged search terms by region and media market.

Stephens-Davidowitz charted the percentage of searches that included the terms “nigger” or “niggers” to gauge racist sentiment.

“I choose the most salient word,” he wrote. “I do not include data after 2007 to avoid capturing reverse causation, with dislike for Obama causing individuals to use racially charged language on Google.”

He then compared his results against the 2008 election results in various areas, writing in a New York Times op-ed that the “conditions under which people use Google — online, most likely alone, not participating in an official survey — are ideal for capturing what they are really thinking and feeling.”

He found that areas where Obama “underperformed” — West Virginia, eastern Ohio, western Pennsylvania, upstate New York and southern Mississippi — were the regions with the highest rates of racially charged searches.

“The results were striking,” said Stephens-Davidowitz. “The higher the racially charged search rate in an area, the worse Mr. Obama did.”

Stephens-Davidowitz found that the state with “the highest racially charged search rate in the country,” West Virginia, also had the “strongest aversion” to Obama, noting that a convicted white felon recently won 41 percent of the vote against the president in West Virginia’s Democratic presidential primary.

“If my findings are correct, race could very well prove decisive against Mr. Obama in 2012,” said Stephens-Davidowitz.

“Most modern presidential elections are close,” said Stephens-Davidowitz. “Losing even two percentage points lowers the probability of a candidate’s winning the popular vote by a third. And prejudice could cost Mr. Obama crucial states like Ohio,Florida and even Pennsylvania.”

Follow Josh on Twitter