Wednesday, February 29, 2012

Freakonomics and contradicting yourself

Part of Levitt and Dubner's Freakonomics franchise is a bi-weekly podcast. The most recent episode talks about economics and political science research into media bias, among other things, research based on Tim Groseclose's measure of ideology called the Political Quotient. Here are two quotes from the show:
Groseclose’s argument, based on his research, is that most news organizations empirically lean to the left, although not as dramatically as some critics might suspect. He ultimately wrote up his findings in a book called Left Turn: How Liberal Media Bias Distorts the American Mind. Now, how did he come to that conclusion -- that the American Mind is being distorted by media bias? Well, Groseclose combined his own findings and existing research to calculate that the average American voter has a “natural” PQ, or Political Quotient, of around 25-30, which is firmly in the conservative range. But, as Groseclose sees it, the left-leaning media pulls some of those naturally conservative voters into the center. Which is why we generally vote about 50-50. Without media bias, Groseclose says, we’d be a much different country.
...and then later on:
(...) having categorized all this language along Democratic and Republican lines, Gentzkow and Shapiro looked at how often a given newspaper used these signature phrases. And from that, they were able to determine each newspaper’s political slant. But it was the next step that really mattered: figuring out where a slant comes from. In other words, is it that reporters have a bias that gets into their stories, or maybe newspaper owners demand a certain line of coverage? They looked into these factors and more -- including one very clever indicator: the voting patterns of the people who read a particular newspaper. Their finding? The most important factor driving the slant of a given newspaper is … the political leanings of the people who buy it. In other words: newspapers are giving the people the news that they want.
The show presents both these findings as take-home points, which is preposterous since at least prima facie they are in blatant contradiction to each other. Now there may very well be an explanation as to how those things can both be true; but Dubner and Levitt seem to think there isn't anything to explain in the first place. (Arguing that the average media consumer is more left-leaning than the average citizen doesn't work because how could the media then be "distorting the American mind"?)

C'mon guys, you gotta do better than that.

Happy Birthday R

Speaking of R, it is celebrating a birthday today. Quoting from an R-help mailing list post by Andy Bunn:
R is refined, tasteful, and beautiful. When I grow up, I want to marry R.
Well, given that R is twelve, Andy might be waiting for the wrong party to grow up. At any rate, to the creators of R: Holy shit, thank you.

Tuesday, February 28, 2012

Editors large and small

Now that the makers of RStudio added seemingly all of the features it was missing, both minor (bracket matching) and major (project manager and version control), their product is officially perfect. It's truly amazing. It basically has all of the functionality of Eclipse with StatET but is much easier to install and runs R code much faster in interactive mode.

Speaking of speed though: sometimes it's still not quite fast enough. This means there's sometimes a need for me to have a backup solution: something that would be a decent code editor (i.e. have at least syntax highlighting, an object browser, and block commenting/uncommenting of code lines), while allowing me to push code to R terminal in order to run it. I did try Emacs and Vim but quickly gave up. It may very well be true that they're much better than everything else, but I'm not a programmer, I'm just a data analyst, so forgive me for thinking that a code editor should be something that makes my life easier right now as opposed to five months down the line. I've also tried Tinn-R but that was a disappointment: it doesn't have an object browser and the interface is horribly cluttered.

I did finally find a good piecemeal solution though: Notepad++ with NppToR, with object browsing via this simple function written by Petr Pikal. Here's a screenshot:


It works well. Still, I don't use it unless I absolutely have to. RStudio is just so much more convenient.

Sunday, February 26, 2012

My favorite line from a motivational speech

It comes from Herb Brooks's locker room speech to his team before the Miracle on Ice game:
If we played them ten times, they might win nine. But not this game. Not tonight.

Wednesday, February 22, 2012

Things I wish would die: Some extremely annoying phrases

If you've ever said he broke his silence or referred to anyone as a policy wonk, I am hereby giving you a one-finger salute.

A concise description of the idea behind evolutionary game theory

People don't change their minds. They die, and are replaced by people with different opinions. 
--Arturo Albergati
OK, so maybe this is just half of this idea. But it is concise.

(I haven't been able to confirm the original source. I'm quoting after Paul Graham.)

Thursday, February 16, 2012

Not for couples

In case you don't already know this: Valentine's Day is not "for couples" or "for lovers". Valentine's Day is for women. Via Robin Hanson:
AshleyMadison.com, a personals site designed to facilitate extramarital affairs … enjoyed another big boost this week, following Father’s Day, when CEO Noel Biderman says men often feel underappreciated. Traffic to the site tripled on Monday. (Biderman says there’s a similar boost in interest from neglected wives and girlfriends after Valentine’s Day.)
Or, here's a bit more direct line of evidence: On average, men spend twice as much as women on Valentine's Day gifts. Note that these averages are over all gifts purchased on that day, regardless of the recipient. If we were to consider heterosexual couples only, and calculate the average spending of men on gifts for their partners and vice versa, I guarantee you the disparity would be even larger. 

Thursday, February 2, 2012

Negative prophet

Apparently, Punxsutawney Phil is right only 39% of the time. Since he's predicting an outcome of a binary variable (either "long winter" or "early spring"), this makes him a valuable expert: if you bet against Phil, you'll be right 61% of the time.