As President Obama works to turn out his base this election weekend, a new PEW study shows that mainstream media tend to give him more favorable coverage than Mitt Romney, but the imbalance is nowhere near as egregious as during the 2008 election.

“Overall from August 27 through October 21, 19% of stories about Obama studied in a cross section of mainstream media were clearly favorable in tone while 30% were unfavorable and 51% mixed,” PEW found. “This is a differential of 11 percentage points between unfavorable and favorable stories. For Romney, 15% of the stories studied were favorable, 38% were unfavorable and 47% were mixed-a differential toward negative stories of 23 points.”

That’s a pretty big swing from 2008, when 36 percent of stories written about him were positive as the media attacked Sen. John McCain, R-Ariz., (about 60 percent of the McCain stories in 2008 were negative).

The PEW study acknowledges the degree to which media coverage of the September 11 terrorist attack in Libya harmed Romney, rather than the president tasked with protecting Americans.

“Most of the advantage in coverage for Obama, however, came in September in the form of highly negative coverage for Romney,” PEW said, noting, among other things, that Romney “was criticized for his comments about Libya.”(Remarkably, Romney’s comments about Libya received more attention than Obama’s decisions about Libya.)

The coverage imbalance has oscillated through three cycles in the period surveyed:

From the conventions until the first debate, a period of improving polls for Obama, Romney suffered his period of the most negative coverage; just 4% of stories about him were positive while 52% were negative. Coverage of Obama during this period was fairly evenly split (20% positive vs. 24% negative). That narrative reversed sharply with the first debate. For the next two weeks, Romney saw the mixed treatment (23% positive vs. 23% negative) while Obama was caught in the critical loop, with 12% positive and 37% negative. After the second debate, coverage returned to its more general pattern, with an edge for Obama.

Interesting that, even when Obama is in a bad phase of coverage for his campaign, he stills gets more positive attention and less negative attention than Romney does when he is in a bad phase.